- Edit /etc/host
127.0.0.1 ca.bc-coop.bclan
127.0.0.1 peer0.bc-coop.bclan
127.0.0.1 orderer.bclan
- Start test network based on bclan and with ssm and ex02 chaincode installed
docker-compose -f docker-compose-it.yaml up -d
./gradlew build
./gradlew clean test
In dev mode configuration can be change in coop-rest/src/main/resources/application.yml
./gradlew coop-rest:bootRun
http://localhost:9090/swagger-ui/index.html
curl -X GET "http://localhost:9090/?args=a&args=b&args=10&cmd=query&fcn=invoke" -H "accept: application/json"
Get token:
curl -X POST "https://$URL/auth/realms/$REALM/protocol/openid-connect/token" \
--header "ontent-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET"
The token is in the field access_token
of the response
Use it in any request:
curl ... --header "Authorization: Bearer $TOKEN"
Example configuration to use ssm in BC1
cd infra
echo ca__ADMIN=${ca__ADMIN} >> .env
echo ca__PASSWD=${ca__PASSWD} >> .env
echo ca__ORG=CivisBlockchain >> .env
echo endorsers=peer0:CivisBlockchain,peer1:CivisBlockchain >> .env
echo channel=sandbox >> .env
echo ccid=ssm >> .env
echo config_file=../../../bc1/config.json >> .env
echo config_crypto=../../../bc1/crypto-config >> .env
docker-compose -f docker-compose.yaml up