crawler

package
v0.0.0-...-1d34b96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: GPL-3.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCrawler

func NewCrawler(
	genesis *core.Genesis,
	networkID uint64,
	nodeURL string,
	input common.NodeSet,
	workers uint64,
	disc resolver,
	iters ...enode.Iterator,
) *crawler

Types

type BlockBodies

type BlockBodies eth.BlockBodiesPacket66

BlockBodies is the network packet for block content distribution.

func (BlockBodies) Code

func (msg BlockBodies) Code() int

func (BlockBodies) ReqID

func (msg BlockBodies) ReqID() uint64

type BlockHeaders

type BlockHeaders eth.BlockHeadersPacket66

func (BlockHeaders) Code

func (msg BlockHeaders) Code() int

func (BlockHeaders) ReqID

func (msg BlockHeaders) ReqID() uint64

type Conn

type Conn struct {
	*rlpx.Conn
	// contains filtered or unexported fields
}

Conn represents an individual connection with a peer

func (*Conn) Read

func (c *Conn) Read() Message

Read reads an eth66 packet from the connection.

func (*Conn) Write

func (c *Conn) Write(msg Message) error

Write writes a eth packet to the connection.

type Crawler

type Crawler struct {
	// These are probably from flags
	NetworkID  uint64
	NodeURL    string
	ListenAddr string
	NodeKey    string
	Bootnodes  []string
	Timeout    time.Duration
	Workers    uint64
	Sepolia    bool
	Goerli     bool

	NodeDB *enode.DB
}

func (Crawler) CrawlRound

func (c Crawler) CrawlRound(
	inputSet common.NodeSet,
	db *sql.DB,
	geoipDB *geoip2.Reader,
) common.NodeSet

type Disconnect

type Disconnect struct {
	Reason p2p.DiscReason
}

Disconnect is the RLP structure for a disconnect message.

func (Disconnect) Code

func (msg Disconnect) Code() int

func (Disconnect) ReqID

func (msg Disconnect) ReqID() uint64

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Code

func (e *Error) Code() int

func (*Error) Error

func (e *Error) Error() string

func (*Error) ReqID

func (e *Error) ReqID() uint64

func (*Error) String

func (e *Error) String() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type GetBlockBodies

type GetBlockBodies eth.GetBlockBodiesPacket66

GetBlockBodies represents a GetBlockBodies request

func (GetBlockBodies) Code

func (msg GetBlockBodies) Code() int

func (GetBlockBodies) ReqID

func (msg GetBlockBodies) ReqID() uint64

type GetBlockHeaders

type GetBlockHeaders eth.GetBlockHeadersPacket66

GetBlockHeaders represents a block header query.

func (GetBlockHeaders) Code

func (msg GetBlockHeaders) Code() int

func (GetBlockHeaders) ReqID

func (msg GetBlockHeaders) ReqID() uint64

type GetPooledTransactions

type GetPooledTransactions eth.GetPooledTransactionsPacket66

func (GetPooledTransactions) Code

func (msg GetPooledTransactions) Code() int

func (GetPooledTransactions) ReqID

func (msg GetPooledTransactions) ReqID() uint64

type Hello

type Hello struct {
	Version    uint64
	Name       string
	Caps       []p2p.Cap
	ListenPort uint64
	ID         []byte // secp256k1 public key

	// Ignore additional fields (for forward compatibility).
	Rest []rlp.RawValue `rlp:"tail"`
}

Hello is the RLP structure of the protocol handshake.

func (Hello) Code

func (msg Hello) Code() int

func (Hello) ReqID

func (msg Hello) ReqID() uint64

type Message

type Message interface {
	Code() int
	ReqID() uint64
}

type NewBlock

type NewBlock eth.NewBlockPacket

NewBlock is the network packet for the block propagation message.

func (NewBlock) Code

func (msg NewBlock) Code() int

func (NewBlock) ReqID

func (msg NewBlock) ReqID() uint64

type NewBlockHashes

type NewBlockHashes eth.NewBlockHashesPacket

NewBlockHashes is the network packet for the block announcements.

func (NewBlockHashes) Code

func (msg NewBlockHashes) Code() int

func (NewBlockHashes) ReqID

func (msg NewBlockHashes) ReqID() uint64

type NewPooledTransactionHashes

type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket68

NewPooledTransactionHashes is the network packet for the tx hash propagation message.

func (NewPooledTransactionHashes) Code

func (msg NewPooledTransactionHashes) Code() int

func (NewPooledTransactionHashes) ReqID

func (msg NewPooledTransactionHashes) ReqID() uint64

type NewPooledTransactionHashes66

type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket66

NewPooledTransactionHashes66 is the network packet for the tx hash propagation message.

func (NewPooledTransactionHashes66) Code

func (msg NewPooledTransactionHashes66) Code() int

func (NewPooledTransactionHashes66) ReqID

type Ping

type Ping struct{}

func (Ping) Code

func (msg Ping) Code() int

func (Ping) ReqID

func (msg Ping) ReqID() uint64

type Pong

type Pong struct{}

func (Pong) Code

func (msg Pong) Code() int

func (Pong) ReqID

func (msg Pong) ReqID() uint64

type PooledTransactions

type PooledTransactions eth.PooledTransactionsPacket66

func (PooledTransactions) Code

func (msg PooledTransactions) Code() int

func (PooledTransactions) ReqID

func (msg PooledTransactions) ReqID() uint64

type Status

type Status eth.StatusPacket

Status is the network packet for the status message for eth/64 and later.

func (Status) Code

func (msg Status) Code() int

func (Status) ReqID

func (msg Status) ReqID() uint64

type Transactions

type Transactions eth.TransactionsPacket

func (Transactions) Code

func (msg Transactions) Code() int

func (Transactions) ReqID

func (msg Transactions) ReqID() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL