3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EOSのインストール〜コントラクトのdeployまで

Posted at

はじめに

DAppsを作る時の、SmartContractをかくケースの選択肢として、比較的Ethereumを撰択するケースが多かったように思いますが、EOSのドキュメントなどが充実してきて、周囲でも利用している人が増えてきたので、ここらでEOSもDAppsを作る選択肢として考えてみようと思いました。
基本的には本家のドキュメントと同じなので、自分の覚え書きとして残す形になります。

手順

Docker入れる

他に選択肢がないかなと見ていましたが、公式でもDockerを使うのが推奨でしたので、
Dockerを入れることから始めます。すでに入ってる場合はskipします。

1.Home brewでDockerをインストール

terminal
$ brew cask install docker
terminal
==> Verifying SHA-256 checksum for Cask 'docker'.
==> Installing Cask docker
==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future.
Password:
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
🍺  docker was successfully installed!

2.アプリケーションを起動

terminal
open /Applications/Docker.app

3.versionを表示する

terminal
docker --version
Docker version 18.06.1-ce, build e68fc7a

EOSIO入れる

1.EOSIOのDockerイメージをinstallする

terminal
$ docker pull eosio/eos
Using default tag: latest
terminal
latest: Pulling from eosio/eos
6b98dfc16071: Pull complete 
4001a1209541: Pull complete 
6319fc68c576: Pull complete 
b24603670dc3: Pull complete 
97f170c87c6f: Pull complete 
ca8277dae3e4: Pull complete 
49bdd58b12e0: Pull complete 
48004ecaaa94: Pull complete 
7f11e84fd457: Pull complete 
212aadeab614: Pull complete 
3e09a471cd15: Pull complete 
e442b1315596: Pull complete 
Digest: sha256:9c1b72166353036e34b92975e832ab8fdaf488f5e26745071490bd2e0387ce99
Status: Downloaded newer image for eosio/eos:latest

2.起動する

terminal
oo
$ docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/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"

3.プロセスを確認する

terminal
$docker ps

4.アクセスする

terminal
{"server_version":"1e9ca55c","chain_id":"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f","head_block_num":389,"last_irreversible_block_num":388,"last_irreversible_block_id":"00000184c7021d42386ff04bc22faa8de0ef67c8efc2e25051741af34e24d915","head_block_id":"00000185332f84a34668e289e082637e01c7146864cd4b6eccb83a3960e85eb5","head_block_time":"2018-10-10T04:54:58.500","head_block_producer":"eosio","virtual_block_cpu_limit":294627,"virtual_block_net_limit":1545701,"block_cpu_limit":199900,"block_net_limit":1048576,"server_version_string":"v1.3.2"}

5.APIの一覧があるので色々使ってみよう

6.作られたblockを見る

terminal
$ docker logs --tail 10 eosio

7.shellに入る

terminal
$ docker exec -it eosio bash

8.walletを確認する

terminal
/# cleos --wallet-url http://127.0.0.1:5555 wallet list keys
"/opt/eosio/bin/keosd" launched
Wallets:
[]
Error 3120006: No available wallet
Ensure that you have created a wallet and have it open

9.walletを作成する

terminal
cleos wallet create -n eosfirstwallet --to-console

> Unable to connect to keosd, if keosd is running please kill the process and try again.

参考

https://developers.eos.io/eosio-home/docs/writing-a-custom-dispatcher
https://note.mu/daidai12/n/n787e009fe6e4
https://medium.com/coinmonks/eos-development-learning-resources-d6875196
b980
https://infinitexlabs.com/eos-development-tutorial-part-1/
https://hackernoon.com/getting-started-on-eos-mainnet-in-10-minutes-bf61dd9ec787

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?