Documentation ¶
Index ¶
- Constants
- Variables
- func BlockReadyToAggregate(block *protocol.Block) bool
- func DeleteAll()
- func DeleteAllFundsTxBeforeAggregation()
- func DeleteAllLastClosedBlock()
- func DeleteBootstrapReceivedMempool()
- func DeleteClosedBlock(hash [32]byte)
- func DeleteClosedTx(transaction protocol.Transaction)
- func DeleteFundsTxBeforeAggregation(hash [32]byte) bool
- func DeleteINVALIDOpenTx(transaction protocol.Transaction)
- func DeleteLastClosedBlock(hash [32]byte)
- func DeleteOpenBlock(hash [32]byte)
- func DeleteOpenTx(transaction protocol.Transaction)
- func DeleteOpenTxWithHash(transactionHash [32]byte)
- func GetAccTxPubKeys(accTxData [][32]byte) (accTxPubKeys [][32]byte)
- func GetAccount(hash [32]byte) (acc *protocol.Account, err error)
- func GetFundsTxPubKeys(fundsTxData [][32]byte) (fundsTxPubKeys [][32]byte)
- func GetRootAccount(hash [32]byte) (acc *protocol.Account, err error)
- func GetTxPubKeys(block *protocol.Block) (txPubKeys [][32]byte)
- func Init(dbname string, bootstrapIpport string)
- func InitLogger() *log.Logger
- func IsRootKey(hash [32]byte) bool
- func ReadAllBootstrapReceivedTransactions() (allOpenTxs []protocol.Transaction)
- func ReadAllClosedBlocks() (allClosedBlocks []*protocol.Block)
- func ReadAllOpenTxs() (allOpenTxs []protocol.Transaction)
- func ReadBootstrapReceivedTransactions(hash [32]byte) (transaction protocol.Transaction)
- func ReadClosedBlock(hash [32]byte) (block *protocol.Block)
- func ReadClosedBlockWithoutTx(hash [32]byte) (block *protocol.Block)
- func ReadClosedTx(hash [32]byte) (transaction protocol.Transaction)
- func ReadFundsTxBeforeAggregation() []*protocol.FundsTx
- func ReadINVALIDOpenTx(hash [32]byte) (transaction protocol.Transaction)
- func ReadLastClosedBlock() (block *protocol.Block)
- func ReadMempool()
- func ReadOpenBlock(hash [32]byte) (block *protocol.Block)
- func ReadOpenTx(hash [32]byte) (transaction protocol.Transaction)
- func ReadReceivedBlockStash() (receivedBlocks []*protocol.Block)
- func TearDown()
- func UpdateBlocksToBlocksWithoutTx(block *protocol.Block) (err error)
- func WriteAccount(account *protocol.Account)
- func WriteBootstrapTxReceived(transaction protocol.Transaction)
- func WriteClosedBlock(block *protocol.Block) (err error)
- func WriteClosedBlockWithoutTx(block *protocol.Block) (err error)
- func WriteClosedTx(transaction protocol.Transaction) (err error)
- func WriteFundsTxBeforeAggregation(transaction *protocol.FundsTx)
- func WriteINVALIDOpenTx(transaction protocol.Transaction)
- func WriteLastClosedBlock(block *protocol.Block) (err error)
- func WriteOpenBlock(block *protocol.Block) (err error)
- func WriteOpenTx(transaction protocol.Transaction)
- func WriteToReceivedStash(block *protocol.Block)
- type ByHeight
Constants ¶
const (
ERROR_MSG = "Initiate storage aborted: "
)
Variables ¶
var ( State = make(map[[32]byte]*protocol.Account) RootKeys = make(map[[32]byte]*protocol.Account) DifferentSenders = make(map[[32]byte]uint32) DifferentReceivers = make(map[[32]byte]uint32) FundsTxBeforeAggregation = make([]*protocol.FundsTx, 0) AllClosedBlocksAsc []*protocol.Block Bootstrap_Server string )
Functions ¶
func BlockReadyToAggregate ¶
func DeleteAllFundsTxBeforeAggregation ¶
func DeleteAllFundsTxBeforeAggregation()
func DeleteAllLastClosedBlock ¶
func DeleteAllLastClosedBlock()
func DeleteBootstrapReceivedMempool ¶
func DeleteBootstrapReceivedMempool()
func DeleteClosedBlock ¶
func DeleteClosedBlock(hash [32]byte)
func DeleteClosedTx ¶
func DeleteClosedTx(transaction protocol.Transaction)
func DeleteINVALIDOpenTx ¶
func DeleteINVALIDOpenTx(transaction protocol.Transaction)
func DeleteLastClosedBlock ¶
func DeleteLastClosedBlock(hash [32]byte)
func DeleteOpenBlock ¶
func DeleteOpenBlock(hash [32]byte)
There exist open/closed buckets and closed tx buckets for all types (open txs are in volatile storage)
func DeleteOpenTx ¶
func DeleteOpenTx(transaction protocol.Transaction)
func DeleteOpenTxWithHash ¶
func DeleteOpenTxWithHash(transactionHash [32]byte)
func GetAccTxPubKeys ¶
Get all pubKey involved in AccTx
func GetAccount ¶
Needed by miner and p2p package
func GetFundsTxPubKeys ¶
Get all pubKey involved in FundsTx
func GetTxPubKeys ¶
Get all pubKeys involved in AccTx, FundsTx of a given block
func InitLogger ¶
func ReadAllBootstrapReceivedTransactions ¶
func ReadAllBootstrapReceivedTransactions() (allOpenTxs []protocol.Transaction)
func ReadAllClosedBlocks ¶
This method does read all blocks in closedBlocks & closedblockswithouttx.
func ReadAllOpenTxs ¶
func ReadAllOpenTxs() (allOpenTxs []protocol.Transaction)
Needed for the miner to prepare a new block
func ReadBootstrapReceivedTransactions ¶
func ReadBootstrapReceivedTransactions(hash [32]byte) (transaction protocol.Transaction)
func ReadClosedBlock ¶
func ReadClosedBlockWithoutTx ¶
This function does read all blocks without transactions inside.
func ReadClosedTx ¶
func ReadClosedTx(hash [32]byte) (transaction protocol.Transaction)
Personally I like it better to test (which tx type it is) here, and get returned the interface. Simplifies the code
func ReadINVALIDOpenTx ¶
func ReadINVALIDOpenTx(hash [32]byte) (transaction protocol.Transaction)
func ReadLastClosedBlock ¶
func ReadMempool ¶
func ReadMempool()
func ReadOpenBlock ¶
Always return nil if requested hash is not in the storage. This return value is then checked against by the caller
func ReadOpenTx ¶
func ReadOpenTx(hash [32]byte) (transaction protocol.Transaction)
func ReadReceivedBlockStash ¶
func WriteAccount ¶
func WriteBootstrapTxReceived ¶
func WriteBootstrapTxReceived(transaction protocol.Transaction)
func WriteClosedBlock ¶
func WriteClosedTx ¶
func WriteClosedTx(transaction protocol.Transaction) (err error)
func WriteINVALIDOpenTx ¶
func WriteINVALIDOpenTx(transaction protocol.Transaction)
func WriteLastClosedBlock ¶
func WriteOpenBlock ¶
func WriteOpenTx ¶
func WriteOpenTx(transaction protocol.Transaction)
Changing the "tx" shortcut here and using "transaction" to distinguish between bolt's transactions