Reputation: 78
I am running Hyperledger Fabric 2.4 test-network on windows using wsl2. I am trying to enable couchdb so that I can have richer asset querying capabilities in my chaincode(for instance, querying list of all assets based on the asset fields).
I am going to the test-network/compose/docker/peercfg
and changing the stateDatabase value to Couchdb
and
I am updating the couchdb address field to my wsl2 IP address.
After doing that I am restarting the network using the commands ./network.sh down
and ./network.sh up
I am making sure that the binaries are added to the PATH variable before I run other commands such as channel creation etc.
I am then creating a channel with the following command
./network.sh createChannel -c test-channel -s couchdb
When I run the above command, the channel is created successfully, but the organization peers are not able to join the channel. The CLI log and the docker logs for the peer container display the following.
CLI log
Status: 201
{
"name": "test-channel",
"url": "/participation/v1/channels/test-channel",
"consensusRelation": "consenter",
"status": "active",
"height": 1
}
Channel 'test-channel' created
Joining org1 peer to the channel...
Using organization 1
+ peer channel join -b ./channel-artifacts/test-channel.block
+ res=1
+ peer channel join -b ./channel-artifacts/test-channel.block
+ res=1
+ peer channel join -b ./channel-artifacts/test-channel.block
+ res=1
+ peer channel join -b ./channel-artifacts/test-channel.block
+ res=1
2023-06-01 18:01:15.731 BST 0001 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 1.427428ms with error: EOF remoteaddress=127.0.0.1:7051
2023-06-01 18:01:16.734 BST 0002 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 1.777634ms with error: EOF remoteaddress=127.0.0.1:7051
2023-06-01 18:01:18.353 BST 0003 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 1.862285ms with error: EOF remoteaddress=127.0.0.1:7051
Error: error getting endorser client for channel: endorser client failed to connect to localhost:7051: failed to create new connection: context deadline exceeded
After 5 attempts, peer0.org1 has failed to join channel 'test-channel'
Docker peer container logs
docker logs 5d84e7eefad0
2023-06-01 17:00:23.702 UTC 0001 INFO [nodeCmd] serve -> Starting peer:
Version: 2.4.9
Commit SHA: 2a13518
Go version: go1.18.10
OS/Arch: linux/amd64
Chaincode:
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2023-06-01 17:00:23.702 UTC 0002 INFO [peer] getLocalAddress -> Auto-detected peer address: 172.22.0.2:7051
2023-06-01 17:00:23.702 UTC 0003 INFO [peer] getLocalAddress -> Returning peer0.org1.example.com:7051
2023-06-01 17:00:23.706 UTC 0004 INFO [nodeCmd] initGrpcSemaphores -> concurrency limit for endorser service is 2500
2023-06-01 17:00:23.706 UTC 0005 INFO [nodeCmd] initGrpcSemaphores -> concurrency limit for deliver service is 2500
2023-06-01 17:00:23.706 UTC 0006 INFO [nodeCmd] serve -> Starting peer with TLS enabled
2023-06-01 17:00:23.721 UTC 0007 INFO [certmonitor] trackCertExpiration -> The enrollment certificate will expire on 2033-05-29 16:55:00 +0000 UTC
2023-06-01 17:00:23.721 UTC 0008 INFO [certmonitor] trackCertExpiration -> The server TLS certificate will expire on 2033-05-29 16:55:00 +0000 UTC
2023-06-01 17:00:23.721 UTC 0009 INFO [ledgermgmt] NewLedgerMgr -> Initializing LedgerMgr
2023-06-01 17:00:23.746 UTC 000a INFO [leveldbhelper] openDBAndCheckFormat -> DB is empty Setting db format as 2.0
2023-06-01 17:00:23.748 UTC 000b INFO [blkstorage] NewProvider -> Creating new file ledger directory at /var/hyperledger/production/ledgersData/chains/chains
2023-06-01 17:00:23.762 UTC 000c INFO [leveldbhelper] openDBAndCheckFormat -> DB is empty Setting db format as 2.0
2023-06-01 17:00:28.779 UTC 000d WARN [couchdb] handleRequest -> Attempt 1 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 125ms
2023-06-01 17:00:33.906 UTC 000e WARN [couchdb] handleRequest -> Attempt 2 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 250ms
2023-06-01 17:00:39.158 UTC 000f WARN [couchdb] handleRequest -> Attempt 3 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 500ms
2023-06-01 17:00:44.660 UTC 0010 WARN [couchdb] handleRequest -> Attempt 4 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 1s
2023-06-01 17:00:50.662 UTC 0011 WARN [couchdb] handleRequest -> Attempt 5 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 2s
2023-06-01 17:00:57.664 UTC 0012 WARN [couchdb] handleRequest -> Attempt 6 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 4s
2023-06-01 17:01:06.668 UTC 0013 WARN [couchdb] handleRequest -> Attempt 7 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 8s
2023-06-01 17:01:19.670 UTC 0014 WARN [couchdb] handleRequest -> Attempt 8 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 16s
2023-06-01 17:01:40.672 UTC 0015 WARN [couchdb] handleRequest -> Attempt 9 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 32s
2023-06-01 17:02:17.675 UTC 0016 WARN [couchdb] handleRequest -> Attempt 10 of 11 returned error: Get "http://172.18.77.0:5984/": dial tcp 172.18.77.0:5984: i/o timeout. Retrying couchdb request in 1m4s
I tried to enable couchdb on my hyperledger fabric 2.4.x test-network, however, I was not able to due to the issues mentioned above. Please help.
Upvotes: 0
Views: 205
Reputation: 78
The above issue was resolved. I opened the issue on github with the Hyperledger Fabric project, here is the link to the issue, the solution explains how to enable couchdb for hyperleder fabric 2.4.x test-network. I was able to enable it on my environment - Hyperledger Fabric 2.4.x test-network wsl2 Ubuntu 22.04.2 LTS
Upvotes: 0