New node methods for tools and otherwise (#265)

* Add IpfsDHT.{Bootstrap{Random,Self},Peer{Id,Key}}
* Include client mode tests, support for Ping, and uncruft setupDHTs
* Include xerrors in deps
This commit is contained in:
Matt Joiner
2019-03-06 08:10:38 +11:00
committed by GitHub
parent bbf33de897
commit 08c34b4d83
6 changed files with 93 additions and 27 deletions

View File

@@ -170,3 +170,12 @@ func (dht *IpfsDHT) runBootstrap(ctx context.Context, cfg BootstrapConfig) error
return err
})
}
func (dht *IpfsDHT) BootstrapRandom(ctx context.Context) error {
return dht.randomWalk(ctx)
}
func (dht *IpfsDHT) BootstrapSelf(ctx context.Context) error {
_, err := dht.walk(ctx, dht.self)
return err
}