public async Task <ulong> Epoch(LocalNodeInfoRequest request, DateTime?deadline = null, CancellationToken context = default) { var resp = await NetmapClient.LocalNodeInfoAsync(request, deadline : deadline, cancellationToken : context); if (!resp.Verify()) { throw new FormatException(nameof(LocalNodeInfo) + " invalid LocalNodeInfo response"); } return(resp.MetaHeader.Epoch); }
public async Task <NodeInfo> LocalNodeInfo(LocalNodeInfoRequest request, DateTime?deadline = null, CancellationToken context = default) { var resp = await NetmapClient.LocalNodeInfoAsync(request, deadline : deadline, cancellationToken : context); if (!resp.Verify()) { throw new FormatException(nameof(LocalNodeInfo) + " invalid LocalNodeInfo response"); } CheckStatus(resp); return(resp.Body.NodeInfo); }
public async Task <ulong> Epoch(CallOptions options = null, CancellationToken context = default) { var opts = DefaultCallOptions.ApplyCustomOptions(options); CheckOptions(opts); var req = new LocalNodeInfoRequest { Body = new LocalNodeInfoRequest.Types.Body { } }; req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); return(await Epoch(req, opts.Deadline, context)); }
public NodeInfo LocalNodeInfo(CancellationToken context, CallOptions options = null) { var netmap_client = new NetmapService.NetmapServiceClient(channel); var opts = DefaultCallOptions.ApplyCustomOptions(options); var req = new LocalNodeInfoRequest { Body = new LocalNodeInfoRequest.Types.Body { } }; req.MetaHeader = opts.GetRequestMetaHeader(); req.SignRequest(key); var resp = netmap_client.LocalNodeInfo(req, cancellationToken: context); if (!resp.VerifyResponse()) { throw new FormatException(nameof(LocalNodeInfo) + " invalid LocalNodeInfo response"); } return(resp.Body.NodeInfo); }