mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-27 05:57:28 +00:00
07ca5c643a
* eth_syncing * linters * fix readme * cleanup cli params * go mod tidy * remove memsize ui dep * remove bloomfilter * implement net_peerCount * remove legacy flags
28 lines
519 B
Go
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
|
|
}
|