Description
I succeeded in operating the test-network provided by hyperledger fabric v2.2 itself.
Chaincode installation complete
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
Setting environment variables
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com /msp
export CORE_PEER_ADDRESS=localhost:7051
Chaincode (Invoke) InitLedger function execution
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'
Execute chaincode (query) GetAllAssets function
It returned as follows.
[{"Key":"asset1","Record":{"ID":"asset1","Color":"blue","Size":5,"Owner":"Tomoko","AppraisedValue":300,"docType":"asset"}},{"Key":"asset2","Record":{"ID":"asset2","Color":"red","Size":5,"Owner":"Brad","AppraisedValue":400,"docType":"asset"}},{"Key":"asset3","Record":{"ID":"asset3","Color":"green","Size":10,"Owner":"Jin Soo","AppraisedValue":500,"docType":"asset"}},{"Key":"asset4","Record":{"ID":"asset4","Color":"yellow","Size":10,"Owner":"Max","AppraisedValue":600,"docType":"asset"}},{"Key":"asset5","Record":{"ID":"asset5","Color":"black","Size":15,"Owner":"Adriana","AppraisedValue":700,"docType":"asset"}},{"Key":"asset6","Record":{"ID":"asset6","Color":"white","Size":15,"Owner":"Michel","AppraisedValue":800,"docType":"asset"}}]
Trying to access fabric-network using nodejs SDK
cd fabric-samples/test-network/docker
Execute command => COMPOSE_PROJECT_NAME=fabric-test docker-compose -f docker-compose-ca.yaml up -d
There are currently 9 containers in operation.
ca.org1
ca.org2
ca.orderer
orderer.example.com
peer0.org1.example.com
peer0.org2.example.com
dev-peer0.org1.example.com-basic_1.0
dev-peer0.org2.example.com-basic_1.0
cli
cd fabric-sample/fabcar/javascript
Execute command => node enrollAdmin.js, node registerUser.js
admin.id and appUser.id files were created in the wallet directory.
An error occurred when running node query.js (the error details are written below.)
2024-01-24T00:45:41.065Z - error: [DiscoveryResultsProcessor]: parseDiscoveryResults[mychannel] - Channel:mychannel received discovery error:access denied
Failed to evaluate transaction: Error: DiscoveryService: mychannel error: access denied
Below is the log of the org1 container (docker logs peer0.or1.example.com)
[discovery] processQuery -> WARN 0e2 got query for channel mychannel from 172.18.0.1:59762 but it isn't eligible: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied
The same error occurs with hyperledger fabric v2.5, and the same error occurs even if you change the Ubuntu version. I'm curious what causes this problem. I'm also curious about the solution to this problem. I am waiting for your reply. please help me
Reactions are currently unavailable
You can’t perform that action at this time.
I succeeded in operating the test-network provided by hyperledger fabric v2.2 itself.
Chaincode installation complete
Setting environment variables
Chaincode (Invoke) InitLedger function execution
Execute chaincode (query) GetAllAssets function
Trying to access fabric-network using nodejs SDK
cd fabric-samples/test-network/docker
Execute command => COMPOSE_PROJECT_NAME=fabric-test docker-compose -f docker-compose-ca.yaml up -d
There are currently 9 containers in operation.
cd fabric-sample/fabcar/javascript
Execute command => node enrollAdmin.js, node registerUser.js
An error occurred when running node query.js (the error details are written below.)
The same error occurs with hyperledger fabric v2.5, and the same error occurs even if you change the Ubuntu version. I'm curious what causes this problem. I'm also curious about the solution to this problem. I am waiting for your reply. please help me