aboutsummaryrefslogtreecommitdiffstats
path: root/node/node.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-12-05 02:56:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-12-15 01:36:51 +0800
commitd8370a4e15f00afeb783f7f3be8b47e93c4338d2 (patch)
tree2d11ad491a7545977ee0a00a0bb7751b714355d3 /node/node.go
parentfa187a366dda1894179635eeec2a929bfacc4ad3 (diff)
downloaddexon-d8370a4e15f00afeb783f7f3be8b47e93c4338d2.tar.gz
dexon-d8370a4e15f00afeb783f7f3be8b47e93c4338d2.tar.zst
dexon-d8370a4e15f00afeb783f7f3be8b47e93c4338d2.zip
core, eth, node, rpc: port the admin and debug API
Diffstat (limited to 'node/node.go')
-rw-r--r--node/node.go30
1 files changed, 27 insertions, 3 deletions
diff --git a/node/node.go b/node/node.go
index d6debe123..5d7b5869c 100644
--- a/node/node.go
+++ b/node/node.go
@@ -266,9 +266,33 @@ func (n *Node) EventMux() *event.TypeMux {
return n.eventmux
}
-// RPCAPIs returns the collection of RPC descriptor this node offers
-func (n *Node) RPCAPIs() []rpc.API {
- var apis []rpc.API
+// APIs returns the collection of RPC descriptor this node offers. This method
+// is just a quick placeholder passthrough for the RPC update, which in the next
+// step will be fully integrated into the node itself.
+func (n *Node) APIs() []rpc.API {
+ // Define all the APIs owned by the node itself
+ apis := []rpc.API{
+ {
+ Namespace: "admin",
+ Version: "1.0",
+ Service: NewPrivateAdminAPI(n),
+ }, {
+ Namespace: "admin",
+ Version: "1.0",
+ Service: NewPublicAdminAPI(n),
+ Public: true,
+ }, {
+ Namespace: "debug",
+ Version: "1.0",
+ Service: NewPrivateDebugAPI(n),
+ }, {
+ Namespace: "debug",
+ Version: "1.0",
+ Service: NewPublicDebugAPI(n),
+ Public: true,
+ },
+ }
+ // Inject all the APIs owned by various services
for _, api := range n.services {
apis = append(apis, api.APIs()...)
}