diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-06-10 17:29:52 +0800 |
---|---|---|
committer | Bas van Kervel <basvankervel@gmail.com> | 2015-06-11 20:01:41 +0800 |
commit | bd38428f33b127e9c60d26127695e50c55798fcd (patch) | |
tree | 9bb838822fc3d1b28775f57223a30a243d4df9f2 /rpc/api/admin.go | |
parent | 87b62f75a7b9c15c17f3352f1b50ad88966e7070 (diff) | |
download | go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar.gz go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar.bz2 go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar.lz go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar.xz go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.tar.zst go-tangerine-bd38428f33b127e9c60d26127695e50c55798fcd.zip |
cleanup of javascript API
Diffstat (limited to 'rpc/api/admin.go')
-rw-r--r-- | rpc/api/admin.go | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/rpc/api/admin.go b/rpc/api/admin.go index c37463604..6b89942b2 100644 --- a/rpc/api/admin.go +++ b/rpc/api/admin.go @@ -25,14 +25,15 @@ var ( AdminMapping = map[string]adminhandler{ // "admin_startRPC": (*adminApi).StartRPC, // "admin_stopRPC": (*adminApi).StopRPC, - "admin_addPeer": (*adminApi).AddPeer, - "admin_peers": (*adminApi).Peers, - "admin_nodeInfo": (*adminApi).NodeInfo, - "admin_exportChain": (*adminApi).ExportChain, - "admin_importChain": (*adminApi).ImportChain, - "admin_verbosity": (*adminApi).Verbosity, - "admin_syncStatus": (*adminApi).SyncStatus, - "admin_setSolc": (*adminApi).SetSolc, + "admin_addPeer": (*adminApi).AddPeer, + "admin_peers": (*adminApi).Peers, + "admin_nodeInfo": (*adminApi).NodeInfo, + "admin_exportChain": (*adminApi).ExportChain, + "admin_importChain": (*adminApi).ImportChain, + "admin_verbosity": (*adminApi).Verbosity, + "admin_chainSyncStatus": (*adminApi).ChainSyncStatus, + "admin_setSolc": (*adminApi).SetSolc, + "admin_datadir": (*adminApi).DataDir, } ) @@ -129,6 +130,10 @@ func (self *adminApi) NodeInfo(req *shared.Request) (interface{}, error) { return self.ethereum.NodeInfo(), nil } +func (self *adminApi) DataDir(req *shared.Request) (interface{}, error) { + return self.ethereum.DataDir, nil +} + func hasAllBlocks(chain *core.ChainManager, bs []*types.Block) bool { for _, b := range bs { if !chain.HasBlock(b.Hash()) { @@ -209,9 +214,9 @@ func (self *adminApi) Verbosity(req *shared.Request) (interface{}, error) { return true, nil } -func (self *adminApi) SyncStatus(req *shared.Request) (interface{}, error) { +func (self *adminApi) ChainSyncStatus(req *shared.Request) (interface{}, error) { pending, cached := self.ethereum.Downloader().Stats() - return map[string]interface{}{"available": pending, "waitingForImport": cached}, nil + return map[string]interface{}{"blocksAvailable": pending, "blocksWaitingForImport": cached}, nil } func (self *adminApi) SetSolc(req *shared.Request) (interface{}, error) { |