Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Latest commit

 

History

History

rpc-node

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

rpc-node

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

Installation

yarn add @mainframe/rpc-node

Usage

import nodeRPC from '@mainframe/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