阿里云服务器跑 hyperledger e2e-cli 运行

go 安装

docker 安装

hyperledger fabric 源码运行

参加上篇博客

 CentOS 7 HyperLedger fabric 实战 e2e-cli 有运行成功图

问题及解决方法

[java] view plain copy
  1. 2018-03-23 17:52:41.021 UTC [channelCmd] readBlock -> DEBU 016 Got status:*orderer.DeliverResponse_Status  
  2. 2018-03-23 17:52:41.021 UTC [msp] GetLocalMSP -> DEBU 017 Returning existing local MSP  
  3. 2018-03-23 17:52:41.021 UTC [msp] GetDefaultSigningIdentity -> DEBU 018 Obtaining default signing identity  
  4. fatal error: unexpected signal during runtime execution  
  5. [signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7fd45dffd259]  
  6.   
  7. runtime stack:  
  8. runtime.throw(0xdc37a70x2a)  
  9.         /opt/go/src/runtime/panic.go:566 +0x95  
  10. runtime.sigpanic()  
  11.         /opt/go/src/runtime/sigpanic_unix.go:12 +0x2cc  
  12.   
  13. goroutine 34 [syscall, locked to thread]:  
  14. runtime.cgocall(0xb08d500xc420020df80xc400000000)  
  15.         /opt/go/src/runtime/cgocall.go:131 +0x110 fp=0xc420020db0 sp=0xc420020d70  
  16. net._C2func_getaddrinfo(0x7fd4580008c00x00xc4203435600xc42012e5e80x00x00x0)  
  17.         ??:0 +0x68 fp=0xc420020df8 sp=0xc420020db0  
  18. net.cgoLookupIPCNAME(0x7ffdd56a1a830x130x00x00x00x00x00x00x0)  
  19.         /opt/go/src/net/cgo_unix.go:146 +0x37c fp=0xc420020f18 sp=0xc420020df8  
  20. net.cgoIPLookup(0xc4203a35600x7ffdd56a1a830x13)  
  21.         /opt/go/src/net/cgo_unix.go:198 +0x4d fp=0xc420020fa8 sp=0xc420020f18  
  22. runtime.goexit()  
  23.         /opt/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc420020fb0 sp=0xc420020fa8  
  24. created by net.cgoLookupIP  
  25.         /opt/go/src/net/cgo_unix.go:208 +0xb4  
  26.   
  27. goroutine 1 [select]:  
  28. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*addrConn).wait(0xc4201d68c00x7fd45e37fda00xc4203434a00xc4201501000x8006f00x7fd45e37fda00xc4203434a00x0)  
  29.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:1032 +0x183  
  30. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*ClientConn).getTransport(0xc42014dd400x7fd45e37fda00xc4203434a00xc4203434000x7fd45e37fda00xc4203434700x190x00xc42015d900)  
  31.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:724 +0x2f7  
  32. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.newClientStream(0x7fd45e37fda00xc4203434a00x13e1f400xc42014dd400xdb7f760x200x00x00x00x0, ...)  
  33.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/stream.go:189 +0x599  
  34. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.NewClientStream(0x7fd45e37fd200xc4200122900x13e1f400xc42014dd400xdb7f760x200x00x00x00x18, ...)  
  35.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/stream.go:105 +0x162  
  36. github.com/hyperledger/fabric/protos/orderer.(*atomicBroadcastClient).Deliver(0xc42012e5d80x7fd45e37fd200xc4200122900x00x00x00x00x00xc42031a9a00xbe4ab0)  
  37.         /opt/gopath/src/github.com/hyperledger/fabric/protos/orderer/ab.pb.go:499 +0xba  
  38. github.com/hyperledger/fabric/peer/channel.InitCmdFactory(0xc4203501000x00x00x13ee140)  
  39.         /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/channel.go:179 +0x2c0  
  40. github.com/hyperledger/fabric/peer/channel.getGenesisBlock(0xc420328f000x00x00x0)  
  41.         /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/deliverclient.go:141 +0x11c  
  42. github.com/hyperledger/fabric/peer/channel.executeCreate(0xc420328f000xc420328f000x0)  
  43.         /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/create.go:183 +0x50  
  44. github.com/hyperledger/fabric/peer/channel.create(0xc4202494400xc42020fcc00x10xa0xc420328f000xd9d9430x5)  
  45.         /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/create.go:213 +0x45  
  46. github.com/hyperledger/fabric/peer/channel.createCmd.func1(0xc4202494400xc42020fcc00x10xa0x00x0)  
  47.         /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/create.go:59 +0x52  
  48. github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0xc4202494400xc42020fb800xa0xa0xc4202494400xc42020fb80)  
  49.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:599 +0x234  
  50. github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x13e58c00xf0xc4200100350x7)  
  51.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:689 +0x367  
  52. github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x13e58c00x7d0xc420010035)  
  53.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:648 +0x2b  
  54. main.main()  
  55.         /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:118 +0x54e  
  56.   
  57. goroutine 17 [syscall, locked to thread]:  
  58. runtime.goexit()  
  59.         /opt/go/src/runtime/asm_amd64.s:2086 +0x1  
  60.   
  61. goroutine 19 [syscall]:  
  62. os/signal.signal_recv(0xc420025fa8)  
  63.         /opt/go/src/runtime/sigqueue.go:116 +0x157  
  64. os/signal.loop()  
  65.         /opt/go/src/os/signal/signal_unix.go:22 +0x22  
  66. created by os/signal.init.1  
  67.         /opt/go/src/os/signal/signal_unix.go:28 +0x41  
  68.   
  69. goroutine 33 [select]:  
  70. net.cgoLookupIP(0x13fc8c00xc4203a34a00x7ffdd56a1a830x130xc4202521800xc42034e4400x00x00xc420026fa80x8f6938)  
  71.         /opt/go/src/net/cgo_unix.go:209 +0x2f5  
  72. net.lookupIP(0x13fc8c00xc4203a34a00x7ffdd56a1a830x130x00x00x13f0a800xc420339aa00xc420018838)  
  73.         /opt/go/src/net/lookup_unix.go:70 +0xf9  
  74. net.glob..func11(0x13fc8c00xc4203a34a00xe2abc00x7ffdd56a1a830x130xc420026ec80x71c6a90xc420026f080xc420026f180x455cc0)  
  75.         /opt/go/src/net/hook.go:19 +0x52  
  76. net.lookupIPContext.func1(0xc42014dd400x7ffdd56a1a830x180x0)  
  77.         /opt/go/src/net/lookup.go:119 +0x5c  
  78. internal/singleflight.(*Group).doCall(0x14197900xc4203a0be00x7ffdd56a1a830x130xc420343500)  
  79.         /opt/go/src/internal/singleflight/singleflight.go:93 +0x3c  
  80. created by internal/singleflight.(*Group).DoChan  
  81.         /opt/go/src/internal/singleflight/singleflight.go:86 +0x339  
  82.   
  83. goroutine 32 [select]:  
  84. net.lookupIPContext(0x13fc8c00xc4203a34a00x7ffdd56a1a830x130x00x00x00x00x0)  
  85.         /opt/go/src/net/lookup.go:122 +0x7bc  
  86. net.internetAddrList(0x13fc8c00xc4203a34a00xd9cd170x30x7ffdd56a1a830x180x00x00x00x0, ...)  
  87.         /opt/go/src/net/ipsock.go:241 +0x5e0  
  88. net.resolveAddrList(0x13fc8c00xc4203a34a00xd9d3170x40xd9cd170x30x7ffdd56a1a830x180x00x0, ...)  
  89.         /opt/go/src/net/dial.go:179 +0x106  
  90. net.(*Dialer).DialContext(0xc4200496c80x13fc8c00xc4203a34a00xd9cd170x30x7ffdd56a1a830x180x00x00x0, ...)  
  91.         /opt/go/src/net/dial.go:329 +0x238  
  92. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.dialContext(0x13fc8c00xc4203a34a00xd9cd170x30x7ffdd56a1a830x180x00x00xc4202503c00xc4203a6780)  
  93.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/go17.go:53 +0xaa  
  94. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.DialContext.func1(0x7fd45e37fde00xc4203a34a00x7ffdd56a1a830x180x10x00x13ee1400xc42012d810)  
  95.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:341 +0x86  
  96. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.newProxyDialer.func1(0x7fd45e37fde00xc4203a34a00x7ffdd56a1a830x180x130x7fd45ebbc6080x00x0)  
  97.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/proxy.go:136 +0x143  
  98. github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport.dial(0x7fd45e37fde00xc4203a34a00xc4203936b00x7ffdd56a1a830x180x410a5e0xc42039e5a00xa00x98)  
  99.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport/http2_client.go:135 +0x5a  
  100. github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport.newHTTP2Client(0x7fd45e37fde00xc4203a34a00x7ffdd56a1a830x180x00x00xda8cf60x110x00x0, ...)  
  101.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport/http2_client.go:173 +0xbf  
  102. github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport.NewClientTransport(0x7fd45e37fde00xc4203a34a00x7ffdd56a1a830x180x00x00xda8cf60x110x00x0, ...)  
  103.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/transport/transport.go:463 +0xae  
  104. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*addrConn).resetTransport(0xc4201d68c00xc4203a2c000x70a61c0x0)  
  105.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:876 +0x282  
  106. github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*ClientConn).resetAddrConn.func1(0xc4201d68c0)  
  107.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:648 +0x34  
  108. created by github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*ClientConn).resetAddrConn  
  109.         /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/clientconn.go:657 +0x756  
  110. !!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!  
  111. ================== ERROR !!! FAILED to execute End-2-End Scenario ==================  
[java] view plain copy
  1.   

切换路径

cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_cli 

关键步骤

修改 /etc/resolv.conf 配置,将 options timeout:2 attempts:3 rotate single-request-reopen 内容注释掉,作者修改后的内容如下

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 100.100.2.136
nameserver 100.100.2.138
# options timeout:2 attempts:3 rotate single-request-reopen

执行启动命令,它会启动一个 mychannel 的channel 

./network_setup.sh up mychannel


问题2:

hyperledger make: *** release/linux-amd64/bin/configtxgen', needed by `linux-amd64/bin

解决方法:

cp -r fabric/bin/* release/linux-amd64/bin/


阿里云服务器跑 hyperledger e2e-cli 运行


参考资料:

阿里云环境部署Hyperledger Fabric之SIGSEGV问题分析和解决经验分享

 https://yq.aliyun.com/articles/238940




上一篇:[类和对象]-C#OOP


下一篇:【手把手教你Maven】构建过程