From 5c25403b13a698267230f859e822a7f714082198 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 16 Jun 2015 13:30:53 +0200 Subject: refactored old rpc structure to new --- rpc/api/api.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index e431e5c1e..dec67fed1 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -20,6 +20,10 @@ const ( ) var ( + DefaultHttpRpcApis = strings.Join([]string{ + EthApiName, NetApiName, Web3ApiName, + }, ",") + // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, -- cgit v1.2.3 From c3f6c322c07a96d3930c75d05ed3859e7d80ddbc Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 16 Jun 2015 14:59:39 +0200 Subject: added DB api --- rpc/api/api.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index dec67fed1..7fc22a263 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -9,6 +9,7 @@ import ( const ( AdminApiName = "admin" EthApiName = "eth" + DbApiName = "db" DebugApiName = "debug" MergedApiName = "merged" MinerApiName = "miner" @@ -21,12 +22,12 @@ const ( var ( DefaultHttpRpcApis = strings.Join([]string{ - EthApiName, NetApiName, Web3ApiName, + DbApiName, EthApiName, NetApiName, Web3ApiName, }, ",") // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ - AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, + AdminApiName, DbApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName, }, ",") ) -- cgit v1.2.3 From a4a4e9fcf824189d8d06940492a01effe6e6cf92 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 17 Jun 2015 16:22:35 +0200 Subject: removed old rpc structure and added new inproc api client --- rpc/api/api.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 7fc22a263..10b448594 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -18,15 +18,13 @@ const ( TxPoolApiName = "txpool" PersonalApiName = "personal" Web3ApiName = "web3" + + JsonRpcVersion = "2.0" ) var ( - DefaultHttpRpcApis = strings.Join([]string{ - DbApiName, EthApiName, NetApiName, Web3ApiName, - }, ",") - - // List with all API's which are offered over the IPC interface by default - DefaultIpcApis = strings.Join([]string{ + // All API's + AllApis = strings.Join([]string{ AdminApiName, DbApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName, }, ",") -- cgit v1.2.3 From 2e0b56a72b3eafc89938003da29c06496ac9ad4e Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Mon, 22 Jun 2015 12:47:32 +0200 Subject: added RPC start/stop support --- rpc/api/api.go | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'rpc/api/api.go') diff --git a/rpc/api/api.go b/rpc/api/api.go index 10b448594..ca1ccb9a5 100644 --- a/rpc/api/api.go +++ b/rpc/api/api.go @@ -1,51 +1,10 @@ package api import ( - "strings" - "github.com/ethereum/go-ethereum/rpc/shared" ) -const ( - AdminApiName = "admin" - EthApiName = "eth" - DbApiName = "db" - DebugApiName = "debug" - MergedApiName = "merged" - MinerApiName = "miner" - NetApiName = "net" - ShhApiName = "shh" - TxPoolApiName = "txpool" - PersonalApiName = "personal" - Web3ApiName = "web3" - - JsonRpcVersion = "2.0" -) - -var ( - // All API's - AllApis = strings.Join([]string{ - AdminApiName, DbApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, - ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName, - }, ",") -) - -// Ethereum RPC API interface -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) - - // List of supported RCP methods this API provides - Methods() []string -} - // Merge multiple API's to a single API instance -func Merge(apis ...EthereumApi) EthereumApi { +func Merge(apis ...shared.EthereumApi) shared.EthereumApi { return newMergedApi(apis...) } -- cgit v1.2.3