Documentation
¶
Index ¶
- func NewGatewayClient(endpoint string, logger *zap.SugaredLogger) *gatewayClient
- func NewNetworkManager(listenAddress string, logger *zap.SugaredLogger) *networkManager
- func NewPeersMap() *peersMap
- type Api
- type ConsulService
- type KafkaMessageProducer
- type Mempool
- type MessageProducer
- type Node
- func (n *Node) Address() string
- func (n *Node) Chain() *chain.Chain
- func (n *Node) Gate() *gatewayClient
- func (n *Node) GetBlocks(ctx context.Context, v *proto.Version) (*proto.Blocks, error)
- func (n *Node) Handshake(ctx context.Context, v *proto.Version) (*proto.Version, error)
- func (r *Node) Mempool() *Mempool
- func (n *Node) NewBlock(ctx context.Context, b *proto.Block) (*proto.Block, error)
- func (n *Node) NewTransaction(ctx context.Context, t *proto.Transaction) (*proto.Transaction, error)
- func (n *Node) Start(opts NodeOpts) error
- func (n *Node) Stop() error
- func (n *Node) String() string
- type NodeOpts
- type Noder
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGatewayClient ¶
func NewGatewayClient(endpoint string, logger *zap.SugaredLogger) *gatewayClient
func NewNetworkManager ¶
func NewNetworkManager(listenAddress string, logger *zap.SugaredLogger) *networkManager
func NewPeersMap ¶
func NewPeersMap() *peersMap
Types ¶
type ConsulService ¶
type ConsulService struct {
// contains filtered or unexported fields
}
func NewConsulService ¶
func NewConsulService(logger *zap.SugaredLogger, consulListenAddr string) *ConsulService
func (*ConsulService) Start ¶
func (cs *ConsulService) Start() error
func (*ConsulService) String ¶
func (cs *ConsulService) String() string
type KafkaMessageProducer ¶
type KafkaMessageProducer struct {
// contains filtered or unexported fields
}
func (*KafkaMessageProducer) ProduceMessage ¶
func (p *KafkaMessageProducer) ProduceMessage(msg any) error
message should a type from message package in common module
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
func NewMempool ¶
func NewMempool() *Mempool
func (*Mempool) Add ¶
func (m *Mempool) Add(tx *proto.Transaction)
func (*Mempool) List ¶
func (m *Mempool) List() []*proto.Transaction
func (*Mempool) Remove ¶
func (m *Mempool) Remove(tx *proto.Transaction)
type MessageProducer ¶
func NewKafkaMessageProducer ¶
func NewKafkaMessageProducer() (MessageProducer, error)
type Node ¶
type Node struct { ServerConfig PrivateKey *crypto.PrivateKey // contains filtered or unexported fields }
func New ¶
func New(conf ServerConfig) *Node
func (*Node) NewTransaction ¶
func (n *Node) NewTransaction( ctx context.Context, t *proto.Transaction, ) (*proto.Transaction, error)
type Noder ¶
type Noder interface { Handshake(ctx context.Context, v *proto.Version) (*proto.Version, error) NewTransaction(ctx context.Context, t *proto.Transaction) (*proto.Transaction, error) NewBlock(ctx context.Context, b *proto.Block) (*proto.Block, error) GetBlocks(ctx context.Context, v *proto.Version) (*proto.Blocks, error) }
Click to show internal directories.
Click to hide internal directories.