Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }