如何提取智能合约的存储?
2 个回答
- 投票数
-
- 2019-06-21
在命令行中
./tezos-client get contract storage for KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ
您也可以只调用RPC
curl http://localhost:8732/chains/main/blocks/head/context/contracts/KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ/storage
In the command line
./tezos-client get contract storage for KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ
You could also just call the RPC
curl http://localhost:8732/chains/main/blocks/head/context/contracts/KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ/storage
-
当然,这是假设您自己运行一个节点.但这就是我想要的.谢谢This is of course assuming you are running a node by yourself. But this is what I was looking for. Thx
- 0
- 2019-06-24
- XTZST2O
-
- 2019-06-21
让我们找到
Arronax合同并查看其代码... storage unit; code { CDR ; NIL operation ; AMOUNT ; PUSH mutez 0 ; { COMPARE ; EQ ; IF {} { SOURCE ; CONTRACT unit ; { IF_NONE { { UNIT ; FAILWITH } } {} } ; AMOUNT ; UNIT ; TRANSFER_TOKENS ; CONS } } ; PAIR }
..您将看到合同中没有有效地存储任何内容,这就是为什么您只获得
Unit
的原因.Let's find the contract on Arronax and look at its code...
storage unit; code { CDR ; NIL operation ; AMOUNT ; PUSH mutez 0 ; { COMPARE ; EQ ; IF {} { SOURCE ; CONTRACT unit ; { IF_NONE { { UNIT ; FAILWITH } } {} } ; AMOUNT ; UNIT ; TRANSFER_TOKENS ; CONS } } ; PAIR }
..you will see that nothing is effectively being stored in the contract, which is why you're just getting
Unit
.
如何提取已部署的智能合约的存储数据?我正在尝试从Tezos基金会中读取"免费Ledger Nano S"合同
KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ
中的存储数据,因为我对它的工作方式感兴趣.合同代码非常简单.例如,TzScan不显示存储数据,它显示的只是Unit
,在这种情况下没有用.旧问题的解决方案如何获取智能合约存储数据?不再起作用.