aeternity / aepp-sdk-go

Golang SDK to interact with the Æternity blockchain
ISC License
18 stars 10 forks source link

Build a function to identify the protocol used by the node using /v2/status endpoint #73

Closed noandrea closed 5 years ago

noandrea commented 5 years ago

the status edpoint replies with something like:

   "difficulty":148788676,
   "genesis_key_block_hash":"kh_QtvT2ZfyWtjQgRLPyBDufu1T6hYpEHQkF6Qy6ztjZAiJHvubg",
   "listening":true,
   "network_id":"ae_devnet",
   "node_revision":"c2b07df5de392ade773a8948051c3b6ec5c90b68",
   "node_version":"3.0.0-rc.1",
   "peer_count":0,
   "pending_transactions_count":0,
   "protocols":[
      {
         "effective_at_height":2,
         "version":3
      },
      {
         "effective_at_height":1,
         "version":2
      },
      {
         "effective_at_height":0,
         "version":1
      }
   ],
   "solutions":0,
   "sync_progress":100.0,
   "syncing":false
}

using the current height it is possible to identify the protocol used by the node