Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@arkecosystem/peers

ArkEcosystem153MIT0.3.0TypeScript support: included

A simple TypeScript peer discovery client for the ARK Blockchain.

readme

@arkecosystem/peers

Latest Version Node Engine Build Status Codecov License: MIT

Lead Maintainer: Brian Faust

Installation

yarn add @arkecosystem/peers

Usage

Peers via GitHub

import { PeerDiscovery } from "@arkecosystem/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://dexplorer.ark.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@ark.io. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

MIT © ARK Ecosystem

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

[0.2.1] - 2019-08-30

Fixed

  • Don't use p2p port from github ([#12])

[0.2.0] - 2019-08-29

Fixed

  • Use of hardcoded port 4003 ([#8])

0.1.2 - 2019-07-06

Added

  • Return additional peer data (#2)

Fixed

  • Force v2 peer endpoint (#3)

0.1.0 - 2019-07-05

  • Initial Release