diff options
author | Dan Laine <[email protected]> | 2020-11-05 15:06:35 -0500 |
---|---|---|
committer | Dan Laine <[email protected]> | 2020-11-05 15:06:35 -0500 |
commit | 06168d588c550afe373f03b47c75244dfa4c60cb (patch) | |
tree | b58135ec87b10872b366d469a4902f4104c60a84 /plugin/evm/service.go | |
parent | 52de74ce47a2614af3b3a32b21aa5309d4b00d78 (diff) | |
parent | a6ffdbbdd269fae35c5600e954bd373b619fe733 (diff) |
Merge tag 'v0.3.12' into v0.3.12-with-id-updatev0.3.12-id-update
Diffstat (limited to 'plugin/evm/service.go')
-rw-r--r-- | plugin/evm/service.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugin/evm/service.go b/plugin/evm/service.go index 3509929..0ec7620 100644 --- a/plugin/evm/service.go +++ b/plugin/evm/service.go @@ -38,6 +38,18 @@ type SnowmanAPI struct{ vm *VM } // AvaxAPI offers Avalanche network related API methods type AvaxAPI struct{ vm *VM } +// NetAPI offers network related API methods +type NetAPI struct{ vm *VM } + +// Listening returns an indication if the node is listening for network connections. +func (s *NetAPI) Listening() bool { return true } // always listening + +// PeerCount returns the number of connected peers +func (s *NetAPI) PeerCount() hexutil.Uint { return hexutil.Uint(0) } // TODO: report number of connected peers + +// Version returns the current ethereum protocol version. +func (s *NetAPI) Version() string { return fmt.Sprintf("%d", s.vm.networkID) } + // GetAcceptedFrontReply defines the reply that will be sent from the // GetAcceptedFront API call type GetAcceptedFrontReply struct { |