diff options
author | Felix Lange <fjl@twurst.com> | 2015-12-15 18:33:18 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-12-15 18:33:18 +0800 |
commit | b9aedeab0b1cf56860f5ca53333a4f348395259c (patch) | |
tree | 3ca53caab0ea965fe322a805f5565e247346cef4 /node/node.go | |
parent | 9c636d2490c4f88598752834cc3226902d198ced (diff) | |
parent | d8370a4e15f00afeb783f7f3be8b47e93c4338d2 (diff) | |
download | dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar.gz dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar.bz2 dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar.lz dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar.xz dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.tar.zst dexon-b9aedeab0b1cf56860f5ca53333a4f348395259c.zip |
Merge pull request #2072 from karalabe/admin-debug-apis
core, eth, node, rpc: port the admin and debug API
Diffstat (limited to 'node/node.go')
-rw-r--r-- | node/node.go | 30 |
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()...) } |