ubuntu 20.04 + geth environment ether remittance

Summarize the ether remittance procedure in ubuntu 20.04 + Geth1.9.25 (Go-Ethereum) environment.

Confirmation of ownership ether of EOA account

Use the > eth.getBalance (eth.accounts [NUmber]) command to check the ether holdings of the EOA account of the remittance source / destination.

> eth.accounts
["0x911e18204582a6de08dd2b1f7540b9167ce93b67", "0x634c921bfbad7756c7988ea74e4bdf5e5387620d"]
>
> eth.getBalance(eth.accounts[0])
2.105e+21
> eth.getBalance(eth.accounts[1])
100000000000000000000

Account unlock

It is necessary to unlock the account when sending ether. Unlock with the personal.unlockAccount (EOA account address) command. The unlock time times out with a default of 300 seconds and is locked.

> personal.unlockAccount(eth.accounts[0])
Unlock account 0x911e18204582a6de08dd2b1f7540b9167ce93b67
Passphrase:
true
>

The command can extend the options as follows. If you specify 0 for the unlock time, it will not be locked. personal.unlockAccount (EOA account address," password "," unlock time (seconds) ")

Ether remittance

Mining processing must be executed at the time of remittance. Since it is a private network and there are no miners other than itself, it carries out mining.

> eth.hashrate
0
> eth.mining
false
> miner.start()
null
> eth.mining
true
> eth.hashrate
2619
>

Send money from the unlocked account [0] to account [1]. Since the remittance unit is wei's unit designation, use the unit conversion function web.toWei. The transaction ID is returned as the execution result.

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

The contents of the transaction can be confirmed with the eth.getTransaction ('transaction address') command.

> eth.getTransaction('0xf03e4882a766d3aa4d3b188bbe191721be63ed2233792e7fcb1d5b7e1dd6b2eb')
{
  blockHash: null,
  blockNumber: null,
  from: "0x911e18204582a6de08dd2b1f7540b9167ce93b67",
  gas: 21000,
  gasPrice: 1000000000,
  hash: "0xf03e4882a766d3aa4d3b188bbe191721be63ed2233792e7fcb1d5b7e1dd6b2eb",
  input: "0x",
  nonce: 0,
  r: "0xda879400e1472aaed815371ab259874a0303f17d732e83959345f4322b5c8195",
  s: "0xc89b9f49f14fa35778b84164eb2a39e34f004ede08044ddc257d332ba7f8fca",
  to: "0x634c921bfbad7756c7988ea74e4bdf5e5387620d",
  transactionIndex: null,
  v: "0x42",
  value: 5000000000000000000
}
>

It seems that it will take a while, so I would like to update it after confirming the remittance.

Recommended Posts

ubuntu 20.04 + geth environment ether remittance
ubuntu20.04 + Geth installation procedure
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
Build python3 environment with ubuntu 16.04
Ubuntu18.04 Development environment creation memo
Ubuntu14.04 + GPU + TensorFlow environment construction
Building a Python environment on Ubuntu
Modify Ubuntu tofu to Japanese environment
From Ubuntu 20.04 introduction to environment construction
Ubuntu Desktop 20.04 development environment construction memo
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Environment construction of "Tello_Video" on Ubuntu
OpenCV3 & Python3 environment construction on Ubuntu