Coder Social home page Coder Social logo

go-tezos's People

Contributors

carte7000 avatar e-asphyx avatar jevonearth avatar juliusv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-tezos's Issues

Get balance for contract address

Implement a method to fetch the balance for a "contract" or "pkh".

Pay attention to data encoding, and use the appropriate decimal data type in go. Looking at http://tezos.gitlab.io/mainnet/tutorials/data_encoding.html might be helpful.

RPC documentation:

http://tezos.gitlab.io/mainnet/api/rpc.html#get-block-id-context-contracts-contract-id-balance

curl RPC examples;

curl localhost:8732/chains/{chain_id}/blocks/{block_id}/context/delegates/{pkh}/balance

chain_id is a symbolic chain identifier, e.g. main or test, or their equivalent Base58-encoded hash, e. g. NetXzGDuYoAawjv.
block_id is a symbolic block identifier, e.g. head of genesis, or any Base58-encoded block hash, e.g.

curl -v localhost:8732/chains/main/blocks/head/context/delegates/tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5/balance

Error for querying a non existent address returns http status 500 with a json payload as follows.

[{"kind":"permanent","id":"proto.002-PsYLVpVv.context.storage_error","missing_key":["contracts","index","ed25519","8f","b5","ce","a6","2d","147c696afd9a93dbce962f4c8a9c91","balance"],"function":"get"}]

Add method for `/network/points`

A method to return all points from the node.

http://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points

  • Unit test coverage
  • GoDoc comments are complete, passes linter, and links to upstream API docs

Sample JSON output;

curl localhost:8732/network/points | jq .

[
  [
    "195.113.242.140:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "208.69.41.98:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "81.38.255.8:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "[2a01:e35:2fd5:2af0:858e:74a5:f493:c07b]:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:04:31Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:13:44Z",
      "last_miss": "2018-10-11T13:13:44Z"
    }
  ],
  [
    "35.166.214.116:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "96.239.24.223:8192",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "35.231.152.106:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "[2001:718:2:2905:842d:b64e:391e:882c]:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:03:54Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:13:07Z",
      "last_miss": "2018-10-11T13:13:07Z"
    }
  ],
  [
    "178.243.49.170:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "77.177.30.38:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "[2a05:d018:791:4602:b5c6:8740:2662:e3bd]:9732",
    {
      "trusted": true,
      "greylisted_until": "2018-10-11T14:00:32Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:09:45Z",
      "last_miss": "2018-10-11T13:09:45Z"
    }
  ],
  [
    "100.38.91.219:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "216.232.49.35:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "66.166.238.179:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "147.32.151.224:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "34.230.42.251:19732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "119.137.52.251:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "162.243.168.138:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "117.111.13.129:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "216.165.95.150:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "77.225.99.178:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "[2a05:d018:791:4603:3938:ca03:a3a:1a7e]:9732",
    {
      "trusted": true,
      "greylisted_until": "2018-10-11T14:00:32Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:09:45Z",
      "last_miss": "2018-10-11T13:09:45Z"
    }
  ],
  [
    "95.91.244.233:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:04:53Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:14:06Z",
      "last_miss": "2018-10-11T13:14:06Z"
    }
  ],
  [
    "158.195.144.77:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:03:44Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:12:57Z",
      "last_miss": "2018-10-11T13:12:57Z"
    }
  ],
  [
    "88.10.236.75:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "35.196.153.188:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "77.178.251.173:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "95.179.141.14:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "68.46.114.126:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "35.180.92.97:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ],
  [
    "147.32.79.109:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:08:10Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:17:23Z",
      "last_miss": "2018-10-11T13:17:23Z"
    }
  ],
  [
    "95.216.22.218:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T13:28:34Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:27:48Z",
      "last_established_connection": [
        "idreJhptM63bo94MG2wZcbMtqSPJfv",
        "2018-10-11T13:21:21Z"
      ],
      "last_disconnection": [
        "idreJhptM63bo94MG2wZcbMtqSPJfv",
        "2018-10-11T13:21:44Z"
      ],
      "last_seen": [
        "idreJhptM63bo94MG2wZcbMtqSPJfv",
        "2018-10-11T13:21:44Z"
      ],
      "last_miss": "2018-10-11T13:27:48Z"
    }
  ],
  [
    "103.47.46.65:9732",
    {
      "trusted": false,
      "greylisted_until": "2018-10-11T14:12:23Z",
      "state": {
        "event_kind": "disconnected"
      },
      "last_failed_connection": "2018-10-11T13:21:36Z",
      "last_miss": "2018-10-11T13:21:36Z"
    }
  ]
]

Get method for mempool

Get method to get contents of mempool

/chains/<chain_id>/mempool

<chain_id> is typically main or test

{
  "applied": [
    {
      "hash": "op2sxKn5meBKEwfQFbojM3yyx9QLpV1dxYsRho6Fu4NKmQ3DSPs",
      "branch": "BL1wRomo8YyD4HjFda6yrov3MJkMEkrmuKLdpQ8SfVps22LRbnt",
      "contents": [
        {
          "kind": "endorsement",
          "level": 161114
        }
      ],
      "signature": "sigwGfK8A5idjVtMrVFG4kif2EZnmPyLTsdffKYAm9Ud2tyea8pPcRF94fkokiVtWChpKkqR9NDJ95T3w6DeXAFUxs2PwskX"
    }
  ],
  "refused": [],
  "branch_refused": [],
  "branch_delayed": [
    [
      "opHj5btdc344e8sD2dnWN25jtTkWKvPkUFFaiXSbCKuHMmiWeBg",
      {
        "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
        "branch": "BLeNzM78QYTyt1UDHzi5AMFA6YMsTiSQakoB2cdrg9hB5qZbrj9",
        "contents": [
          {
            "kind": "endorsement",
            "level": 161076
          }
        ],
        "signature": "sigpqTRHDhcfy4Q5D52CqTGY6PSt4bYRQPRZs5A67PuQqsoDvdFbv5Kh59yrmAHwg254yR9VijwCQaxmPTp9cZCGyPfVCF8G",
        "error": [
          {
            "kind": "temporary",
            "id": "proto.002-PsYLVpVv.operation.wrong_endorsement_predecessor",
            "expected": "BL1wRomo8YyD4HjFda6yrov3MJkMEkrmuKLdpQ8SfVps22LRbnt",
            "provided": "BLeNzM78QYTyt1UDHzi5AMFA6YMsTiSQakoB2cdrg9hB5qZbrj9"
          }
        ]
      }
    ],
    [
      "opZmp7ogsWuVtjDEK7yHkqyCA3AxfyLoB7qUjKMjwAapVJEbbFs",
      {
        "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
        "branch": "BMepDQZmPfhywCWGDz3sVjeAgComVGiU6ePEkFWjAyLgfdw2p1u",
        "contents": [
          {
            "kind": "endorsement",
            "level": 161071
          }
        ],
        "signature": "sighfnzzfJFTMV2S6bxsSXz3ozFqDPuEY8fKE2EChxAyEQFsuCzatzDF9gnfytk27GYfUgVLA65jwELjEAPRyibdZ1iTrFFi",
        "error": [
          {
            "kind": "temporary",
            "id": "proto.002-PsYLVpVv.operation.wrong_endorsement_predecessor",
            "expected": "BL1wRomo8YyD4HjFda6yrov3MJkMEkrmuKLdpQ8SfVps22LRbnt",
            "provided": "BMepDQZmPfhywCWGDz3sVjeAgComVGiU6ePEkFWjAyLgfdw2p1u"
          }
        ]
      }
    ]
  ],
  "unprocessed": []
}

Add method for `/network/peers`

RPC method: http://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers

  • Unit test coverage
  • GoDoc comments are complete, passes linter, and links to upstream API docs

Example json taken from alphanet;

curl -s localhost:8732/network/peers | jq .

[
  [
    "idsXeq1zboupwXXDdDDiWhBjimeJe3",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      },
      "last_established_connection": [
        {
          "addr": "::ffff:104.155.17.238",
          "port": 9732
        },
        "2018-10-11T13:03:12Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:104.155.17.238",
          "port": 9732
        },
        "2018-10-11T13:05:06Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:104.155.17.238",
          "port": 9732
        },
        "2018-10-11T13:05:06Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:104.155.17.238",
          "port": 9732
        },
        "2018-10-11T13:05:06Z"
      ]
    }
  ],
  [
    "idtZsSTZjDe82mxjEu5PCxTJa66TBr",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:34.249.109.84",
        "port": 9732
      },
      "stat": {
        "total_sent": "2041894",
        "total_recv": "10738581",
        "current_inflow": 309,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:34.249.109.84",
          "port": 9732
        },
        "2018-10-11T10:33:22Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:34.249.109.84",
          "port": 9732
        },
        "2018-10-11T10:32:10Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:34.249.109.84",
          "port": 9732
        },
        "2018-10-11T10:33:22Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:34.249.109.84",
          "port": 9732
        },
        "2018-10-11T10:32:10Z"
      ]
    }
  ],
  [
    "idsd3pxzs1LnCaA3HejFgUVbniQgiY",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:45.56.64.171",
        "port": 9732
      },
      "stat": {
        "total_sent": "15024",
        "total_recv": "21029",
        "current_inflow": 333,
        "current_outflow": 41
      },
      "last_established_connection": [
        {
          "addr": "::ffff:45.56.64.171",
          "port": 9732
        },
        "2018-10-11T13:20:45Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:45.56.64.171",
          "port": 9732
        },
        "2018-10-11T13:18:44Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:45.56.64.171",
          "port": 9732
        },
        "2018-10-11T13:20:45Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:45.56.64.171",
          "port": 9732
        },
        "2018-10-11T13:18:44Z"
      ]
    }
  ],
  [
    "idqzZWysSBakFFXgVTTodc75vRSntM",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      },
      "last_established_connection": [
        {
          "addr": "::ffff:46.101.164.28",
          "port": 9732
        },
        "2018-10-11T13:17:08Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:46.101.164.28",
          "port": 9732
        },
        "2018-10-11T13:19:06Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:46.101.164.28",
          "port": 9732
        },
        "2018-10-11T13:19:06Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:46.101.164.28",
          "port": 9732
        },
        "2018-10-11T13:19:06Z"
      ]
    }
  ],
  [
    "idswViYTeuM4yEU3gbpjepTo3svjju",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      }
    }
  ],
  [
    "idtf8JcEoaGbpbzcrVGjmnMj8fHdDJ",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:23.253.218.136",
        "port": 9732
      },
      "stat": {
        "total_sent": "7385408",
        "total_recv": "36729688",
        "current_inflow": 304,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:23.253.218.136",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:23.253.218.136",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idt5zodzH9Lf7fC18teKVLkVaRuFbw",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:165.227.58.23",
        "port": 9732
      },
      "stat": {
        "total_sent": "8225951",
        "total_recv": "41173629",
        "current_inflow": 280,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:165.227.58.23",
          "port": 9732
        },
        "2018-10-11T08:21:15Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:165.227.58.23",
          "port": 9732
        },
        "2018-10-11T08:21:15Z"
      ]
    }
  ],
  [
    "idt8kLsEKddRBgjychUmdPCtNKE4tz",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:159.203.4.80",
        "port": 9732
      },
      "stat": {
        "total_sent": "7659318",
        "total_recv": "39909762",
        "current_inflow": 281,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:159.203.4.80",
          "port": 9732
        },
        "2018-10-11T08:21:15Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:159.203.4.80",
          "port": 9732
        },
        "2018-10-11T08:21:15Z"
      ]
    }
  ],
  [
    "idtrec2dhz3UssfG1RPnwk4osUeMxg",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:35.194.235.75",
        "port": 9732
      },
      "stat": {
        "total_sent": "6140519",
        "total_recv": "30419660",
        "current_inflow": 288,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:35.194.235.75",
          "port": 9732
        },
        "2018-10-11T08:20:25Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:35.194.235.75",
          "port": 9732
        },
        "2018-10-11T08:20:25Z"
      ]
    }
  ],
  [
    "idsaJzUjfw7bQ3pCJbcVmTdWG9PAJD",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      },
      "last_established_connection": [
        {
          "addr": "::ffff:167.99.228.4",
          "port": 9732
        },
        "2018-10-11T12:46:50Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:167.99.228.4",
          "port": 9732
        },
        "2018-10-11T12:48:46Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:167.99.228.4",
          "port": 9732
        },
        "2018-10-11T12:48:46Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:167.99.228.4",
          "port": 9732
        },
        "2018-10-11T12:48:46Z"
      ]
    }
  ],
  [
    "idscXPuYVi3wny9NmSfcSxL5SMQLJf",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:34.255.45.149",
        "port": 9732
      },
      "stat": {
        "total_sent": "7526817",
        "total_recv": "44465401",
        "current_inflow": 312,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:34.255.45.149",
          "port": 9732
        },
        "2018-10-11T08:20:18Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:34.255.45.149",
          "port": 9732
        },
        "2018-10-11T08:20:18Z"
      ]
    }
  ],
  [
    "idsTwANBbHaDFqPQYitc9YDN1TtUr5",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:94.23.212.216",
        "port": 9732
      },
      "stat": {
        "total_sent": "9986540",
        "total_recv": "50367149",
        "current_inflow": 295,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:94.23.212.216",
          "port": 9732
        },
        "2018-10-11T08:22:10Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:94.23.212.216",
          "port": 9732
        },
        "2018-10-11T08:22:10Z"
      ]
    }
  ],
  [
    "idssPGKH7bZXcVxvzMMVvHQLBFxMGA",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      },
      "last_established_connection": [
        {
          "addr": "::ffff:159.89.230.246",
          "port": 9732
        },
        "2018-10-11T13:13:44Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:159.89.230.246",
          "port": 9732
        },
        "2018-10-11T13:15:35Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:159.89.230.246",
          "port": 9732
        },
        "2018-10-11T13:15:35Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:159.89.230.246",
          "port": 9732
        },
        "2018-10-11T13:15:35Z"
      ]
    }
  ],
  [
    "idtcDVHfiJ8mipqJxxz4pnVMGw4tZK",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:188.166.120.181",
        "port": 9732
      },
      "stat": {
        "total_sent": "8059985",
        "total_recv": "41052473",
        "current_inflow": 404,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:188.166.120.181",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:188.166.120.181",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idtEfMQqYpAYrhxuAySfDA45XC4xiy",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:70.27.61.202",
        "port": 9732
      },
      "stat": {
        "total_sent": "8346253",
        "total_recv": "42458933",
        "current_inflow": 275,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:70.27.61.202",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:70.27.61.202",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idqZ5aT6VeZ3MeScLEohxSueXxct5G",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:34.255.45.196",
        "port": 9732
      },
      "stat": {
        "total_sent": "122977",
        "total_recv": "1096522",
        "current_inflow": 309,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:34.255.45.196",
          "port": 9732
        },
        "2018-10-11T11:53:12Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:34.255.45.196",
          "port": 9732
        },
        "2018-10-11T11:51:16Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:34.255.45.196",
          "port": 9732
        },
        "2018-10-11T11:53:12Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:34.255.45.196",
          "port": 9732
        },
        "2018-10-11T11:51:16Z"
      ]
    }
  ],
  [
    "idsVdMtrNXYSpuSEbRrRb9iGCFdjKQ",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:45.56.90.73",
        "port": 9732
      },
      "stat": {
        "total_sent": "7733455",
        "total_recv": "40381841",
        "current_inflow": 306,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:45.56.90.73",
          "port": 9732
        },
        "2018-10-11T08:22:10Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:45.56.90.73",
          "port": 9732
        },
        "2018-10-11T08:22:10Z"
      ]
    }
  ],
  [
    "idr8p2VKnsN8DsTGAzWSMAnUCYaXio",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:34.253.64.43",
        "port": 9732
      },
      "stat": {
        "total_sent": "195626",
        "total_recv": "711161",
        "current_inflow": 321,
        "current_outflow": 23
      },
      "last_rejected_connection": [
        {
          "addr": "::ffff:34.253.64.43",
          "port": 9732
        },
        "2018-10-11T12:27:22Z"
      ],
      "last_established_connection": [
        {
          "addr": "::ffff:34.253.64.43",
          "port": 9732
        },
        "2018-10-11T12:27:37Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:34.253.64.43",
          "port": 9732
        },
        "2018-10-11T12:25:28Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:34.253.64.43",
          "port": 9732
        },
        "2018-10-11T12:27:37Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:34.253.64.43",
          "port": 9732
        },
        "2018-10-11T12:27:22Z"
      ]
    }
  ],
  [
    "idrdkREfPWWkdfqVuiDXojvRMaUNuA",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:59.106.183.32",
        "port": 9732
      },
      "stat": {
        "total_sent": "6509477",
        "total_recv": "32438482",
        "current_inflow": 283,
        "current_outflow": 18
      },
      "last_established_connection": [
        {
          "addr": "::ffff:59.106.183.32",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:59.106.183.32",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idqyoSTu9c2Ta45tiqHkHbGhHmNbKo",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:45.76.46.124",
        "port": 9732
      },
      "stat": {
        "total_sent": "7605654",
        "total_recv": "39433142",
        "current_inflow": 344,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:45.76.46.124",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:45.76.46.124",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idsJBjVXyADAuKixCbmnPNek5DtaLM",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:206.189.69.33",
        "port": 9732
      },
      "stat": {
        "total_sent": "7457627",
        "total_recv": "37574347",
        "current_inflow": 279,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:206.189.69.33",
          "port": 9732
        },
        "2018-10-11T08:21:00Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:206.189.69.33",
          "port": 9732
        },
        "2018-10-11T08:21:00Z"
      ]
    }
  ],
  [
    "idreJhptM63bo94MG2wZcbMtqSPJfv",
    {
      "score": 0,
      "trusted": false,
      "state": "disconnected",
      "stat": {
        "total_sent": "0",
        "total_recv": "0",
        "current_inflow": 0,
        "current_outflow": 0
      },
      "last_established_connection": [
        {
          "addr": "::ffff:95.216.22.218",
          "port": 9732
        },
        "2018-10-11T13:15:36Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:95.216.22.218",
          "port": 9732
        },
        "2018-10-11T13:17:06Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:95.216.22.218",
          "port": 9732
        },
        "2018-10-11T13:17:06Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:95.216.22.218",
          "port": 9732
        },
        "2018-10-11T13:17:06Z"
      ]
    }
  ],
  [
    "idrPSsREFE1MV1161ybEpaebFwgYWE",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:168.63.27.15",
        "port": 9732
      },
      "stat": {
        "total_sent": "7680643",
        "total_recv": "39160353",
        "current_inflow": 290,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:168.63.27.15",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:168.63.27.15",
          "port": 9732
        },
        "2018-10-11T08:20:24Z"
      ]
    }
  ],
  [
    "idqj42tAbPHa5pdLqD2yRbso8xwFu5",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:51.255.34.46",
        "port": 9732
      },
      "stat": {
        "total_sent": "10194906",
        "total_recv": "51137365",
        "current_inflow": 304,
        "current_outflow": 15
      },
      "last_established_connection": [
        {
          "addr": "::ffff:51.255.34.46",
          "port": 9732
        },
        "2018-10-11T08:21:00Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:51.255.34.46",
          "port": 9732
        },
        "2018-10-11T08:21:00Z"
      ]
    }
  ],
  [
    "idqYQiZpiX2qfBoURyMMdvVWCWZCy2",
    {
      "score": 0,
      "trusted": false,
      "conn_metadata": {
        "disable_mempool": false,
        "private_node": false
      },
      "state": "running",
      "reachable_at": {
        "addr": "::ffff:52.50.125.15",
        "port": 9732
      },
      "stat": {
        "total_sent": "113596",
        "total_recv": "973473",
        "current_inflow": 328,
        "current_outflow": 18
      },
      "last_established_connection": [
        {
          "addr": "::ffff:52.50.125.15",
          "port": 9732
        },
        "2018-10-11T12:03:17Z"
      ],
      "last_disconnection": [
        {
          "addr": "::ffff:52.50.125.15",
          "port": 9732
        },
        "2018-10-11T12:02:13Z"
      ],
      "last_seen": [
        {
          "addr": "::ffff:52.50.125.15",
          "port": 9732
        },
        "2018-10-11T12:03:17Z"
      ],
      "last_miss": [
        {
          "addr": "::ffff:52.50.125.15",
          "port": 9732
        },
        "2018-10-11T12:02:13Z"
      ]
    }
  ]
]

Key generation

This is a placeholder issue related to key generation.

As part of the CII Best Practices which this project is enrolled in, it provides the following requirements around key generation. I have set this to "N/A" in our projects checklist, but this should be updated after this issue has been implemented.

The security mechanisms within the software produced by the project MUST generate all cryptographic keys and nonces using a cryptographically secure random number generator, and MUST NOT do so using generators that are cryptographically insecure. [crypto_random]
A cryptographically secure random number generator may be a hardware random number generator, or it may be a cryptographically secure pseudo-random number generator (CSPRNG) using an algorithm such as Hash_DRBG, HMAC_DRBG, CTR_DRBG, Yarrow, or Fortuna. Examples of calls to secure random number generators include Java's java.security.SecureRandom and JavaScript's window.crypto.getRandomValues. Examples of calls to insecure random number generators include Java's java.util.Random and JavaScript's Math.random.

Method for `bootstrapped` RPC

The RPC localhost:8732/monitor/bootstrapped indicates if the node is "bootstrapped", or in other terms, it has syned the entire chain. Implement a method for callers to access this data.

The return payload looks like:

{"block":"BLZPJiiCBRyCEaZpwXYKsBBne98YBJRLpo5B5pfWYKKZVtTvLuG","timestamp":"2018-10-13T13:29:42Z"}
  • Unit test coverage
  • GoDoc comments are complete, passes linter, and links to upstream API docs

Add support for fetching `/network/connections`

Add support for fetching active connections from the tezos node.

To fetch data from a node running locally, one can use curl;
curl -s localhost:8732/network/connections |jq .

  • Implement GetConnections method
  • [/] Add integration test
  • ensure godoc comments are readable and useful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.