长安链cmc工具check user cert on chain failed解决
之前文章中介紹過使用國密算法啟動(dòng)鏈,但當(dāng)國密算法鏈啟動(dòng)后,使用CMC命令工具進(jìn)行后續(xù)的操作時(shí),發(fā)生如下問題:
Error: check user cert on chain failed, check user upload cert on chain failed, try again later, user cert havenot on chain yet, and try again截圖如下:
[root@node cmc]# ./cmc query block-by-height 1 --chain-id=chain1 --sdk-conf-path=./testdata/sdk_config.yml Error: check user cert on chain failed, check user upload cert on chain failed, try again later, user cert havenot on chain yet, and try again Usage:cmc query block-by-height [height] [flags]Flags:--chain-id string Chain ID--enable-cert-hash whether enable cert hash (default true)-h, --help help for block-by-height--sdk-conf-path string specify sdk config path經(jīng)過各種嘗試和官方文檔搜索都沒找到答案。最后看命令提示欄中有一個(gè)
--enable-cert-hash
在官方文檔沒有介紹這個(gè)的具體用途,抱著試一試的心態(tài),添加了一行命令,如下:
[root@node cmc]# ./cmc query block-by-height 0 --chain-id=chain1 --sdk-conf-path=./testdata/sdk_config.yml --enable-cert-hash=false {"block": {"dag": {"vertexes": [{}]}, 。。。。后邊省略。。。。竟然成功了,此解決辦法暫時(shí)就這么用了。已反饋官方ISSUE,待后邊有回復(fù)再更新具體原理。
這個(gè)命令執(zhí)行成功了,但是后邊在執(zhí)行其他的CMC命令時(shí)怎么添加--enable-cert-hash都沒用,此時(shí)就開始仔細(xì)梳理。提示語說的是證書沒在鏈上,但是因?yàn)楦鞴?jié)點(diǎn)是多機(jī)部署,所以是各節(jié)點(diǎn)是啟動(dòng)狀態(tài)的,但是再仔細(xì)想想懷疑是各節(jié)點(diǎn)沒有真正形成一條鏈,導(dǎo)致各自節(jié)點(diǎn)的信任證書都沒有寫進(jìn)區(qū)塊,所以才會(huì)有此情況發(fā)生。
重頭梳理一下多機(jī)部署流程并檢查日志。重點(diǎn)是查日志發(fā)現(xiàn)確實(shí)是環(huán)境沒正常運(yùn)行。后續(xù)通過修改錯(cuò)誤的配置和確認(rèn)啟動(dòng)日志解決此問題。
檢查日志的命令:(在節(jié)點(diǎn)配置文件的bin目錄下執(zhí)行)
[root@node bin]# cat ../log/system.log |grep "ERROR\|put block\|all necessary" 2022-06-14 15:10:37.023 [INFO] [Net] libp2pnet/libp2p_connection_supervisor.go:116 [ConnSupervisor] all necessary peers connected. 2022-06-14 15:16:14.662 [INFO] [Storage] @chain1 v2@v2.2.1/blockstore_impl.go:254 chain[chain1]: put block[0] hash[979be638a997f8d4d52587e1bac53e99e179c581c89ca8ec8f8286245be045f1] (txs:1 bytes:16239), 2022-06-14 15:16:14.708 [INFO] [Storage] @chain2 v2@v2.2.1/blockstore_impl.go:254 chain[chain2]: put block[0] hash[d3bc0a7a256807ad142feff8e1f034c15837da2c64c58de003f44f105601d8a1] (txs:1 bytes:16239), 2022-06-14 15:17:09.725 [INFO] [Net] libp2pnet/libp2p_connection_supervisor.go:116 [ConnSupervisor] all necessary peers connected. 2022-06-14 15:18:12.454 [INFO] [Storage] @chain1 v2@v2.2.1/blockstore_impl.go:566 chain[chain1]: put block[1] common (txs:1, bytes: 10960), time used: marshal: 0, writeFile: 1, writeCache: 0, writeKvDB: 0, total: 2 2022-06-14 15:20:02.982 [INFO] [Storage] @chain1 v2@v2.2.1/blockstore_impl.go:566 chain[chain1]: put block[2] common (txs:1, bytes: 10959), time used: marshal: 0, writeFile: 3, writeCache: 0, writeKvDB: 0, total: 3 2022-06-14 15:20:04.031 [INFO] [Storage] @chain1 v2@v2.2.1/blockstore_impl.go:566 chain[chain1]: put block[3] common (txs:1, bytes: 29313), time used: marshal: 0, writeFile: 1, writeCache: 0, writeKvDB: 0, total: 1總結(jié)
以上是生活随笔為你收集整理的长安链cmc工具check user cert on chain failed解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 汽车IVI中控开发入门及进阶(六):仪表
- 下一篇: 60GHZ雷达液位仪 液位传感器