Send ether by JSON-RPC API

I will send ether from miner2 node to server node.

  • Check balance in console of server node

    > eth.coinbase
    "0x88dd6b191d4bca6b059dd35ac0cffb2ffd072d62"
    > web3.fromWei(eth.getBalance(eth.coinbase))
    21.861329701779912001
    
  • Using eth_sendTransaction API by PostMan POST http://192.168.26.59:8487

    • body
    {
        "jsonrpc":"2.0",
        "method":"eth_sendTransaction",
        "params":[{
            "from": "0x4d0362700bcdc69e2e4e083c3f098ca55efd1119",
            "to": "0x88dd6b191d4bca6b059dd35ac0cffb2ffd072d62",
            "gas": "0x76c0",
            "gasPrice": "0x9184e72a000",
            "value": "0x1",
            "data": ""
        }],
        "id":63
    }
    
    • response
    {
        "jsonrpc": "2.0",
        "id": 63,
        "result": "0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787"
    }
    

Then asking server and miner2 nodes to mining.

  • miner2 console

    > INFO [05-10|10:53:29] Submitted transaction                    fullhash=0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787 recipient=0x88dd6b191d4Bca6B059Dd35Ac0cFFb2FfD072D62
    INFO [05-10|10:53:41] Imported new chain segment               blocks=1   txs=1  mgas=0.021 elapsed=991.606µs mgasps=21.178  number=1749 hash=3e1c27…125a8f cache=51.96kB
    > miner.start();
    INFO [05-10|10:53:44] Transaction pool price threshold updated price=18000000000
    
  • server console

> INFO [05-10|10:36:55] Regenerated local transaction journal    transactions=0 accounts=0
> miner.start();
INFO [05-10|10:53:41] Transaction pool price threshold updated price=18000000000
INFO [05-10|10:53:41] Starting mining operation 
null
> INFO [05-10|10:53:41] Commit new mining work                   number=1749 txs=1  uncles=0 elapsed=1.373ms
INFO [05-10|10:53:41] Successfully sealed new block            number=1749 hash=3e1c27…125a8f
INFO [05-10|10:53:41] 🔨 mined potential block                  number=1749 hash=3e1c27…125a8f

> web3.fromWei(eth.getBalance(eth.coinbase))
22.071329701779912002

> eth.getTransaction("0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787")
{
  blockHash: "0x3e1c272e1570a5dbd9afd72d12cda0b13885e2dcaad14a71b82fa172b0125a8f",
  blockNumber: 1749,
  from: "0x4d0362700bcdc69e2e4e083c3f098ca55efd1119",
  gas: 30400,
  gasPrice: 10000000000000,
  hash: "0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787",
  input: "0x",
  nonce: 84,
  r: "0x8f75d6d0da18b0a9af3bff30e933d3baf40d423231602ebefc1a9683c75d8c6b",
  s: "0x59c8b9645c46f3edd73443a5bd6e7498ec9199722911a5d0353021c0ed41cdb5",
  to: "0x88dd6b191d4bca6b059dd35ac0cffb2ffd072d62",
  transactionIndex: 0,
  v: "0x11baa",
  value: 1
}
> eth.getTransactionReceipt("0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787");
{
  blockHash: "0x3e1c272e1570a5dbd9afd72d12cda0b13885e2dcaad14a71b82fa172b0125a8f",
  blockNumber: 1749,
  contractAddress: null,
  cumulativeGasUsed: 21000,
  from: "0x4d0362700bcdc69e2e4e083c3f098ca55efd1119",
  gasUsed: 21000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  root: "0x7fac9ce1fcd92a953100b791d689a8cff74c419d8ecc24f6d1efba1d3f891055",
  to: "0x88dd6b191d4bca6b059dd35ac0cffb2ffd072d62",
  transactionHash: "0xead3272fd7cbc724706ca195d905205171922b05ade2020643831ea1781d8787",
  transactionIndex: 0
}

results matching ""

    No results matching ""