|
|
@ -16,7 +16,7 @@ import ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
AdminVersion = "1.0.0" |
|
|
|
AdminApiversion = "1.0" |
|
|
|
importBatchSize = 2500 |
|
|
|
importBatchSize = 2500 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -82,6 +82,10 @@ func (self *adminApi) Name() string { |
|
|
|
return AdminApiName |
|
|
|
return AdminApiName |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (self *adminApi) ApiVersion() string { |
|
|
|
|
|
|
|
return AdminApiversion |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *adminApi) AddPeer(req *shared.Request) (interface{}, error) { |
|
|
|
func (self *adminApi) AddPeer(req *shared.Request) (interface{}, error) { |
|
|
|
args := new(AddPeerArgs) |
|
|
|
args := new(AddPeerArgs) |
|
|
|
if err := self.codec.Decode(req.Params, &args); err != nil { |
|
|
|
if err := self.codec.Decode(req.Params, &args); err != nil { |
|
|
@ -215,8 +219,14 @@ func (self *adminApi) Verbosity(req *shared.Request) (interface{}, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *adminApi) ChainSyncStatus(req *shared.Request) (interface{}, error) { |
|
|
|
func (self *adminApi) ChainSyncStatus(req *shared.Request) (interface{}, error) { |
|
|
|
pending, cached := self.ethereum.Downloader().Stats() |
|
|
|
pending, cached, importing, estimate := self.ethereum.Downloader().Stats() |
|
|
|
return map[string]interface{}{"blocksAvailable": pending, "blocksWaitingForImport": cached}, nil |
|
|
|
|
|
|
|
|
|
|
|
return map[string]interface{}{ |
|
|
|
|
|
|
|
"blocksAvailable": pending, |
|
|
|
|
|
|
|
"blocksWaitingForImport": cached, |
|
|
|
|
|
|
|
"importing": importing, |
|
|
|
|
|
|
|
"estimate": estimate.String(), |
|
|
|
|
|
|
|
}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *adminApi) SetSolc(req *shared.Request) (interface{}, error) { |
|
|
|
func (self *adminApi) SetSolc(req *shared.Request) (interface{}, error) { |
|
|
|