0.11.0 • Published 4 years ago

@erebos/rpc-node v0.11.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

rpc-node

rpc-request or rpc-stream factory with automatic transport selection.

Installation

yarn add @erebos/rpc-node

Usage

import nodeRPC from '@erebos/rpc-node'

const rpcOverHTTP = nodeRPC('http://localhost') // RequestRPC using HTTP transport
const rpcOverWS = nodeRPC('ws://localhost') // StreamRPC using WebSocket transport
const rpcOverIPC = nodeRPC('/path/to/socket') // StreamRPC using ICP transport

API

nodeRPC()

Arguments

  1. endpoint: string: socket path, HTTP or WebSocket URL to connect to.

Returns RequestRPC (with HTTP endpoint) or StreamRPC (with IPC or WebSocket endpoint).

License

MIT