Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

Credits

License

MIT © Ark Ecosystem

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages