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

Geth コンソール基礎知識

Last updated at Posted at 2019-06-16

gethの起動コマンド

geth --networkid "10" --nodiscover --datadir ~/geth/private_net/ --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --rpcapi "eth,net,web3,personal" --targetgaslimit "20000000" console 2>> ~/geth/private_net/error.log

アカウント作成

personal.newAccount("password")

コインベースアカウントの確認

eth.counbase

コインベースアカウントの変更

miner.setEtherbase(eth.accounts[?])

genesisブロックの確認

eth.getBlock(0)

マイニングの開始、確認、停止

miner.start(1)
eth.mining
miner.stop()

コインベースの残高確認

eth.getBalance(eth.accounts[0])
web3.fromWei(eth.getBalance(eth.accounts[0], "either")

送金

(eth.accountがロックされてるので送金不可)

eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(5, "ether")})

PASSWORDアンロック

personal.unlockAccount(eth.accounts[0])

送金が成功したトランザクション

eth.getTransaction("address")

トランザクション内のblockNumberに残高が存在する

web3.fromWei(eth.getBalance(eth.accounts[1], 58), "ether")

レシート

eth.getTransactionReceipt("address")
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?