ptokens-node-selector
v0.15.0
Published
repo holding the code for selecting validator nodes
Downloads
104
Readme
ptokens-node-selector
Module for selecting a validator node
Installation:
npm install ptokens-node-selector
Usage:
import { NodeSelector } from 'ptokens-node-selector'
import { HttpProvider } from 'ptokens-providers'
import { Node } from 'ptokens-node'
const nodeSelector = new NodeSelector({
pToken: 'pToken name',
blockchain: 'ETH', //or EOS
network: 'testnet', //'testnet' or 'mainnet', default 'testnet'
//if you want to be more detailed
hostBlockchain: 'ETH',
hostNetwork: 'testnet_ropsten',
nativeBlockchain: 'BTC'
nativeNetwork: 'testnet'
// optionals
defaultNode: new Node({
pToken: 'pBTC',
blockchain: 'ETH',
provider: new HttpProvider(
'node endpoint',
{
'Access-Control-Allow-Origin': '*',
...
}
)
})
})