使用JSONRPC创建账户

09/10/2018 16:40 下午 posted in  EOS

创建成功返回的JSON:
创建是用Action进行的,包含三个action,newaccount,buyram,delegatebw,
先对各自的abi进行参数对齐 然后进行abi_json_to_bin请求 最后进行整合请求

{
    "timestamp": "2018-09-10T09:33:29.000",
    "producer": "funnyhamster",
    "confirmed": 0,
    "previous": "00d06974a6485b5e6c80d804313d6c0058870848f103735fb24ae63851a61f66",
    "transaction_mroot": "00eb3fbea28360f5ab26cae9cf50c081baf5579800aa6062f059808ad9b44d7a",
    "action_mroot": "10a2e5ea43847603f2d68bc5b403eea5ec744b70d38ff1d73e859fbe9413e6c6",
    "schedule_version": 217,
    "new_producers": null,
    "header_extensions": [],
    "producer_signature": "SIG_K1_K26xvdaxUhQcE6Cga1fQfDLKxVYKpAG9nNk8isA4Pby8ZH2Jp8y8Z6ki8p3ZHAvuBFTJDrNTAW6va9Xbd1R7E8DoosQdXE",
    "transactions": [
        {
            "status": "executed",
            "cpu_usage_us": 7238,
            "net_usage_words": 43,
            "trx": {
                "id": "929ecaca3aa6aa09a515239ff79e78b4df62bf87809a45a7baf2848696c3f094",
                "signatures": [
                    "SIG_K1_KVJz9woQUmHRCot6prUeeY3H8vjZBSStUhefQhrmzsCDKS8MkqYV2ANgfPeSpdEgmAnqX39WnKraCGiwJYedzKkbu5nBnS"
                ],
                "compression": "none",
                "packed_context_free_data": "",
                "context_free_data": [],
                "packed_trx": "e03a965b2868e3b6720100000000030000000000ea305500409e9a2264b89a0150c810611a17b58b00000000a8ed32326650c810611a17b58b208269a69996b1ca01000000010002aa1bf6ea68794eb7ad364ea9e3438171866a557f1db49f596c67eab2a6a0d7230100000001000000010002aa1bf6ea68794eb7ad364ea9e3438171866a557f1db49f596c67eab2a6a0d723010000000000000000ea3055000000004873bd3e0150c810611a17b58b00000000a8ed32322050c810611a17b58b208269a69996b1caa08601000000000004454f53000000000000000000ea305500003f2a1ba6a24a0150c810611a17b58b00000000a8ed32323150c810611a17b58b208269a69996b1caa08601000000000004454f5300000000a08601000000000004454f53000000000100",
                "transaction": {
                    "expiration": "2018-09-10T09:35:28",
                    "ref_block_num": 26664,
                    "ref_block_prefix": 24295139,
                    "max_net_usage_words": 0,
                    "max_cpu_usage_ms": 0,
                    "delay_sec": 0,
                    "context_free_actions": [],
                    "actions": [
                        {
                            "account": "eosio",
                            "name": "newaccount",
                            "authorization": [
                                {
                                    "actor": "liulian12345",
                                    "permission": "active"
                                }
                            ],
                            "data": {
                                "creator": "liulian12345",
                                "name": "testhahaha12",
                                "owner": {
                                    "threshold": 1,
                                    "keys": [
                                        {
                                            "key": "EOS6BQZmWhPKZLVg4YDcR6KdrYb1dqjDAWxyGPHRTD6mpqJ1dACAp",
                                            "weight": 1
                                        }
                                    ],
                                    "accounts": [],
                                    "waits": []
                                },
                                "active": {
                                    "threshold": 1,
                                    "keys": [
                                        {
                                            "key": "EOS6BQZmWhPKZLVg4YDcR6KdrYb1dqjDAWxyGPHRTD6mpqJ1dACAp",
                                            "weight": 1
                                        }
                                    ],
                                    "accounts": [],
                                    "waits": []
                                }
                            },
                            "hex_data": "50c810611a17b58b208269a69996b1ca01000000010002aa1bf6ea68794eb7ad364ea9e3438171866a557f1db49f596c67eab2a6a0d7230100000001000000010002aa1bf6ea68794eb7ad364ea9e3438171866a557f1db49f596c67eab2a6a0d72301000000"
                        },
                        {
                            "account": "eosio",
                            "name": "buyram",
                            "authorization": [
                                {
                                    "actor": "liulian12345",
                                    "permission": "active"
                                }
                            ],
                            "data": {
                                "payer": "liulian12345",
                                "receiver": "testhahaha12",
                                "quant": "10.0000 EOS"
                            },
                            "hex_data": "50c810611a17b58b208269a69996b1caa08601000000000004454f5300000000"
                        },
                        {
                            "account": "eosio",
                            "name": "delegatebw",
                            "authorization": [
                                {
                                    "actor": "liulian12345",
                                    "permission": "active"
                                }
                            ],
                            "data": {
                                "from": "liulian12345",
                                "receiver": "testhahaha12",
                                "stake_net_quantity": "10.0000 EOS",
                                "stake_cpu_quantity": "10.0000 EOS",
                                "transfer": 1
                            },
                            "hex_data": "50c810611a17b58b208269a69996b1caa08601000000000004454f5300000000a08601000000000004454f530000000001"
                        }
                    ],
                    "transaction_extensions": []
                }
            }
        }
    ],
    "block_extensions": [],
    "id": "00d06975eb6fb6c7c281c3f68819489c27a2f876e3820f8bc37bb09f09f6d4ef",
    "block_num": 13658485,
    "ref_block_prefix": 4140007874
}