current position:Home>Error connecting orderer when fabric SDK go creates channel
Error connecting orderer when fabric SDK go creates channel
2022-02-03 20:55:41 【Q & A of Denglian community】
The network environment :
tcp 0 0 ubuntu:domain *:* LISTEN - tcp 0 0 localhost:ipp *:* LISTEN - tcp6 0 0 [::]:7050 [::]:* LISTEN - tcp6 0 0 [::]:7051 [::]:* LISTEN - tcp6 0 0 [::]:8051 [::]:* LISTEN - tcp6 0 0 ip6-localhost:ipp [::]:* LISTEN - tcp6 0 0 [::]:9051 [::]:* LISTEN - tcp6 0 0 [::]:zabbix-trapper [::]:* LISTEN -
docker List of containers
9840eb307233 hyperledger/fabric-peer:1.4.6 "peer node start" 5 hours ago Up 5 hours 0.0.0.0:8051->7051/tcp peer1.org1.example.coma05df5289ee6 hyperledger/fabric-peer:1.4.6 "peer node start" 5 hours ago Up 5 hours 0.0.0.0:10051->7051/tcp peer1.org2.example.comac87a29766e2 hyperledger/fabric-peer:1.4.6 "peer node start" 5 hours ago Up 5 hours 0.0.0.0:7051->7051/tcp peer0.org1.example.comf62d617920c2 hyperledger/fabric-peer:1.4.6 "peer node start" 5 hours ago Up 5 hours 0.0.0.0:9051->7051/tcp peer0.org2.example.comb1db61093899 hyperledger/fabric-orderer:1.4.6 "orderer" 5 hours ago Up 5 hours 0.0.0.0:7050->7050/tcp orderer.example.com
The wrong part of the code
channelReq := resmgmt.SaveChannelRequest{ChannelID: info.ChannelID, ChannelConfigPath: info.ChannelConfig, SigningIdentities: []msp.SigningIdentity{adminIdentity}} // save channel response with transaction ID _, err = resMgmtClient.SaveChannel(channelReq, resmgmt.WithRetry(retry.DefaultResMgmtOpts), resmgmt.WithOrdererEndpoint(info.OrdererOrgName)) if err != nil { return fmt.Errorf(" Failed to create application channel : %v", err) }
info
initInfo := &sdkInit.InitInfo{ ChannelID: "sdkchannel", ChannelConfig: os.Getenv("GOPATH") + "/src/myfabric/channel-artifacts/channel.tx", OrgAdmin: "Admin", OrgName: "Org1", OrdererOrgName: "orderer.example.com", }
config.yaml file
orderers: orderer.example.com: # [Optional] Default: Infer from hostname url: orderer.example.com:7050 # these are standard properties defined by the gRPC library # they will be passed in as-is to gRPC client constructor grpcOptions: #ssl-target-name-override: orderer.example.com # These parameters should be set in coordination with the keepalive policy on the server, # as incompatible settings can result in closing of connection. # When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled keep-alive-time: 0s keep-alive-timeout: 20s keep-alive-permit: false fail-fast: false # allow-insecure will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs allow-insecure: false tlsCACerts: # Certificate location absolute path path: /home/arthur/go/src/myfabric/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem.......orderer: - pattern: (\w+)orderer.example.com(\w*) urlSubstitutionExp: grpc://orderer.example.com:7050 sslTargetOverrideUrlSubstitutionExp: orderer.example.com mappedHost: orderer.example.com
Error message create channel failed: SendEnvelope failed: calling orderer 'orderer.example.com:7050' failed: Orderer Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection timed out [orderer.example.com:7050]
Orderer Node log information
2020-03-22 04:53:30.882 UTC [core.comm] ServerHandshake -> ERRO 6d8 TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=172.20.0.1:382262020-03-22 04:53:30.884 UTC [grpc] handleRawConn -> DEBU 6d9 grpc: Server.Serve failed to complete security handshake from "172.20.0.1:38226": remote error: tls: bad certificate2020-03-22 04:53:31.881 UTC [core.comm] ServerHandshake -> ERRO 6da TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=172.20.0.1:382302020-03-22 04:53:31.882 UTC [grpc] handleRawConn -> DEBU 6db grpc: Server.Serve failed to complete security handshake from "172.20.0.1:38230": remote error: tls: bad certificate2020-03-22 04:53:33.800 UTC [core.comm] ServerHandshake -> ERRO 6dc TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=172.20.0.1:382342020-03-22 04:53:33.800 UTC [grpc] handleRawConn -> DEBU 6dd grpc: Server.Serve failed to complete security handshake from "172.20.0.1:38234": remote error: tls: bad certificate2020-03-22 04:53:36.623 UTC [core.comm] ServerHandshake -> ERRO 6de TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=172.20.0.1:382382020-03-22 04:53:36.624 UTC [grpc] handleRawConn -> DEBU 6df grpc: Server.Serve failed to complete security handshake from "172.20.0.1:38238": remote error: tls: bad certificate2020-03-22 04:53:40.002 UTC [core.comm] ServerHandshake -> ERRO 6e0 TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=172.20.0.1:382422020-03-22 04:53:40.002 UTC [grpc] handleRawConn -> DEBU 6e1 grpc: Server.Serve failed to complete security handshake from "172.20.0.1:38242": remote error: tls: bad certificate2020-03-22 05:15:59.952 UTC [core.comm] ServerHandshake -> ERRO 6e2 TLS handshake failed with error tls: first record does not look like a TLS handshake server=Orderer remoteaddress=172.20.0.3:563962020-03-22 05:15:59.953 UTC [grpc] handleRawConn -> DEBU 6e3 grpc: Server.Serve failed to complete security handshake from "172.20.0.3:56396": tls: first record does not look like a TLS handshake2020-03-22 05:26:43.787 UTC [core.comm] ServerHandshake -> ERRO 6e4 TLS handshake failed with error tls: first record does not look like a TLS handshake server=Orderer remoteaddress=172.20.0.3:564062020-03-22 05:26:43.787 UTC [grpc] handleRawConn -> DEBU 6e5 grpc: Server.Serve failed to complete security handshake from "172.20.0.3:56406": tls: first record does not look like a TLS handshake
Take the answer 1:
It should be a certificate problem .
Adjust the log level to DEBUG , Check out the details .
export FABRIC_LOGGING_SPEC=DEBUG
Possible problems : Certificate does not contain IP( Replace... With a domain name )、 Wrong certificate specified 、TLS The function is not turned on correctly
Other answers 1:
copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032055396006.html
The sidebar is recommended
- Teacher, I got the value with Web3 according to your video tutorial, but when calling setinfo with Web3, an error is reported when the set value is set. What is the reason?
- Accounts has been unable to get the local address.
- Metamask is connected to the local network. Why can't Web3 use the default address?
- Write the code in and still can't get the address. Is it related to my network? I've been using metamask reponste3 to test the network, but the local network 8545 can't be connected
- Setinfo is called successfully, but an error will be reported after success. What is the reason?
- Use the Ganache local node to prompt that the introduction of Web3 is successful. But you can't use Web3's method
- Solid returns cannot return results
- Why did I get an error initializing the genesis block.
- Why do I start the RPC service of geth node and send a request to the node without response from the terminal?
- How to solve the problem of displaying errors in the constructor of solidity because of the version of vs Code?
guess what you like
-
The new version of truss initializes test with init. There are no files in test. Is it a version problem?
-
What do you think of the time it takes to call a contract
-
Problems encountered initializing folders with truss init. Prompt: how to solve the problem of unable to connect to the network
-
What is the solution
-
When compiling the contract, the terminal input truss compile is stuck and cannot be compiled successfully
-
What is the problem that the version of the solid compiler cannot be matched after the truss compile prompt
-
After downloading the truss again, the problem of Solc compiling environment will not be prompted, but the output error will be displayed. Why?
-
Interact with the contract in the truss console, and call Web3 when passing parameters The toWei hint is not a function
-
Building usdt wallet node based on erc20
-
Why is there a promise syntax error when it is written like this? It shows that the listener function is undecided. Obviously, a contract instance has been successfully introduced.
Random recommended
- The wallet can be connected to metamask and Ganache to obtain balance, but the balance connected to get is 0
- How do contracts simulate the passage of time?
- How to use private key offline signature to initiate a contract call transaction?
- Why does nonce in eth trading have to be continuous? I think it's bigger than the current one. Please solve your doubts???
- When the third parameter is passed, the web console reports an error and votes for the third candidate. Metamask is not approved, but it is OK to delete the third parameter "Jose".
- How does solidity calculate the square root of a number?
- What's the use of solidity contract address?
- How to ensure that the information collected by each node is consistent in the generation of a block?
- How to use different users to call contract functions in truffle console
- How to use the call, callcode, and delegatecall functions called by the solidity contract?
- How to assign and deploy constructor parameters in geth console?
- How to use the keyword "solid payable"?
- How to construct offline transaction for bitcoin isolation address
- Ganache installation problem
- The "gas deduction" function appears in the "solid require" function?
- How does a smart contract receive Ethernet?
- Metamask transfer error
- Etherscan has been blocked. What alternative blockchain browser is available?
- Bitcoin 6 block confirmation problem
- When mining with code, why do you have to convert it into JSON format and sort it when hashing?
- How to use the etheric currency allocated by Ethereum Genesis block
- The voting code runs on Remix. The constructor version is compatible. The code and error information are attached. Please have a look.
- The geth node is killed
- About Web3 JS installation problem???
- How to deploy truss to remote private chain
- Is there a size limit for the storage of Ethereum contract accounts?
- How can Ethereum contract accounts prevent disclosure of their own information?
- How to use delegatecall and what is its specific function?
- An error occurred when golang implemented the offline signature (cold signature) transaction of eth transaction
- Ask a question about the use of anonymous event in solidity
- How do erc20 tokens upload icons?
- Fabric 2.0 compile make error solution!
- How to do Merkle hash for the block hash of two sub chains
- Check the Ethereum source code and find that the precompiled contract ecrecover has a devil number
- How can smart contracts receive various token transfers from others?
- When I changed the compiled version of solidity
- After using the truss test command, an error is reported. How to solve it?
- The token contract of geth private chain deployment is successful, but the totalsupply is 0 and there is no other initialization information. The contract looks like it has not taken effect
- The Syntax version of Ethereum DAPP development practical video tutorial?
- Remix deployment contract failed