Ethereumとは
・2015-7-30リリース
・Ethereum(パブリック型ブロックチェーン)
・マイクロソフトが開発環境を提供しているらしい
・スマートコントラクト・分散型アプリケーション(DApps)の構築プラットフォーム
・派生したプロジェクトにEris、HydraChain(エスタブリッシュ型ブロックチェーン)
ブロックチェーン情報
・ETHの残高情報等がブロックチェーンに直接記録されるアカウントがベースとなったシステム
2種類のアカウントがある
・従来のビットコイン等の仮想通貨のアドレスと同様のアカウント
・「コントラクトアカウント(Contract Account)」と呼ばれるプログラムコードによって
管理されるスマートコントラクト実行用のアカウント
インストール
debianで試そうとしたが、サポート外とのこと(公式フォーラムより)
root@ubuntu1404:/home/shimizu# bash <(curl -L https://install-geth.ethereum.org) ... root@ubuntu1404:/home/shimizu# geth version Geth Version: 1.4.10-stable Protocol Versions: [63 62] Network Id: 1 Go Version: go1.5.1 OS: linux GOPATH= GOROOT=/usr/lib/go
テスト環境で採掘する
パーミッションド型ブロックチェーンを試せる(Ehterの挙動調査や個人的な作業に向いている)
ただしそこで得たEtherはパブリック型ブロックチェーン(Frontier)では利用できない
root@ubuntu1404:/home/shimizu# mkdir eth_data
root@ubuntu1404:/home/shimizu# geth --networkid "10" --datadir "/home/shimizu/eth_data" --olympic console
...
> personal.newAccount("shimizu")
"0x2e7f96d3251027d3b4e2d90be4f9a320e7a28f07"
> personal.newAccount("shimizu02")
"0x8e9b51319dc468e8c1ea55737ba3192f40693103"
> eth.accounts
["0x2e7f96d3251027d3b4e2d90be4f9a320e7a28f07", "0x8e9b51319dc468e8c1ea55737ba3192f40693103"]
> miner.start()
I0719 00:47:10.318491 miner/miner.go:119] Starting mining operation (CPU=1 TOT=2)
I0719 00:47:10.318831 miner/worker.go:573] commit new work on block 1 with 0 txs & 0 uncles. Took 204.305µs
true
> I0719 00:47:10.319500 eth/backend.go:454] Automatic pregeneration of ethash DAG ON (ethash dir: /root/.ethash)
I0719 00:47:10.319637 ethash.go:259] Generating DAG for epoch 0 (size 1073739904) (0000000000000000000000000000000000000000000000000000000000000000)
I0719 00:47:10.319935 eth/backend.go:461] checking DAG (ethash dir: /root/.ethash)
I0719 00:47:12.251590 ethash.go:291] Generating DAG: 0%
I0719 00:47:14.766994 ethash.go:291] Generating DAG: 1%
I0719 00:47:17.135879 ethash.go:291] Generating DAG: 2%
...
miner.stop()
### ブロックチェーンの長さ ###
> eth.blockNumber
937
### etherの持ち高確認 ###
> eth.getBalance("0x2e7f96d3251027d3b4e2d90be4f9a320e7a28f07")
1.40765625e+21
Frontierに接続してみる
アカウントの削除方法がわからなかったため、新しくディレクトリを作成して試してみた
root@ubuntu1404:/home/shimizu# mkdir eth_data_frontier root@ubuntu1404:/home/shimizu# geth --datadir "/home/shimizu/eth_data_frontier" ... I0719 02:01:41.677036 core/blockchain.go:963] imported 1906 block(s) (0 queued 0 ignored) ... ...