ganacheとgethでのETH送金 確認

1.確認内容
(1) 送金テスト
(2) 送金した時のGas
(3) トランザクション情報
(4) ブロック情報

2.送金テスト

# geth attach http://localhost:8545
> web3.fromWei(eth.getBalance(eth.accounts[0]));
1000
> web3.fromWei(eth.getBalance(eth.accounts[1]));
1000
> personal.unlockAccount(eth.accounts[0],"")
true
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(5, "ether")})
"0x751735f0379947734ef0f73ad53e3831cd5b63ba468d917e3f210575ca5bf2de"
> web3.fromWei(eth.getBalance(eth.accounts[1], 'latest'));


1005
> web3.fromWei(eth.getBalance(eth.accounts[1], 'pending'));

1005
>  personal.unlockAccount(eth.accounts[1],"")


true
> eth.sendTransaction({from: eth.accounts[1], to: eth.accounts[0], value: web3.t
oWei(5, "ether")})
"0xb9225bbd23465cc7788b7abc67a2f5021fc0e41957b5e46da97cddcb728b9a34"
>
>
> web3.fromWei(eth.getBalance(eth.accounts[1], 'latest'));

999.999979647053302
> web3.fromWei(eth.getBalance(eth.accounts[1], 'pending'));
999.999979647053302
> web3.fromWei(eth.getBalance(eth.accounts[0], 'latest'));
999.999976744140625
>

3.送金した時のGasは一定ではない

> web3.fromWei(eth.getBalance(eth.accounts[2], 'latest'));
1000
> web3.fromWei(eth.getBalance(eth.accounts[3], 'latest'));
1000
> eth.sendTransaction({from: eth.accounts[2], to: eth.accounts[3], value: web3.t
oWei(5, "ether")})
"0xedc2386f764f94ebb59016c6e698052d926b260e1beddb2e759c12303993d65b"
> web3.fromWei(eth.getBalance(eth.accounts[2], 'latest'));

994.999982187609866
> web3.fromWei(eth.getBalance(eth.accounts[3], 'latest'));
1005
> eth.sendTransaction({from: eth.accounts[3], to: eth.accounts[2], value: web3.t
oWei(5, "ether")})
"0x1f7d26fa2e1de9ccca3c74efe76f591b33e633daa02908b1cbd8f5a7e671d149"
> web3.fromWei(eth.getBalance(eth.accounts[2], 'latest'));

999.999982187609866
> web3.fromWei(eth.getBalance(eth.accounts[3], 'latest'));

999.99998441104144
> web3.fromWei(eth.getBalance(eth.accounts[4], 'latest'));

1000
> web3.fromWei(eth.getBalance(eth.accounts[5], 'latest'));
1000
> eth.sendTransaction({from: eth.accounts[4], to: eth.accounts[5], value: web3.t
oWei(5, "ether")})
"0xa478e5979071dcc5d8bc3050f74f9f137888f371ba45467dbdd46ecf8f9fb7f9"
> web3.fromWei(eth.getBalance(eth.accounts[4], 'latest'));

994.999986356933192
> web3.fromWei(eth.getBalance(eth.accounts[5], 'latest'));
1005
> eth.sendTransaction({from: eth.accounts[5], to: eth.accounts[4], value: web3.t
oWei(5, "ether")})
"0xe38e77b23128babf87dcce2f33d0114b0b01cecff47545f354ff52e297095e10"
> web3.fromWei(eth.getBalance(eth.accounts[4], 'latest'));

999.999986356933192
> web3.fromWei(eth.getBalance(eth.accounts[5], 'latest'));

999.999988059929011
>

4.トランザクション情報

> eth.getTransaction("0xa478e5979071dcc5d8bc3050f74f9f137888f371ba45467dbdd46ecf8f9fb7f9")
{
  accessList: [],
  blockHash: "0xbe23e36e1c2377084851f03d5eba392963aa2613258e1da8a6e516a2499c5cf6",
  blockNumber: 5,
  chainId: "0x539",
  from: "0x41f5c190ea91d4eddcd53b7ac60b162031f6a99e",
  gas: 90000,
  gasPrice: 649669848,
  hash: "0xa478e5979071dcc5d8bc3050f74f9f137888f371ba45467dbdd46ecf8f9fb7f9",
  input: "0x",
  maxFeePerGas: "0x26b92cd8",
  maxPriorityFeePerGas: "0x3b9aca00",
  nonce: 0,
  r: "0x16c72aca113dd150dae43aee556af6b406a6d0520beecf9c3190230abf777d6a",
  s: "0xa5fa90ddc0edd8270819c5d214c5fd246b0b788f1b2371c03de8acae06ddf8",
  to: "0x7e561e420b6839ed0a8facf63be25abfc5ee8b44",
  transactionIndex: 0,
  type: "0x2",
  v: "0x1",
  value: 5000000000000000000
}
>
> eth.getTransaction("0xe38e77b23128babf87dcce2f33d0114b0b01cecff47545f354ff52e297095e10")
{
  accessList: [],
  blockHash: "0xb9cc109cd2b281d535f497b6b12245d6c7b301245279c9c87490eae850e3b5d9",
  blockNumber: 6,
  chainId: "0x539",
  from: "0x7e561e420b6839ed0a8facf63be25abfc5ee8b44",
  gas: 90000,
  gasPrice: 568574809,
  hash: "0xe38e77b23128babf87dcce2f33d0114b0b01cecff47545f354ff52e297095e10",
  input: "0x",
  maxFeePerGas: "0x21e3c359",
  maxPriorityFeePerGas: "0x3b9aca00",
  nonce: 0,
  r: "0xc3d64996f1e014541889c6eae16d39c96e0c26886ab070e6eb4c29dfaea45ad8",
  s: "0x19a99a6218e32b027e40edb044b4ee7d681f90c9dff3226a15e50a69769499da",
  to: "0x41f5c190ea91d4eddcd53b7ac60b162031f6a99e",
  transactionIndex: 0,
  type: "0x2",
  v: "0x1",
  value: 5000000000000000000
}
>

5.ブロック情報

> eth.getBlock(5)
{
  baseFeePerGas: "0x1e98a1db",
  difficulty: 1,
  extraData: "0x",
  gasLimit: 30000000,
  gasUsed: 21000,
  hash: "0xbe23e36e1c2377084851f03d5eba392963aa2613258e1da8a6e516a2499c5cf6",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x0000000000000000000000000000000000000000",
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: "0x0000000000000000",
  number: 5,
  parentHash: "0xd91c2c134f35886580cd7d6b4a9666b792d0af6d01592165e812a79ec8c2f992",
  receiptsRoot: "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 636,
  stateRoot: "0x54406356dac0766c627cf398c8f71240cc3c72af36a0a66e52745fa0066d211a",
  timestamp: 1651387204,
  totalDifficulty: 6,
  transactions: ["0xa478e5979071dcc5d8bc3050f74f9f137888f371ba45467dbdd46ecf8f9fb7f9"],
  transactionsRoot: "0xa68356ad90fb878a3cbbea35f7194aca144ee0dc8ee29028c6be9597a63ab54f",
  uncles: []
}
> eth.getBlock(6)
{
  baseFeePerGas: "0x1ac6ec87",
  difficulty: 1,
  extraData: "0x",
  gasLimit: 30000000,
  gasUsed: 21000,
  hash: "0xb9cc109cd2b281d535f497b6b12245d6c7b301245279c9c87490eae850e3b5d9",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x0000000000000000000000000000000000000000",
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: "0x0000000000000000",
  number: 6,
  parentHash: "0xbe23e36e1c2377084851f03d5eba392963aa2613258e1da8a6e516a2499c5cf6",
  receiptsRoot: "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 637,
  stateRoot: "0x97f01c0615598edefa96cf41c8323d0d4d9c2135795f08f60f780d4bb44c06c2",
  timestamp: 1651387245,
  totalDifficulty: 7,
  transactions: ["0xe38e77b23128babf87dcce2f33d0114b0b01cecff47545f354ff52e297095e10"],
  transactionsRoot: "0x9d27bc440ca377994ca24f66ae33d6ae6f76b7d7289085d50e33e5121ec7454c",
  uncles: []
}
>