Documentation
¶
Index ¶
- Constants
- type Client
- type ClientFactory
- type Host
- type Neighbor
- func (neighbor *Neighbor) AddTransaction(request network.TransactionRequest) (err error)
- func (neighbor *Neighbor) GetAmount(request network.AmountRequest) (amountResponse *network.AmountResponse, err error)
- func (neighbor *Neighbor) GetBlocks() (blockResponses []*network.BlockResponse, err error)
- func (neighbor *Neighbor) GetTransactions() (transactionResponses []network.TransactionResponse, err error)
- func (neighbor *Neighbor) Ip() string
- func (neighbor *Neighbor) Mine() (err error)
- func (neighbor *Neighbor) Port() uint16
- func (neighbor *Neighbor) SendTargets(request []network.TargetRequest) (err error)
- func (neighbor *Neighbor) StartMining() (err error)
- func (neighbor *Neighbor) StopMining() (err error)
- func (neighbor *Neighbor) Target() string
- type Server
- type Synchronizer
- type Target
Constants ¶
View Source
const ( GetBlocksRequest = "GET BLOCKS REQUEST" GetTransactionsRequest = "GET TRANSACTIONS REQUEST" MineRequest = "MINE REQUEST" StartMiningRequest = "START MINING REQUEST" StopMiningRequest = "STOP MINING REQUEST" )
View Source
const (
DefaultPort = 8106
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type Neighbor ¶
type Neighbor struct {
// contains filtered or unexported fields
}
func NewNeighbor ¶
func NewNeighbor(target *Target, clientFactory ClientFactory) (*Neighbor, error)
func (*Neighbor) AddTransaction ¶
func (neighbor *Neighbor) AddTransaction(request network.TransactionRequest) (err error)
func (*Neighbor) GetAmount ¶
func (neighbor *Neighbor) GetAmount(request network.AmountRequest) (amountResponse *network.AmountResponse, err error)
func (*Neighbor) GetBlocks ¶
func (neighbor *Neighbor) GetBlocks() (blockResponses []*network.BlockResponse, err error)
func (*Neighbor) GetTransactions ¶
func (neighbor *Neighbor) GetTransactions() (transactionResponses []network.TransactionResponse, err error)
func (*Neighbor) SendTargets ¶
func (neighbor *Neighbor) SendTargets(request []network.TargetRequest) (err error)
func (*Neighbor) StartMining ¶
func (*Neighbor) StopMining ¶
type Synchronizer ¶
type Synchronizer struct {
// contains filtered or unexported fields
}
func NewSynchronizer ¶
func NewSynchronizer(hostPort uint16, watch clock.Watch, clientFactory ClientFactory, configurationPath string, logger log.Logger) (synchronizer *Synchronizer, err error)
func (*Synchronizer) AddTargets ¶
func (synchronizer *Synchronizer) AddTargets(targetRequests []network.TargetRequest)
func (*Synchronizer) Neighbors ¶
func (synchronizer *Synchronizer) Neighbors() []network.Neighbor
func (*Synchronizer) Synchronize ¶
func (synchronizer *Synchronizer) Synchronize(int64)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.