diff options
author | Felix Lange <fjl@twurst.com> | 2016-01-26 21:39:21 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-01-28 20:36:11 +0800 |
commit | 3750d835a1697f6784c727074cc959dda33cdcf3 (patch) | |
tree | 6183747f1ce69b6bb1ed256e4dd9a1bba0031d69 /node | |
parent | e287b56b69cdf8340f679e9cfd229c959cc45e24 (diff) | |
download | go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar.gz go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar.bz2 go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar.lz go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar.xz go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.tar.zst go-tangerine-3750d835a1697f6784c727074cc959dda33cdcf3.zip |
internal/debug: APIs for profiling and tracing
The debug package provides an RPC wrapper for glog settings and the
debugging facilities of the Go runtime. They can be triggered through
both command line flags and the IPC listener.
Diffstat (limited to 'node')
-rw-r--r-- | node/api.go | 28 | ||||
-rw-r--r-- | node/node.go | 3 |
2 files changed, 3 insertions, 28 deletions
diff --git a/node/api.go b/node/api.go index 7b247dc51..bc1795407 100644 --- a/node/api.go +++ b/node/api.go @@ -23,7 +23,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rpc" @@ -100,7 +99,6 @@ func (api *PrivateAdminAPI) StopRPC() (bool, error) { return err == nil, err } - // StartWS starts the websocket RPC API server. func (api *PrivateAdminAPI) StartWS(address string, port int, cors string, apis string) (bool, error) { var offeredAPIs []rpc.API @@ -131,7 +129,7 @@ func (api *PrivateAdminAPI) StartWS(address string, port int, cors string, apis } corsDomains := strings.Split(cors, " ") - + err := rpc.StartWS(address, port, corsDomains, offeredAPIs) return err == nil, err } @@ -179,30 +177,6 @@ func (api *PublicAdminAPI) Datadir() string { return api.node.DataDir() } -// PrivateDebugAPI is the collection of debugging related API methods exposed -// only over a secure RPC channel. -type PrivateDebugAPI struct { - node *Node // Node interfaced by this API -} - -// NewPrivateDebugAPI creates a new API definition for the private debug methods -// of the node itself. -func NewPrivateDebugAPI(node *Node) *PrivateDebugAPI { - return &PrivateDebugAPI{node: node} -} - -// Verbosity updates the node's logging verbosity. Note, due to the lack of fine -// grained contextual loggers, this will update the verbosity level for the entire -// process, not just this node instance. -func (api *PrivateDebugAPI) Verbosity(level int) { - glog.SetV(level) -} - -// Vmodule updates the node's logging verbosity pattern. -func (api *PrivateDebugAPI) Vmodule(pattern string) error { - return glog.SetVmodule(pattern) -} - // PublicDebugAPI is the collection of debugging related API methods exposed over // both secure and unsecure RPC channels. type PublicDebugAPI struct { diff --git a/node/node.go b/node/node.go index 3d077b0bd..4af111a41 100644 --- a/node/node.go +++ b/node/node.go @@ -26,6 +26,7 @@ import ( "syscall" "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/internal/debug" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" ) @@ -284,7 +285,7 @@ func (n *Node) APIs() []rpc.API { }, { Namespace: "debug", Version: "1.0", - Service: NewPrivateDebugAPI(n), + Service: debug.Handler, }, { Namespace: "debug", Version: "1.0", |