示例#1
0
        public override async Task <NodeStatusResult> GetStatusAsync()
        {
            var rawStatusResul = await SendJsonRpc("status", new dynamic[0]);

            var result = NodeStatusResult.FromDynamicJsonObject(rawStatusResul);

            return(result);
        }
示例#2
0
        public static NodeStatusResult FromDynamicJsonObject(dynamic jsonObject)
        {
            var result = new NodeStatusResult()
            {
                ChainId  = jsonObject.chain_id,
                RpcAddr  = jsonObject.rpc_addr,
                SyncInfo = new SyncInfo()
                {
                    LatestBlockHash   = jsonObject.sync_info.latest_block_hash,
                    LatestBlockHeight = jsonObject.sync_info.latest_block_height,
                    LatestBlockTime   = jsonObject.sync_info.latest_block_time,
                    LatestStateRoot   = jsonObject.sync_info.latest_state_root,
                    Syncing           = jsonObject.sync_info.syncing
                },
                Validators = jsonObject.validators
            };

            return(result);
        }