ビットコイン・ネットワークノード接続

vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoin-cli getconnectioncount
error: Could not connect to the server 127.0.0.1:8332

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoind -daemon
Bitcoin server starting
vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoin-cli getconnectioncount
6

接続しているpeerの情報も見れる。
vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoin-cli getpeerinfo
[
{
“id”: 0,
“addr”: “82.195.237.253:8333”,
“addrlocal”: “106.154.137.22:64472”,
“addrbind”: “10.0.2.15:37006”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 1002038,
“bytesrecv”: 113691047,
“conntime”: 1572482645,
“timeoffset”: 0,
“pingtime”: 0.359843,
“minping”: 0.359843,
“version”: 70015,
“subver”: “/Satoshi:0.18.0/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601714,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40376,
“inflight”: [
40404,
40411,
40416,
40447,
40451,
40463,
40464,
40465,
40466,
40472,
40480,
40485,
40499,
40519,
40523,
40524
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 55,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 304889,
“getheaders”: 696606,
“ping”: 96,
“pong”: 96,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30247,
“block”: 1261801,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 112377726,
“inv”: 19756,
“ping”: 96,
“pong”: 96,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
},
{
“id”: 7,
“addr”: “70.123.51.122:8333”,
“addrlocal”: “106.154.137.22:64482”,
“addrbind”: “10.0.2.15:45234”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 470175,
“bytesrecv”: 18568584,
“conntime”: 1572482661,
“timeoffset”: 0,
“pingtime”: 0.248508,
“minping”: 0.248508,
“version”: 70015,
“subver”: “/Satoshi:0.18.1/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601715,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40390,
“inflight”: [
40448,
40452,
40455,
40457,
40458,
40459,
40460,
40462,
40491,
40494,
40544,
40546,
40547,
40548,
40549,
40555
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 110,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 360103,
“getheaders”: 109474,
“ping”: 96,
“pong”: 96,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30137,
“block”: 1515686,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 16989937,
“inv”: 31307,
“ping”: 96,
“pong”: 96,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
},
{
“id”: 9,
“addr”: “188.194.53.187:8333”,
“addrlocal”: “106.154.137.22:64485”,
“addrbind”: “10.0.2.15:57228”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 295793,
“bytesrecv”: 17806963,
“conntime”: 1572482668,
“timeoffset”: 0,
“pingtime”: 0.544024,
“minping”: 0.544024,
“version”: 70015,
“subver”: “/Satoshi:0.18.0/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601715,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40393,
“inflight”: [
40421,
40449,
40453,
40481,
40513,
40536,
40539,
40541,
40545,
40550,
40551,
40552,
40553,
40554,
40566,
40569
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 55,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 185840,
“getheaders”: 109474,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30222,
“block”: 754920,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 16989937,
“inv”: 30431,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
},
{
“id”: 10,
“addr”: “34.211.159.217:8333”,
“addrlocal”: “106.154.137.22:64486”,
“addrbind”: “10.0.2.15:37076”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 600482,
“bytesrecv”: 19067437,
“conntime”: 1572482669,
“timeoffset”: 0,
“pingtime”: 0.306789,
“minping”: 0.301101,
“version”: 70015,
“subver”: “/Satoshi:0.17.0/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601715,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40387,
“inflight”: [
40473,
40482,
40486,
40511,
40512,
40514,
40515,
40520,
40525,
40526,
40529,
40531,
40533,
40534,
40535,
40537
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 110,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 490474,
“getheaders”: 109474,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30082,
“block”: 2015514,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 16989937,
“inv”: 30451,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
},
{
“id”: 11,
“addr”: “24.86.184.66:8333”,
“addrlocal”: “106.154.137.22:64526”,
“addrbind”: “10.0.2.15:33247”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 437167,
“bytesrecv”: 1929784,
“conntime”: 1572482769,
“timeoffset”: 0,
“pingtime”: 0.277844,
“minping”: 0.268512,
“version”: 70015,
“subver”: “/Satoshi:0.17.0.1/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601716,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40390,
“inflight”: [
40454,
40505,
40506,
40516,
40518,
40521,
40527,
40530,
40538,
40540,
40542,
40543,
40556,
40558,
40561,
40565
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 55,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 435635,
“getheaders”: 1053,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30137,
“block”: 1884252,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 106,
“inv”: 13834,
“ping”: 64,
“pong”: 64,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 128
}
},
{
“id”: 13,
“addr”: “99.79.135.85:8333”,
“addrlocal”: “106.154.137.22:64537”,
“addrbind”: “10.0.2.15:56065”,
“services”: “0000000000000409”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 329279,
“bytesrecv”: 1443236,
“conntime”: 1572482803,
“timeoffset”: -1,
“pingtime”: 0.4799,
“minping”: 0.4799,
“version”: 70015,
“subver”: “/Satoshi:0.18.99/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601716,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40390,
“inflight”: [
40500,
40502,
40503,
40507,
40508,
40509,
40510,
40517,
40522,
40557,
40559,
40560,
40562,
40563,
40564,
40567
],
“whitelisted”: false,
“bytessent_per_msg”: {
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 327866,
“getheaders”: 1053,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30082,
“block”: 1402751,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 106,
“inv”: 8907,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 127
}
},
{
“id”: 14,
“addr”: “144.76.136.19:8333”,
“addrlocal”: “106.154.137.22:64546”,
“addrbind”: “10.0.2.15:57609”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 185008,
“bytesrecv”: 823277,
“conntime”: 1572482832,
“timeoffset”: 0,
“pingtime”: 0.459487,
“minping”: 0.459487,
“version”: 70015,
“subver”: “/Satoshi:0.18.0/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601716,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40356,
“inflight”: [
40467,
40469,
40470,
40471,
40474,
40475,
40476,
40477,
40478,
40483,
40487,
40489,
40492,
40495,
40497,
40498
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 55,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 183540,
“getheaders”: 1053,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30082,
“block”: 784172,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 106,
“inv”: 7528,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
},
{
“id”: 15,
“addr”: “95.216.40.83:8333”,
“addrlocal”: “106.154.137.22:64547”,
“addrbind”: “10.0.2.15:57602”,
“services”: “000000000000040d”,
“relaytxes”: true,
“lastsend”: 1572482905,
“lastrecv”: 1572482905,
“bytessent”: 178267,
“bytesrecv”: 744186,
“conntime”: 1572482834,
“timeoffset”: 0,
“pingtime”: 0.407235,
“minping”: 0.407235,
“version”: 70015,
“subver”: “/Satoshi:0.18.0/”,
“inbound”: false,
“addnode”: false,
“startingheight”: 601716,
“banscore”: 0,
“synced_headers”: 601716,
“synced_blocks”: 40394,
“inflight”: [
40456,
40461,
40468,
40479,
40484,
40488,
40490,
40493,
40496,
40501,
40504,
40528,
40532,
40568,
40570
],
“whitelisted”: false,
“bytessent_per_msg”: {
“addr”: 85,
“feefilter”: 32,
“getaddr”: 24,
“getdata”: 176769,
“getheaders”: 1053,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
},
“bytesrecv_per_msg”: {
“addr”: 30167,
“block”: 705406,
“feefilter”: 32,
“getheaders”: 1053,
“headers”: 106,
“inv”: 7118,
“ping”: 32,
“pong”: 32,
“sendcmpct”: 66,
“sendheaders”: 24,
“verack”: 24,
“version”: 126
}
}
]

regtestモードで起動してブロック生成する
vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoind -regtest -daemon
Bitcoin server starting
vagrant@vagrant-ubuntu-trusty-64:~/bitcoin$ bitcoin-cli -regtest generate 1
[
“18c1e609d11c30dbec70459f8d84f51448cbe83f442553f91c438e710b3bbb12”
]