Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { Block() Block MinedBlock() MinedBlock Link() Link MinedLink() MinedLink Chain() Chain }
Application represents the blockchain application
func NewApplication ¶
func NewApplication( block Block, minedBlock MinedBlock, link Link, minedLink MinedLink, chain Chain, ) Application
NewApplication creates a new application instance
type Block ¶
type Block interface { Create(hashes []hash.Hash) (blocks.Block, error) Delete(hash hash.Hash) error }
Block represents a block application
type Chain ¶
type Chain interface { Update(id *uuid.UUID) error Delete(id *uuid.UUID) error Sync(waitPeriod time.Duration) Create( id *uuid.UUID, miningValue uint8, blockBaseDifficulty uint, blockIncreaseDiffPerHash float64, linkDifficulty uint, initialHashes []hash.Hash, ) (chains.Chain, error) }
Chain represents a chain application
func NewChain ¶
func NewChain( peerSyncInterval time.Duration, remoteAppBuilder repositories.RemoteBuilder, chainService chains.Service, blockApp Block, minedBlockApp MinedBlock, minedLinkApp MinedLink, minedLinkRepository repositories.MinedLink, chainRepositoryApp repositories.Chain, ) Chain
NewChain creates a new chain application instance
type Link ¶
type Link interface { Create(prevMinedLinkHash hash.Hash, nextBlockHash hash.Hash) (links.Link, error) Delete(hash hash.Hash) error }
Link represents the link application
func NewLink ¶
func NewLink( linkService links.Service, blockRepository repositories.Block, linkRepository repositories.Link, minedLinkRepository repositories.MinedLink, ) Link
NewLink creates a new link application instance
type MinedBlock ¶
type MinedBlock interface { Mine(miningValue uint8, baseDifficulty uint, incrPerHash float64, blockHash hash.Hash) (mined_block.Block, error) MineList(miningValue uint8, baseDifficulty uint, incrPerHash float64) ([]mined_block.Block, error) Delete(hash hash.Hash) error }
MinedBlock represents the mined block application
func NewMinedBlock ¶
func NewMinedBlock( mineBlockService mined_block.Service, mineBlockRepositoryApp repositories.MinedBlock, blockRepositoryApp repositories.Block, minerApp Miner, ) MinedBlock
NewMinedBlock creates a new mined block application instance
type MinedLink ¶
type MinedLink interface { Mine(miningValue uint8, difficulty uint, linkHash hash.Hash) (mined_link.Link, error) MineList(miningValue uint8, difficulty uint) ([]mined_link.Link, error) Delete(hash hash.Hash) error }
MinedLink represents the mined link application
func NewMinedLink ¶
func NewMinedLink( minedLinkService mined_link.Service, linkRepositoryApp repositories.Link, minedLinkRepositoryApp repositories.MinedLink, minerApp Miner, ) MinedLink
NewMinedLink creates a new mined link application instance
Click to show internal directories.
Click to hide internal directories.