Constructs a BaseJsonRpcServer server and returns it. Listens on localhost:8080 by default, on both IPv4 and IPv6 To listen only on IPv4, override onBeforeListening and call dns.setDefaultResultOrder('ipv4first'); To listen only on IPv6, if both IPv4 and IPv6 is enabled, just pass "localhost" to the host parameter
Optionalhost: string = "::"The IP address/hostname to listen on
Optionalport: number = CDefaultPortThe port number to listen on
BaseJsonRpcServer
ProtectedmProtectedmProtectedmProtectedmProtectedmProtectedmOnly valid when processing a request
ProtectedmOnly valid when processing a request
ProtectedmReturns the path on which to listen to requests for. Override to listen on another path.
path on which to listen to requests for
ProtectedaddRPCMethodsProtectedafterProtectedcreateCreates an Invalid Params JSON RPC Error exception, with the message as Invalid Params. The caller must throw the return of this call.
Optionaldata: anyInvalid Params JSON RPC Error exception
ProtectedcreateCreates an Invalid Params JSON RPC Error exception, with the given message. The caller must throw the return of this call.
Optionaldata: anyInvalid Params JSON RPC Error exception
ProtectedcreateCreates an Invalid Request JSON RPC Error exception, with the message as Invalid Params. The caller must throw the return of this call.
Optionaldata: anyInvalid Request JSON RPC Error exception
ProtectedcreateProtectedcreateCreates a Method not found JSON RPC Error response, with the message as Invalid Params. The caller must throw the return of this call.
Invalid Request JSON RPC Error exception
ProtecteddoProtectedhandleProtectedimplementedRPCMethodsReturns RPC methods implemented by the server Override to return an array of RPC methods implemented.
array of RPC methods implemented
ProtectedinitProtectedinitInitializes the JSON RPC server and returns it
ProtectedinitProtectedJsonProtectedlogProtectedlogDisplays the JSON RPC methods being listened to
ProtectedonCalled before every valid JSON body is dispatched, this doesn't mean that the request is a valid JSON RPC call though. If the request is valid, the method should call next(request, serverParams) and return its result. If the request is invalid, it should throw an appropriate error.
ProtectedonProtectedonCalled when there's a parsing error. The overridden method should create a JSON RPC Error response and send it using response.send(err_response) If the error is not handled, this class will return an error
ProtectedsendProtectedsendProtectedstopProtectedwaitProtectedwait
This is a JSON RPC server that conforms to the JSON RPC 2.0 spec as documented at https://www.jsonrpc.org/specification
BaseJsonRpcServer