Documentation ¶
Index ¶
- func CreateOpenTransactionIndexerFiles(folderName string) transactionindexing.ITransactionIndexer
- func HardCodedJsonBlock(height int64) string
- func HardCodedJsonBlockCount() int64
- func HashOfString(in string) indexedhashes.Sha256
- func TestGenesisHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestInvalidHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestJustFiveCoinbaseBlocks_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- type AddressHandle
- func (ah *AddressHandle) Hash() indexedhashes.Sha256
- func (ah *AddressHandle) HashSpecified() bool
- func (ah *AddressHandle) Height() int64
- func (ah *AddressHandle) HeightSpecified() bool
- func (ah *AddressHandle) NthTxo(n int64) (chainreadinterface.ITxoHandle, error)
- func (ah *AddressHandle) TxoCount() (int64, error)
- type BlockHandle
- type HardCodedBlockFetcher
- type IBlockJsonFetcher
- type ITransIndicesPath
- type ITransLocatorByHash
- type JsonBlockEssential
- func (b *JsonBlockEssential) Hash() (indexedhashes.Sha256, error)
- func (b *JsonBlockEssential) HashSpecified() bool
- func (b *JsonBlockEssential) Height() int64
- func (b *JsonBlockEssential) HeightSpecified() bool
- func (b *JsonBlockEssential) IsBlockHandle()
- func (b *JsonBlockEssential) IsInvalid() bool
- func (b *JsonBlockEssential) NonEssentialInts() (*map[string]int64, error)
- func (b *JsonBlockEssential) NthTransaction(n int64) (chainreadinterface.ITransHandle, error)
- func (b *JsonBlockEssential) TransactionCount() (int64, error)
- type OneBlockChain
- func (obc *OneBlockChain) AddressInterface(handle chainreadinterface.IAddressHandle) (chainreadinterface.IAddress, error)
- func (obc *OneBlockChain) BlockInterface(handle chainreadinterface.IBlockHandle) (chainreadinterface.IBlock, error)
- func (obc *OneBlockChain) GenesisBlock() chainreadinterface.IBlockHandle
- func (obc *OneBlockChain) GenesisTransaction() (chainreadinterface.ITransHandle, error)
- func (obc *OneBlockChain) InvalidBlock() chainreadinterface.IBlockHandle
- func (obc *OneBlockChain) InvalidTrans() chainreadinterface.ITransHandle
- func (obc *OneBlockChain) IsBlockTree() bool
- func (obc *OneBlockChain) LatestBlock() (chainreadinterface.IBlockHandle, error)
- func (obc *OneBlockChain) LatestTransaction() (chainreadinterface.ITransHandle, error)
- func (obc *OneBlockChain) NextBlock(bh chainreadinterface.IBlockHandle) (chainreadinterface.IBlockHandle, error)
- func (obc *OneBlockChain) NextTransaction(transHandle chainreadinterface.ITransHandle) (chainreadinterface.ITransHandle, error)
- func (obc *OneBlockChain) ParentBlock(block chainreadinterface.IBlockHandle) chainreadinterface.IBlockHandle
- func (obc *OneBlockChain) PreviousTransaction(trans chainreadinterface.ITransHandle) chainreadinterface.ITransHandle
- func (obc *OneBlockChain) TransInterface(handle chainreadinterface.ITransHandle) (chainreadinterface.ITransaction, error)
- func (obc *OneBlockChain) TxiInterface(handle chainreadinterface.ITxiHandle) (chainreadinterface.ITxi, error)
- func (obc *OneBlockChain) TxoInterface(handle chainreadinterface.ITxoHandle) (chainreadinterface.ITxo, error)
- type TransHandle
- func (th *TransHandle) Hash() (indexedhashes.Sha256, error)
- func (th *TransHandle) HashSpecified() bool
- func (th *TransHandle) Height() int64
- func (th *TransHandle) HeightSpecified() bool
- func (th *TransHandle) IndicesPath() (int64, int64)
- func (th *TransHandle) IndicesPathSpecified() bool
- func (th *TransHandle) IsInvalid() bool
- func (th *TransHandle) IsTransHandle()
- type TxiHandle
- func (th *TxiHandle) IndicesPath() (int64, int64, int64)
- func (th *TxiHandle) IndicesPathSpecified() bool
- func (th *TxiHandle) ParentIndex() int64
- func (th *TxiHandle) ParentSpecified() bool
- func (th *TxiHandle) ParentTrans() chainreadinterface.ITransHandle
- func (th *TxiHandle) TxiHeight() int64
- func (th *TxiHandle) TxiHeightSpecified() bool
- type TxoHandle
- func (th *TxoHandle) IndicesPath() (int64, int64, int64)
- func (th *TxoHandle) IndicesPathSpecified() bool
- func (th *TxoHandle) ParentIndex() int64
- func (th *TxoHandle) ParentSpecified() bool
- func (th *TxoHandle) ParentTrans() chainreadinterface.ITransHandle
- func (th *TxoHandle) TxoHeight() int64
- func (th *TxoHandle) TxoHeightSpecified() bool
- type TxxIndicesPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOpenTransactionIndexerFiles ¶
func CreateOpenTransactionIndexerFiles(folderName string) transactionindexing.ITransactionIndexer
func HardCodedJsonBlock ¶
func HardCodedJsonBlockCount ¶
func HardCodedJsonBlockCount() int64
func HashOfString ¶
func HashOfString(in string) indexedhashes.Sha256
func TestGenesisHandle_helper ¶
func TestGenesisHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestInvalidHandle_helper ¶
func TestInvalidHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestJustFiveCoinbaseBlocks_helper ¶
func TestJustFiveCoinbaseBlocks_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
Types ¶
type AddressHandle ¶
type AddressHandle struct {
// contains filtered or unexported fields
}
func (*AddressHandle) Hash ¶
func (ah *AddressHandle) Hash() indexedhashes.Sha256
Functions in jsonblock.AddressHandle to implement chainreadinterface.IAddressHandle
func (*AddressHandle) HashSpecified ¶
func (ah *AddressHandle) HashSpecified() bool
func (*AddressHandle) Height ¶
func (ah *AddressHandle) Height() int64
func (*AddressHandle) HeightSpecified ¶
func (ah *AddressHandle) HeightSpecified() bool
func (*AddressHandle) NthTxo ¶
func (ah *AddressHandle) NthTxo(n int64) (chainreadinterface.ITxoHandle, error)
func (*AddressHandle) TxoCount ¶
func (ah *AddressHandle) TxoCount() (int64, error)
type BlockHandle ¶
type BlockHandle struct {
// contains filtered or unexported fields
}
func (*BlockHandle) Hash ¶
func (bh *BlockHandle) Hash() (indexedhashes.Sha256, error)
func (*BlockHandle) HashSpecified ¶
func (bh *BlockHandle) HashSpecified() bool
func (*BlockHandle) Height ¶
func (bh *BlockHandle) Height() int64
func (*BlockHandle) HeightSpecified ¶
func (bh *BlockHandle) HeightSpecified() bool
func (*BlockHandle) IsBlockHandle ¶
func (bh *BlockHandle) IsBlockHandle()
func (*BlockHandle) IsInvalid ¶
func (bh *BlockHandle) IsInvalid() bool
type HardCodedBlockFetcher ¶
type HardCodedBlockFetcher struct { }
func (*HardCodedBlockFetcher) CountBlocks ¶
func (fbf *HardCodedBlockFetcher) CountBlocks() (int64, error)
func (*HardCodedBlockFetcher) FetchBlockJsonBytes ¶
func (fbf *HardCodedBlockFetcher) FetchBlockJsonBytes(height int64) ([]byte, error)
type IBlockJsonFetcher ¶
type IBlockJsonFetcher interface { CountBlocks() (int64, error) FetchBlockJsonBytes(height int64) ([]byte, error) }
IBlockJsonFetcher describes an object that serves each block as json bytes
type ITransIndicesPath ¶
type ITransLocatorByHash ¶
type ITransLocatorByHash interface {
GetTransIndicesPathByHash(sha256 indexedhashes.Sha256) (ITransIndicesPath, error)
}
ITransLocatorByHash describes an object that obtains a transaction's Indices Path (block/trans) based on hash
type JsonBlockEssential ¶
type JsonBlockEssential struct { J_height int `json:"height"` J_hash string `json:"hash"` J_tx []jsonTransEssential `json:"tx"` // Non essential integers // Changes here should be reflected in postJsonGatherNonEssentialInts() J_version int64 `json:"version"` J_time int64 `json:"time"` J_mediantime int64 `json:"mediantime"` J_nonce int64 `json:"nonce"` J_difficulty float64 `json:"difficulty"` J_strippedsize int64 `json:"strippedsize"` J_size int64 `json:"size"` J_weight int64 `json:"weight"` // contains filtered or unexported fields }
func (*JsonBlockEssential) Hash ¶
func (b *JsonBlockEssential) Hash() (indexedhashes.Sha256, error)
func (*JsonBlockEssential) HashSpecified ¶
func (b *JsonBlockEssential) HashSpecified() bool
func (*JsonBlockEssential) Height ¶
func (b *JsonBlockEssential) Height() int64
func (*JsonBlockEssential) HeightSpecified ¶
func (b *JsonBlockEssential) HeightSpecified() bool
func (*JsonBlockEssential) IsBlockHandle ¶
func (b *JsonBlockEssential) IsBlockHandle()
func (*JsonBlockEssential) IsInvalid ¶
func (b *JsonBlockEssential) IsInvalid() bool
func (*JsonBlockEssential) NonEssentialInts ¶
func (b *JsonBlockEssential) NonEssentialInts() (*map[string]int64, error)
func (*JsonBlockEssential) NthTransaction ¶
func (b *JsonBlockEssential) NthTransaction(n int64) (chainreadinterface.ITransHandle, error)
func (*JsonBlockEssential) TransactionCount ¶
func (b *JsonBlockEssential) TransactionCount() (int64, error)
type OneBlockChain ¶
type OneBlockChain struct {
// contains filtered or unexported fields
}
OneBlockChain - We call it a one block chain, as one block is in memory at any point in time
func CreateOneBlockChain ¶
func CreateOneBlockChain( fetcher IBlockJsonFetcher, indexer transactionindexing.ITransactionIndexer, ) *OneBlockChain
func (*OneBlockChain) AddressInterface ¶
func (obc *OneBlockChain) AddressInterface(handle chainreadinterface.IAddressHandle) (chainreadinterface.IAddress, error)
func (*OneBlockChain) BlockInterface ¶
func (obc *OneBlockChain) BlockInterface(handle chainreadinterface.IBlockHandle) (chainreadinterface.IBlock, error)
func (*OneBlockChain) GenesisBlock ¶
func (obc *OneBlockChain) GenesisBlock() chainreadinterface.IBlockHandle
func (*OneBlockChain) GenesisTransaction ¶
func (obc *OneBlockChain) GenesisTransaction() (chainreadinterface.ITransHandle, error)
func (*OneBlockChain) InvalidBlock ¶
func (obc *OneBlockChain) InvalidBlock() chainreadinterface.IBlockHandle
func (*OneBlockChain) InvalidTrans ¶
func (obc *OneBlockChain) InvalidTrans() chainreadinterface.ITransHandle
func (*OneBlockChain) IsBlockTree ¶
func (obc *OneBlockChain) IsBlockTree() bool
func (*OneBlockChain) LatestBlock ¶
func (obc *OneBlockChain) LatestBlock() (chainreadinterface.IBlockHandle, error)
func (*OneBlockChain) LatestTransaction ¶
func (obc *OneBlockChain) LatestTransaction() (chainreadinterface.ITransHandle, error)
func (*OneBlockChain) NextBlock ¶
func (obc *OneBlockChain) NextBlock(bh chainreadinterface.IBlockHandle) (chainreadinterface.IBlockHandle, error)
func (*OneBlockChain) NextTransaction ¶
func (obc *OneBlockChain) NextTransaction(transHandle chainreadinterface.ITransHandle) (chainreadinterface.ITransHandle, error)
func (*OneBlockChain) ParentBlock ¶
func (obc *OneBlockChain) ParentBlock(block chainreadinterface.IBlockHandle) chainreadinterface.IBlockHandle
func (*OneBlockChain) PreviousTransaction ¶
func (obc *OneBlockChain) PreviousTransaction(trans chainreadinterface.ITransHandle) chainreadinterface.ITransHandle
func (*OneBlockChain) TransInterface ¶
func (obc *OneBlockChain) TransInterface(handle chainreadinterface.ITransHandle) (chainreadinterface.ITransaction, error)
func (*OneBlockChain) TxiInterface ¶
func (obc *OneBlockChain) TxiInterface(handle chainreadinterface.ITxiHandle) (chainreadinterface.ITxi, error)
func (*OneBlockChain) TxoInterface ¶
func (obc *OneBlockChain) TxoInterface(handle chainreadinterface.ITxoHandle) (chainreadinterface.ITxo, error)
type TransHandle ¶
type TransHandle struct {
// contains filtered or unexported fields
}
func (*TransHandle) Hash ¶
func (th *TransHandle) Hash() (indexedhashes.Sha256, error)
func (*TransHandle) HashSpecified ¶
func (th *TransHandle) HashSpecified() bool
func (*TransHandle) Height ¶
func (th *TransHandle) Height() int64
func (*TransHandle) HeightSpecified ¶
func (th *TransHandle) HeightSpecified() bool
func (*TransHandle) IndicesPath ¶
func (th *TransHandle) IndicesPath() (int64, int64)
func (*TransHandle) IndicesPathSpecified ¶
func (th *TransHandle) IndicesPathSpecified() bool
func (*TransHandle) IsInvalid ¶
func (th *TransHandle) IsInvalid() bool
func (*TransHandle) IsTransHandle ¶
func (th *TransHandle) IsTransHandle()
type TxiHandle ¶
type TxiHandle struct {
TxxIndicesPath
}
func (*TxiHandle) IndicesPathSpecified ¶
func (*TxiHandle) ParentIndex ¶
func (*TxiHandle) ParentSpecified ¶
func (*TxiHandle) ParentTrans ¶
func (th *TxiHandle) ParentTrans() chainreadinterface.ITransHandle
func (*TxiHandle) TxiHeightSpecified ¶
type TxoHandle ¶
type TxoHandle struct {
TxxIndicesPath
}
func (*TxoHandle) IndicesPathSpecified ¶
func (*TxoHandle) ParentIndex ¶
func (*TxoHandle) ParentSpecified ¶
func (*TxoHandle) ParentTrans ¶
func (th *TxoHandle) ParentTrans() chainreadinterface.ITransHandle
func (*TxoHandle) TxoHeightSpecified ¶
type TxxIndicesPath ¶
type TxxIndicesPath struct {
// contains filtered or unexported fields
}
TxxIndicesPath specifies block height, nth transaction within block, and vin/vout index (vindex) It is used for TxiHandle and TxoHandle
Click to show internal directories.
Click to hide internal directories.