createNode( [options] )
Creates a new Node.
Arguments
[options] Object
-
serialize
functionBy default isJSON.stringify -
deserialize
functionBy default isJSON.parse -
rpcFilter
functionCan be used to block or manipulate the rpc that is going to be created.
Returns Object
A new Node instance.
Example
import { createNode } from 'dop' const node = createNode({ serialize: JSON.stringify, deserialize: JSON.parse, rpcFilter: ({ rpc }) => rpc, })