[Ethereum] GethでETH送金

### ETH送金
> web3.fromWei(eth.getBalance(eth.accounts[1]), “ether”)
0
> web3.fromWei(eth.getBalance(eth.accounts[0]), “ether”)
265

– アカウントのロック解除
> personal.unlockAccount(eth.accounts[0],”pass1″)
true

– ETH送金
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(10, “ether”)})
“0x2c0c90b18598551e678fa0eddef034c5e7759c2750927abae38cef9486814c0c”

– マイニングする(マイニングをしないと送金されない ブロックが生成されてないからか)
> miner.start()
null
> eth.mining
true
> eth.hashrate
16082
> web3.fromWei(eth.getBalance(eth.accounts[1]),”ether”)
10
> miner.stop()
null

### トランザクション、ブロック
> eth.getTransaction(“0x2c0c90b18598551e678fa0eddef034c5e7759c2750927abae38cef9486814c0c”)
{
blockHash: “0xc0f7e2bffbeece31a4a890f6d4b554a7b79f323543a3d146463ad78b9d9a6198”,
blockNumber: 54,
from: “0x6752a913de4f4530ed3f071371db8d70acc42fce”,
gas: 21000,
gasPrice: 1000000000,
hash: “0x2c0c90b18598551e678fa0eddef034c5e7759c2750927abae38cef9486814c0c”,
input: “0x”,
nonce: 0,
r: “0x32d8d13541808080dabefbc39df215e01516ead9115be54de16133d60e9104d8”,
s: “0x3d1e49ba781eaa5ccae9683f8c2e2225e06aed1bdb736514bc29cf551923be33”,
to: “0x87b2d715dafdfa88da7d76b25069162153967e23”,
transactionIndex: 0,
type: “0x0”,
v: “0x38”,
value: 10000000000000000000
}

> eth.getBlock(“54”)
{
difficulty: 131072,
extraData: “0xd883010a0d846765746888676f312e31372e32856c696e7578”,
gasLimit: 3311539,
gasUsed: 21000,
hash: “0xc0f7e2bffbeece31a4a890f6d4b554a7b79f323543a3d146463ad78b9d9a6198”,
logsBloom: “0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000”,
miner: “0x6752a913de4f4530ed3f071371db8d70acc42fce”,
mixHash: “0x08bb6af9df543835877260cd890a8e234383269fcefaa0b03f6cec0aea87ae18”,
nonce: “0x77ca71556eca292f”,
number: 54,
parentHash: “0x14be3c7269afab1eb01e221dfe05283d21a574cabb707571a464f5d3e106210a”,
receiptsRoot: “0xaa48dd6dc5cf21faf1da3ed77d1b91e087e446ad7485ac4d8b737c53e6faf2c1”,
sha3Uncles: “0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347”,
size: 648,
stateRoot: “0xc76aaf77c4d6a10159b8dd505eef0e2c3c3b00afcf3ef826db794d895e8b3c84”,
timestamp: 1639974714,
totalDifficulty: 7294014,
transactions: [“0x2c0c90b18598551e678fa0eddef034c5e7759c2750927abae38cef9486814c0c”],
transactionsRoot: “0xce5ed8b87e501a3061bf6520df5c76ee0847426e8ad05e647f847fca0e5b4acf”,
uncles: []
}

### 手数料の確認
> personal.newAccount(“pass3”)
“0x3c0fdb1594e99dc9c0cdd65ea8f6c2631b838553″
> eth.getBalance(eth.accounts[1])
10000000000000000000
> eth.getBalance(eth.accounts[2])
0

> personal.unlockAccount(eth.accounts[1],”pass2″)
true
> eth.sendTransaction({from: eth.accounts[1], to: eth.accounts[2], value: web3.toWei(6,”ether”)})
“0xb1a53e635f9c6cec886b23d31a8184cb3490c0bed8b2348267d49d663b2b5bd1”
> miner.start()
> eth.getBalance(eth.accounts[2])
6000000000000000000
> miner.stop()
null
> eth.getBalance(eth.accounts[1])
3999979000000000000

手数料がかかるアカウントと、かからないアカウントがあるのね