[#418] netmap: Support NetmapService.NetmapSnapshot RPC

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-09-17 13:59:54 +04:00 committed by LeL
parent f3e1f8ae7a
commit cf868188ef
36 changed files with 1139 additions and 197 deletions

View file

@ -11,6 +11,7 @@ const serviceNetmap = serviceNamePrefix + "netmap.NetmapService"
const (
rpcNetmapNodeInfo = "LocalNodeInfo"
rpcNetmapNetInfo = "NetworkInfo"
rpcNetmapSnapshot = "NetmapSnapshot"
)
// LocalNodeInfo executes NetmapService.LocalNodeInfo RPC.
@ -44,3 +45,19 @@ func NetworkInfo(
return resp, nil
}
// NetMapSnapshot executes NetmapService.NetmapSnapshot RPC.
func NetMapSnapshot(
cli *client.Client,
req *netmap.SnapshotRequest,
opts ...client.CallOption,
) (*netmap.SnapshotResponse, error) {
resp := new(netmap.SnapshotResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapSnapshot), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}