From 427338e0bbcb8d37bd202cc26c44f191c7a31f89 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Tue, 13 Feb 2018 11:21:38 +1300 Subject: [PATCH] feat(bootstrap): add the spec --- SPEC/BOOTSTRAP.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 SPEC/BOOTSTRAP.md diff --git a/SPEC/BOOTSTRAP.md b/SPEC/BOOTSTRAP.md new file mode 100644 index 00000000..a009d18a --- /dev/null +++ b/SPEC/BOOTSTRAP.md @@ -0,0 +1,43 @@ +Bootstrap API +============= + +> Manipulates the `bootstrap list`, which contains + the addresses of the bootstrap nodes. These are the trusted peers from + which to learn about other peers in the network. + +> Only edit this list if you understand the risks of adding or removing nodes from this list. + +#### `add` + +> Add a peer address to the bootstrap list + +##### `Go` **WIP** + +##### `JavaScript` - ipfs.bootstrap.add(addr, [opts,] callback) + +- `addr` is a [multiaddr](https://github.com/multiformats/js-multiaddr) to a peer node +- `opts.default` if true, add the default peers to the list +- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of added addresses. + +#### `list` + +> List all peer addresses in the bootstrap list + +##### `Go` **WIP** + +##### `JavaScript` - ipfs.bootstrap.list(callback) + +- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of addresses. + + +#### `rm` + +> Remove a peer address from the bootstrap list + +##### `Go` **WIP** + +##### `JavaScript` - ipfs.bootstrap.rm(peer, [opt,] callback) + +- `addr` is a [multiaddr](https://github.com/multiformats/js-multiaddr) to a peer node +- `opts.all` if true, remove all peers from the list +- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of removed addresses.