Documentation ¶
Index ¶
- Constants
- type AmountRequest
- type AmountResponse
- type BlockResponse
- type Neighbor
- func (neighbor *Neighbor) AddTransaction(request TransactionRequest) (err error)
- func (neighbor *Neighbor) GetAmount(request AmountRequest) (amountResponse *AmountResponse, err error)
- func (neighbor *Neighbor) GetBlocks() (blockResponses []*BlockResponse, err error)
- func (neighbor *Neighbor) GetTransactions() (transactionResponses []TransactionResponse, err error)
- func (neighbor *Neighbor) Ip() string
- func (neighbor *Neighbor) IsFound() bool
- func (neighbor *Neighbor) Mine() (err error)
- func (neighbor *Neighbor) Port() uint16
- func (neighbor *Neighbor) SendTargets(request []TargetRequest) (err error)
- func (neighbor *Neighbor) StartMining() (err error)
- func (neighbor *Neighbor) StopMining() (err error)
- func (neighbor *Neighbor) Target() string
- type TargetRequest
- type TransactionRequest
- type TransactionResponse
Constants ¶
View Source
const ( GetBlocksRequest = "GET BLOCKS REQUEST" GetTransactionsRequest = "GET TRANSACTIONS REQUEST" MineRequest = "MINE REQUEST" StartMiningRequest = "START MINING REQUEST" StopMiningRequest = "STOP MINING REQUEST" NeighborFindingTimeoutSecond = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmountRequest ¶
type AmountRequest struct {
Address *string
}
func (*AmountRequest) IsInvalid ¶
func (amountRequest *AmountRequest) IsInvalid() bool
type AmountResponse ¶
type AmountResponse struct {
Amount uint64
}
type BlockResponse ¶
type BlockResponse struct { Timestamp int64 PreviousHash [32]byte Transactions []*TransactionResponse RegisteredAddresses []string }
type Neighbor ¶
type Neighbor struct {
// contains filtered or unexported fields
}
func (*Neighbor) AddTransaction ¶
func (neighbor *Neighbor) AddTransaction(request TransactionRequest) (err error)
func (*Neighbor) GetAmount ¶
func (neighbor *Neighbor) GetAmount(request AmountRequest) (amountResponse *AmountResponse, err error)
func (*Neighbor) GetBlocks ¶
func (neighbor *Neighbor) GetBlocks() (blockResponses []*BlockResponse, err error)
func (*Neighbor) GetTransactions ¶
func (neighbor *Neighbor) GetTransactions() (transactionResponses []TransactionResponse, err error)
func (*Neighbor) SendTargets ¶
func (neighbor *Neighbor) SendTargets(request []TargetRequest) (err error)
func (*Neighbor) StartMining ¶
func (*Neighbor) StopMining ¶
type TargetRequest ¶
func (*TargetRequest) IsInvalid ¶
func (targetRequest *TargetRequest) IsInvalid() bool
Click to show internal directories.
Click to hide internal directories.