Commands to interact with BitCoin node


!pip install python-bitcoinlib
Requirement already satisfied: python-bitcoinlib in ./.conda/bitcoin/lib/python3.5/site-packages
import pprint
from bitcoin.rpc import RawProxy
pp = pprint.PrettyPrinter(indent=4)
# What is BitCoin
# Info about the node server: getinfo: versions, block-height
p=RawProxy(btc_conf_file="./btc.conf")
info=p.getinfo()
pp.pprint(info)
{   'balance': Decimal('0E-8'),
    'blocks': 447373,
    'connections': 8,
    'deprecation-warning': 'WARNING: getinfo is deprecated and will be fully '
                           'removed in 0.16. Projects should transition to '
                           'using getblockchaininfo, getnetworkinfo, and '
                           'getwalletinfo before upgrading to 0.16',
    'difficulty': Decimal('317688400354.0338'),
    'errors': '',
    'keypoololdest': 1512965795,
    'keypoolsize': 2000,
    'paytxfee': Decimal('0E-8'),
    'protocolversion': 70015,
    'proxy': '',
    'relayfee': Decimal('0.00001000'),
    'testnet': False,
    'timeoffset': -2,
    'version': 150100,
    'walletversion': 139900}
# getinfo in curl
!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary '{"jsonrpc":"1.0", "id":"curltest", "method":"getinfo", "params":[] }' -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   607  100   539  100    68  13550   1709 --:--:-- --:--:-- --:--:-- 13820
{
   "id" : "curltest",
   "error" : null,
   "result" : {
      "errors" : "",
      "walletversion" : 139900,
      "connections" : 8,
      "timeoffset" : -2,
      "keypoolsize" : 2000,
      "difficulty" : 317688400354.034,
      "proxy" : "",
      "paytxfee" : 0,
      "version" : 150100,
      "relayfee" : 1e-05,
      "blocks" : 447373,
      "keypoololdest" : 1512965795,
      "testnet" : false,
      "balance" : 0,
      "protocolversion" : 70015,
      "deprecation-warning" : "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16"
   }
}
# Transactions: Initial
# Getting details of a transaction: input, output, input transaction id

!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary \
    '{"jsonrpc":"1.0", "id":"curltest", "method":"decoderawtransaction", \
    "params":["0100000001186f9f998a5aa6f048e51dd8419a14d8\
a0f1a8a2836dd734d2804fe65fa35779000000008b483045022100884d142d86652a3f47ba474\
6ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298\
cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fd\
e0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa\
336a8d752adfffffffff0260e31600000000001976a914ab68025513c3dbd2f7b92a94e0581f5\
d50f654e788acd0ef8000000000001976a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8\
88ac00000000"] }' \
    -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2113  100  1510  100   603  27299  10901 --:--:-- --:--:-- --:--:-- 27454
{
   "error" : null,
   "id" : "curltest",
   "result" : {
      "locktime" : 0,
      "hash" : "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2",
      "txid" : "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2",
      "vin" : [
         {
            "vout" : 0,
            "txid" : "7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18",
            "scriptSig" : {
               "hex" : "483045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf",
               "asm" : "3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e3813[ALL] 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf"
            },
            "sequence" : 4294967295
         }
      ],
      "vsize" : 258,
      "version" : 1,
      "size" : 258,
      "vout" : [
         {
            "scriptPubKey" : {
               "reqSigs" : 1,
               "addresses" : [
                  "1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA"
               ],
               "asm" : "OP_DUP OP_HASH160 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 OP_EQUALVERIFY OP_CHECKSIG",
               "type" : "pubkeyhash",
               "hex" : "76a914ab68025513c3dbd2f7b92a94e0581f5d50f654e788ac"
            },
            "value" : 0.015,
            "n" : 0
         },
         {
            "value" : 0.0845,
            "n" : 1,
            "scriptPubKey" : {
               "reqSigs" : 1,
               "asm" : "OP_DUP OP_HASH160 7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG",
               "type" : "pubkeyhash",
               "hex" : "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
               "addresses" : [
                  "1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK"
               ]
            }
         }
      ]
   }
}
# Getting block hash from block number
!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary \
    '{"jsonrpc":"1.0", "id":"curltest", "method":"getblockhash", \
    "params":[420000] }' \
    -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   190  100   107  100    83   4848   3760 --:--:-- --:--:-- --:--:--  5095
{
   "id" : "curltest",
   "error" : null,
   "result" : "000000000000000002cce816c0ab2c5c269cb081896b7dcb34b8422d6b74ffa1"
}
# Getting block details from block hash
!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary \
    '{"jsonrpc":"1.0", "id":"curltest", "method":"getblock", \
    "params":["000000000000000002cce816c0ab2c5c269cb081896b7dcb34b8422d6b74ffa1"] }' \
    -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 85055  100 84916  100   139   723k   1212 --:--:-- --:--:-- --:--:--  727k
{
   "error" : null,
   "id" : "curltest",
   "result" : {
      "mediantime" : 1468080438,
      "merkleroot" : "028323a5bcacb0057274ee0a4366e5671278bc736b57176d9bb929c3a69e0ffa",
      "chainwork" : "0000000000000000000000000000000000000000001f28eb367714df2be21f6f",
      "versionHex" : "20000000",
      "strippedsize" : 999838,
      "difficulty" : 213398925331.324,
      "confirmations" : 27374,
      "hash" : "000000000000000002cce816c0ab2c5c269cb081896b7dcb34b8422d6b74ffa1",
      "weight" : 3999352,
      "size" : 999838,
      "nextblockhash" : "000000000000000004db7eebf333b81f2529835102f7f7e86eca889287148885",
      "nonce" : 2193437364,
      "tx" : [
         "5787c3d0740f13f280118404405f1c93fb7a63a953fa482b13e23c3b03a14bd4",
         "a8f758497b2f8bd6342b4491f18873b423a275469ac03b0afc680581e18e3e16",
         "b9c86416274aa8e233a838ac84dfb9a576f73dde3cc9ed941fafaf5cdff13412",
         "a3c69e60424c1a753bba5d62a4f353001a301d61e81c79e63de619b37e77c64b",
         "c60614f952b00ff2e50473a7a196d89c0a7ed4d72dcde55069f327876cbbed17",
         "f5c2e75367e21bd98200db3509e88be060a67f6a0f68dd3c727bfd0a45443fad",
         "ceaadeff88ad1376604343a69e18dae3360f635cb730e1a1c5c3d5f617a1ae23",
         "bdd9f57ad384237ce363f3383cac46b924bb197abc8eff8e3fd153b8b3d48e7f",
        "74b91a88d4d2c5bd6473407201a3b7f85e8612438bdf1d3217fc2c9ba5ddfe1b",
         "beeb14092712e516f62f0686c3558903ef84b4983b6a538cbc1025d656214032",
         "c023c36f9092a405ac61820bdbbfd7fc0b045d955c1773c179217a79854928eb",
         "9a0665c196a4916175c1f15ea732be9cf231945488820b97f269e1faf4f1d026",
         "d5d2e6ebee27d5bbd06da8a914e0b4884e629d16ba67542b326366df06eabe93",
         "632fbeff94afdc526d84857241950d1157892e3f66fe228eddb9a5fc95399372",
         "08c35a09218999e98764c9ad07b401643febfaa1001592bf78529602c29cfb2a",
         "5f2259b462e7706c48f3c011643c2eb8afd61f6522f60bd0bdf9c87cf1bc735c",
         "83faf8e37cea31e56e33b0b1fdbb4a441e2744bccfe91e6d5854db7dfa757ce9",
         "53b8d5b0f46cf177fae5c1e579e61c08789f4197bb3837d6d55e2cc608d9c435",
         "e6a721fa408010ab24b13fcc9a749e76532f8e48481b2ac21df4aeb86d082e82",
         "9b7967fd118ffbc6f60ed5c1df43d8193450a673273e295623b08dee622dcdc9",
         "adf2ee307d77fe946d70d619b4855de0920d469ec1f7f10651c9a58eaa2bfc29",
         "e7378a93fceafcf52a41018a933f1615699e60ec61706a53be6c38b93b565c57",
         "3fd7fcd38f2764227df4797bb189bac20e23a0f3c741115e24afaf23cd42964b",
         "98c6451916d75e32c44f70df725af78d40d286b86619823a7e81183529576b49",
         "24de7a1d483edb3bb2722c81b1d865e8481042c1c9b9545a8ebeb7e42c793642",
         "832e6ce32d53489dd34a2538e2f1aceea1e73bd7390725959719169f8026879d",
         "17b91ec9b7ba6f7b0625f648b167b6015b65d3d71f6c049ecc5c980eb10506cc",
         "e2e631e664f232128ea0980c32c4b4389a55d771b21c65f876d8c9eb771688a1",
         "ffc628a1462f4b121821913032b3b1a52e1a7417d99f655ec5bed3f67fb49544",
         "18bd2461bf4b577556071bd65f3c296f0fed5667f7f42624765cd8e9c2c5a9c7",
        "88967aa496ddf7e0c5254f6c7a162986c9fb74cd52d6157ad56631051c054a23",
         "a16b77afbe312047ec2e783d2da93ec5cad5753d45fbefef034e062a3d260414",
         "69632c014961b302b994ab0355ed2904261a314959b653eb8f29ceb5f9221819",
         "40f4d14b1dad9a05f0af68f99f0e776f9acafce65d405e4a2ac6447c88ab4054",
         "de2f6b0e27c521de7a3a7f812de5d434228dd83bffcf6fd307f0b89d92089739",
         "8638a3ea6cb2648316a1414c091381fa5ab9c5f85d48952174b211965c13d037",
         "56aa4f49049a09b58163d56067e2ed981cfe648bada5beb906bffc3dcfb0570f",
         "ed1e2c72d5fffb22b8906a32e3bdd698365bcfe3b95f68428e16552686bee3ed",
         "ec9cd54b3649adc0cac33d95bb58845a8a949f84cdbcf0e6ffe855783ba1675e",
         "401451c72421375870b4e14445665a1d5cc2c5ec4aeb80250acb6e4652259d20",
         "df952247e2aa78509a65e543c378ffaf54a65f4e8e6cd26d4c7deb0535495b10",
         "764a8c9643a40aa7131d2306899bcab2162aff77eb831f4acd45d9da7fdf74f2",
         "ce5928727a97e2ddc8ee65d2010309951b2149ada77db774ca390ea98d568858",
         "bc715d6a10e621ffb5ac3ce1abd4cb49f76bb41c511f97aa899155c44bc74976",
         "9c52095991b20a89e79f012348ef1a5589bd886b1a9507abc4022d7960217961",
         "ef6f341e2a7d2c1098cf4f3de001e735891e5cf4428a43c07abb408771cab053",
         "ec2dca24ca9d5ab65184036d3da02179f9f7fcff8070979bfbec147e5ff275a0",
         "7a989945528bc9980f14416903252e643d42f030dde916ab19e141f19825d123",
         "5c43fb2adfbde64c45bbed3a5977c0e3983c195fbc95035bf74e582e1a074481",
         "e0b1b72c559933dd41261858f6ffb1ab6664066fd7c89fbe1e91db4194ed82f3",
         "95a88aa3347a84a617f2233d4a318c0ced97ed5d4a1075e84ff216ae0b636233",
         "f1a1dea5240673e53926c24d69a2bab77b68d5cf17ea8e3b3e7732d712632f5e",
         "a20ff766936773a899f087033158cd1aa2c7dc0c2a7a78ebf3d78e834763e2d0",
         "76528a0eba4a5e0146475edeb87862716b78acd8806425393d1d01ab337d547c",
         "434afb209e4378aa71983beb23005ea5b1c6e4f208516219de4ee7adc7ee102f",
         "1dc20c9b07571bd22af5719127519c9e85fa20fab6edc1ae9940191b7ec949ec",
         "30b9de94b8af57af72a8caea4b89028f05e7bae6edc791d8f9626e77a5a1d768",
         "680f8c33f6e7c07a6e428b0092217510556d1a447cdb9709409fc6b2af26022b",
         "a867c3c8f11b6268d9ab7bfc1edcc20635158c44ea215338db680f1c694bdcc4",
         "44cbd1288d134211b9194ccfc4e6d24cac5f3f3dbd46339eead68294a53de1bd",
         "45a6b0970a540fcc1b4c380eb93275f72652f11b99eb48b1ac98586765e31bab",
         "f27b3b9c02a3ba1ef46784357f9bf18c9579dc80abfc2b821f2307d6377c66a8",
         "23becf33564684d7c494d8b42991b80e7832fdb107fc7c7575a2be416c6d339c",
         "c7e99023978a875543560c28afbc78e937ed95d5d1ebcc0bb0535db9a6733729",
         "f429eb252672f630f23474a63c770ad6e785679657d32c9b89f985df134c5c1b",
         "1bb736a551548b1ac5fca63d3f3d3ebcc70a64780b7f713a157444ec03cbe746",
         "25fc9e60176b2e563abf934ed522b1a30e28e2aac24c62980e55e0015da138dd",
         "7b07abe2e5518bf9f4a7e077b445876f0409c938399d6ca9977dd849cff9720e",
         "e98993025f6c61ae7fc2f86ce29c2bd3e27fb6a43539b1f72c9704dfa5b8eeca",
         "42522b57715df9bb8e1e45218d307792238e07dc9792f2f5cae56644fe959d7f",
         "6f96a4f46e8718749c362292e7886f46a3f6faad2bd7f1331bd24c7e036ec3ba",
         "d84714d0c599981bb466f24a69c490aa583debe1af97bcb17b6bac891ec85a3f",
         "40e343cd3cdbbb5c5d12637f2167ff8641eb04364001843f5e14c305baf2fe12",
         "042c73e89e310839e593aaaffd511cc1b73d96f1166b8d16ddec1ae08f2dc462",
         "6fbda224062732046371daf6cc3542b79271c19ccb863dae65f8121121f0042b",
         "95072dd7763aec3437e7f67d67f5f2501e83eeb3d5ee9bc392644aaebffada5c",
         "ac8926db60dfbc2ce8b69cb74773b7ba091e19f996cd8df9f7319c30d2ca5ab7",
         "04e48d4c2d9596634b58d1faa07d29d0a0583685feac457d9964c0befa5639de",
         "0e373193ca645d03b80f187770223e7a342274704f37f75ded22eb67ca4e61d9",
         "8054e9fcbd94087a8a8febf6d03ef220b8c71043dd10901ce3f6bb149f58d4db",
         "65695f5f18b99a604abdd53376174fb9ea03a9fd86549f9ff58f187dce0a784e",
         "fac9afc0eaba1402904a6ffcd22f3aac1f9bb49bf5c2cf11b28c1ca29fb1349c",
         "01ee9405ed858680d546cd4da06857befddd034d1a3de9f3588970a8575b8d5f",
         "3b58940c04948bf2996d226902e5c9e5f9ee09988f538eb7bf8e1f90ce7e9e4b",
         "a6cbbfd19ad9acdab99934b07026c54455ff8cc1cafb0807ec375b78e474b170",
         "02cea4a0e2f233a2b354edf35e73b88aa9f8e39b2ac24aba1087b6797cf086d1",
         "4c7f3976f228bb2c7890b32c9f64c632c880ecc56f5dcecc3c95f6b17945fe2b",
         "68b06b53c7e7a66a6bcce3f28b8d3ac8670925ff7c64bf51777481ffefc1368d",
         "7c4a0bb873398caf8ff043a793b62ac9ebea79d6ac0c7c681c610b1e320bf2c7",
         "c955377f806131ae15a5e3f6972f0c8d54c2735e1f38ae47d698d63d7142cb3a",
         "5dd06fe10e7533f7103219e31822cd18995eec7956e30aeb725f11fe9d8b7d26",
         "9c1212f625a634ffb53aaa61f0d9a42b5d83e4570aab2e67b5a9bf1b2a61c1e9",
         "ee2e49e3df73e9549a50ca6262da342918bfa0a01eaf3f53b3e74dbe2b893ab0",
         "c3d1981776a726584f6fe7bd2213003d4dd4df1188c1469ad06ad8c3b5ccb835",
         "b7bfddef56e8526370d98be74fe37421d542c9452283fe32315e8cecbacc1c25",
         "66093e0d03fb9bd9db06fe289ce07c09081429170277462e326603eb771d6a6a",
         "dc3968fa77edffa35831a9c68febc2c32ce59d79f621a91b32d8c671b1e8837c",
         "b7dacd75b3f12b7af6a74f7e97f94f3ca67f8af24e5d50faa4cbbe7521b34a23",
         "7ded3beda84e2d36ca43730a1ecbb340a6d22cc80a1421c1339c9f8a271545c8",
         "e1e9720dede8d266fb33ee49a6e58fb26cb7131862f7416b448f4257615bd4ad",
         "b8ee79da6bb1fcb0cfac7fd1a45a39aae0a9ae0d895cde49f26c8bc427df49c7",
         "966400028d4a1b884dcc2c631635b68d09b55bc929e284ef18c3bc94ed14de8c",
         "ddeca69bc40ab6f8b0bbede4c2ddbcca9dfd1a1aa7d3869431cede383dfb6f0f",
         "74d3578e3264854082297b411de77e41e6205c401b59794b3c764c37a946dd1d",
         "4ca299bc0d2f520ab3f55f4a530d957487661f5aebc4a56cea016e818e9025f6"
      ],
      "previousblockhash" : "000000000000000003035bc31911d3eea46c8a23b36d6d558141d1d09cc960cf",
      "bits" : "180526fd",
      "time" : 1468082773,
      "version" : 536870912,
      "height" : 420000
   }
}
## Keys and digital signatures
# Getting block details from block hash
!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary \
    '{"jsonrpc":"1.0", "id":"curltest", "method":"getpeerinfo", \
    "params":[] }' \
    -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8171  100  8095  100    76   117k   1131 --:--:-- --:--:-- --:--:--  117k
{
   "result" : [
      {
         "conntime" : 1512985284,
         "inflight" : [
            447397,
            447402,
            447407,
            447412,
            447415,
            447420,
            447423,
            447427,
            447438,
            447444,
            447461,
            447464,
            447496,
            447498,
            447500,
            447504
         ],
         "startingheight" : 498717,
         "version" : 70015,
         "inbound" : false,
         "bytessent" : 3242346,
         "synced_headers" : 498816,
         "addnode" : false,
         "bytesrecv" : 14606825219,
         "bytessent_per_msg" : {
            "ping" : 11648,
            "verack" : 24,
            "version" : 126,
            "addr" : 27360,
            "getdata" : 3190245,
            "getaddr" : 24,
            "pong" : 11776,
            "sendcmpct" : 66,
            "getheaders" : 1021,
            "sendheaders" : 24,
            "feefilter" : 32
         },
         "services" : "000000000000000d",
         "lastrecv" : 1513037640,
         "subver" : "/Satoshi:0.15.0/",
         "bytesrecv_per_msg" : {
            "sendheaders" : 24,
            "feefilter" : 1536,
            "inv" : 9253298,
            "block" : 14597440393,
            "headers" : 10600,
            "pong" : 11616,
            "sendcmpct" : 66,
            "version" : 126,
            "addr" : 52732,
            "ping" : 11776,
            "verack" : 24
         },
         "whitelisted" : false,
         "synced_blocks" : 447370,
         "addr" : "148.251.92.40:8333",
         "minping" : 0.17038,
         "pingtime" : 94.095061,
         "pingwait" : 41.102779,
         "addrbind" : "172.31.1.11:39668",
         "relaytxes" : true,
         "id" : 9,
         "timeoffset" : -1,
         "banscore" : 0,
         "addrlocal" : "52.25.234.236:39668",
         "lastsend" : 1513037640
      },
      {
         "banscore" : 0,
         "timeoffset" : -1,
         "addrlocal" : "52.25.234.236:55136",
         "lastsend" : 1513037605,
         "pingwait" : 168.977942,
         "pingtime" : 94.419833,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:55136",
         "id" : 10,
         "whitelisted" : false,
         "minping" : 0.152828,
         "synced_blocks" : 447345,
         "addr" : "46.166.148.218:8333",
         "bytesrecv_per_msg" : {
            "ping" : 11968,
            "verack" : 24,
            "addr" : 49917,
            "version" : 126,
            "block" : 13556721297,
            "headers" : 10706,
            "pong" : 11744,
            "sendcmpct" : 66,
            "feefilter" : 1568,
            "inv" : 9247655,
            "sendheaders" : 24
         },
         "bytessent_per_msg" : {
            "ping" : 11744,
            "verack" : 24,
            "getdata" : 2923770,
            "getaddr" : 24,
            "addr" : 28915,
            "version" : 126,
            "pong" : 11968,
            "sendcmpct" : 66,
            "feefilter" : 32,
            "getheaders" : 1021,
            "sendheaders" : 24
         },
         "services" : "000000000000000d",
         "bytesrecv" : 13566093714,
         "lastrecv" : 1513037605,
         "subver" : "/Satoshi:0.15.1/",
         "synced_headers" : 498816,
         "addnode" : false,
         "startingheight" : 498717,
         "version" : 70015,
         "inbound" : false,
         "bytessent" : 2977714,
         "conntime" : 1512985301,
         "inflight" : [
            447374,
            447380,
            447398,
            447403,
            447408,
            447416,
            447434,
            447465,
            447467,
            447470,
            447476,
            447484,
            447487,
            447488,
            447490,
            447493
         ]
      },
      {
         "bytesrecv_per_msg" : {
            "inv" : 9323295,
            "feefilter" : 1248,
            "sendheaders" : 24,
            "headers" : 10282,
            "pong" : 11360,
            "block" : 10804520150,
            "sendcmpct" : 66,
            "addr" : 54637,
            "version" : 126,
            "ping" : 11552,
            "verack" : 24
         },
         "synced_blocks" : 447373,
         "minping" : 0.032188,
         "addr" : "170.75.195.168:8333",
         "whitelisted" : false,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:55204",
         "pingwait" : 159.350991,
         "pingtime" : 131.415665,
         "id" : 21,
         "addrlocal" : "52.25.234.236:55204",
         "banscore" : 0,
         "timeoffset" : -2,
         "lastsend" : 1513037646,
         "inflight" : [
            447384,
            447396,
            447399,
            447431,
            447435,
            447439,
            447449,
            447457,
            447462,
            447471,
            447478,
            447480,
            447485,
            447501,
            447505,
            447512
         ],
         "conntime" : 1512985985,
         "version" : 70015,
         "startingheight" : 498720,
         "inbound" : false,
         "bytessent" : 1594625,
         "synced_headers" : 498816,
         "addnode" : false,
         "lastrecv" : 1513037646,
         "bytesrecv" : 10813939283,
         "bytessent_per_msg" : {
            "feefilter" : 32,
            "getheaders" : 1021,
            "sendheaders" : 24,
            "sendcmpct" : 66,
            "pong" : 11520,
            "getdata" : 1543661,
            "getaddr" : 24,
            "addr" : 26735,
            "version" : 126,
            "verack" : 24,
            "ping" : 11392
         },
         "services" : "000000000000000d",
         "subver" : "/Satoshi:0.13.2/"
      },
      {
         "subver" : "/Satoshi:0.14.2/",
         "lastrecv" : 1513037642,
         "bytessent_per_msg" : {
            "getheaders" : 1021,
            "sendheaders" : 24,
            "feefilter" : 32,
            "sendcmpct" : 66,
            "pong" : 11328,
            "version" : 126,
            "getaddr" : 24,
            "getdata" : 1676479,
            "addr" : 26340,
            "verack" : 24,
            "ping" : 11328
         },
         "bytesrecv" : 11976427864,
         "services" : "000000000000000d",
         "addnode" : false,
         "synced_headers" : 498816,
         "bytessent" : 1726792,
         "inbound" : false,
         "startingheight" : 498720,
         "version" : 70015,
         "inflight" : [
            447381,
            447387,
            447390,
            447393,
            447421,
            447424,
            447425,
            447440,
            447445,
            447450,
            447454,
            447472,
            447474,
            447477,
            447502,
            447506
         ],
         "conntime" : 1512986330,
         "lastsend" : 1513037642,
         "addrlocal" : "52.25.234.236:45684",
         "timeoffset" : 4,
         "banscore" : 0,
         "id" : 23,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:45684",
         "pingtime" : 64.543608,
         "pingwait" : 166.024838,
         "addr" : "63.98.230.187:8333",
         "synced_blocks" : 447371,
         "minping" : 0.057939,
         "whitelisted" : false,
         "bytesrecv_per_msg" : {
            "addr" : 53867,
            "version" : 126,
            "verack" : 24,
            "ping" : 11360,
            "feefilter" : 1312,
            "inv" : 9062707,
            "sendheaders" : 24,
            "sendcmpct" : 66,
            "pong" : 11328,
            "block" : 11967232919,
            "headers" : 10282
         }
      },
      {
         "lastsend" : 1513037646,
         "addrlocal" : "52.25.234.236:40154",
         "banscore" : 0,
         "timeoffset" : -1,
         "id" : 44,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:40154",
         "pingtime" : 94.301755,
         "pingwait" : 42.308469,
         "minping" : 0.196677,
         "synced_blocks" : 447373,
         "addr" : "85.228.207.132:8333",
         "whitelisted" : false,
         "bytesrecv_per_msg" : {
            "feefilter" : 1344,
            "inv" : 8337114,
            "sendheaders" : 24,
            "sendcmpct" : 66,
            "pong" : 10272,
            "block" : 6766940789,
            "headers" : 9540,
            "addr" : 54762,
            "version" : 126,
            "verack" : 24,
            "ping" : 10400
         },
         "subver" : "/Satoshi:0.15.1/",
         "lastrecv" : 1513037646,
         "services" : "000000000000000d",
         "bytessent_per_msg" : {
            "sendcmpct" : 66,
            "pong" : 10400,
            "sendheaders" : 24,
            "getheaders" : 1021,
            "feefilter" : 32,
            "verack" : 24,
            "ping" : 10304,
            "version" : 126,
            "getdata" : 573702,
            "getaddr" : 24,
            "addr" : 22500
         },
         "bytesrecv" : 6775419025,
         "addnode" : false,
         "synced_headers" : 498816,
         "bytessent" : 618223,
         "inbound" : false,
         "version" : 70015,
         "startingheight" : 498727,
         "inflight" : [
            447382,
            447385,
            447404,
            447409,
            447417,
            447428,
            447432,
            447441,
            447451,
            447455,
            447458,
            447459,
            447489,
            447491,
            447494,
            447513
         ],
         "conntime" : 1512990222
      },
      {
         "subver" : "/Satoshi:0.15.1/",
         "bytesrecv" : 6685576560,
         "bytessent_per_msg" : {
            "pong" : 10624,
            "sendcmpct" : 66,
            "sendheaders" : 24,
            "getheaders" : 1021,
            "feefilter" : 32,
            "ping" : 10432,
            "verack" : 24,
            "version" : 126,
            "getdata" : 557224,
            "getaddr" : 24,
            "addr" : 21830
         },
         "services" : "000000000000000d",
         "lastrecv" : 1513037646,
         "addnode" : false,
         "synced_headers" : 498816,
         "bytessent" : 601427,
         "inbound" : false,
         "startingheight" : 498727,
         "version" : 70015,
         "conntime" : 1512990621,
         "inflight" : [
            447400,
            447405,
            447413,
            447418,
            447436,
            447442,
            447446,
            447452,
            447456,
            447466,
            447468,
            447479,
            447482,
            447486,
            447499,
            447507
         ],
         "lastsend" : 1513037645,
         "banscore" : 0,
         "timeoffset" : -2,
         "id" : 45,
         "pingtime" : 68.631405,
         "pingwait" : 163.860007,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:33264",
         "whitelisted" : false,
         "synced_blocks" : 447373,
         "minping" : 0.097276,
         "addr" : "136.32.244.141:8333",
         "bytesrecv_per_msg" : {
            "sendcmpct" : 66,
            "pong" : 10432,
            "headers" : 9540,
            "block" : 6677193363,
            "feefilter" : 1408,
            "inv" : 8281733,
            "sendheaders" : 24,
            "verack" : 24,
            "ping" : 10656,
            "addr" : 53747,
            "version" : 126
         }
      },
      {
         "synced_headers" : 498816,
         "addnode" : false,
         "lastrecv" : 1513037646,
         "services" : "000000000000000d",
         "bytessent_per_msg" : {
            "verack" : 24,
            "ping" : 8160,
            "version" : 126,
            "addr" : 17595,
            "getdata" : 286809,
            "getaddr" : 24,
            "sendcmpct" : 66,
            "pong" : 8256,
            "getheaders" : 1021,
            "sendheaders" : 24,
            "feefilter" : 32
         },
         "bytesrecv" : 3851094004,
         "subver" : "/Satoshi:0.15.0(We-Win-Jihan-GTFU)/",
         "inflight" : [
            447429,
            447433,
            447447,
            447453,
            447460,
            447469,
            447473,
            447475,
            447481,
            447483,
            447492,
            447495,
            447503,
            447509,
            447511,
            447514
         ],
         "conntime" : 1512998712,
         "startingheight" : 498746,
         "version" : 70015,
         "bytessent" : 322137,
         "inbound" : false,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:46110",
         "pingtime" : 107.328508,
         "pingwait" : 100.205464,
         "id" : 58,
         "addrlocal" : "52.25.234.236:46110",
         "timeoffset" : 0,
         "banscore" : 0,
         "lastsend" : 1513037646,
         "bytesrecv_per_msg" : {
            "headers" : 7632,
            "block" : 3843897666,
            "pong" : 8160,
            "sendcmpct" : 66,
            "sendheaders" : 24,
            "feefilter" : 992,
            "inv" : 7060967,
            "ping" : 8288,
            "verack" : 24,
            "version" : 145,
            "addr" : 49472
         },
         "synced_blocks" : 447373,
         "addr" : "82.211.31.142:8333",
         "minping" : 0.159687,
         "whitelisted" : false
      },
      {
         "subver" : "/Satoshi:0.15.1/",
         "lastrecv" : 1513037646,
         "bytessent_per_msg" : {
            "version" : 126,
            "getdata" : 55501,
            "addr" : 2215,
            "getaddr" : 24,
            "verack" : 24,
            "ping" : 1728,
            "sendheaders" : 24,
            "getheaders" : 1021,
            "feefilter" : 32,
            "sendcmpct" : 66,
            "pong" : 1728
         },
         "bytesrecv" : 813909338,
         "services" : "000000000000000d",
         "addnode" : false,
         "synced_headers" : 498816,
         "inbound" : false,
         "bytessent" : 62489,
         "version" : 70015,
         "startingheight" : 498804,
         "inflight" : [
            447401,
            447406,
            447411,
            447414,
            447419,
            447422,
            447426,
            447430,
            447437,
            447443,
            447448,
            447463,
            447497,
            447508,
            447510,
            447515
         ],
         "conntime" : 1513028426,
         "lastsend" : 1513037646,
         "addrlocal" : "52.25.234.236:60062",
         "timeoffset" : -21,
         "banscore" : 0,
         "id" : 88,
         "relaytxes" : true,
         "addrbind" : "172.31.1.11:60062",
         "pingwait" : 165.41456,
         "pingtime" : 148.196887,
         "synced_blocks" : 447373,
         "minping" : 0.13941,
         "addr" : "47.42.47.206:8333",
         "whitelisted" : false,
         "bytesrecv_per_msg" : {
            "verack" : 24,
            "ping" : 1728,
            "addr" : 35242,
            "version" : 126,
            "sendcmpct" : 66,
            "headers" : 1378,
            "pong" : 1696,
            "block" : 811726181,
            "inv" : 1426179,
            "feefilter" : 160,
            "sendheaders" : 24
         }
      }
   ],
   "error" : null,
   "id" : "curltest"
}

!curl --user randomstring1324566:randompassword98749589857829287494  --data-binary \
    '{"jsonrpc":"1.0", "id":"curltest", "method":"getblock", \
    "params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"] }' \
    -H 'content-type: text/plain;' http://172.31.1.11:8332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   237  100    98  100   139     94    134  0:00:01  0:00:01 --:--:--   134
{
   "result" : null,
   "error" : {
      "code" : -1,
      "message" : "Block not available (pruned data)"
   },
   "id" : "curltest"
}