执行chainmaker-tee项目的gateway出错
【问题分类】
- bug
- P2P网络相关(包含libp2p,liquid)
- 链账户身份与权限相关(证书问题、public、多签投票问题)
- 核心交易引擎相关(交易池、DAG)
- 共识相关
- 智能合约相关
- 存储相关
- SDK相关
- 长安链CMC工具
- 长安链管理台
- 长安链浏览器
- 长安链合约IDE
- 长安链web签名插件
- 跨链相关
- 轻节点相关
- 隐私计算相关
- 密码学相关
- 环境依赖
- 其他补充:
【问题描述】(请对问题进行描述,方便定位问题)
相关版本:
1、git clone -b v2.2.1_private_contract --depth=1 https://git.chainmaker.org.cn/chainmaker/chainmaker-go.git 2、git clone -b v2.2.1_private_contract --depth=1 https://git.chainmaker.org.cn/chainmaker/graphene.git 3、git clone -b v2.2.1_private_contract --depth=1 https://git.chainmaker.org.cn/chainmaker/chainmaker-tee.git
1、用openssl生成根CA证书存放在目录/home/ubuntu/ca/cacert/CAcert.pem下
2、执行chainmaker-graphene项目,执行后等待in_teecert.pem,用该CA证书签out_csr.pem得到in_teecert.pem
3、用命令sudo gramine-sgx ./enclave-server运行起来enclave,端口一切正常, ubuntu@VM-0-17-ubuntu:~/ca/cacert$ sudo netstat -ntlp | grep ./loader tcp6 0 0 :::50053 :::* LISTEN 639680/loader
4、chainmaker-go编译cmc工具,执行如下命令,上传CAcert.pem文件和out_report.dat文件(out_report.dat文件从chainmaker-graphene项目的config中得到)
`
cmc将ca上链
./cmc tee upload_ca_cert
--sdk-conf-path=./testdata/sdk_config.yml
--ca_cert=/home/ubuntu/ca/cacert/CAcert.pem
--admin-key-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.sign.key,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.sign.key,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.sign.key
--admin-crt-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.sign.crt,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.sign.crt,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.sign.crt
将chainmaker-graphene的ca文件上链
./cmc tee upload_report
--sdk-conf-path=./testdata/sdk_config.yml
--report=/home/ubuntu/chainmaker-graphene/configs/out_report.dat
--admin-key-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.sign.key,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.sign.key,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.sign.key
--admin-crt-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.sign.crt,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.sign.crt,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.sign.crt
`
4、配置chainmaker-tee,原来在cmclient.go使用的配置文件为configs,将cmc中用到的testdata(cmc工具运行正常,testdata中的配置文件也是对的)拷贝到当前文件夹中,然后修改cmclient.go的InitCmClient函数部分
` const ( sdkConfigOrg1Client1Path = "./testdata/sdk_config.yml" )
func InitCmClient() error { //初始化配置 CmC = &CmClient{}
var err error
CmC.chainClient, err = sdk.NewChainClient(
// 直接用配置文件去连接
sdk.WithConfPath(sdkConfigOrg1Client1Path),
sdk.WithAuthType("permissionedwithcert"),
// // 设置归属组织
// sdk.WithChainClientOrgId(config.CmcConfig.OrgId),
// // 设置链ID
// sdk.WithChainClientChainId(config.CmcConfig.ChainId),
// // 设置客户端用户私钥路径
// sdk.WithUserKeyFilePath(config.CmcConfig.UserKeyPath),
// // 设置客户端用户证书
// sdk.WithUserCrtFilePath(config.CmcConfig.UserCrtPath),
// // 添加节点1
// sdk.AddChainClientNodeConfig(getNodeConfig()),
// //
// sdk.WithAuthType("permissionedwithcert"),
)
if err != nil {
return err
}
//启用证书压缩(开启证书压缩可以减小交易包大小,提升处理性能)
if err = CmC.chainClient.EnableCertHash(); err != nil {
return err
}
return nil
} `
5、编译后执行
使用如下代码:
go build ./gateway start
出现如下报错内容
ubuntu@VM-0-17-ubuntu:~/chainmaker-tee/gateway$ ./gateway start init grpc pool client success 当前工作目录: /home/ubuntu/chainmaker-tee/gateway 2023/05/25 15:53:26 starting sgx server save remote attestation proof error: get sync result failed, get tx by txId [176253ab6817d9daca34e92f88d17f6be75ea4532cc34b1d8b73fdafc6a10a13] failed, QUERY_CONTRACT failed, txStatusCode:4, resultCode:1, contractName[CHAIN_QUERY] method[GET_TX_BY_TX_ID] txType[QUERY_CONTRACT], no such transaction, chainId:chain1
【相关日志文件】(如果有报错日志请贴图,或者上传附件)
chainmaker-go 的 log/system.log & bin/panic.log file *
SDK 的 sdk.log file
相关log如下:
2023-05-25 15:53:24.850 [INFO] [Core] [31;1m@chain1[0m scheduler/scheduler.go:139 before Schedule(...) dispatch txs of block(14) 2023-05-25 15:53:24.850 [INFO] [Core] [31;1m@chain1[0m scheduler/scheduler.go:155 end Schedule(...) dispatch txs of block(14) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/37/PROPOSE) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:390 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send roundqc [14/37/VOTE_PRECOMMIT] to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/37/PROPOSE) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/37/PROPOSE) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:390 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send roundqc [14/37/VOTE_PRECOMMIT] to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/37/PROPOSE) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/37/PROPOSE) 2023-05-25 15:53:24.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:390 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send roundqc [14/37/VOTE_PRECOMMIT] to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/37/PROPOSE) 2023-05-25 15:53:25.395 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/38/PROPOSE) 2023-05-25 15:53:25.396 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/38/PROPOSE) 2023-05-25 15:53:25.396 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/38/PROPOSE) 2023-05-25 15:53:25.896 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/38/PROPOSE) 2023-05-25 15:53:25.896 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/38/PROPOSE) 2023-05-25 15:53:25.896 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/38/PROPOSE) 2023-05-25 15:53:26.236 [INFO] [Vm] [31;1m@chain1[0m certmgr/cert_manage_contract.go:240 certManage query success certHashes[a90068d708d49ead1124f2a04466c0d98088e14b6d30a4c09cb62fa9a8189dda] 2023-05-25 15:53:26.241 [WARN] [Vm] [31;1m@chain1[0m blockcontract/block_contract.go:865 no such transaction, chainId:chain1 2023-05-25 15:53:26.241 [WARN] [Rpc] rpcserver/api_service.go:299 txStatusCode:4, resultCode:1, contractName[CHAIN_QUERY] method[GET_TX_BY_TX_ID] txType[QUERY_CONTRACT], no such transaction, chainId:chain1 2023-05-25 15:53:26.396 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/38/PROPOSE) 2023-05-25 15:53:26.396 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/38/PROPOSE) 2023-05-25 15:53:26.396 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/38/PROPOSE) 2023-05-25 15:53:26.743 [WARN] [Vm] [31;1m@chain1[0m blockcontract/block_contract.go:865 no such transaction, chainId:chain1 2023-05-25 15:53:26.743 [WARN] [Rpc] rpcserver/api_service.go:299 txStatusCode:4, resultCode:1, contractName[CHAIN_QUERY] method[GET_TX_BY_TX_ID] txType[QUERY_CONTRACT], no such transaction, chainId:chain1 2023-05-25 15:53:26.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQNXKzuRZLCTryGccxXnjCy2RDS3QiEsyERkURbPtTQij](14/38/PROPOSE) 2023-05-25 15:53:26.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [QmQreGSUmhUQKWJQGQ1v96Ztt3Ne3RZvysYDdEQ8T4DeHi](14/38/PROPOSE) 2023-05-25 15:53:26.895 [INFO] [Consensus] [31;1m@chain1[0m v2@v2.3.2/tbft_status_broadcaster.go:193 [QmRu4qVPxUM3vc2NzT3phRtctDtyTp2D2LGR7ZK41qhaB3](14/38/PROPOSE) send state to [Qmeon7vrzuv2hUgJUeMUdVbGkSS9735g2Goc4PRCoksWfz](14/38/PROPOSE) 2023-05-25 15:53:27.245 [WARN] [Vm] [31;1m@chain1[0m blockcontract/block_contract.go:865 no such transaction, chainId:chain1 2023-05-25 15:53:27.245 [WARN] [Rpc] rpcserver/api_service.go:299 txStatusCode:4, resultCode:1, contractName[CHAIN_QUERY] method[GET_TX_BY_TX_ID] txType[QUERY_CONTRACT], no such transaction, chainId:chain1
【系统信息】(请填写系统信息,方便定位问题)
- chainmaker-go version * : go version go1.16.15 linux/amd64
- OS & version * : ubuntu22.04
- docker镜像 version: 否
-
管理台 version: 未使用
- 如果是管理台的相关问题,请附带管理台版本,如果不是可忽略。
-
区块浏览器 version: 未使用
- 如果是浏览器的相关问题,请附带浏览器版本,如果不是可忽略。
-
合约IDE version: 未使用
- 如果是合约IDE的相关问题,请附带合约IDE版本,如果不是可忽略。
-
web签名插件 version: 未使用
- 如果是web签名插件的相关问题,请附带web签名插件版本,如果不是可忽略。