Documentation
¶
Overview ¶
Defines the `LocalNode` type of Node, which is our node
A `LocalNode` is the local node, as opposed to a `Validator` which is the remote nodes this `LocalNode` sees.
There should only be one `LocalNode` per program.
Functions and types usable only from unit tests ¶
Defines the `Validator` type of Node, which is a remote node ¶
A `Validator` is a remote node as seen by the other type of node (`LocalNode`). It provides any information which is node-specific and relevant to us / consensus.
Index ¶
- func MakeAlias(address string) string
- type LocalNode
- func (n *LocalNode) AddValidators(validators ...*Validator) error
- func (n *LocalNode) Address() string
- func (n *LocalNode) Alias() string
- func (n *LocalNode) BindEndpoint() *common.Endpoint
- func (n *LocalNode) ClearValidators()
- func (n *LocalNode) ConvertToValidator() *Validator
- func (n *LocalNode) Endpoint() *common.Endpoint
- func (n *LocalNode) Equal(a Node) bool
- func (n *LocalNode) GetValidators() map[string]*Validator
- func (n *LocalNode) HasValidators(address string) bool
- func (n *LocalNode) Keypair() *keypair.Full
- func (n *LocalNode) MarshalJSON() ([]byte, error)
- func (n *LocalNode) PublishEndpoint() *common.Endpoint
- func (n *LocalNode) Serialize() ([]byte, error)
- func (n *LocalNode) SetBooting()
- func (n *LocalNode) SetConsensus()
- func (n *LocalNode) SetPublishEndpoint(endpoint *common.Endpoint)
- func (n *LocalNode) SetSync()
- func (n *LocalNode) SetWatch()
- func (n *LocalNode) State() State
- func (n *LocalNode) String() string
- func (n *LocalNode) Validator(address string) *Validator
- type Node
- type NodeBlockInfo
- type NodeInfo
- type NodeInfoNode
- type NodePolicy
- type NodeVersion
- type Queue
- type State
- type Validator
- func (v *Validator) Address() string
- func (v *Validator) Alias() string
- func (v *Validator) Endpoint() *common.Endpoint
- func (v *Validator) Equal(a Node) bool
- func (v *Validator) MarshalJSON() ([]byte, error)
- func (v *Validator) Serialize() ([]byte, error)
- func (v *Validator) SetEndpoint(endpoint *common.Endpoint)
- func (v *Validator) String() string
- func (v *Validator) UnmarshalJSON(b []byte) error
- type ValidatorFromJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalNode ¶
func NewLocalNode ¶
func NewTestLocalNode ¶
Ditto
func NewTestLocalNode0 ¶
func NewTestLocalNode0() *LocalNode
Return a new LocalNode with sensible defaults
func (*LocalNode) AddValidators ¶
func (*LocalNode) BindEndpoint ¶
func (*LocalNode) ClearValidators ¶
func (n *LocalNode) ClearValidators()
func (*LocalNode) ConvertToValidator ¶
func (*LocalNode) GetValidators ¶
func (*LocalNode) HasValidators ¶
func (*LocalNode) MarshalJSON ¶
func (*LocalNode) PublishEndpoint ¶
func (*LocalNode) SetBooting ¶
func (n *LocalNode) SetBooting()
func (*LocalNode) SetConsensus ¶
func (n *LocalNode) SetConsensus()
func (*LocalNode) SetPublishEndpoint ¶
type NodeBlockInfo ¶
type NodeInfo ¶
type NodeInfo struct {
Node NodeInfoNode `json:"node"`
Policy NodePolicy `json:"policy"`
Block NodeBlockInfo `json:"block"`
}
func NewNodeInfoFromJSON ¶
type NodeInfoNode ¶
type NodePolicy ¶
type NodePolicy struct {
NetworkID string `json:"network-id"` // network id
InitialBalance common.Amount `json:"initial-balance"` // initial balance of genesis account
BaseReserve common.Amount `json:"base-reserve"` // base reserve for one account
BaseFee common.Amount `json:"base-fee"` // base fee of operation
BlockTime time.Duration `json:"block-time"` // block creation time
BlockTimeDelta time.Duration `json:"block-time-delta"`
TimeoutINIT time.Duration `json:"timeout-init"`
TimeoutSIGN time.Duration `json:"timeout-sign"`
TimeoutACCEPT time.Duration `json:"timeout-accept"`
TimeoutALLCONFIRM time.Duration `json:"timeout-allconfirm"`
RateLimitRuleAPI string `json:"rate-limit-api"`
RateLimitRuleNode string `json:"rate-limit-node"`
TransactionsLimit int `json:"transactions-limit"` // transactions limit in a ballot
OperationsLimit int `json:"operations-limit"` // operations limit in a transaction
OperationsInBallotLimit int `json:"operations-in-ballot-limit"` // operations limit in a ballot
GenesisBlockConfirmedTime string `json:"genesis-block-confirmed-time"` // confirmed time of genesis block; see `common.GenesisBlockConfirmedTime`
InflationRatio string `json:"inflation-ratio"` // inflation ratio; see `common.InflationRatio`
UnfreezingPeriod uint64 `json:"unfreezing-period"` // unfreezing period
BlockHeightEndOfInflation uint64 `json:"block-height-end-of-inflation"` // block height of inflation end; see `common.BlockHeightEndOfInflation`
}
type NodeVersion ¶
type Validator ¶
func NewValidator ¶
func NewValidatorFromURI ¶
func (*Validator) MarshalJSON ¶
func (*Validator) SetEndpoint ¶
func (*Validator) UnmarshalJSON ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sebak is the node of blockchain, which implements "ISAAC" Consensus Protocol at first time.
|
Package sebak is the node of blockchain, which implements "ISAAC" Consensus Protocol at first time. |
Click to show internal directories.
Click to hide internal directories.