public PeerResult GetPeers(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_peers"; var peers = HttpRequestHelper.Request <JsonRpcResult <PeerResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/net", jsonRpcArg); return(peers.Result); }
public async Task <bool> IsForked(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "node_isforked"; var state = await HttpRequestHelper.Request <JsonRpcResult <NodeStateResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(state.Result.IsForked); }
public PoolStateResult GetPoolState(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_pool_state"; var state = HttpRequestHelper.Request <JsonRpcResult <PoolStateResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/net", jsonRpcArg); return(state.Result); }
public async Task <bool> IsAlive(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "dpos_isalive"; var state = await HttpRequestHelper.Request <JsonRpcResult <DposStateResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(state.Result.IsAlive); }
private async Task <ulong> GetCurrentChainHeight(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_block_height"; var height = await HttpRequestHelper.Request <JsonRpcResult <ChainHeightResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(Convert.ToUInt64(height.Result.Result.ChainHeight)); }
private async Task <int> GetRollBackTimes(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_rollback_times"; var state = await HttpRequestHelper.Request <JsonRpcResult <RollBackResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(state.Result.RollBackTimes); }
public ulong GetPoolSize(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_txpool_size"; var state = HttpRequestHelper.Request <JsonRpcResult <TxPoolSizeResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(state.Result.CurrentTransactionPoolSize); }
private async Task <int> GetInvalidBlockCount(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "get_invalid_block"; var state = await HttpRequestHelper.Request <JsonRpcResult <InvalidBlockResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(state.Result.InvalidBlockCount); }
public async Task <List <ActorStateResult> > GetState(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "akkastate"; var state = await HttpRequestHelper.Request <JsonRpcResult <List <ActorStateResult> > >(ServiceUrlHelper.GetMonitorRpcAddress(chainId), jsonRpcArg); return(state.Result); }
// public async Task<PoolStateResult> GetPoolState(string chainId) // { // var jsonRpcArg = new JsonRpcArg(); // jsonRpcArg.Method = "get_pool_state"; // // var state = await HttpRequestHelper.Request<JsonRpcResult<PoolStateResult>>( // _managementOptions.ServiceUrls[chainId].RpcAddress + "/net", jsonRpcArg); // // return state.Result; // } public async Task <PeerResult> GetPeers(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "GetPeers"; var peers = await HttpRequestHelper.Request <JsonRpcResult <PeerResult> >( _managementOptions.ServiceUrls[chainId].RpcAddress + "/net", jsonRpcArg); return(peers.Result); }
public async Task <List <ActorStateResult> > GetState(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "AkkaState"; var state = await HttpRequestHelper.Request <JsonRpcResult <List <ActorStateResult> > >(_managementOptions .ServiceUrls[chainId].MonitorRpcAddress, jsonRpcArg); return(state.Result); }
public async Task <bool> IsForked(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "GetNodeStatus"; var state = await HttpRequestHelper.Request <JsonRpcResult <NodeStateResult> >( _managementOptions.ServiceUrls[chainId].RpcAddress + "/chain", jsonRpcArg); return(state.Result.IsForked); }
public async Task <int> GetPoolSize(string chainId) { var jsonRpcArg = new JsonRpcArg { Method = "GetTransactionPoolStatus" }; var state = await HttpRequestHelper.Request <JsonRpcResult <TxPoolSizeResult> >( _managementOptions.ServiceUrls[chainId].RpcAddress + "/chain", jsonRpcArg); return(state.Result.Queued); }
private async Task <ChainStatusResult> GetCurrentChainStatus(string chainId) { var jsonRpcArg = new JsonRpcArg(); jsonRpcArg.Method = "GetChainStatus"; var height = await HttpRequestHelper.Request <JsonRpcResult <ChainStatusResult> >( _managementOptions.ServiceUrls[chainId].RpcAddress + "/chain", jsonRpcArg); return(height.Result); }
private async Task <BlockInfoResult> GetBlockInfo(string chainId, ulong height) { var jsonRpcArg = new JsonRpcArg <BlockInfoArg>(); jsonRpcArg.Method = "get_block_info"; jsonRpcArg.Params = new BlockInfoArg { BlockHeight = height, IncludeTxs = false }; var blockInfo = await HttpRequestHelper.Request <JsonRpcResult <BlockInfoResult> >(ServiceUrlHelper.GetRpcAddress(chainId) + "/chain", jsonRpcArg); return(blockInfo.Result); }
private async Task <BlockInfoResult> GetBlockInfo(string chainId, long height) { var jsonRpcArg = new JsonRpcArg <BlockInfoArg>(); jsonRpcArg.Method = "GetBlockInfo"; jsonRpcArg.Params = new BlockInfoArg { BlockHeight = height, IncludeTxs = false }; var blockInfo = await HttpRequestHelper.Request <JsonRpcResult <BlockInfoResult> >( _managementOptions.ServiceUrls[chainId].RpcAddress + "/chain", jsonRpcArg); return(blockInfo.Result); }