services

package
v0.0.0-...-d1df423 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastBlock

func BroadcastBlock(block *blockchain.Block, msg *messages.Message)

func BroadcastTran

func BroadcastTran(tran *blockchain.Transaction)

func RequestHeight

func RequestHeight(c *blockchain.BlockChain, height uint64)

func RequestHeightTask

func RequestHeightTask()

func StartTask

func StartTask()

Types

type BlockChainService

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

func GetBlockChainService

func GetBlockChainService() *BlockChainService

func (*BlockChainService) GetTransChannel

func (s *BlockChainService) GetTransChannel() chan<- *blockchain.Transaction

func (*BlockChainService) Messages

func (s *BlockChainService) Messages() []messages.MessageHandler

func (*BlockChainService) RunBlocksHash

func (s *BlockChainService) RunBlocksHash(t *dht.Transport, msg *messages.Message) error

func (*BlockChainService) RunGetBlock

func (s *BlockChainService) RunGetBlock(t *dht.Transport, msg *messages.Message) error

func (*BlockChainService) RunGetBlockAck

func (s *BlockChainService) RunGetBlockAck(t *dht.Transport, msg *messages.Message) error

func (*BlockChainService) RunNewTransaction

func (s *BlockChainService) RunNewTransaction(t *dht.Transport, msg *messages.Message) error

func (*BlockChainService) RunRequestHeight

func (s *BlockChainService) RunRequestHeight(t *dht.Transport, msg *messages.Message) error

func (*BlockChainService) Start

func (s *BlockChainService) Start() error

func (*BlockChainService) Stop

func (s *BlockChainService) Stop() error

type DiscoveryService

type DiscoveryService struct{}

func (*DiscoveryService) Messages

func (s *DiscoveryService) Messages() []messages.MessageHandler

func (*DiscoveryService) RunFindNode

func (s *DiscoveryService) RunFindNode(t *dht.Transport, msg *messages.Message) error

func (*DiscoveryService) RunFindNodeAck

func (s *DiscoveryService) RunFindNodeAck(t *dht.Transport, msg *messages.Message) error

func (*DiscoveryService) RunHelloTCP

func (s *DiscoveryService) RunHelloTCP(t *dht.Transport, msg *messages.Message) error

func (*DiscoveryService) Start

func (s *DiscoveryService) Start() error

func (*DiscoveryService) Stop

func (s *DiscoveryService) Stop() error

type HeartbeatService

type HeartbeatService struct{}

func (*HeartbeatService) Messages

func (s *HeartbeatService) Messages() []messages.MessageHandler

func (*HeartbeatService) RunHeartbeat

func (s *HeartbeatService) RunHeartbeat(t *dht.Transport, msg *messages.Message) error

func (*HeartbeatService) RunHeartbeatAck

func (s *HeartbeatService) RunHeartbeatAck(t *dht.Transport, msg *messages.Message) error

func (*HeartbeatService) Start

func (s *HeartbeatService) Start() error

func (*HeartbeatService) Stop

func (s *HeartbeatService) Stop() error

type Service

type Service interface {
	Messages() []messages.MessageHandler
	Start() error
	Stop() error
}

func NewBlockChainService

func NewBlockChainService() Service

func NewDiscoveryService

func NewDiscoveryService() Service

func NewHeartbeatService

func NewHeartbeatService() Service

type Stack

type Stack struct {
	Name string
	// contains filtered or unexported fields
}
var GeneralStack *Stack

func NewStack

func NewStack(name string) *Stack

func NewStackWithTemplate

func NewStackWithTemplate(presetName string) *Stack

func (*Stack) GetService

func (s *Stack) GetService(serviceType reflect.Type) Service

func (*Stack) RegisterService

func (s *Stack) RegisterService(c serviceConstructor)

func (*Stack) Start

func (s *Stack) Start() error

func (*Stack) Stop

func (s *Stack) Stop() error

Jump to

Keyboard shortcuts

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