Article directory
-
- The Node Npm version corresponding to the Hyperledger Fabric2.X network needs to be upgraded in the future. The default version is too low, and an error will be reported later
- Start the Fabcar network
- report error
- Run the following command to kill the currently running or active container:
- Clear all cached networks:
- Add mapping file
- Enter the javascript directory
- Install npm inside this folder
- Execute registration, creation, and query work through the command line
- error 2
- Solve the error
- Successfully invoked the chaincode to query the parameters
The Node Npm version corresponding to the Hyperledger Fabric2.X network needs to be upgraded in the future. The default version is too low, and an error will be reported later
Start the Fabcar network
./startFabric.sh javascript
report error
Run the following command to kill the currently running or active container:
docker rm -f $(docker ps -aq)
Clear all cached networks:
docker network prune
Add mapping file
127.0.0.1 peer0.org1.example.com
127.0.0.1 peer0.org2.example.com
127.0.0.1 ca.org2.example.com
127.0.0.1 ca.org1.example.com
127.0.0.1 orderer.example.com
127.0.0.1 peer1.org1.example.com
Enter the javascript directory
cd javascript
Install npm inside this folder
Just install it on first run, after that you can skip
npm to enable the app to connect to channels, submit transactions and wait for notifications using identities, wallets and gateways.
sudo npm install
Execute registration, creation, and query work through the command line
node enrollAdmin.js
node registerUser.js
node query.js
error 2
error: [Channel.js]: Channel:mychannel received discovery error:access denied
[Channel.js]: Error: Channel:mychannel Discovery error:access denied
Channel.js]: Channel:mychannel received discovery error:access denied
Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
at Channel._discover (/home/mxj/go/src/github.com/hyperledger/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:1254:11)
at async Channel._initialize (/home/mxj/go/src/github.com/hyperledger/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:282:32)
at async Channel.initialize (/home/mxj/go/src/github.com/hyperledger/fabric-samples/fabcar/javascri
Solve the error
Enter the wallet folder, delete all the following two files, and run the following command again