长安链cmc工具check user cert on chain failed解决
生活随笔
收集整理的這篇文章主要介紹了
长安链cmc工具check user cert on chain failed解决
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
之前文章中介紹過使用國密算法啟動鏈,但當國密算法鏈啟動后,使用CMC命令工具進行后續的操作時,發生如下問題:
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經過各種嘗試和官方文檔搜索都沒找到答案。最后看命令提示欄中有一個
--enable-cert-hash
在官方文檔沒有介紹這個的具體用途,抱著試一試的心態,添加了一行命令,如下:
[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": [{}]}, 。。。。后邊省略。。。。竟然成功了,此解決辦法暫時就這么用了。已反饋官方ISSUE,待后邊有回復再更新具體原理。
這個命令執行成功了,但是后邊在執行其他的CMC命令時怎么添加--enable-cert-hash都沒用,此時就開始仔細梳理。提示語說的是證書沒在鏈上,但是因為各節點是多機部署,所以是各節點是啟動狀態的,但是再仔細想想懷疑是各節點沒有真正形成一條鏈,導致各自節點的信任證書都沒有寫進區塊,所以才會有此情況發生。
重頭梳理一下多機部署流程并檢查日志。重點是查日志發現確實是環境沒正常運行。后續通過修改錯誤的配置和確認啟動日志解決此問題。
檢查日志的命令:(在節點配置文件的bin目錄下執行)
[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總結
以上是生活随笔為你收集整理的长安链cmc工具check user cert on chain failed解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 汽车IVI中控开发入门及进阶(六):仪表
- 下一篇: 60GHZ雷达液位仪 液位传感器