@solar-network/peers
v3.1.2
Published
A simple TypeScript peer discovery client for the Solar Blockchain.
Downloads
4
Readme
@solar-network/peers
Installation
yarn add @solar-network/peers
Usage
Peers via GitHub
import { PeerDiscovery } from "@solar-network/peers";
peerDiscovery = await PeerDiscovery.new({
networkOrHost: "devnet"
})
peers = peerDiscovery
.withVersion(">=2.4.0-next.0")
.withLatency(300)
.sortBy("latency")
.findPeersWithPlugin("core-api");
Peers via Relay
import { PeerDiscovery } from "@solar-network/peers";
peerDiscovery = await PeerDiscovery.new({,
// https://sxp.testnet.sh for development
networkOrHost: "https://sxp.mainnet.sh/api/peers",
})
peers = peerDiscovery
.withVersion(">=2.4.0-next.0")
.withLatency(300)
.sortBy("latency")
.findPeersWithPlugin("core-api");
Testing
yarn test