2024-03-13 15:58:50 +00:00
|
|
|
# fluffy
|
2024-01-13 01:41:57 +00:00
|
|
|
# Copyright (c) 2021-2024 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2024-03-13 15:58:50 +00:00
|
|
|
{.push raises: [].}
|
2021-11-24 07:45:55 +00:00
|
|
|
|
2024-03-13 15:58:50 +00:00
|
|
|
import std/json, json_rpc/rpcclient, ../rpc_types
|
2023-03-17 09:19:17 +00:00
|
|
|
|
2024-03-13 15:58:50 +00:00
|
|
|
export rpc_types
|
|
|
|
|
|
|
|
createRpcSigsFromNim(RpcClient):
|
|
|
|
## Portal State Network json-rpc calls
|
|
|
|
proc portal_stateNodeInfo(): NodeInfo
|
|
|
|
proc portal_stateRoutingTableInfo(): RoutingTableInfo
|
|
|
|
proc portal_stateAddEnr(enr: Record): bool
|
|
|
|
proc portal_stateAddEnrs(enrs: seq[Record]): bool
|
|
|
|
proc portal_stateGetEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_stateDeleteEnr(nodeId: NodeId): bool
|
|
|
|
proc portal_stateLookupEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_statePing(enr: Record): PingResult
|
|
|
|
proc portal_stateFindNodes(enr: Record): seq[Record]
|
|
|
|
proc portal_stateFindContent(enr: Record, contentKey: string): JsonNode
|
|
|
|
proc portal_stateOffer(enr: Record, contentKey: string, contentValue: string): string
|
|
|
|
proc portal_stateRecursiveFindNodes(nodeId: NodeId): seq[Record]
|
2024-03-26 21:27:31 +00:00
|
|
|
proc portal_stateRecursiveFindContent(contentKey: string): ContentInfo
|
2024-03-13 15:58:50 +00:00
|
|
|
proc portal_stateStore(contentKey: string, contentValue: string): bool
|
|
|
|
proc portal_stateLocalContent(contentKey: string): string
|
|
|
|
proc portal_stateGossip(contentKey: string, contentValue: string): int
|
|
|
|
|
|
|
|
## Portal History Network json-rpc calls
|
|
|
|
proc portal_historyNodeInfo(): NodeInfo
|
|
|
|
proc portal_historyRoutingTableInfo(): RoutingTableInfo
|
|
|
|
proc portal_historyAddEnr(enr: Record): bool
|
|
|
|
proc portal_historyAddEnrs(enrs: seq[Record]): bool
|
|
|
|
proc portal_historyGetEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_historyDeleteEnr(nodeId: NodeId): bool
|
|
|
|
proc portal_historyLookupEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_historyPing(enr: Record): PingResult
|
|
|
|
proc portal_historyFindNodes(enr: Record): seq[Record]
|
|
|
|
proc portal_historyFindContent(enr: Record, contentKey: string): JsonNode
|
|
|
|
proc portal_historyOffer(
|
|
|
|
enr: Record, contentKey: string, contentValue: string
|
|
|
|
): string
|
|
|
|
|
|
|
|
proc portal_historyRecursiveFindNodes(nodeId: NodeId): seq[Record]
|
2024-03-26 21:27:31 +00:00
|
|
|
proc portal_historyRecursiveFindContent(contentKey: string): ContentInfo
|
2024-03-13 15:58:50 +00:00
|
|
|
proc portal_historyStore(contentKey: string, contentValue: string): bool
|
|
|
|
proc portal_historyLocalContent(contentKey: string): string
|
|
|
|
proc portal_historyGossip(contentKey: string, contentValue: string): int
|
|
|
|
|
|
|
|
## Portal Beacon Light Client Network json-rpc calls
|
|
|
|
proc portal_beaconNodeInfo(): NodeInfo
|
|
|
|
proc portal_beaconRoutingTableInfo(): RoutingTableInfo
|
|
|
|
proc portal_beaconAddEnr(enr: Record): bool
|
|
|
|
proc portal_beaconAddEnrs(enrs: seq[Record]): bool
|
|
|
|
proc portal_beaconGetEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_beaconDeleteEnr(nodeId: NodeId): bool
|
|
|
|
proc portal_beaconLookupEnr(nodeId: NodeId): Record
|
|
|
|
proc portal_beaconPing(enr: Record): PingResult
|
|
|
|
proc portal_beaconFindNodes(enr: Record): seq[Record]
|
|
|
|
proc portal_beaconFindContent(enr: Record, contentKey: string): JsonNode
|
|
|
|
proc portal_beaconOffer(enr: Record, contentKey: string, contentValue: string): string
|
|
|
|
proc portal_beaconRecursiveFindNodes(nodeId: NodeId): seq[Record]
|
2024-03-26 21:27:31 +00:00
|
|
|
proc portal_beaconRecursiveFindContent(contentKey: string): ContentInfo
|
2024-03-13 15:58:50 +00:00
|
|
|
proc portal_beaconStore(contentKey: string, contentValue: string): bool
|
|
|
|
proc portal_beaconLocalContent(contentKey: string): string
|
|
|
|
proc portal_beaconGossip(contentKey: string, contentValue: string): int
|
|
|
|
proc portal_beaconRandomGossip(contentKey: string, contentValue: string): int
|