0.3.0 • Published 2 years ago

@swipechain/peers v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@swipechain/peers

Installation

yarn add @swipechain/peers

Usage

Peers via GitHub

import { PeerDiscovery } from "@swipechain/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 "@arkecosystem/peers";

peerDiscovery = await PeerDiscovery.new({
	networkOrHost: "http://explorer.swipechain.io/api/peers",
})

peers = peerDiscovery
	.withVersion(">=2.4.0-next.0")
	.withLatency(300)
	.sortBy("latency")
	.findPeersWithPlugin("core-api");

Testing

yarn test

Security

If you discover a security vulnerability within this package, please send an e-mail to security@swipechain.org. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Swipechain