Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fabric-gm编译后创建channel时的错误 #1

Open
ssy1997 opened this issue Mar 22, 2020 · 4 comments
Open

fabric-gm编译后创建channel时的错误 #1

ssy1997 opened this issue Mar 22, 2020 · 4 comments

Comments

@ssy1997
Copy link

ssy1997 commented Mar 22, 2020

您好,我将您的源码进行以下编译:

  1. make peer/orderer
  2. make peer-docker/orderer-docker/tools-docker
    之后,利用fabric-sample中first-network来测试是否可行
    启动./byfn.sh脚本后报错:
    Build your first network (BYFN) end-to-end test
  • peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    Channel name : mychannel
    Creating channel...
  • res=2
  • set +x
    bccsp gm keyimport pk is *sm2.PublicKeypanic: interface conversion: interface {} is *sm2.PublicKey, not *ecdsa.PublicKey

goroutine 1 [running]:
github.com/hyperledger/fabric/msp.sanitizeECDSASignedCert(0xc00052a480, 0xc00052a480, 0x0, 0x0, 0xc0001b39e0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/cert.go:84 +0x475
github.com/hyperledger/fabric/msp.(*bccspmsp).sanitizeCert(0xc0004a6480, 0xc00052a480, 0x1990900, 0xc00026f920, 0x19a8e60)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:695 +0x133
github.com/hyperledger/fabric/msp.newIdentity(0xc00052a480, 0x19a8e60, 0xc00000ed20, 0xc0004a6480, 0xc00026f920, 0x19a8e60, 0xc00000ed20, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/identities.go:47 +0x70
github.com/hyperledger/fabric/msp.(*bccspmsp).getIdentityFromConf(0xc0004a6480, 0xc000142a80, 0x35f, 0x380, 0x1, 0x1, 0x0, 0x0, 0xc000443870, 0xdaebc5)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:161 +0x102
github.com/hyperledger/fabric/msp.(*bccspmsp).setupCAs(0xc0004a6480, 0xc00012a3c0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:134 +0x65d
github.com/hyperledger/fabric/msp.(*bccspmsp).preSetupV1(0xc0004a6480, 0xc00012a3c0, 0xc000443960, 0xdad8d0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:393 +0x64
github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1(0xc0004a6480, 0xc00012a3c0, 0x1, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:373 +0x39
github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1-fm(0xc00012a3c0, 0x183cd90, 0x1a)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:112 +0x34
github.com/hyperledger/fabric/msp.(*bccspmsp).Setup(0xc0004a6480, 0xc0005e91c0, 0x0, 0x25c9408)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:225 +0x14d
github.com/hyperledger/fabric/msp/cache.(*cachedMSP).Setup(0xc0001b3710, 0xc0005e91c0, 0xc0004c66a0, 0xc00003e035)
/opt/gopath/src/github.com/hyperledger/fabric/msp/cache/cache.go:88 +0x4b
github.com/hyperledger/fabric/msp/mgmt.LoadLocalMspWithType(0xc0000401f8, 0x7d, 0xc0004c66a0, 0xc00003e035, 0x7, 0xc0003a1ae0, 0x5, 0xc0002a4ea0, 0xc000443ae8)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mgmt/mgmt.go:32 +0xd5
github.com/hyperledger/fabric/peer/common.InitCrypto(0xc0000401f8, 0x7d, 0xc00003e035, 0x7, 0xc0003a1ae0, 0x5, 0x15e4b40, 0x24e5b80)
/opt/gopath/src/github.com/hyperledger/fabric/peer/common/common.go:143 +0x2e9
github.com/hyperledger/fabric/peer/common.InitCmd(0xc00029cf00, 0xc000294140, 0x1, 0xa)
/opt/gopath/src/github.com/hyperledger/fabric/peer/common/common.go:309 +0x2d9
github.com/hyperledger/fabric/peer/channel.glob..func1(0xc00029cf00, 0xc000294140, 0x1, 0xa)
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/channel.go:102 +0x49
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0xc00029cf00, 0xc000294000, 0xa, 0xa, 0xc00029cf00, 0xc000294000)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:746 +0x242
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x24bba80, 0x8, 0x0, 0x24ba780)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x24bba80, 0xc0000e3f40, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:53 +0x2f7
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

ERROR !!!! Test failed

我利用docker-compose-cli.yaml来启动也是同样的错误。
暂时没查阅到相关类似的错误解决方案,
请问这是什么问题呢?

@qiangjiyi
Copy link
Owner

qiangjiyi commented Mar 30, 2020 via email

@ssy1997
Copy link
Author

ssy1997 commented Apr 3, 2020 via email

@qiangjiyi
Copy link
Owner

qiangjiyi commented Apr 10, 2020 via email

@csquan
Copy link

csquan commented Sep 15, 2020

interface conversion: interface {} is *sm2.PublicKey, not *ecdsa.PublicKey
首先make后用新的程序生成了证书等,然后启动创建通道,报上面错误,定位代码,msp/ceert.go 92行
expectedSig, err := gm.SignatureToLowS(parentCert.PublicKey.(*ecdsa.PublicKey), cert.Signature)
清楚看到,第一个参数是ecdsa,既然如此,为何还有这个参数错误?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants