4

at first is there any way to deploy a contract with RPC methods?

if had, could give me a step by step example?

why I have so much problems confusing me because the official RPC doc have't detail example(just show u description,some methods no args ...) and I don't use CLI interface. such as.. I want to construct a transaction but I don't know how to do this with RPC methods, finally I found this article then I got it-----https://medium.com/@bakenrolls/sending-multiple-transactions-in-one-batch-using-tezos-rpc-6cab3a21f254

1 Answer 1

1

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);
4
  • 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?
    – purplecity
    Feb 14, 2019 at 7:42
  • If it's a smart-contract based multi-sig wallet, than the owners keys would be stored within the smart contract code. Feb 14, 2019 at 7:48
  • 1
    You can access contract storage via /chains/main/blocks/head/context/contracts/<KT1 address>/storage Feb 14, 2019 at 7:53
  • thanks . I got it BY this. ---- /chains/main/blocks/head/context/contracts/KT1JZH514bbBzyna3Dqmg6it5WzUEQoK6LPy/storage
    – purplecity
    Feb 14, 2019 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.