From 827737b0f6fac90f5047eca5fb81a4bc3e738067 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Mon, 27 Jun 2016 15:56:15 +0200 Subject: [PATCH] add default peer --- cmd/geth/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index f32d341b5d..18377ac9d9 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -41,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/release" "github.com/ethereum/go-ethereum/rlp" @@ -316,6 +317,14 @@ func startNode(ctx *cli.Context, stack *node.Node) { // Start up the node itself utils.StartNode(stack) + if ctx.GlobalBool(utils.LightModeFlag.Name) { + // add default light server; test phase only + node, err := discover.ParseNode("enode://201aa667e0b75462c8837708dbc3c91b43f84d233efda2f4e2c5ae0ea237d646db656375b394fb35d841cf8ea2814e3629af4821d3b0204508f7eb8cea8e7f31@40.118.3.223:30303") + if err == nil { + stack.Server().AddPeer(node) + } + } + // Unlock any account specifically requested var accman *accounts.Manager if err := stack.Service(&accman); err != nil {