基本环境配置

EOS 版本:1.0.1(2018-06-04更新)
 
节点nodeos http监听端口:127.0.0.1:8888
本地钱包keosd http监听端口:127.0.0.1:8900
 
本文使用tcpdump工具进行抓包,使用wireshark对.cap文件进行分析。   利用cleos配置了两个帐户并进行了eos币的交易,具体使用情况如下。
 
tcpdump命令:
tcpdump tcp -i lo port 8888 and host 127.0.0.1 -w ./nodeos.cap
tcpdump tcp -i lo port 8900 and host 127.0.0.1 -w ./keosd.cap
 

1.创建钱包walleta

root@Ulord-19:~# cleos create key Private key: 5KLv6yJhKYxkJRbzrPZvQ8GH8qqKjtNAFPHYWH3563XJ1J2KToc Public key: EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw
root@Ulord-19:~# cleos create key Private key: 5KW91QVfGCJr7bTkpzFaneaUH6vGpy56hV2x16ic8YEjiZJ3uJW Public key: EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k
 
root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 wallet create -n walleta
Creating wallet: walleta
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5HsLWU5TeUWfwBCkb6MgieQfhmJSQdQxwC7ZREsAq5Lg2J5Xi9y"
 
//与keosd通信
POST /v1/wallet/create HTTP/1.0
Host: 127.0.0.1
content-length: 9
Accept: */*
Connection: close
"walleta"
 
HTTP/1.1 201 Created
Content-Length: 55
Content-type: application/json
Server: WebSocket++/0.7.0
"PW5HsLWU5TeUWfwBCkb6MgieQfhmJSQdQxwC7ZREsAq5Lg2J5Xi9y"
 

2.将密匙导入钱包

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 wallet import -n walleta 5KLv6yJhKYxkJRbzrPZvQ8GH8qqKjtNAFPHYWH3563XJ1J2KToc
imported private key for: EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw
 
root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 wallet import -n walleta 5KW91QVfGCJr7bTkpzFaneaUH6vGpy56hV2x16ic8YEjiZJ3uJW
imported private key for: EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k
 
//与keosd通信
POST /v1/wallet/import_key HTTP/1.0
Host: 127.0.0.1
content-length: 65
Accept: */*
Connection: close
["walleta","5KLv6yJhKYxkJRbzrPZvQ8GH8qqKjtNAFPHYWH3563XJ1J2KToc"]
 
HTTP/1.1 201 Created
Content-Length: 2
Content-type: application/json
Server: WebSocket++/0.7.0
{}
 
POST /v1/wallet/import_key HTTP/1.0
Host: 127.0.0.1
content-length: 65
Accept: */*
Connection: close
["walleta","5KW91QVfGCJr7bTkpzFaneaUH6vGpy56hV2x16ic8YEjiZJ3uJW"]
 
HTTP/1.1 201 Created
Content-Length: 2
Content-type: application/json
Server: WebSocket++/0.7.0
{}
 

3.创建帐户accounta

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 create account eosio accounta EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k
executed transaction: 822d3aaf1569ac14c35d2d4d073c7e21873cdca6730e87463151fe3c3b3ff788 200 bytes 324 us
eosio <= eosio::newaccount {"creator":"eosio","name":"accounta","owner":{"threshold":1,"keys":[{"key":"EOS73x8e6YK6dtYg2ZRK9V5E...
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 689
Accept: */*
Connection: close
[{"expiration":"2018-06-04T09:10:18","ref_block_num":2954,"ref_block_prefix":114916746,"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":"0000000000ea3055000000264f4d1132010000000100031ce04b549db51177736e03400e115722d6025f685f62657490b5292cb2303c87010000000100000001000304ae77a20a776044cef890600457c7b0f8d923453e654af9e9a3a563b025720a01000000"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 665
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T09:10:18","ref_block_num":2954,"ref_block_prefix":114916746,"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":"0000000000ea3055000000264f4d1132010000000100031ce04b549db51177736e03400e115722d6025f685f62657490b5292cb2303c87010000000100000001000304ae77a20a776044cef890600457c7b0f8d923453e654af9e9a3a563b025720a01000000"}],"transaction_extensions":[],"signatures":["SIG_K1_KYQFtyBrg1j9dzpteUqf7iAduPUVcdqoPxTc5RDnSBh9p8vhV5puL6qngBAzi4AidwHTBhwNFWx2ZyWfnmmysHsfKSHfYV"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 533
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":2955,"last_irreversible_block_num":2954,"last_irreversible_block_id":"00000b8a2e8cd44d8a7dd906a556835c7422d9dcb2332fc7f4a8e2bf5efda555","head_block_id":"00000b8bcd50f4b8ff009975289aae4253fafa692c50d6acc16d6bcf9948abfc","head_block_time":"2018-06-04T09:09:48","head_block_producer":"eosio","virtual_block_cpu_limit":3833029,"virtual_block_net_limit":20135069,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 726
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T09:10:18","ref_block_num":2954,"ref_block_prefix":114916746,"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":"0000000000ea3055000000264f4d1132010000000100031ce04b549db51177736e03400e115722d6025f685f62657490b5292cb2303c87010000000100000001000304ae77a20a776044cef890600457c7b0f8d923453e654af9e9a3a563b025720a01000000"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 491
Accept: */*
Connection: close
{"signatures":["SIG_K1_KYQFtyBrg1j9dzpteUqf7iAduPUVcdqoPxTc5RDnSBh9p8vhV5puL6qngBAzi4AidwHTBhwNFWx2ZyWfnmmysHsfKSHfYV"],"compression":"none","packed_context_free_data":"","packed_trx":"fa01155b8a0b8a7dd90600000000010000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232660000000000ea3055000000264f4d1132010000000100031ce04b549db51177736e03400e115722d6025f685f62657490b5292cb2303c87010000000100000001000304ae77a20a776044cef890600457c7b0f8d923453e654af9e9a3a563b025720a0100000000"}
 
HTTP/1.1 202 Accepted
Content-Length: 1337
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"822d3aaf1569ac14c35d2d4d073c7e21873cdca6730e87463151fe3c3b3ff788","processed":{"id":"822d3aaf1569ac14c35d2d4d073c7e21873cdca6730e87463151fe3c3b3ff788","receipt":{"status":"executed","cpu_usage_us":324,"net_usage_words":25},"elapsed":324,"net_usage":200,"scheduled":false,"action_traces":[{"receipt":{"receiver":"eosio","act_digest":"159dba8f326cedddb044080c183041cc12c0b12bb6401778a258e168e6fb54c1","global_sequence":2956,"recv_sequence":2956,"auth_sequence":[["eosio",2956]],"code_sequence":0,"abi_sequence":0},"act":{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":{"creator":"eosio","name":"accounta","owner":{"threshold":1,"keys":[{"key":"EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw","weight":1}],"accounts":[],"waits":[]},"active":{"threshold":1,"keys":[{"key":"EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","weight":1}],"accounts":[],"waits":[]}},"hex_data":"0000000000ea3055000000264f4d1132010000000100031ce04b549db51177736e03400e115722d6025f685f62657490b5292cb2303c87010000000100000001000304ae77a20a776044cef890600457c7b0f8d923453e654af9e9a3a563b025720a01000000"},"elapsed":56,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"822d3aaf1569ac14c35d2d4d073c7e21873cdca6730e87463151fe3c3b3ff788","inline_traces":[]}],"except":null}}
 

4.创建钱包walletb

root@Ulord-19:~# cleos create key
Private key: 5JWRrXbMLFmR4nUU3XrBYL7rsQM2Dq7L2sjpo6s3hHhUye6QKtz Public key: EOS5K6NjGirsrXX35RJ1RJsrP1uCTgHDhTPFsjdiCWkgxS4N7BsC9
root@Ulord-19:~# cleos create key Private key: 5KiG6wsi5mq9pjmsy6cqUBAmzCqWzZJLu4GSiDC8XmC2VAU4CbQ Public key: EOS666Syo2q3rPuwvjC9KiwudETYP4tiw4J2cdfni31A5WaDwt3pb
 
root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 wallet create -n walletb
Creating wallet: walletb
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JznQxztsk7zLX9jhgkZGRjjghqBrZ4EN6vpn7Nzbi4qUB3H5R7"
 
//与keosd交互
POST /v1/wallet/create HTTP/1.0
Host: 127.0.0.1
content-length: 9
Accept: */*
Connection: close
"walletb"
 
HTTP/1.1 201 Created
Content-Length: 55
Content-type: application/json
Server: WebSocket++/0.7.0
"PW5JznQxztsk7zLX9jhgkZGRjjghqBrZ4EN6vpn7Nzbi4qUB3H5R7"
 

5.由帐户accounta创建帐户accountb

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 create account accounta accountb EOS5K6NjGirsrXX35RJ1RJsrP1uCTgHDhTPFsjdiCWkgxS4N7BsC9 EOS666Syo2q3rPuwvjC9KiwudETYP4tiw4J2cdfni31A5WaDwt3pb
executed transaction: 09c591ce271c309302656da25f5630a70029e9f7c799ef3ed61062cbe26fc0f3 200 bytes 307 us
eosio <= eosio::newaccount {"creator":"accounta","name":"accountb","owner":{"threshold":1,"keys":[{"key":"EOS5K6NjGirsrXX35RJ1R...
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 693
Accept: */*
Connection: close
[{"expiration":"2018-06-04T09:25:52","ref_block_num":4822,"ref_block_prefix":4221298011,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d11320100000001000237ddb1b7ca68bbe2b6859cd21c4a095d75b90618686f21f489f3f4973d6258d601000000010000000100029e0bff784dd6c08a2e69def1cf35cf1dc0b998b50f6803ea59089b7e332b40ee01000000"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 669
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T09:25:52","ref_block_num":4822,"ref_block_prefix":4221298011,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d11320100000001000237ddb1b7ca68bbe2b6859cd21c4a095d75b90618686f21f489f3f4973d6258d601000000010000000100029e0bff784dd6c08a2e69def1cf35cf1dc0b998b50f6803ea59089b7e332b40ee01000000"}],"transaction_extensions":[],"signatures":["SIG_K1_KWKJ1TdA58gHvggZMLCWoVnNantcyveMLFpJMdVk5Vj7D3fjMxYL8zHP8ChSGtDoJeA9WpumJkrbfhouZabpWEB4LbQhhb"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 535
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":4823,"last_irreversible_block_num":4822,"last_irreversible_block_id":"000012d6211efc5d5be59bfb00bb2406fa19d2ffb5efb5ef2e8a7bc529a68082","head_block_id":"000012d7115cb860f7b7f2b5b0f03e915b56ad0edc93d75c880493ba95b60647","head_block_time":"2018-06-04T09:25:22","head_block_producer":"eosio","virtual_block_cpu_limit":24840596,"virtual_block_net_limit":130500514,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 730
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T09:25:52","ref_block_num":4822,"ref_block_prefix":4221298011,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d11320100000001000237ddb1b7ca68bbe2b6859cd21c4a095d75b90618686f21f489f3f4973d6258d601000000010000000100029e0bff784dd6c08a2e69def1cf35cf1dc0b998b50f6803ea59089b7e332b40ee01000000"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 491
Accept: */*
Connection: close
{"signatures":["SIG_K1_KWKJ1TdA58gHvggZMLCWoVnNantcyveMLFpJMdVk5Vj7D3fjMxYL8zHP8ChSGtDoJeA9WpumJkrbfhouZabpWEB4LbQhhb"],"compression":"none","packed_context_free_data":"","packed_trx":"a005155bd6125be59bfb00000000010000000000ea305500409e9a2264b89a01000000264f4d113200000000a8ed323266000000264f4d1132000000274f4d11320100000001000237ddb1b7ca68bbe2b6859cd21c4a095d75b90618686f21f489f3f4973d6258d601000000010000000100029e0bff784dd6c08a2e69def1cf35cf1dc0b998b50f6803ea59089b7e332b40ee0100000000"}
 
HTTP/1.1 202 Accepted
Content-Length: 1343
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"09c591ce271c309302656da25f5630a70029e9f7c799ef3ed61062cbe26fc0f3","processed":{"id":"09c591ce271c309302656da25f5630a70029e9f7c799ef3ed61062cbe26fc0f3","receipt":{"status":"executed","cpu_usage_us":307,"net_usage_words":25},"elapsed":307,"net_usage":200,"scheduled":false,"action_traces":[{"receipt":{"receiver":"eosio","act_digest":"a193e5702a4462fe97a592ca51fdb8bfaff0df713f44aec671faa710f301430c","global_sequence":4825,"recv_sequence":4825,"auth_sequence":[["accounta",1]],"code_sequence":0,"abi_sequence":0},"act":{"account":"eosio","name":"newaccount","authorization":[{"actor":"accounta","permission":"active"}],"data":{"creator":"accounta","name":"accountb","owner":{"threshold":1,"keys":[{"key":"EOS5K6NjGirsrXX35RJ1RJsrP1uCTgHDhTPFsjdiCWkgxS4N7BsC9","weight":1}],"accounts":[],"waits":[]},"active":{"threshold":1,"keys":[{"key":"EOS666Syo2q3rPuwvjC9KiwudETYP4tiw4J2cdfni31A5WaDwt3pb","weight":1}],"accounts":[],"waits":[]}},"hex_data":"000000264f4d1132000000274f4d11320100000001000237ddb1b7ca68bbe2b6859cd21c4a095d75b90618686f21f489f3f4973d6258d601000000010000000100029e0bff784dd6c08a2e69def1cf35cf1dc0b998b50f6803ea59089b7e332b40ee01000000"},"elapsed":81,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"09c591ce271c309302656da25f5630a70029e9f7c799ef3ed61062cbe26fc0f3","inline_traces":[]}],"except":null}}
 

6.创建token合约

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 set contract accounta /root/eos/build/contracts/eosio.token -p accounta -x 1000
Reading WAST/WASM from /root/eos/build/contracts/eosio.token/eosio.token.wasm... Using already assembled WASM... Publishing contract... executed transaction: 7a548b74bd66fe3e688aceb02700be413f7167c8bbc0189fc79fb43e57c4b593 8104 bytes 1946 us
eosio <= eosio::setcode {"account":"accounta","vmtype":0,"vmversion":0,"code":"0061736d01000000017e1560037f7e7f0060057f7e7e7...
eosio <= eosio::setabi {"account":"accounta","abi":"0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d65050...
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 39441
Accept: */*
Connection: close
[{"expiration":"2018-06-04T09:50:45","ref_block_num":5868,"ref_block_prefix":3126000885,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"setcode","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d113200009594010061736d01000000017e1560037f7e7f0
/************************************ 此处省略约142行十六进制数据字*****************************************************/
1001c0206f636174656400"},{"account":"eosio","name":"setabi","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132b4030e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d6505087472616e7366657200040466726f6d0c6163636f756e745f6e616d6502746f0c6163636f756e745f6e616d65087175616e74697479056173736574046d656d6f06737472696e67066372656174650002066973737565720c6163636f756e745f6e616d650e6d6178696d756d5f737570706c79056173736574056973737565000302746f0c6163636f756e745f6e616d65087175616e74697479056173736574046d656d6f06737472696e67076163636f756e7400010762616c616e63650561737365740e63757272656e63795f7374617473000306737570706c790561737365740a6d61785f737570706c79056173736574066973737565720c6163636f756e745f6e616d6503000000572d3ccdcd087472616e73666572000000000000a531760569737375650000000000a86cd445066372656174650002000000384f4d113203693634010863757272656e6379010675696e743634076163636f756e740000000000904dc603693634010863757272656e6379010675696e7436340e63757272656e63795f7374617473000000"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 39417
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T09:50:45","ref_block_num":5868,"ref_block_prefix":3126000885,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"setcode","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d113200009594010061736d01000000017e1560037f7e7f0
/************************************ 此处省略约155行十六进制数据字*****************************************************/
6c6f636174656400"},{"account":"eosio","name":"setabi","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132b4030e656f73696f3a3a6162692f312e30010c61636
/************************************ 此处省略10行十六进制数据字*****************************************************/
72656e63795f7374617473000000"}],"transaction_extensions":[],"signatures":["SIG_K1_K722Zw5bmqwEvvQZ4LhwPHoc2w8ksrLpeH6ke2c332Q6cVcT3AfkHfbVpj1vyrQe4KtUxz6sE9QQa5A2YQXSdaYs4NjLPf"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 16297
Accept: */*
Connection: close
{"signatures":["SIG_K1_K722Zw5bmqwEvvQZ4LhwPHoc2w8ksrLpeH6ke2c332Q6cVcT3AfkHfbVpj1vyrQe4KtUxz6sE9QQa5A2YQXSdaYs4NjLPf"],"compression":"zlib","packed_context_free_data":"","packed_trx":"78daed7c7b8c5cd779dfb9e7dcd7cc9dd9bdb46879
/************************************ 此处省略80行十六进制数据字*****************************************************/
e4d77fab417172078e176776d307dba84157fb79efb9707f7da0b39fdfd5f45a2d4b3"}
 
HTTP/1.1 202 Accepted
Content-Length: 79079
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"7a548b74bd66fe3e688aceb02700be413f7167c8bbc0189fc79fb43e57c4b593","processed":{"id":"7a548b74bd66fe3e688aceb02700be413f7167c8bbc0189fc79fb43e57c4b593","receipt":{"status":"executed","cpu_usage_us":1946,"net_usage_words":1013},"elapsed":1946,"net_usage":8104,"scheduled":false,"action_traces":[{"receipt":{"receiver":"eosio","act_digest":"e32fed46a370e3c68b7af6581652a50a98db8775127fdd844b5a243174dc0cd6","global_sequence":5872,"recv_sequence":5872,"auth_sequence":[["accounta",2]],"code_sequence":0,"abi_sequence":0},"act":{"account":"eosio","name":"setcode","authorization":[{"actor":"accounta","permission":"active"}],"data":{"account":"accounta","vmtype":0,"vmversion":0,"code":"0061736d01000000017e1560037f7e7f0060057f7e7e7f7f0060047f
/************************************ 此处省略约320行十六进制数据字*****************************************************/
2063616c6c6564206166746572205f686561702077617320636f6d706c6574656c7920616c6c6f636174656400"},"elapsed":1470,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"7a548b74bd66fe3e688aceb02700be413f7167c8bbc0189fc79fb43e57c4b593","inline_traces":[]},{"receipt":{"receiver":"eosio","act_digest":"2a8600d8293878cb85dd2f534403353fa2dd8d1ed14f3ad0dc870bd81086370b","global_sequence":5873,"recv_sequence":5873,"auth_sequence":[["accounta",3]],"code_sequence":0,"abi_sequence":0},"act":{"account":"eosio","name":"setabi","authorization":[{"actor":"accounta","permission":"active"}],"data":{"account":"accounta","abi":"0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d650508747261
/************************************ 此处省略12行十六进制数据字*****************************************************/
00904dc603693634010863757272656e6379010675696e7436340e63757272656e63795f7374617473000000"},"elapsed":17,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"7a548b74bd66fe3e688aceb02700be413f7167c8bbc0189fc79fb43e57c4b593","inline_traces":[]}],"except":null}}
 

7.发放EOS代币

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 push action accounta create '[ "accounta", "100000000.0000 EOS", 0, 0, 0]' -p accounta -x 3000
executed transaction: 1032aa01d0fbf4bf7103ccef98b2a36176c622795d67133c64b4df2e2a495df6 120 bytes 1206 us
accounta <= accounta::create {"issuer":"accounta","maximum_supply":"100000000.0000 EOS"}
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与nodeos交互
POST /v1/chain/abi_json_to_bin HTTP/1.0
Host: 127.0.0.1
content-length: 84
Accept: */*
Connection: close
{"code":"accounta","action":"create","args":["accounta","100000000.0000 EOS",0,0,0]}
 
HTTP/1.1 200 OK
Content-Length: 62
Content-type: application/json
Server: WebSocket++/0.7.0
{"binargs":"000000264f4d11320010a5d4e800000004454f5300000000"}
 
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 536
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":6551,"last_irreversible_block_num":6550,"last_irreversible_block_id":"00001996772415a5566c641783aa912deb0e55d364c1030745eae0651052a5a8","head_block_id":"0000199773f171426476a2aeae0862fee0161c2805a278a53f6d73b0c7107074","head_block_time":"2018-06-04T09:39:46","head_block_producer":"eosio","virtual_block_cpu_limit":139955910,"virtual_block_net_limit":735270574,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 572
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T10:29:46","ref_block_num":6550,"ref_block_prefix":392457302,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"create","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d11320010a5d4e800000004454f5300000000"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 335
Accept: */*
Connection: close
{"signatures":["SIG_K1_KUtHyRswsbqenjBMqt8ib4iR6bteqhJ5icXmJA6RNAJgUTYF2tfYfMtwBvxo7cBCKGmE1eF57wFqo2ZYXaNGTuG8yQsMVe"],"compression":"none","packed_context_free_data":"","packed_trx":"9a14155b9619566c64170000000001000000264f4d113200000000a86cd44501000000264f4d113200000000a8ed323218000000264f4d11320010a5d4e800000004454f530000000000"}
 
HTTP/1.1 202 Accepted
Content-Length: 942
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"1032aa01d0fbf4bf7103ccef98b2a36176c622795d67133c64b4df2e2a495df6","processed":{"id":"1032aa01d0fbf4bf7103ccef98b2a36176c622795d67133c64b4df2e2a495df6","receipt":{"status":"executed","cpu_usage_us":1206,"net_usage_words":15},"elapsed":8149,"net_usage":120,"scheduled":false,"action_traces":[{"receipt":{"receiver":"accounta","act_digest":"e73cf0b5b8634fe0bd767428d44bbd2b33843a9f72eb460761e172ea51adcf73","global_sequence":6556,"recv_sequence":1,"auth_sequence":[["accounta",4]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"create","authorization":[{"actor":"accounta","permission":"active"}],"data":{"issuer":"accounta","maximum_supply":"100000000.0000 EOS"},"hex_data":"000000264f4d11320010a5d4e800000004454f5300000000"},"elapsed":7875,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"1032aa01d0fbf4bf7103ccef98b2a36176c622795d67133c64b4df2e2a495df6","inline_traces":[]}],"except":null}}
 

8.给帐户accounta转帐10000EOS

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 push action accounta issue '["accounta","10000.0000 EOS", "memo"]' -p accounta
executed transaction: 750da44edfc8b2f79caba31e1d497bcc8725fd470942926cd56e4562510c0a07 128 bytes 880 us
accounta <= accounta::issue {"to":"accounta","quantity":"10000.0000 EOS","memo":"memo"}
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 545
Accept: */*
Connection: close
[{"expiration":"2018-06-04T09:53:59","ref_block_num":8195,"ref_block_prefix":2458824205,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d113200e1f5050000000004454f5300000000046d656d6f"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 521
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T09:53:59","ref_block_num":8195,"ref_block_prefix":2458824205,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d113200e1f5050000000004454f5300000000046d656d6f"}],"transaction_extensions":[],"signatures":["SIG_K1_Jys42Cxhy8BNEGQk4L5g6dSt47MQgTxTZRzygUwvszSnPFwAJXB71HjcYayLH4phFXcistRnv6bS731rDp9hvFPDJEbyGL"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/abi_json_to_bin HTTP/1.0
Host: 127.0.0.1
content-length: 80
Accept: */*
Connection: close
{"code":"accounta","action":"issue","args":["accounta","10000.0000 EOS","memo"]}
 
HTTP/1.1 200 OK
Content-Length: 72
Content-type: application/json
Server: WebSocket++/0.7.0
{"binargs":"000000264f4d113200e1f5050000000004454f5300000000046d656d6f"}
 
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 537
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":8196,"last_irreversible_block_num":8195,"last_irreversible_block_id":"00002003b760b43f0dae8e9215428801b259e949ecf206acff5b9e96da64813e","head_block_id":"00002004ba394bc4864762a01d6fa9f14637d7221e8a53cffbf46432f404aa93","head_block_time":"2018-06-04T09:53:29","head_block_producer":"eosio","virtual_block_cpu_limit":200000000,"virtual_block_net_limit":1048576000,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 582
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T09:53:59","ref_block_num":8195,"ref_block_prefix":2458824205,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d113200e1f5050000000004454f5300000000046d656d6f"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 345
Accept: */*
Connection: close
{"signatures":["SIG_K1_Jys42Cxhy8BNEGQk4L5g6dSt47MQgTxTZRzygUwvszSnPFwAJXB71HjcYayLH4phFXcistRnv6bS731rDp9hvFPDJEbyGL"],"compression":"none","packed_context_free_data":"","packed_trx":"370c155b03200dae8e920000000001000000264f4d11320000000000a5317601000000264f4d113200000000a8ed32321d000000264f4d113200e1f5050000000004454f5300000000046d656d6f00"}
 
HTTP/1.1 202 Accepted
Content-Length: 948
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"750da44edfc8b2f79caba31e1d497bcc8725fd470942926cd56e4562510c0a07","processed":{"id":"750da44edfc8b2f79caba31e1d497bcc8725fd470942926cd56e4562510c0a07","receipt":{"status":"executed","cpu_usage_us":880,"net_usage_words":16},"elapsed":880,"net_usage":128,"scheduled":false,"action_traces":[{"receipt":{"receiver":"accounta","act_digest":"7f371c8d81b984e4be82398016751141e694a3038409f30af12187261b6ba79b","global_sequence":8203,"recv_sequence":2,"auth_sequence":[["accounta",5]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":{"to":"accounta","quantity":"10000.0000 EOS","memo":"memo"},"hex_data":"000000264f4d113200e1f5050000000004454f5300000000046d656d6f"},"elapsed":673,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"750da44edfc8b2f79caba31e1d497bcc8725fd470942926cd56e4562510c0a07","inline_traces":[]}],"except":null}}
 

9.查询帐户accounta的余额

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 get currency balance accounta accounta EOS
10000.0000 EOS
 
//与nodeos交互
POST /v1/chain/get_currency_balance HTTP/1.0
Host: 127.0.0.1
content-length: 55
Accept: */*
Connection: close
{"account":"accounta","code":"accounta","symbol":"EOS"}
 
HTTP/1.1 200 OK
Content-Length: 18
Content-type: application/json
Server: WebSocket++/0.7.0
["10000.0000 EOS"]
 

10.给帐户accountb发放8000EOS

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 push action accounta issue '["accountb","8000.0000 EOS", "memo"]' -p accounta
executed transaction: bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33 128 bytes 1761 us
accounta <= accounta::issue {"to":"accountb","quantity":"8000.0000 EOS","memo":"memo"}
accounta <= accounta::transfer {"from":"accounta","to":"accountb","quantity":"8000.0000 EOS","memo":"memo"}
accountb <= accounta::transfer {"from":"accounta","to":"accountb","quantity":"8000.0000 EOS","memo":"memo"}
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 545
Accept: */*
Connection: close
[{"expiration":"2018-06-04T11:21:30","ref_block_num":18697,"ref_block_prefix":584090902,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000274f4d113200b4c4040000000004454f5300000000046d656d6f"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 521
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T11:21:30","ref_block_num":18697,"ref_block_prefix":584090902,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000274f4d113200b4c4040000000004454f5300000000046d656d6f"}],"transaction_extensions":[],"signatures":["SIG_K1_JwGbve4bmE8mX2M5aoH5HZviCRhPqpRaZvi4G18qwySP6C8P72jqvKm2KfcC7sYGdabeGMqCZigV3UovBVWFM5LdKzxmS1"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/abi_json_to_bin HTTP/1.0
Host: 127.0.0.1
content-length: 79
Accept: */*
Connection: close
{"code":"accounta","action":"issue","args":["accountb","8000.0000 EOS","memo"]}
 
HTTP/1.1 200 OK
Content-Length: 72
Content-type: application/json
Server: WebSocket++/0.7.0
{"binargs":"000000274f4d113200b4c4040000000004454f5300000000046d656d6f"}
 
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 539
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":18698,"last_irreversible_block_num":18697,"last_irreversible_block_id":"000049098a86a4ce1685d02251fff7f0e66d7dcfe7a534ba6270229d8919a539","head_block_id":"0000490a5bdfc7f2343e404c8d9183733849b1f84e1d51a8e4cdc38f149e102b","head_block_time":"2018-06-04T11:21:00","head_block_producer":"eosio","virtual_block_cpu_limit":200000000,"virtual_block_net_limit":1048576000,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 582
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T11:21:30","ref_block_num":18697,"ref_block_prefix":584090902,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000274f4d113200b4c4040000000004454f5300000000046d656d6f"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 345
Accept: */*
Connection: close
{"signatures":["SIG_K1_JwGbve4bmE8mX2M5aoH5HZviCRhPqpRaZvi4G18qwySP6C8P72jqvKm2KfcC7sYGdabeGMqCZigV3UovBVWFM5LdKzxmS1"],"compression":"none","packed_context_free_data":"","packed_trx":"ba20155b09491685d0220000000001000000264f4d11320000000000a5317601000000264f4d113200000000a8ed32321d000000274f4d113200b4c4040000000004454f5300000000046d656d6f00"}
 
HTTP/1.1 202 Accepted
Content-Length: 2270
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33","processed":{"id":"bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33","receipt":{"status":"executed","cpu_usage_us":1761,"net_usage_words":16},"elapsed":1761,"net_usage":128,"scheduled":false,"action_traces":[{"receipt":{"receiver":"accounta","act_digest":"a2d445b268ca4555224a93117696fddf515c59159ea7c916c42f3b0713127837","global_sequence":18705,"recv_sequence":3,"auth_sequence":[["accounta",6]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"issue","authorization":[{"actor":"accounta","permission":"active"}],"data":{"to":"accountb","quantity":"8000.0000 EOS","memo":"memo"},"hex_data":"000000274f4d113200b4c4040000000004454f5300000000046d656d6f"},"elapsed":927,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33","inline_traces":[{"receipt":{"receiver":"accounta","act_digest":"2d9ad9850dfbd8cbd1c99abdca5e959bc9823c113f2b1227b66d74dc1468e601","global_sequence":18706,"recv_sequence":4,"auth_sequence":[["accounta",7]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":{"from":"accounta","to":"accountb","quantity":"8000.0000 EOS","memo":"memo"},"hex_data":"000000264f4d1132000000274f4d113200b4c4040000000004454f5300000000046d656d6f"},"elapsed":505,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33","inline_traces":[{"receipt":{"receiver":"accountb","act_digest":"2d9ad9850dfbd8cbd1c99abdca5e959bc9823c113f2b1227b66d74dc1468e601","global_sequence":18707,"recv_sequence":1,"auth_sequence":[["accounta",8]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":{"from":"accounta","to":"accountb","quantity":"8000.0000 EOS","memo":"memo"},"hex_data":"000000264f4d1132000000274f4d113200b4c4040000000004454f5300000000046d656d6f"},"elapsed":7,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"bb55326f9d8e203ef52e65c947eca9d14680c7a781bface023b84a72685e2c33","inline_traces":[]}]}]}],"except":null}}
 

11,分别查看两个帐户的余额

root@Ulord-19:~# cleos --wallet-u rl http://127.0.0.1:8900 -u http://127.0.0.1:8888 get currency balance accounta accounta EOS
10000.0000 EOS
root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 get currency balance accounta accountb EOS
8000.0000 EOS
 

12.帐户accounta与accountb交易

root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 push action accounta transfer '["accounta", "accountb", "6000.0000 EOS", "m"]' -p accounta executed transaction: c6349ac1a692bb7afc7ef25364f4fcef8f430c8fed923c4315a7c8eb6063b9bb 128 bytes 1603 us
accounta <= accounta::transfer {"from":"accounta","to":"accountb","quantity":"6000.0000 EOS","memo":"m"}
accountb <= accounta::transfer {"from":"accounta","to":"accountb","quantity":"6000.0000 EOS","memo":"m"}
warning: transaction executed locally, but may not be confirmed by the network yet
 
//与keosd交互
POST /v1/wallet/get_public_keys HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 169
Content-type: application/json
Server: WebSocket++/0.7.0
["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]
 
POST /v1/wallet/sign_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 559
Accept: */*
Connection: close
[{"expiration":"2018-06-04T11:32:21","ref_block_num":20000,"ref_block_prefix":3988279612,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"}],"transaction_extensions":[],"signatures":[],"context_free_data":[]},["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"],"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"]
 
HTTP/1.1 201 Created
Content-Length: 535
Content-type: application/json
Server: WebSocket++/0.7.0
{"expiration":"2018-06-04T11:32:21","ref_block_num":20000,"ref_block_prefix":3988279612,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"}],"transaction_extensions":[],"signatures":["SIG_K1_K1BVbTAuyLTAGMZCEgDBaRWmgpsnrrLuZy9pyi8WMm1CWbz1nzxgMVNLCANPnABEfEqksKHZx3DqczRmETwdY8djEsG1Je"],"context_free_data":[]}
 
//与nodeos交互
POST /v1/chain/abi_json_to_bin HTTP/1.0
Host: 127.0.0.1
content-length: 90
Accept: */*
Connection: close
{"code":"accounta","action":"transfer","args":["accounta","accountb","6000.0000 EOS","m"]}
 
HTTP/1.1 200 OK
Content-Length: 82
Content-type: application/json
Server: WebSocket++/0.7.0
{"binargs":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"}
 
POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1
content-length: 0
Accept: */*
Connection: close
 
HTTP/1.1 200 OK
Content-Length: 539
Content-type: application/json
Server: WebSocket++/0.7.0
{"server_version":"74d12f35","chain_id":"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477","head_block_num":20001,"last_irreversible_block_num":20000,"last_irreversible_block_id":"00004e20991e73cd3c51b8ed0f399df819c4d7f1f7073c4a6e322ca561ae8ad1","head_block_id":"00004e217e8751cb7544039f9b85b8c6c2cc337ab2ef1b8f7acf322ec167138e","head_block_time":"2018-06-04T11:31:51","head_block_producer":"eosio","virtual_block_cpu_limit":200000000,"virtual_block_net_limit":1048576000,"block_cpu_limit":199900,"block_net_limit":1048576}
 
POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1
content-length: 596
Accept: */*
Connection: close
{"transaction":{"expiration":"2018-06-04T11:32:21","ref_block_num":20000,"ref_block_prefix":3988279612,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"}],"transaction_extensions":[]},"available_keys":["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k","EOS73x8e6YK6dtYg2ZRK9V5E5QuaiHv5t69dgmCoXQo3AuzTyh8iw"]}
 
HTTP/1.1 200 OK
Content-Length: 75
Content-type: application/json
Server: WebSocket++/0.7.0
{"required_keys":["EOS6sJ7WSbV6WWhARkjtC6hoFzfP8w5b5nPNHUKVnyzEbxzi8sh6k"]}
 
POST /v1/chain/push_transaction HTTP/1.0
Host: 127.0.0.1
content-length: 355
Accept: */*
Connection: close
{"signatures":["SIG_K1_K1BVbTAuyLTAGMZCEgDBaRWmgpsnrrLuZy9pyi8WMm1CWbz1nzxgMVNLCANPnABEfEqksKHZx3DqczRmETwdY8djEsG1Je"],"compression":"none","packed_context_free_data":"","packed_trx":"4523155b204e3c51b8ed0000000001000000264f4d1132000000572d3ccdcd01000000264f4d113200000000a8ed323222000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d00"}
 
HTTP/1.1 202 Accepted
Content-Length: 1630
Content-type: application/json
Server: WebSocket++/0.7.0
{"transaction_id":"c6349ac1a692bb7afc7ef25364f4fcef8f430c8fed923c4315a7c8eb6063b9bb","processed":{"id":"c6349ac1a692bb7afc7ef25364f4fcef8f430c8fed923c4315a7c8eb6063b9bb","receipt":{"status":"executed","cpu_usage_us":1603,"net_usage_words":16},"elapsed":1603,"net_usage":128,"scheduled":false,"action_traces":[{"receipt":{"receiver":"accounta","act_digest":"fefee92181a51662b42c0790b6cea39362e25b8848a9fefab6a0e721f5077171","global_sequence":20011,"recv_sequence":5,"auth_sequence":[["accounta",9]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":{"from":"accounta","to":"accountb","quantity":"6000.0000 EOS","memo":"m"},"hex_data":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"},"elapsed":1378,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"c6349ac1a692bb7afc7ef25364f4fcef8f430c8fed923c4315a7c8eb6063b9bb","inline_traces":[{"receipt":{"receiver":"accountb","act_digest":"fefee92181a51662b42c0790b6cea39362e25b8848a9fefab6a0e721f5077171","global_sequence":20012,"recv_sequence":2,"auth_sequence":[["accounta",10]],"code_sequence":1,"abi_sequence":1},"act":{"account":"accounta","name":"transfer","authorization":[{"actor":"accounta","permission":"active"}],"data":{"from":"accounta","to":"accountb","quantity":"6000.0000 EOS","memo":"m"},"hex_data":"000000264f4d1132000000274f4d1132008793030000000004454f5300000000016d"},"elapsed":6,"cpu_usage":0,"console":"","total_cpu_usage":0,"trx_id":"c6349ac1a692bb7afc7ef25364f4fcef8f430c8fed923c4315a7c8eb6063b9bb","inline_traces":[]}]}],"except":null}}
 

13.查看两个帐户的余额

root@Ulord-19:~# cleos wallet-url http:/cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 get currency balance accounta accounta EOS
4000.0000 EOS
root@Ulord-19:~# cleos --wallet-url http://127.0.0.1:8900 -u http://127.0.0.1:8888 get currency balance accounta accountb EOS
14000.0000 EOS

使用tcpdump抓取EOS帐户创建与交易数据的更多相关文章

  1. tcpdump抓取HTTP包

    tcpdump抓取HTTP包 tcpdump -XvvennSs 0 -i eth0 tcp[20:2]=0x4745 or tcp[20:2]=0x4854 0x4745为"GET&quo ...

  2. 用wireshark查看 tcpdump 抓取的mysql交互数据

    用tcpdump  抓取 mysql客户端与服务器端的交互 1开启tcpdump tcpdump -i eth0 -s 3000 port 3306 -w ~/sql.pcap 先故意输入一个错误的密 ...

  3. 使用Fiddler抓取微信饿了么小程序数据

    使用Fiddler抓取微信饿了么小程序数据 准备 一部装载Android 7.0以下的手机:此处使用华为荣耀5x 微信小程序7.0以下版本:此处为6.6.7.此处可通过豌豆荚应用下载. 安装好的Fid ...

  4. 如何使用TcpDump抓取远程主机的流量并回显到本地的WireShark上

    ssh -t username@remoteip "echo rootpassword | sudo -S tcpdump -i eth0 -A '(tcp[((tcp[12:1] & ...

  5. tcpdump抓取HTTP包【转载】

    tcpdump -XvvennSs 0 -i eth0 tcp[20:2]=0x4745 or tcp[20:2]=0x4854 0x4745 为"GET"前两个字母"G ...

  6. linux tcpdump抓取HTTP包的详细解释

    tcpdump tcpdump是linux系统自带的抓包工具,主要通过命令行的方式,比较适合在线上服务器进行抓包操作,如果是windows或者ubuntu完全可 以选择一些图形化的工具,ubuntu比 ...

  7. EOS帐户交易的构建命令

    EOS版本:4.0   系统:Ubuntu 16.04 LTS   1.创建两对密匙   cleos create key   Private key:5JeTwSwKfpVRHGLqysakTXfk ...

  8. tcpdump抓取mysql语句

    抓包工具tcpdump的使用,抓取具体的sql语句 [root@test7_chat_api_im ~]# tcpdump -s -l - |strings tcpdump: listening on ...

  9. EOS 帐户权限操作--你找不到的干货 (原创) 续集-EOS 3.0

    https://eosfans.io/topics/372 关于2.0权限问题请移步https://eosfans.io/topics/28 目录 查看权限 改变权限 增加权限 删除权限 查看权限 有 ...

随机推荐

  1. mysql父子查询

    https://segmentfault.com/a/1190000007531328

  2. [LeetCode] 698. Partition to K Equal Sum Subsets

    Problem Given an array of integers nums and a positive integer k, find whether it's possible to divi ...

  3. event loop笔记

    注意四个对象: 主进程 执行栈 异步进程 任务队列 1.主进程读取js代码,形成对应的堆和执行栈(此时在同步环境) 2.当遇见异步任务,转交给异步进程进行处理 3.异步任务完成,将其推入任务队列 4. ...

  4. 初学OpenMP

    这两天在看多核计算的书,就要用到openmp,因为我使用vs2015,从微软可以看到是支持openmp2.0版本的 具体使用: 在vs里创造一个控制台项目,然后打开属性管理器,在属性管理器里找到配置属 ...

  5. Memcached HA架构探索

    https://code.google.com/p/memagent/ 标签:memcached magent 高可用 HA 架构原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者 ...

  6. spring框架IOC原理分析代码

    模拟ClasspathXmlApplication: package junit.test; import java.beans.Introspector; import java.beans.Pro ...

  7. (转)C语言之原码、反码和补码

    原码.反码和补码 1).数据在内存中存储的时候都是以二进制的形式存储的. int num = 10; 原码.反码.补码都是二进制.只不过是二进制的不同的表现形式. 数据是以补码的二进制存储的. 2). ...

  8. 【LeetCode】064. Minimum Path Sum

    题目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right w ...

  9. 如何让Surface RT支持网站的flash

    Go to the desktop version of IE10, hit the click ALT button on your keyboard, click on and then Comp ...

  10. Java中的IO流(1)

    字节流: //一个字节一个字节的读写 FileInputStream in=new FileInputStream("源文件"); FileOutputStream out=new ...