From de0549fabb8be4dbaf382ee68ec1b702cb0c5c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 29 Apr 2015 18:04:08 +0300 Subject: cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peers --- cmd/geth/admin.go | 6 +++--- cmd/geth/main.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'cmd/geth') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 31f8d4400..a07e694de 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -25,7 +25,7 @@ func (js *jsre) adminBindings() { js.re.Set("admin", struct{}{}) t, _ := js.re.Get("admin") admin := t.Object() - admin.Set("suggestPeer", js.suggestPeer) + admin.Set("trustPeer", js.trustPeer) admin.Set("startRPC", js.startRPC) admin.Set("stopRPC", js.stopRPC) admin.Set("nodeInfo", js.nodeInfo) @@ -243,13 +243,13 @@ func (js *jsre) stopRPC(call otto.FunctionCall) otto.Value { return otto.FalseValue() } -func (js *jsre) suggestPeer(call otto.FunctionCall) otto.Value { +func (js *jsre) trustPeer(call otto.FunctionCall) otto.Value { nodeURL, err := call.Argument(0).ToString() if err != nil { fmt.Println(err) return otto.FalseValue() } - err = js.ethereum.SuggestPeer(nodeURL) + err = js.ethereum.TrustPeer(nodeURL) if err != nil { fmt.Println(err) return otto.FalseValue() diff --git a/cmd/geth/main.go b/cmd/geth/main.go index ef007051c..d9d1c1b15 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -232,7 +232,8 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.IdentityFlag, utils.UnlockedAccountFlag, utils.PasswordFileFlag, - utils.BootnodesFlag, + utils.BootNodesFlag, + utils.TrustedNodesFlag, utils.DataDirFlag, utils.BlockchainVersionFlag, utils.JSpathFlag, -- cgit v1.2.3 From 679c90b873f78b10a97a85ddd29b91bded9b0dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 29 Apr 2015 18:50:52 +0300 Subject: cmd/geth, cmd/utils, eth: internalize trusted node config file --- cmd/geth/main.go | 1 - 1 file changed, 1 deletion(-) (limited to 'cmd/geth') diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d9d1c1b15..036ee2d0c 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -233,7 +233,6 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.UnlockedAccountFlag, utils.PasswordFileFlag, utils.BootNodesFlag, - utils.TrustedNodesFlag, utils.DataDirFlag, utils.BlockchainVersionFlag, utils.JSpathFlag, -- cgit v1.2.3 From 701591b403a8bae8c1dfb648a49d587968ff0c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 30 Apr 2015 16:15:29 +0300 Subject: cmd, eth, p2p: fix review issues enumerated by Felix --- cmd/geth/admin.go | 6 +++--- cmd/geth/main.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/geth') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index a07e694de..77510b8b8 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -25,7 +25,7 @@ func (js *jsre) adminBindings() { js.re.Set("admin", struct{}{}) t, _ := js.re.Get("admin") admin := t.Object() - admin.Set("trustPeer", js.trustPeer) + admin.Set("addPeer", js.addPeer) admin.Set("startRPC", js.startRPC) admin.Set("stopRPC", js.stopRPC) admin.Set("nodeInfo", js.nodeInfo) @@ -243,13 +243,13 @@ func (js *jsre) stopRPC(call otto.FunctionCall) otto.Value { return otto.FalseValue() } -func (js *jsre) trustPeer(call otto.FunctionCall) otto.Value { +func (js *jsre) addPeer(call otto.FunctionCall) otto.Value { nodeURL, err := call.Argument(0).ToString() if err != nil { fmt.Println(err) return otto.FalseValue() } - err = js.ethereum.TrustPeer(nodeURL) + err = js.ethereum.AddPeer(nodeURL) if err != nil { fmt.Println(err) return otto.FalseValue() diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 036ee2d0c..ef007051c 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -232,7 +232,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.IdentityFlag, utils.UnlockedAccountFlag, utils.PasswordFileFlag, - utils.BootNodesFlag, + utils.BootnodesFlag, utils.DataDirFlag, utils.BlockchainVersionFlag, utils.JSpathFlag, -- cgit v1.2.3