eos代码阅读笔记04- account账号


开始之前先改两个地方,注释掉 print_request,print_response 让它总是打印请求响应数据。方便看程序做了什么。记得从新编译 sudo ./eosio_build.sh

   //if ( print_request ) {
      string s(request.size(), '\0');
      buffer_copy(boost::asio::buffer(s), request.data());
      std::cerr << "REQUEST:" << std::endl
                << "---------------------" << std::endl
                << s << std::endl
                << "---------------------" << std::endl;
   //}
// if( print_response ) {
      std::cerr << "RESPONSE:" << std::endl
                << "---------------------" << std::endl
                << fc::json::to_pretty_string( response_result ) << std::endl
                << "---------------------" << std::endl;
  // }

创建钱包

$ ./cleos wallet create -n w1

Creating wallet: w1
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.

"PW5JPstGVWrThpcQvv2F9CB5tu9Pc34YJoHAy21coHEpdTUYTkWzv"

给eosio导入key

注意点:创建账号必须有用现有的账号创建新的账号。刚刚安装完,只能用eosio,需要先导入它的key。在配置文件,和源代码多个地方出现。

eos/programs/eosio-launcher/main.cpp

producer_names names(producers);
   int non_bios = prod_nodes - 1;
   int per_node = producers / non_bios;
   int extra = producers % non_bios;
   unsigned int i = 0;
   for (auto &h : bindings) {
      for (auto &inst : h.instances) {
         bool is_bios = inst.name == "bios";
         tn_node_def node;
         node.name = inst.name;
         node.instance = &inst;
         auto kp = is_bios ?
            private_key_type(string("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3")) :
            private_key_type::generate();
         auto pubkey = kp.get_public_key();
         node.keys.emplace_back (move(kp));
         if (is_bios) {
            string prodname = "eosio";
            node.producers.push_back(prodname);
            producer_set.schedule.push_back({prodname,pubkey});
         }

名字是 eosio, 私钥是5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

用eosio创建第一个账号后,就可以用自己创建的账号创建其他账号了。


~/.local/share/eosio/nodeos/config/config.ini 文件里的

signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

导入

$ ./cleos wallet import -n w1 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

创建key

$ ./cleos create key
Private key: 5JZ1Pjyr7SBp2QEoC4voDLSfaB7WdeUw7Bzqc3jcxMQiwSKUt1p
Public key: EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF

导入key到钱包

$ ./cleos wallet import -n w1 5JZ1Pjyr7SBp2QEoC4voDLSfaB7WdeUw7Bzqc3jcxMQiwSKUt1p
imported private key for: EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF

创建账号t1

$ ./cleos create account eosio t1 EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP

REQUEST:
---------------------
POST /v1/chain/get_info HTTP/1.0
Host: localhost
content-length: 0
Accept: */*
Connection: close


---------------------
RESPONSE:
---------------------
{
  "server_version": "79651199",
  "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",链ID
  "head_block_num": 47,
  "last_irreversible_block_num": 46
  "last_irreversible_block_id": "0000002e626849c451c58caeb079bec496734d1a48e5a7e0edc62eaf032db2e5",不可更改的块ID,上一个块ID
  "head_block_id": "0000002f67e0f8260a0a3188d4e7540db332867eb776daafc8100d61b00d3b8b",块ID
  "head_block_time": "2018-06-29T08:02:16.000",块时间
  "head_block_producer": "eosio",挖矿人
  "virtual_block_cpu_limit": 209398,
  "virtual_block_net_limit": 1097937,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576
}
---------------------
REQUEST:
---------------------
POST /v1/wallet/get_public_keys HTTP/1.0
Host: localhost
content-length: 0
Accept: */*
Connection: close


---------------------
RESPONSE:
---------------------
[
  "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
  "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
  "EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF",
  "EOS81YV1WK9nisqyFrbS7nZjh9NYS1K5xjntyMkCW1VopBDrtEMgT"
]
---------------------
REQUEST:
---------------------
POST /v1/chain/get_required_keys HTTP/1.0
Host: localhost
content-length: 781
Accept: */*
Connection: close

{"transaction":{"expiration":"2018-06-29T08:02:46","ref_block_num":46,"ref_block_prefix":2928461137,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP","EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF","EOS81YV1WK9nisqyFrbS7nZjh9NYS1K5xjntyMkCW1VopBDrtEMgT"]}
---------------------
RESPONSE:
---------------------
{
  "required_keys": [
    "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
  ]
}
---------------------
REQUEST:
---------------------
POST /v1/wallet/sign_transaction HTTP/1.0
Host: localhost
content-length: 688
Accept: */*
Connection: close

[{"expiration":"2018-06-29T08:02:46","ref_block_num":46,"ref_block_prefix":2928461137,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"],"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f"]
---------------------
RESPONSE:
---------------------
{
  "expiration": "2018-06-29T08:02:46",
  "ref_block_num": 46,
  "ref_block_prefix": 2928461137,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio",
      "name": "newaccount",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": "0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [
    "SIG_K1_KenQx2BuGv5tYU31Q97oQLgowyw9woDhRdxuUcRYrk34qyoBnEMjUcECL14juchJATCzM5rj14LP5ATViy5mDyZVpyGh8N"
  ],
  "context_free_data": []
}
---------------------
REQUEST:
---------------------
POST /v1/chain/push_transaction HTTP/1.0
Host: localhost
content-length: 491
Accept: */*
Connection: close

{"signatures":["SIG_K1_KenQx2BuGv5tYU31Q97oQLgowyw9woDhRdxuUcRYrk34qyoBnEMjUcECL14juchJATCzM5rj14LP5ATViy5mDyZVpyGh8N"],"compression":"none","packed_context_free_data":"","packed_trx":"a6e7355b2e0051c58cae00000000010000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232660000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000000"}
---------------------
RESPONSE:
---------------------
{
  "transaction_id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",
  "processed": {
    "id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",
    "receipt": {
      "status": "executed",
      "cpu_usage_us": 860,
      "net_usage_words": 25
    },
    "elapsed": 860,
    "net_usage": 200,
    "scheduled": false,
    "action_traces": [{
        "receipt": {
          "receiver": "eosio",
          "act_digest": "7bef9ed2c5a15dfdc4c4e999210ff4ea00ce4227f4503200898965ca25b6fcb8",
          "global_sequence": 48,
          "recv_sequence": 48,
          "auth_sequence": [[
              "eosio",
              48
            ]
          ],
          "code_sequence": 0,
          "abi_sequence": 0
        },
        "act": {
          "account": "eosio",
          "name": "newaccount",
          "authorization": [{
              "actor": "eosio",
              "permission": "active"
            }
          ],
          "data": {
            "creator": "eosio",
            "name": "t1",
            "owner": {
              "threshold": 1,
              "keys": [{
                  "key": "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
                  "weight": 1
                }
              ],
              "accounts": [],
              "waits": []
            },
            "active": {
              "threshold": 1,
              "keys": [{
                  "key": "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
                  "weight": 1
                }
              ],
              "accounts": [],
              "waits": []
            }
          },
          "hex_data": "0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"
        },
        "elapsed": 246,
        "cpu_usage": 0,
        "console": "",
        "total_cpu_usage": 0,
        "trx_id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",
        "inline_traces": []
      }
    ],
    "except": null
  }
}
---------------------
executed transaction: 774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188  200 bytes  860 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"t1","owner":{"threshold":1,"keys":[{"key":"EOS6iqBbXReXaERSW9Ubv19M8JtQFW...
warning: transaction executed locally, but may not be confirmed by the network yet

创建账号的时候执行了这些请求

/v1/chain/get_info

/v1/wallet/get_public_keys

/v1/chain/get_required_keys

/v1/wallet/sign_transaction

/v1/chain/push_transaction

具体跟踪一下代码,在cleos/main.cpp, create account的回调函数

 createAccount->set_callback([this] {
            if( !active_key_str.size() )
               active_key_str = owner_key_str;
            public_key_type owner_key, active_key;
            try {
               owner_key = public_key_type(owner_key_str);
            } EOS_RETHROW_EXCEPTIONS(public_key_type_exception, "Invalid owner public key: ${public_key}", ("public_key", owner_key_str));
            try {
               active_key = public_key_type(active_key_str);
            } EOS_RETHROW_EXCEPTIONS(public_key_type_exception, "Invalid active public key: ${public_key}", ("public_key", active_key_str));
            auto create = create_newaccount(creator, account_name, owner_key, active_key);
            if (!simple) {
               ....
            } else {
               send_actions( { create } );
            }
      });


void send_actions(std::vector<chain::action>&& actions, int32_t extra_kcpu = 1000, packed_transaction::compression_type compression = packed_transaction::none ) {
   auto result = push_actions( move(actions), extra_kcpu, compression);

   if( tx_print_json ) {
      cout << fc::json::to_pretty_string( result ) << endl;
   } else {
      print_result( result );
   }
}

创建签名交易对象


fc::variant push_actions(std::vector<chain::action>&& actions, int32_t extra_kcpu, packed_transaction::compression_type compression = packed_transaction::none ) {
   signed_transaction trx;创建了签名交易
   trx.actions = std::forward<decltype(actions)>(actions);

   return push_transaction(trx, extra_kcpu, compression);
}



fc::variant push_transaction( signed_transaction& trx, int32_t extra_kcpu = 1000, packed_transaction::compression_type compression = packed_transaction::none ) {
   auto info = get_info();获取区块链信息
   trx.expiration = info.head_block_time + tx_expiration;用最后的块时间给当前交易做到期时间

   // Set tapos, default to last irreversible block if it's not specified by the user
   block_id_type ref_block_id = info.last_irreversible_block_id;最后的不可逆的块ID
   try {
      fc::variant ref_block;
      if (!tx_ref_block_num_or_id.empty()) {
         ref_block = call(get_block_func, fc::mutable_variant_object("block_num_or_id", tx_ref_block_num_or_id));
         ref_block_id = ref_block["id"].as<block_id_type>();
      }
   } EOS_RETHROW_EXCEPTIONS(invalid_ref_block_exception, "Invalid reference block num or id: ${block_num_or_id}", ("block_num_or_id", tx_ref_block_num_or_id));
   trx.set_reference_block(ref_block_id);

   if (tx_force_unique) {
      trx.context_free_actions.emplace_back( generate_nonce_action() );
   }

   trx.max_cpu_usage_ms = tx_max_net_usage;
   trx.max_net_usage_words = (tx_max_net_usage + 7)/8;

   if (!tx_skip_sign) {
      auto required_keys = determine_required_keys(trx);判断key
      sign_transaction(trx, required_keys, info.chain_id);
   }

   if (!tx_dont_broadcast) {
      return call(push_txn_func, packed_transaction(trx, compression));
   } else {
      return fc::variant(trx);
   }
}

区块链信息,包含最后一个块的时间head_block_time,块的id等信息

REQUEST:
---------------------
POST /v1/chain/get_info HTTP/1.0
Host: localhost
content-length: 0
Accept: */*
Connection: close


---------------------
RESPONSE:
---------------------
{
  "server_version": "79651199",
  "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",链ID
  "head_block_num": 47,
  "last_irreversible_block_num": 46
  "last_irreversible_block_id": "0000002e626849c451c58caeb079bec496734d1a48e5a7e0edc62eaf032db2e5",不可更改的块ID,上一个块ID
  "head_block_id": "0000002f67e0f8260a0a3188d4e7540db332867eb776daafc8100d61b00d3b8b",块ID
  "head_block_time": "2018-06-29T08:02:16.000",块时间
  "head_block_producer": "eosio",挖矿人
  "virtual_block_cpu_limit": 209398,
  "virtual_block_net_limit": 1097937,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576
}

决定key

fc::variant determine_required_keys(const signed_transaction& trx) {
   // TODO better error checking
   //wdump((trx));
   const auto& public_keys = call(wallet_url, wallet_public_keys);
   auto get_arg = fc::mutable_variant_object
           ("transaction", (transaction)trx)
           ("available_keys", public_keys);
   const auto& required_keys = call(get_required_keys, get_arg);
   return required_keys["required_keys"];
}

wallet_public_key, 返回了打开着的钱包全部公钥

get_required_keys,把所有的公钥,

---------------------
REQUEST:
---------------------
POST /v1/wallet/get_public_keys HTTP/1.0
Host: localhost
content-length: 0
Accept: */*
Connection: close


---------------------
RESPONSE:
---------------------
[
  "EOS5DnBiXzg7WJDcqpVa5RtvBxnF94DadwokVtM1xCy3BSGiJpfJ3",
  "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
  "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
  "EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF",
  "EOS81YV1WK9nisqyFrbS7nZjh9NYS1K5xjntyMkCW1VopBDrtEMgT",
  "EOS82x2vmDFkvkzfHXaEF3SepfV9YRf58Z9pZDRcVeABVGA4LCoc2"
]
---------------------
REQUEST:
---------------------
POST /v1/chain/get_required_keys HTTP/1.0
Host: localhost
content-length: 893
Accept: */*
Connection: close
{
    "transaction": {
        "expiration": "2018-06-29T10:12:18",
        "ref_block_num": 15590,
        "ref_block_prefix": 1895433715,
        "max_net_usage_words": 0,
        "max_cpu_usage_ms": 0,
        "delay_sec": 0,
        "context_free_actions": [],
        "actions": [{
            "account": "eosio",
            "name": "newaccount",
            "authorization": [{
                "actor": "t1",
                "permission": "active"
            }],
            "data": "00000000000040c800000000002072e0010000000100039e4c3a6d769bf70ccde5b54ffbdfd8f664b2ff6e74a8d65b894889e388248ba101000000010000000100039e4c3a6d769bf70ccde5b54ffbdfd8f664b2ff6e74a8d65b894889e388248ba101000000"
        }],
        "transaction_extensions": []
    },
    "available_keys": ["EOS5DnBiXzg7WJDcqpVa5RtvBxnF94DadwokVtM1xCy3BSGiJpfJ3", 
"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", 
"EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP", 
"EOS7bcZoaEmV46VDpHxxsyn4K3QwQZW13Nodp6K7Jpiyn3TjHbhsF", 
"EOS81YV1WK9nisqyFrbS7nZjh9NYS1K5xjntyMkCW1VopBDrtEMgT",
 "EOS82x2vmDFkvkzfHXaEF3SepfV9YRf58Z9pZDRcVeABVGA4LCoc2"]
}
---------------------
RESPONSE:
---------------------
{
  "required_keys": [
    "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP"
  ]
}
---------------------

签名交易 sign_transaction,请求返回的结果里多了signatures 这一部分。如果用已经使用过的公钥创建账号,着一部会出错。

void sign_transaction(signed_transaction& trx, fc::variant& required_keys, const chain_id_type& chain_id) {
   fc::variants sign_args = {fc::variant(trx), required_keys, fc::variant(chain_id)};
   const auto& signed_trx = call(wallet_url, wallet_sign_trx, sign_args);
   trx = signed_trx.as<signed_transaction>();
}

REQUEST:
---------------------
POST /v1/wallet/sign_transaction HTTP/1.0
Host: localhost
content-length: 688
Accept: */*
Connection: close
[{
        "expiration": "2018-06-29T08:02:46",
        "ref_block_num": 46,
        "ref_block_prefix": 2928461137,
        "max_net_usage_words": 0,
        "max_cpu_usage_ms": 0,
        "delay_sec": 0,
        "context_free_actions": [],
        "actions": [{
            "account": "eosio",
            "name": "newaccount",
            "authorization": [{
                "actor": "eosio",
                "permission": "active"
            }],
            "data": "0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"
        }],
        "transaction_extensions": [],
        "signatures": [],
        "context_free_data": []
    },
    ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f"
]
---------------------
RESPONSE:
---------------------
{
  "expiration": "2018-06-29T08:02:46",
  "ref_block_num": 46,
  "ref_block_prefix": 2928461137,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio",
      "name": "newaccount",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": "0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [
    "SIG_K1_KenQx2BuGv5tYU31Q97oQLgowyw9woDhRdxuUcRYrk34qyoBnEMjUcECL14juchJATCzM5rj14LP5ATViy5mDyZVpyGh8N"
  ],
  "context_free_data": []
}
---------------------


压缩交易,然后推送 push_transaction,发送了签名,和压缩后的交易信息。

返回交易执行情况,交易ID,

if (!tx_dont_broadcast) {
      return call(push_txn_func, packed_transaction(trx, compression));
   } else {
      return fc::variant(trx);
   }

REQUEST:
---------------------
POST /v1/chain/push_transaction HTTP/1.0
Host: localhost
content-length: 491
Accept: */*
Connection: close
{
    "signatures": ["SIG_K1_KenQx2BuGv5tYU31Q97oQLgowyw9woDhRdxuUcRYrk34qyoBnEMjUcECL14juchJATCzM5rj14LP5ATViy5mDyZVpyGh8N"],
    "compression": "none",
    "packed_context_free_data": "",
    "packed_trx": "a6e7355b2e0051c58cae00000000010000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232660000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000000"
}
---------------------
RESPONSE:
---------------------
{
  "transaction_id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",交易ID
  "processed": {
    "id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",
    "receipt": {收据
      "status": "executed",  执行状态
      "cpu_usage_us": 860,   cpu使用
      "net_usage_words": 25  带宽使用
    },
    "elapsed": 860,
    "net_usage": 200,
    "scheduled": false,
    "action_traces": [{活动轨迹
        "receipt": {
          "receiver": "eosio",
          "act_digest": "7bef9ed2c5a15dfdc4c4e999210ff4ea00ce4227f4503200898965ca25b6fcb8",
          "global_sequence": 48,全局序列
          "recv_sequence": 48,
          "auth_sequence": [[
              "eosio",
              48
            ]
          ],
          "code_sequence": 0,
          "abi_sequence": 0
        },
        "act": {活动
          "account": "eosio", 活动执行者
          "name": "newaccount",活动名字
          "authorization": [{
              "actor": "eosio",
              "permission": "active"
            }
          ],
          "data": {
            "creator": "eosio",创建者
            "name": "t1",创建的账号名字
            "owner": {拥有者权限
              "threshold": 1,
              "keys": [{
                  "key": "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
                  "weight": 1
                }
              ],
              "accounts": [],
              "waits": []
            },
            "active": {执行者权限
              "threshold": 1,
              "keys": [{
                  "key": "EOS6iqBbXReXaERSW9Ubv19M8JtQFWJ3gsoJaxE4HiLsPsEGJjvqP",
                  "weight": 1
                }
              ],
              "accounts": [],
              "waits": []
            }
          },
          "hex_data": "0000000000ea305500000000000040c801000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a0100000001000000010002f17657f3303512f7b0ea2f2a682aa8b1b693817d98d959800fdcf480881aef0a01000000"
        },
        "elapsed": 246,
        "cpu_usage": 0,
        "console": "",
        "total_cpu_usage": 0,
        "trx_id": "774f5e219d78ecab70231cfe3e3ae056708a808aa8c37a3d9aa2aced69999188",
        "inline_traces": []
      }
    ],
    "except": null
  }
}

猜你喜欢

转载自blog.csdn.net/zfdabc_ok/article/details/80857661