add the ability to provide seed nodes to the network

This commit is contained in:
Asim Aslam
2019-08-29 14:53:30 +01:00
parent 6e3d53e1ee
commit 7479515099
2 changed files with 22 additions and 1 deletions

View File

@@ -20,6 +20,8 @@ type Options struct {
Name string
// Address to bind to
Address string
// Nodes is a list of seed nodes
Nodes []string
// Tunnel is network tunnel
Tunnel tunnel.Tunnel
// Router is network router
@@ -51,6 +53,14 @@ func Address(a string) Option {
}
}
// Nodes is a list of seed nodes used along
// with resolved node
func Nodes(n ...string) Option {
return func(o *Options) {
o.Nodes = n
}
}
// Tunnel sets the network tunnel
func Tunnel(t tunnel.Tunnel) Option {
return func(o *Options) {