如何使用RPC方法部署合同?
1 个回答
- 投票数
-
- 2019-02-14
您可以通过具有种类来源的签名操作来做到这一点: http://tezos.gitlab.io/mainnet/api/p2p.html#origination-tag-9
与KT地址的标准来源相似,不同之处在于存在脚本字段.为此,您需要将Michelson转换为Micheline(此处为Micheline ),然后您需要伪造TX(您可以使用eztz进行此操作,也可以使用伪造/操作RPC端点远程进行此操作).
然后您可以签名并注入伪造的十六进制.
eztz确实具有可以将Michelson转换为Micheline的基本功能,但是它是不完整的(不解析注释或解析宏),因此仅适用于非常基本的智能合约.但是您可以在eztz中执行以下操作:eztz.rpc.originate(keys, 0, "parameter unit;storage unit;code{CDR;NIL operation;PAIR};", "Unit", false, false, false, 5000, 100000, 500).then(console.log);
You can do this via a signed operation of kind origination: http://tezos.gitlab.io/mainnet/api/p2p.html#origination-tag-9
Similar to a standard origination of a KT address, except there's the presence of the script field. To get this, you need to convert your Michelson to Micheline (details of the syntax/format for Micheline here) and then you need to forge your tx (you can do this with eztz, or remotely using the forge/operation RPC endpoint).
You can then sign and inject the forged hex.
eztz does have a basic function that can convert Michelson to Micheline, but it's incomplete (doesn't parse annotations or resolve the macros) so it's only viable for very basic smart contracts. But you could do the following in eztz:
eztz.rpc.originate(keys, 0, "parameter unit;storage unit;code{CDR;NIL operation;PAIR};", "Unit", false, false, false, 5000, 100000, 500).then(console.log);
-
抱歉.我不懂js......我会像你说的那样通过RPC尝试.谢谢.另一个问题:提供一个KT地址.有什么办法让这个地址的拥有者?我没有通过RPC或tzscan API找到任何方法.例如.KT是多号地址.有3个所有者.如何获得这3位拥有者?sorry. I don't know js. ... .. I will try via RPC like u say. thanks. another question: give a KT address. is there any way to get owners of this address? I have't found any method via RPC or tzscan API. for example. KT is multsign address. have 3 owners. how to get this 3 owner?
- 0
- 2019-02-14
- purplecity
-
如果它是一个基于智能合约的多签名钱包,那么所有者密钥将存储在智能合约代码中.If it's a smart-contract based multi-sig wallet, than the owners keys would be stored within the smart contract code.
- 0
- 2019-02-14
- Stephen Andrews
-
您可以通过/chains/main/blocks/head/context/contracts/
/storage访问合同存储 You can access contract storage via /chains/main/blocks/head/context/contracts//storage - 1
- 2019-02-14
- Stephen Andrews
-
谢谢 .我是通过这个得到的.----/chains/main/blocks/head/context/contracts/KT1JZH514bbBzyna3Dqmg6it5WzUEQoK6LPy/storagethanks . I got it BY this. ---- /chains/main/blocks/head/context/contracts/KT1JZH514bbBzyna3Dqmg6it5WzUEQoK6LPy/storage
- 0
- 2019-02-14
- purplecity
起初有什么方法可以使用RPC方法部署合同吗?
如果有的话,可以给我一步一步的例子吗?
为什么我有这么多问题困扰我,因为官方的RPC文档没有详细的示例(仅显示u描述,某些方法没有args ...)并且我不使用CLI界面.我想构造一个事务,但是我不知道如何使用RPC方法来完成此操作,最后我找到了这篇文章,然后明白了这一点----- https://medium.com/@bakenrolls/sending-multiple-transactions-in-批量使用Tezos-rpc-6cab3a21f254