mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
Portal JSON-RPC API fixes (#1511)
This commit is contained in:
parent
633f135c72
commit
249cabd64e
@ -98,31 +98,6 @@ proc installDiscoveryApiHandlers*(rpcServer: RpcServer|RpcProxy,
|
||||
else:
|
||||
raise newException(ValueError, "Record not found in DHT lookup.")
|
||||
|
||||
# Note:
|
||||
# These are difficult to support in our current discv5 implementation and it
|
||||
# should be proven first that they are deemed useful before implementing them.
|
||||
rpcServer.rpc("discv5_sendPing") do(enr: Record) -> string:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_sendPong") do(enr: Record, requestId: string) -> bool:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_sendFindNode") do(
|
||||
enr: Record, distances: seq[uint16]) -> string:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_sendNodes") do(
|
||||
enr: Record, nodes: seq[Record], requestId: string) -> uint8:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_sendTalkRequest") do(
|
||||
enr: Record, protocolId: string, payload: string) -> string:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_sendTalkResponse") do(
|
||||
enr: Record, payload: string, requestId: string) -> bool:
|
||||
raise newException(ValueError, "This JSON-RPC is not supported")
|
||||
|
||||
rpcServer.rpc("discv5_ping") do(enr: Record) -> PongResponse:
|
||||
let
|
||||
node = toNodeWithAddress(enr)
|
||||
|
@ -195,9 +195,9 @@ proc installPortalApiHandlers*(
|
||||
raise newException(ValueError, "Invalid content key")
|
||||
|
||||
contentResult = (await p.contentLookup(key, contentId)).valueOr:
|
||||
raise newException(ValueError, "Content not found")
|
||||
return "0x"
|
||||
|
||||
return contentResult.content.toHex()
|
||||
return "0x" & contentResult.content.toHex()
|
||||
|
||||
rpcServer.rpc("portal_" & network & "Store") do(
|
||||
contentKey: string, contentValue: string) -> bool:
|
||||
@ -219,9 +219,9 @@ proc installPortalApiHandlers*(
|
||||
|
||||
let contentResult = p.dbGet(key, contentId)
|
||||
if contentResult.isOk():
|
||||
return contentResult.get().toHex()
|
||||
return "0x" & contentResult.get().toHex()
|
||||
else:
|
||||
return "0x0"
|
||||
return "0x"
|
||||
|
||||
rpcServer.rpc("portal_" & network & "Gossip") do(
|
||||
contentKey: string, contentValue: string) -> int:
|
||||
|
Loading…
x
Reference in New Issue
Block a user