erigon-pulse/cmd/rpcdaemon/commands/net_api.go
Alex Sharov 07ca5c643a
eth_syncing (#991)
* eth_syncing

* linters

* fix readme

* cleanup cli params

* go mod tidy

* remove memsize ui dep

* remove bloomfilter

* implement net_peerCount

* remove legacy flags
2020-08-29 08:24:50 +01:00

28 lines
519 B
Go

package commands
import (
"context"
"github.com/ledgerwatch/turbo-geth/common/hexutil"
"github.com/ledgerwatch/turbo-geth/ethdb"
)
type NetAPI interface {
Version(ctx context.Context) (string, error)
}
type NetAPIImpl struct {
ethBackend ethdb.Backend
}
// NwtNetAPIImpl returns NetAPIImplImpl instance
func NewNetAPIImpl(eth ethdb.Backend) *NetAPIImpl {
return &NetAPIImpl{
ethBackend: eth,
}
}
func (api *NetAPIImpl) PeerCount(_ context.Context) (hexutil.Uint, error) {
return hexutil.Uint(25), nil
}