Documentation
¶
Overview ¶
Package coordinatornetwork implements a comunication layer among coordinators in order to share information such as transactions in the pool and create account authorizations.
To do so the pubsub gossip protocol is used. This code is currently heavily based on this example: https://github.com/libp2p/go-libp2p/blob/master/examples/pubsub
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoordinatorNetwork ¶
type CoordinatorNetwork struct {
// contains filtered or unexported fields
}
CoordinatorNetwork it's a p2p communication layer that enables coordinators to exchange information in benefit of the network and them selfs. The main goal is to share L2 data (common.PoolL2Tx and common.AccountCreationAuth)
func NewCoordinatorNetwork ¶
func NewCoordinatorNetwork( ethPrivKey *ecdsa.PrivateKey, bootstrapPeers []multiaddr.Multiaddr, chainID uint16, newPoolTxHandler func(common.PoolL2Tx) error, ) (CoordinatorNetwork, error)
NewCoordinatorNetwork connects to coordinators network and return a CoordinatorNetwork to be able to receive and send information from and to other coordinators.
func (CoordinatorNetwork) FindMorePeers ¶
func (coordnet CoordinatorNetwork) FindMorePeers() error
FindMorePeers discover more peers that have already join the coordinators network