Gethのコンソールコマンド一覧です。
引数は適宜ご自身で切り替えてください。
アカウント関連
- アカウントの作成
> personal.newAccount("passphrase")
- アカウントの確認
> eth.accounts
- インデックス指定でのアカウントの確認
> eth.accounts[index]
- コインベースのアカウントの確認 ※コインベース: ブロック生成のマイニング報酬を得るアカウント
> eth.coinbase
- コインベースアカウントの変更
> miner.setEtherbase(eth.accounts[index])
- 残高確認 (wei)
> eth.getBalance(eth.accounts[index])
- 残高確認 (ether) ※単位はether以外にも変更可能。
> personal.unlockAccount(eth.accounts[index])
マイニング関連
- マイニングの開始 ※引数はマイニング処理を実行するスレッド数。
> miner.start(num_of_threads)
- マイニングの停止
> miner.stop()
- マイニング中か確認
> eth.mining
- マイニングHashrateの確認
> miner.hashrate
- ブロックの内容確認
eth.getBlock(blockNumber)
トランザクション関連
- アカウントのロック解除 ※送金前に必要。
> web3.fromWei(eth.getBalance(eth.accounts[index]), "ether")
- 送金
eth.sendTransaction({from: eth.accounts[source_index], to: eth.accounts[destination_index], value: web3.toWei(amount, "ether")})
- トランザクションの確認
eth.getTransaction("transaction_address")
- トランザクションの実行結果(レシート)の確認
eth.getTransactionReceipt("transaction_address")