Skip to content

Commit

Permalink
Add second bootnode (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ridenaio authored and sidenaio committed Aug 16, 2019
1 parent 7f800d0 commit b949d6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,20 @@ func MakeConfig(ctx *cli.Context) (*Config, error) {
}

func getDefaultConfig(dataDir string) *Config {
bootNode, _ := enode.ParseV4(DefaultBootNode)
var bootNodes []*enode.Node
for _, item := range DefaultBootstrapNodes {
bootNode, _ := enode.ParseV4(item)
bootNodes = append(bootNodes, bootNode)
}

return &Config{
DataDir: dataDir,
Network: 0x1, // testnet
P2P: &p2p.Config{
ListenAddr: fmt.Sprintf(":%d", DefaultPort),
MaxPeers: 25,
MaxPeers: 50,
NAT: nat.Any(),
BootstrapNodes: []*enode.Node{bootNode},
BootstrapNodes: bootNodes,
},
Consensus: GetDefaultConsensusConfig(),
RPC: rpc.GetDefaultRPCConfig(DefaultRpcHost, DefaultRpcPort),
Expand Down
6 changes: 5 additions & 1 deletion config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "gopkg.in/urfave/cli.v1"

const (
DefaultDataDir = "datadir"
DefaultBootNode = "enode://baeceea089e3e9f5382940ef38168fff4c5155692f5a3e0f618ca586ea73a62f8fc858995471741a50724c651af37db84c14254ad80ecbe8e1f979ce8a9ec7b0@111.90.140.21:40404"
DefaultPort = 40404
DefaultRpcHost = "localhost"
DefaultRpcPort = 9009
Expand All @@ -18,8 +17,13 @@ const (
)

var (
DefaultBootstrapNodes = []string{
"enode://baeceea089e3e9f5382940ef38168fff4c5155692f5a3e0f618ca586ea73a62f8fc858995471741a50724c651af37db84c14254ad80ecbe8e1f979ce8a9ec7b0@111.90.140.21:40404",
"enode://1596e005b3addf7b6ef43ce574a18948ec127681d4262ec05da06a38bca5f08d52a8189807c7330c49dc8548b7345fc570c77b6e9541bb952be23f71dfd9eb85@206.81.23.186:40404",
}
DefaultIpfsBootstrapNodes = []string{
"/ip4/111.90.140.21/tcp/4002/ipfs/QmZV7cwSgVTSnMUE2zTK3f5nepCuT5yYnTyMpRgGhxJoTG",
"/ip4/206.81.23.186/tcp/40403/ipfs/QmcNz33dvfrY5cMMQs64CcSQoR9sVVGL8qD4mptYUGHUTD",
}
CfgFileFlag = cli.StringFlag{
Name: "config",
Expand Down

0 comments on commit b949d6a

Please sign in to comment.