0
0

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 3 years have passed since last update.

Gethインストール

$ brew tap ethereum/ethereum
$ brew install ethereum

Geth起動

$ mkdir ~/main_data
$ cd ~/main_data
$ geth --dev --datadir .              // gethプロセス起動
$ geth attach geth.ipc

アカウント作成

> eth.accounts                       // アカウント確認
> personal.newAccount("test01")      // アカウント作成
> eth.coinbase                       // etherbase (coinbase)作成

マイニング

> miner.start()                     // マイニング開始
> eth.mining                        // マイニング中か否か              
> eth.hashrate                      // マイニング中でない場合、ハッシュ・レートは0となる。
> miner.stop()                      // マイニング終了
> eth.getBalance(eth.accounts[0])   // 持ち高表示

送金

> personal.unlockAccount(eth.accounts[0])  // アカウントロック解除
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: 10000})
> eth.getBalance(eth.accounts[1])          // 確認
> eth.getTransaction('10x010x010x010x0')   // 手数料(gasPrice)確認

接続確認

> net.listening           // 疎通確認
> net.peerCount           // 接続されているノード数
> admin.nodeInfo
> admin.peers             // 接続されているノード情報

privateネットワーク

$ mkdir ~/private_net
$ cd ~/private_net
$ vim Genesis.json        // Genesisファイル作成
$ geth --datadir private_net init Genesis.json
$ geth --dev --datadir .              // gethプロセス起動
$ geth attach geth.ipc

参考文献

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?