npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@libp2p/amino-dht-bootstrapper

v1.7.4

Published

Run an Amino DHT boostrapper with js-libp2p

Downloads

97

Readme

@libp2p/amino-dht-bootstrapper

libp2p.io Discuss codecov CI

Run an Amino DHT boostrapper with js-libp2p

Install

$ npm i @libp2p/amino-dht-bootstrapper

Bootstrap details

EPIC tracking issue: https://github.com/protocol/bifrost-infra/issues/2778

Find more info at https://github.com/protocol/bifrost-infra/blob/master/docs/bootstrap.md

Rust bootstrapper: https://github.com/libp2p/rust-libp2p/tree/master/misc/server

Requirements of a bootstrap node

  • The Peer IDs of the default bootstrap nodes are set explicitly, to assert that you only trust a specific peer at a given ip or dns entry.
    • This makes it harder for attackers to spoof or otherwise MITM attack, as they would also have to compromise our infrastructure to steal the private key behind the Peer ID.
  • Defaults
    • The default addresses for the bootstrap nodes are set in the ipfs/go-ipfs-config configuration

Start the bootstrapper

$ npx --package=@libp2p/amino-dht-bootstrapper -- amino
Options:
      --config <CONFIG>              Path to IPFS config file (required)
      --metrics-path <METRICS_PATH>  Metric endpoint path [default: /metrics]
      --metrics-port <PORT>          Metric endpoint path [default: 8888]
      --enable-kademlia              Whether to run the libp2p Kademlia protocol and join the IPFS DHT
      --enable-autonat               Whether to run the libp2p Autonat protocol
      --api-port <PORT>              Port to serve the RPC API [default: 8899]
      --api-host <HOST>              Host to serve the RPC API on [default: 127.0.0.1]
  -h, --help                         Print help

RPC API

To make a request via CURL, you can use the following command:

# run garbage collection
$ curl http://${HOST}:${RPC_PORT}/api/v0/nodejs/gc

# execute a heapdump
$ curl http://${HOST}:${RPC_PORT}/api/v0/nodejs/heapdump

# change the log level
$ curl http://${HOST}:${RPC_PORT}/api/v0/nodejs/log?namespace=libp2p:*

Please note that the RPC API server only listens on the loopback interface (127.0.0.1) by default. If you decide to change the api-host option, please make sure that the RPC API server is only used for development purposes and is not accessible publicly.

Configuring bootstrapper options

{
  "config": {
    "description": "Path to IPFS config file",
    "type": "string"
  },
  "enable-kademlia": {
    "description": "Whether to run the libp2p Kademlia protocol and join the IPFS DHT",
    "type": "boolean"
  },
  "enable-autonat": {
    "description": "Whether to run the libp2p Autonat protocol",
    "type": "boolean"
  },
  "metrics-path": {
    "description": "Metric endpoint path",
    "default": "/metrics",
    "type": "string"
  },
  "metrics-port": {
    "description": "Port to serve metrics",
    "default": "8888",
    "type": "string"
  },
  "api-port": {
    "description": "Port for api endpoint",
    "default": "8899",
    "type": "string"
  },
  "api-host": {
    "description": "The listen address hostname for the RPC API server",
    "default": "127.0.0.1",
    "type": "string"
  },
  "help": {
    "description": "Show help text",
    "type": "boolean"
  }

Config file example

A config file will be generated for you automatically, and stored at $HOME/.config/@libp2p/amino-dht-bootstrapper/config.json. The default config we generate looks like this:

{
  "addresses": {
    "announce": [],
    "noAnnounce": [],
    "listen": [
      "/ip4/0.0.0.0/tcp/4003/ws",
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4004/ws",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4002/webrtc"
    ]
  },
  "bootstrap": {
    "list": [
      "/dns4/am6.bootstrap.libp2p.io/tcp/443/wss/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
      "/dns4/sg1.bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
      "/dns4/sv15.bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN"
    ]
  },
  "privateKey": "generated by `auto-config.ts`",
  "connectionManager": {
    "inboundConnectionThreshold": 100,
    "maxIncomingPendingConnections": 100,
    "maxConnections": 500
  }
}

Building the Docker Image

Building should be straightforward from the root of the repository:

$ docker build . --tag amino

Running the docker image (once built):

$ docker run -it amino

By default, the config file is stored at $HOME/.config/@libp2p/amino-dht-bootstrapper/config.json. You can mount this file into the container by running:

$ docker run -v $HOME/.config/@libp2p/amino-dht-bootstrapper/:/root/.config/@libp2p/amino-dht-bootstrapper/ -it amino

To pass args:

$ docker run -it amino [--enable-kademlia] [--enable-autonat]

To expose the metrics port:

$ docker run -p 8888:8888 -it amino

Running the docker image with monitoring:

$ docker compose --profile dashboard up -d

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.