Run an Amino DHT bootstrapper with js-libp2p
npm install @libp2p/amino-dht-bootstrapper



> Run an Amino DHT bootstrapper with js-libp2p
``console`
$ npm i @libp2p/amino-dht-bootstrapper
EPIC tracking issue:
Find more info at
Rust bootstrapper:
- 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
`console`
$ npx --package=@libp2p/amino-dht-bootstrapper -- amino
`sh`
Options:
--config
--metrics-path
--metrics-port
--api-port
--api-host
-h, --help Print help
To make a request via CURL, you can use the following command:
`shrun garbage collection
$ curl http://${HOST}:${RPC_PORT}/api/v0/nodejs/gc
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.$3
`json
{
"config": {
"description": "Path to IPFS config file",
"type": "string"
},
"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"
}
`$3
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:`json
{
"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-direct"
]
},
"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:
`sh
$ docker build . --tag amino
`$3
`sh
$ 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:`sh
$ docker run -v $HOME/.config/@libp2p/amino-dht-bootstrapper/:/root/.config/@libp2p/amino-dht-bootstrapper/ -it amino
`To pass args:
`sh
$ docker run -it amino [--enable-kademlia] [--enable-autonat]
`To expose the metrics port:
`sh
$ docker run -p 8888:8888 -it amino
`$3
`sh
$ docker compose --profile dashboard up -d
``Licensed under either of
- Apache 2.0, (LICENSE-APACHE /
- MIT (LICENSE-MIT /
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.