From 2f55a1d79853c1348fb1a4332fff98110167da80 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 10:23:54 +0200 Subject: restructured eth rpc API --- rpc/api/api.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 rpc/api/api.go (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go new file mode 100644 index 000000000..758e056ed --- /dev/null +++ b/rpc/api/api.go @@ -0,0 +1,12 @@ +package api + +import "github.com/ethereum/go-ethereum/rpc/shared" + +// Ethereum RPC API interface +type EthereumApi interface { + // Execute the given request and returns the response or an error + Execute(*shared.Request) (interface{}, error) + + // List of supported RCP methods this API provides + Methods() []string +} -- cgit v1.2.3 From 2a0d888326036be9cabe6680617ce2d1a27761d3 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 11:01:02 +0200 Subject: added API/IPC commandline flags --- rpc/api/api.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 758e056ed..93dc3058c 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -2,6 +2,11 @@ package api import "github.com/ethereum/go-ethereum/rpc/shared" +const ( + // List with all API's which are offered over the IPC interface by default + DefaultIpcApis = "eth" +) + // Ethereum RPC API interface type EthereumApi interface { // Execute the given request and returns the response or an error -- cgit v1.2.3 From a1a475fb9296e214292840d89811123292c7953c Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 12:43:58 +0200 Subject: added console command --- rpc/api/api.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 93dc3058c..153c73f48 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -4,14 +4,26 @@ import "github.com/ethereum/go-ethereum/rpc/shared" const ( // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "eth" + DefaultIpcApis = "eth,web3" + + EthApiName = "eth" + MergedApiName = "merged" + Web3ApiName = "web3" ) // Ethereum RPC API interface type EthereumApi interface { + // API identifier + Name() string + // Execute the given request and returns the response or an error Execute(*shared.Request) (interface{}, error) // List of supported RCP methods this API provides Methods() []string } + +// Merge multiple API's to a single API instance +func Merge(apis ...EthereumApi) EthereumApi { + return newMergedApi(apis...) +} -- cgit v1.2.3 From 4b9b633dfe8c36d3a8909024ff23a1cdedce44d8 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Mon, 8 Jun 2015 14:42:15 +0200 Subject: added miner API --- rpc/api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 153c73f48..7b3774b4e 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -4,10 +4,11 @@ import "github.com/ethereum/go-ethereum/rpc/shared" const ( // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "eth,web3" + DefaultIpcApis = "eth,web3,miner" EthApiName = "eth" MergedApiName = "merged" + MinerApiName = "miner" Web3ApiName = "web3" ) -- cgit v1.2.3 From d2a87f6f72b1582fd6e220e2a00d7c3f5a6df335 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Mon, 8 Jun 2015 14:50:11 +0200 Subject: added net API --- rpc/api/api.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 7b3774b4e..e4f0e7446 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -4,12 +4,13 @@ import "github.com/ethereum/go-ethereum/rpc/shared" const ( // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "eth,web3,miner" + DefaultIpcApis = "eth,miner,net,web3" - EthApiName = "eth" + EthApiName = "eth" MergedApiName = "merged" - MinerApiName = "miner" - Web3ApiName = "web3" + MinerApiName = "miner" + NetApiName = "net" + Web3ApiName = "web3" ) // Ethereum RPC API interface -- cgit v1.2.3 From 09d0d55fc579701191ff34f38cc20b437ee23577 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Tue, 9 Jun 2015 09:48:18 +0200 Subject: added debug API --- rpc/api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index e4f0e7446..067a4d4e8 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -4,9 +4,10 @@ import "github.com/ethereum/go-ethereum/rpc/shared" const ( // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "eth,miner,net,web3" + DefaultIpcApis = "debug,eth,miner,net,web3" EthApiName = "eth" + DebugApiName = "debug" MergedApiName = "merged" MinerApiName = "miner" NetApiName = "net" -- cgit v1.2.3 From 08d72a9245ce6f1e11f84a6b59d66cb083bea9f9 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Tue, 9 Jun 2015 10:59:44 +0200 Subject: added personal API --- rpc/api/api.go | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 067a4d4e8..d2c548ed1 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -1,17 +1,30 @@ package api -import "github.com/ethereum/go-ethereum/rpc/shared" +import ( + "strings" + + "github.com/ethereum/go-ethereum/rpc/shared" +) const ( + EthApiName = "eth" + DebugApiName = "debug" + MergedApiName = "merged" + MinerApiName = "miner" + NetApiName = "net" + PersonalApiName = "personal" + Web3ApiName = "web3" +) + +var ( // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "debug,eth,miner,net,web3" - - EthApiName = "eth" - DebugApiName = "debug" - MergedApiName = "merged" - MinerApiName = "miner" - NetApiName = "net" - Web3ApiName = "web3" + DefaultIpcApis = strings.Join([]string{ + EthApiName, + DebugApiName, + MinerApiName, + NetApiName, + PersonalApiName, + }, ",") ) // Ethereum RPC API interface -- cgit v1.2.3 From cc9ae399338557b6671e8fc83bb696c5ddb068fe Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Tue, 9 Jun 2015 16:06:51 +0200 Subject: added admin API --- rpc/api/api.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index d2c548ed1..28b824658 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -7,6 +7,7 @@ import ( ) const ( + AdminApiName = "admin" EthApiName = "eth" DebugApiName = "debug" MergedApiName = "merged" @@ -19,11 +20,7 @@ const ( var ( // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ - EthApiName, - DebugApiName, - MinerApiName, - NetApiName, - PersonalApiName, + AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, PersonalApiName, Web3ApiName, }, ",") ) -- cgit v1.2.3 From 87b62f75a7b9c15c17f3352f1b50ad88966e7070 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Wed, 10 Jun 2015 10:37:10 +0200 Subject: added txpool API --- rpc/api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 28b824658..e870ec58e 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -13,6 +13,7 @@ const ( MergedApiName = "merged" MinerApiName = "miner" NetApiName = "net" + txPoolApiName = "txpool" PersonalApiName = "personal" Web3ApiName = "web3" ) @@ -20,7 +21,7 @@ const ( var ( // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ - AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, PersonalApiName, Web3ApiName, + AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, txPoolApiName, PersonalApiName, Web3ApiName, }, ",") ) -- cgit v1.2.3 From 7e41d7ac51fdaba1c03ec3f9cb8cc7a7bc3830f4 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <bas@ethdev.com> Date: Wed, 10 Jun 2015 12:35:12 +0200 Subject: added shh API --- rpc/api/api.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index e870ec58e..206647946 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -13,7 +13,8 @@ const ( MergedApiName = "merged" MinerApiName = "miner" NetApiName = "net" - txPoolApiName = "txpool" + ShhApiName = "shh" + TxPoolApiName = "txpool" PersonalApiName = "personal" Web3ApiName = "web3" ) @@ -21,7 +22,8 @@ const ( var ( // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ - AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, txPoolApiName, PersonalApiName, Web3ApiName, + AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, + ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName, }, ",") ) -- cgit v1.2.3 From 348f1562e29c80cac3c1d13ff255a25ed4ec81c7 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 10:23:54 +0200 Subject: restructured eth rpc API --- rpc/api/api.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 206647946..e431e5c1e 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -32,6 +32,9 @@ type EthereumApi interface { // API identifier Name() string + // API version + ApiVersion() string + // Execute the given request and returns the response or an error Execute(*shared.Request) (interface{}, error) -- cgit v1.2.3 From bbfa0a3dcb82e704828d1438261ff26c50c4ccc3 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 11:01:02 +0200 Subject: added API/IPC commandline flags --- rpc/api/api.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index e431e5c1e..f62e48772 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -27,6 +27,11 @@ var ( }, ",") ) +const ( + // List with all API's which are offered over the IPC interface by default + DefaultIpcApis = "eth" +) + // Ethereum RPC API interface type EthereumApi interface { // API identifier -- cgit v1.2.3 From 1b59f890955c3658516daa958d0e4732004a78b7 Mon Sep 17 00:00:00 2001 From: Bas van Kervel <basvankervel@ziggo.nl> Date: Mon, 8 Jun 2015 12:43:58 +0200 Subject: added console command --- rpc/api/api.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index f62e48772..e431e5c1e 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -27,11 +27,6 @@ var ( }, ",") ) -const ( - // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = "eth" -) - // Ethereum RPC API interface type EthereumApi interface { // API identifier -- cgit v1.2.3