Documentation ¶
Index ¶
- Variables
- func CheckOrCreateDir(fsx iFS, path string) error
- func GenesisBlock(network string) (block umi.Block)
- type Blockchain
- func (bc *Blockchain) AppendBlock(block umi.Block) error
- func (bc *Blockchain) Block(height uint32) (umi.Block, error)
- func (bc *Blockchain) Close()
- func (bc *Blockchain) Height() int
- func (bc *Blockchain) OpenOrCreate() (err error)
- func (bc *Blockchain) Scan(confirmer iConfirmer) error
- func (bc *Blockchain) StreamBlocks(writer io.Writer, height, limit uint32)
- func (bc *Blockchain) Subscribe(ch chan umi.Block)
- func (bc *Blockchain) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
- type BlockchainMemory
- func (bc *BlockchainMemory) AppendBlock(block umi.Block) error
- func (bc *BlockchainMemory) Block(height uint32) (umi.Block, error)
- func (*BlockchainMemory) Close()
- func (bc *BlockchainMemory) Height() int
- func (bc *BlockchainMemory) OpenOrCreate() error
- func (*BlockchainMemory) Scan(iConfirmer) error
- func (bc *BlockchainMemory) StreamBlocks(writer io.Writer, height, limit uint32)
- func (bc *BlockchainMemory) Subscribe(ch chan umi.Block)
- func (bc *BlockchainMemory) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
- type BlockchainMmap
- func (bc *BlockchainMmap) AppendBlock(blk umi.Block) error
- func (bc *BlockchainMmap) Block(height uint32) (umi.Block, error)
- func (bc *BlockchainMmap) Close()
- func (bc *BlockchainMmap) FastScan()
- func (bc *BlockchainMmap) Height() int
- func (bc *BlockchainMmap) OpenOrCreate() error
- func (bc *BlockchainMmap) StreamBlocks(writer io.Writer, height, limit uint32)
- func (bc *BlockchainMmap) Subscribe(ch chan umi.Block)
- func (bc *BlockchainMmap) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
- type FSx
- type IBlockchain
- type IFile
- type Index
- type Mempool
- func (mempool *Mempool) Mempool() (transactions []*umi.Transaction)
- func (mempool *Mempool) ParseBlock(block umi.Block)
- func (mempool *Mempool) Push(transaction umi.Transaction) error
- func (mempool *Mempool) SetLedger(ledger1 iLedger)
- func (mempool *Mempool) Subscribe(ch chan *umi.Transaction)
- func (mempool *Mempool) SubscribeTo(subscriber iSubscriber)
- func (mempool *Mempool) Transactions(address umi.Address) (transactions []*umi.Transaction)
- func (mempool *Mempool) UnconfirmedBalance(address umi.Address) int64
- func (mempool *Mempool) Worker(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrBlockSequence = errors.New("block sequence") )
View Source
var ( ErrNotExist = fs.ErrNotExist ErrExist = fs.ErrExist ErrPermission = fs.ErrPermission ErrIsDir = errors.New("not a file") ErrNotDir = errors.New("not a directory") ErrSize = errors.New("file has wrong size") )
View Source
var ErrMempool = errors.New("mempool")
Functions ¶
func CheckOrCreateDir ¶
func GenesisBlock ¶
Types ¶
type Blockchain ¶
func NewBlockchain ¶
func NewBlockchain(conf *config.Config) *Blockchain
func (*Blockchain) AppendBlock ¶
func (bc *Blockchain) AppendBlock(block umi.Block) error
func (*Blockchain) Close ¶
func (bc *Blockchain) Close()
func (*Blockchain) Height ¶
func (bc *Blockchain) Height() int
func (*Blockchain) OpenOrCreate ¶
func (bc *Blockchain) OpenOrCreate() (err error)
func (*Blockchain) Scan ¶
func (bc *Blockchain) Scan(confirmer iConfirmer) error
func (*Blockchain) StreamBlocks ¶
func (bc *Blockchain) StreamBlocks(writer io.Writer, height, limit uint32)
func (*Blockchain) Subscribe ¶
func (bc *Blockchain) Subscribe(ch chan umi.Block)
func (*Blockchain) Transaction ¶
func (bc *Blockchain) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
type BlockchainMemory ¶
func NewBlockchainMemory ¶
func NewBlockchainMemory(conf *config.Config) *BlockchainMemory
func (*BlockchainMemory) AppendBlock ¶
func (bc *BlockchainMemory) AppendBlock(block umi.Block) error
func (*BlockchainMemory) Block ¶
func (bc *BlockchainMemory) Block(height uint32) (umi.Block, error)
func (*BlockchainMemory) Close ¶
func (*BlockchainMemory) Close()
func (*BlockchainMemory) Height ¶
func (bc *BlockchainMemory) Height() int
func (*BlockchainMemory) OpenOrCreate ¶
func (bc *BlockchainMemory) OpenOrCreate() error
func (*BlockchainMemory) Scan ¶
func (*BlockchainMemory) Scan(iConfirmer) error
func (*BlockchainMemory) StreamBlocks ¶
func (bc *BlockchainMemory) StreamBlocks(writer io.Writer, height, limit uint32)
func (*BlockchainMemory) Subscribe ¶
func (bc *BlockchainMemory) Subscribe(ch chan umi.Block)
func (*BlockchainMemory) Transaction ¶
func (bc *BlockchainMemory) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
type BlockchainMmap ¶
func (*BlockchainMmap) AppendBlock ¶
func (bc *BlockchainMmap) AppendBlock(blk umi.Block) error
func (*BlockchainMmap) Close ¶
func (bc *BlockchainMmap) Close()
func (*BlockchainMmap) FastScan ¶
func (bc *BlockchainMmap) FastScan()
func (*BlockchainMmap) Height ¶
func (bc *BlockchainMmap) Height() int
func (*BlockchainMmap) OpenOrCreate ¶
func (bc *BlockchainMmap) OpenOrCreate() error
func (*BlockchainMmap) StreamBlocks ¶
func (bc *BlockchainMmap) StreamBlocks(writer io.Writer, height, limit uint32)
func (*BlockchainMmap) Subscribe ¶
func (bc *BlockchainMmap) Subscribe(ch chan umi.Block)
func (*BlockchainMmap) Transaction ¶
func (bc *BlockchainMmap) Transaction(blockHeight uint32, txIndex uint16) (umi.Transaction, bool)
type IBlockchain ¶
type IFile ¶
func CreateAndFillFile ¶
type Index ¶
func (*Index) SubscribeTo ¶
func (index *Index) SubscribeTo(subscriber iSubscriber)
func (*Index) TransactionsByAddress ¶
type Mempool ¶
func NewMempool ¶
func NewMempool() *Mempool
func (*Mempool) Mempool ¶
func (mempool *Mempool) Mempool() (transactions []*umi.Transaction)
func (*Mempool) ParseBlock ¶
func (*Mempool) Subscribe ¶
func (mempool *Mempool) Subscribe(ch chan *umi.Transaction)
func (*Mempool) SubscribeTo ¶
func (mempool *Mempool) SubscribeTo(subscriber iSubscriber)
func (*Mempool) Transactions ¶
func (mempool *Mempool) Transactions(address umi.Address) (transactions []*umi.Transaction)
func (*Mempool) UnconfirmedBalance ¶
Click to show internal directories.
Click to hide internal directories.