Skip to content

Instantly share code, notes, and snippets.

@blueplanet
Last active September 15, 2018 22:12
Show Gist options
  • Save blueplanet/7d1c610f2c82dec2430e305593daa312 to your computer and use it in GitHub Desktop.
Save blueplanet/7d1c610f2c82dec2430e305593daa312 to your computer and use it in GitHub Desktop.
EOS の Docker Quickstart に加えて、Account を作成するまでやってみた ref: https://qiita.com/blueplanet/items/62669b69377a031f5271
"Id": "sha256:8926b83923b11e8ea6e6be1c8f96f941fcd7731238273b2bed692b407e37fd3c",
"RepoTags": [
"eosio/eos-dev:latest"
],
"RepoDigests": [
"eosio/eos-dev@sha256:150cab925ca326293a82518bcd7d1a3cbbd5720f7e12f4545c6a616819083ab2"
],
"Parent": "",
"Comment": "",
"Created": "2018-09-12T00:24:34.401119021Z",
"Container": "b631fb0509d24f1f2a4e799681774aa12760718a9075f82d6b10ff24e62222ee",
$ docker pull eosio/eos-dev
$ cleos create key --to-console
Private key: 5J43P9JQkNxa58uCXhtxQRQo6iFZW4jHxLRi7LfjrxEL9qNpTAt
Public key: EOS64PRrt3iQb3AbyTEBUmQxChub2eyoSKs1UQVJcvokKkTyySwpW
$
$ cleos wallet import --private-key 5J43P9JQkNxa58uCXhtxQRQo6iFZW4jHxLRi7LfjrxEL9qNpTAt
imported private key for: EOS64PRrt3iQb3AbyTEBUmQxChub2eyoSKs1UQVJcvokKkTyySwpW
$
# https://github.com/EOSIO/eos/issues/4154#issuecomment-397820824
# docker の場合、 `eosio` アカウントのキーペアは下記になっている
# eosio public key: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
# eosio private key: 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
$ cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
$
# `cleos create account eosio` の部分は固定値
# `newaccount` は新しいアカウント名
# 最後のパラメータは、上のステップで作成したキーペアの中のパブリックキー
$ cleos create account eosio newaccount EOS64PRrt3iQb3AbyTEBUmQxChub2eyoSKs1UQVJcvokKkTyySwpW
executed transaction: a369f27db7737df0491d4df6f39ceb11b2ff8d681d3eece0014cadc361990de2 200 bytes 381 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"newaccount","owner":{"threshold":1,"keys":[{"key":"EOS64PRrt3iQb3AbyTEBUm...
warning: transaction executed locally, but may not be confirmed by the network yet ]
$
# `cleos create account eosio` の部分は固定値
# `newaccount` は新しいアカウント名
# 最後のパラメータは、上のステップで作成したキーペアの中のパブリックキー
cleos create account eosio newaccount EOS64PRrt3iQb3AbyTEBUmQxChub2eyoSKs1UQVJcvokKkTyySwpW
executed transaction: a369f27db7737df0491d4df6f39ceb11b2ff8d681d3eece0014cadc361990de2 200 bytes 381 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"newaccount","owner":{"threshold":1,"keys":[{"key":"EOS64PRrt3iQb3AbyTEBUm...
warning: transaction executed locally, but may not be confirmed by the network yet ]
$
$ docker network create eosdev
$ docker run --name nodeos -d -p 8888:8888 --network eosdev \
-v /tmp/eosio/work:/work -v /tmp/eosio/data:/mnt/dev/data \
-v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev \
/bin/bash -c "nodeos -e -p eosio --plugin eosio::producer_plugin \
--plugin eosio::history_plugin --plugin eosio::chain_api_plugin \
--plugin eosio::history_api_plugin \
--plugin eosio::http_plugin -d /mnt/dev/data \
--config-dir /mnt/dev/config \
--http-server-address=0.0.0.0:8888 \
--access-control-allow-origin=* --contracts-console --http-validate-host=false"
$ docker run -d --name keosd --network=eosdev \
-i eosio/eos-dev /bin/bash -c "keosd --http-server-address=0.0.0.0:9876"
$ docker logs --tail 10 nodeos
# 上記コマンドを実行して、下記のようにブロックが作成されているログができていればOK
2018-09-15T07:34:08.008 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e303284a82... #6627 @ 2018-09-15T07:34:08.000 signed by eosio [trxs: 0, lib: 6626, confirmed: 0]
2018-09-15T07:34:08.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e4200a713d... #6628 @ 2018-09-15T07:34:08.500 signed by eosio [trxs: 0, lib: 6627, confirmed: 0]
2018-09-15T07:34:09.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e5ac15b894... #6629 @ 2018-09-15T07:34:09.000 signed by eosio [trxs: 0, lib: 6628, confirmed: 0]
2018-09-15T07:34:09.504 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e6e0f7f8a8... #6630 @ 2018-09-15T07:34:09.500 signed by eosio [trxs: 0, lib: 6629, confirmed: 0]
2018-09-15T07:34:10.006 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e7d0021ecf... #6631 @ 2018-09-15T07:34:10.000 signed by eosio [trxs: 0, lib: 6630, confirmed: 0]
2018-09-15T07:34:10.504 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e875aeae34... #6632 @ 2018-09-15T07:34:10.500 signed by eosio [trxs: 0, lib: 6631, confirmed: 0]
2018-09-15T07:34:11.003 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019e9e128983f... #6633 @ 2018-09-15T07:34:11.000 signed by eosio [trxs: 0, lib: 6632, confirmed: 0]
2018-09-15T07:34:11.503 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019ea4f2468a0... #6634 @ 2018-09-15T07:34:11.500 signed by eosio [trxs: 0, lib: 6633, confirmed: 0]
2018-09-15T07:34:12.004 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019eb2df923cd... #6635 @ 2018-09-15T07:34:12.000 signed by eosio [trxs: 0, lib: 6634, confirmed: 0]
2018-09-15T07:34:12.501 thread-0 producer_plugin.cpp:1302 produce_block ] Produced block 000019ece62046d4... #6636 @ 2018-09-15T07:34:12.500 signed by eosio [trxs: 0, lib: 6635, confirmed: 0]
$ docker exec -it keosd bash
root@1883574ee3c4:/# cleos --wallet-url http://127.0.0.1:9876 wallet list keys
$ curl http://localhost:8888/v1/chain/get_info
{"server_version":"08819aae","chain_id":"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f","head_block_num":8161,"last_irreversible_block_num":8160,"last_irreversible_block_id":"00001fe0eb0e27e6f6417493e7411ef66afc4b901601c77b2169ecec7a6fffe0","head_block_id":"00001fe1d97b445fdcdfdbb9fbb5b4c3f483a92e2fd19181ecbdd460e8eae535","head_block_time":"2018-09-15T07:47:35.500","head_block_producer":"eosio","virtual_block_cpu_limit":200000000,"virtual_block_net_limit":1048576000,"block_cpu_limit":199900,"block_net_limit":1048576,"server_version_string":"v1.2.5"}
$ docker network inspect eosdev
[
{
"Name": "eosdev",
"Id": "f65504e7e905aaacf8133788b71caf92caac0f0f2b7562d62b492a98d92fb384",
"Created": "2018-09-07T07:06:37.687702865Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"1883574ee3c437dbd50bb95a00ce4e98d37abc352655165d172c3dce9a1133fe": {
"Name": "keosd",
"EndpointID": "63506bca063dcc0fa21bb2b65c4a46ea84ecf29e88dd7eb9338bfb83210603dd",
"MacAddress": "02:42:ac:13:00:03",
"IPv4Address": "172.19.0.3/16",
"IPv6Address": ""
},
"f0050f87cabd114dcaa4036a9a7f3cd508f185bf75ce2d6e81491d7bc3decf20": {
"Name": "nodeos",
"EndpointID": "adc77b77c339625538559bb3fc3ebef4480edf5f464cf0f9be6111fc595a9b1c",
"MacAddress": "02:42:ac:13:00:02",
"IPv4Address": "172.19.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
$
$ alias cleos='docker exec -it nodeos /opt/eosio/bin/cleos --url http://127.0.0.1:8888 --wallet-url http://172.19.0.3:9876'
# cleos wallet list を実行して、設定を確認する
$ cleos wallet list
Wallets:
[]
$
$ cleos wallet create --to-console
# 出力されたパスワードは必ずメモしておく
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KWT9p86GuWMzwpCV4UDuB7Y9Agi5w14BtfcN3in72N93DQ8cSw"
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment