Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder interface { Create() Builder WithID(id *uuid.UUID) Builder WithPeers(peers peers.Peers) Builder WithOriginal(original Chain) Builder WithGenesis(gen genesis.Genesis) Builder WithRoot(root block_mined.Block) Builder WithHead(head link_mined.Link) Builder CreatedOn(createdOn time.Time) Builder Now() (Chain, error) }
Builder represents a chain builder
func NewBuilder ¶
NewBuilder creates a new builder instance
type Chain ¶
type Chain interface { ID() *uuid.UUID Peers() peers.Peers Genesis() genesis.Genesis Root() block_mined.Block TotalHashes() uint Height() uint CreatedOn() time.Time HasHead() bool Head() link_mined.Link }
Chain represents a chain
func CreateChainForTests ¶
func CreateChainForTests() Chain
CreateChainForTests creates a new chain instance for tests
type Repository ¶
Repository represents a chain repository
type Service ¶
type Service interface { Insert(chain Chain) error Update(original Chain, updated Chain) error Delete(chain Chain) error }
Service represents a chain service
type Validator ¶
Validator represents a chain validator
func NewValidator ¶
func NewValidator( minedBlockValidator mined_block.Validator, minedLinkValidator mined_link.Validator, chainRepository Repository, ) Validator
NewValidator creates a new validator instance
Click to show internal directories.
Click to hide internal directories.