Documentation ¶
Index ¶
- Constants
- func Test_print_all_address_balance(db *statedomaindb.StateDomainDB)
- type ChainState
- func (cs *ChainState) Balance(addr fields.Address) (*stores.Balance, error)
- func (cs *ChainState) BalanceDel(addr fields.Address) error
- func (cs *ChainState) BalanceSet(addr fields.Address, balance *stores.Balance) error
- func (cs *ChainState) BitcoinLendingCreate(lendid fields.BitcoinSyslendId, stoitem *stores.BitcoinSystemLending) error
- func (cs *ChainState) BitcoinLendingDelete(lendid fields.BitcoinSyslendId) error
- func (cs *ChainState) BitcoinLendingUpdate(lendid fields.BitcoinSyslendId, stoitem *stores.BitcoinSystemLending) error
- func (cs *ChainState) BitcoinSystemLending(lendid fields.BitcoinSyslendId) (*stores.BitcoinSystemLending, error)
- func (cs *ChainState) BlockStore() interfacev2.BlockStore
- func (cs *ChainState) BlockStoreRead() interfaces.BlockStoreRead
- func (cs *ChainState) Channel(channelid fields.ChannelId) (*stores.Channel, error)
- func (cs *ChainState) ChannelCreate(channel_id fields.ChannelId, channel *stores.Channel) error
- func (cs *ChainState) ChannelDelete(channel_id fields.ChannelId) error
- func (cs *ChainState) ChannelUpdate(channel_id fields.ChannelId, channel *stores.Channel) error
- func (cs *ChainState) Chaswap(chaswap_id fields.HashHalfChecker) (*stores.Chaswap, error)
- func (cs *ChainState) ChaswapCreate(chaswap_id fields.HashHalfChecker, chaswap *stores.Chaswap) error
- func (cs *ChainState) ChaswapDelete(chaswap_id fields.HashHalfChecker) error
- func (cs *ChainState) ChaswapUpdate(chaswap_id fields.HashHalfChecker, chaswap *stores.Chaswap) error
- func (cs *ChainState) CheckTxHash(txhx fields.Hash) (bool, error)
- func (cs *ChainState) Close()
- func (cs *ChainState) ContainTxHash(txhx fields.Hash, blkhei fields.BlockHeight) error
- func (cs *ChainState) Destory()
- func (cs *ChainState) DestoryTemporary()
- func (cs *ChainState) Diamond(diamond fields.DiamondName) (*stores.Diamond, error)
- func (cs *ChainState) DiamondDel(diamond_name fields.DiamondName) error
- func (cs *ChainState) DiamondLendingCreate(dmdid fields.DiamondSyslendId, stoitem *stores.DiamondSystemLending) error
- func (cs *ChainState) DiamondLendingDelete(dmdid fields.DiamondSyslendId) error
- func (cs *ChainState) DiamondLendingUpdate(dmdid fields.DiamondSyslendId, stoitem *stores.DiamondSystemLending) error
- func (cs *ChainState) DiamondSet(diamond_name fields.DiamondName, diamond *stores.Diamond) error
- func (cs *ChainState) DiamondSystemLending(dmdid fields.DiamondSyslendId) (*stores.DiamondSystemLending, error)
- func (cs *ChainState) Fork() (interfacev2.ChainState, error)
- func (cs *ChainState) GetPendingBlockHash() fields.Hash
- func (cs *ChainState) GetPendingBlockHeight() uint64
- func (cs *ChainState) GetPendingSubmitStoreDiamond() (*stores.DiamondSmelt, error)
- func (cs *ChainState) IncompleteSaveLastestBlockHeadAndMeta() error
- func (cs *ChainState) IncompleteSaveLastestDiamond() error
- func (cs *ChainState) IncompleteSaveTotalSupply() error
- func (cs *ChainState) IsDatabaseVersionRebuildMode() bool
- func (cs *ChainState) IsInTxPool() bool
- func (cs *ChainState) LoadValidatedSatoshiGenesis(trsno int64) (*stores.SatoshiGenesis, bool)
- func (cs *ChainState) Lockbls(lkid fields.LockblsId) (*stores.Lockbls, error)
- func (cs *ChainState) LockblsCreate(lkid fields.LockblsId, stoitem *stores.Lockbls) error
- func (cs *ChainState) LockblsDelete(lkid fields.LockblsId) error
- func (cs *ChainState) LockblsUpdate(lkid fields.LockblsId, stoitem *stores.Lockbls) error
- func (cs *ChainState) MergeCoverWriteChainState(src *ChainState) error
- func (cs *ChainState) NewSubBranchTemporaryChainState() (*ChainState, error)
- func (cs *ChainState) ReadLastestBlockHeadAndMeta() (interfacev2.Block, error)
- func (cs *ChainState) ReadLastestBlockHeadMetaForRead() (interfaces.BlockHeadMetaRead, error)
- func (cs *ChainState) ReadLastestDiamond() (*stores.DiamondSmelt, error)
- func (cs *ChainState) ReadMoveBTCTxHashByNumber(number uint32) ([]byte, error)
- func (cs *ChainState) ReadMoveBTCTxHashByTrsNo(trsno uint32) ([]byte, error)
- func (cs *ChainState) ReadTotalSupply() (*stores.TotalSupply, error)
- func (cs *ChainState) ReadTransactionBytesByHash(txhx fields.Hash) (fields.BlockHeight, []byte, error)
- func (cs *ChainState) ReadTxBelongHeightByHash(txhx fields.Hash) (fields.BlockHeight, error)
- func (cs *ChainState) RemoveTxHash(txhx fields.Hash) error
- func (cs *ChainState) SaveMoveBTCBelongTxHash(trsno uint32, txhash []byte) error
- func (cs *ChainState) SetBlockStore(store interfacev2.BlockStore) error
- func (cs *ChainState) SetDatabaseVersionRebuildMode(set bool)
- func (cs *ChainState) SetInTxPool(stat bool)
- func (cs *ChainState) SetLastestBlockHeadAndMeta(blockmeta interfacev2.Block) error
- func (cs *ChainState) SetLastestDiamond(diamond *stores.DiamondSmelt) error
- func (cs *ChainState) SetPendingBlockHash(hash fields.Hash)
- func (cs *ChainState) SetPendingBlockHeight(height uint64)
- func (cs *ChainState) SetPendingSubmitStoreDiamond(diamond *stores.DiamondSmelt) error
- func (cs *ChainState) SubmitDataStoreWriteToInvariableDisk(block interfacev2.Block) error
- func (cs *ChainState) UpdateSetTotalSupply(totalobj *stores.TotalSupply) error
- func (cs *ChainState) UserLending(lendid fields.UserLendingId) (*stores.UserLending, error)
- func (cs *ChainState) UserLendingCreate(lendid fields.UserLendingId, stoitem *stores.UserLending) error
- func (cs *ChainState) UserLendingDelete(lendid fields.UserLendingId) error
- func (cs *ChainState) UserLendingUpdate(lendid fields.UserLendingId, stoitem *stores.UserLending) error
- type ChainStateConfig
Constants ¶
View Source
const ( LastestStatusKeyName_lastest_block_head_meta = "lastest_block_head_meta" LastestStatusKeyName_lastest_diamond = "lastest_diamond" LastestStatusKeyName_total_supply = "total_supply" )
Variables ¶
This section is empty.
Functions ¶
func Test_print_all_address_balance ¶
func Test_print_all_address_balance(db *statedomaindb.StateDomainDB)
Types ¶
type ChainState ¶
type ChainState struct {
// contains filtered or unexported fields
}
func NewChainState ¶
func NewChainState(cnf *ChainStateConfig) (*ChainState, error)
func (*ChainState) BalanceDel ¶
func (cs *ChainState) BalanceDel(addr fields.Address) error
func (*ChainState) BalanceSet ¶
func (*ChainState) BitcoinLendingCreate ¶
func (cs *ChainState) BitcoinLendingCreate(lendid fields.BitcoinSyslendId, stoitem *stores.BitcoinSystemLending) error
Create diamond lending
func (*ChainState) BitcoinLendingDelete ¶
func (cs *ChainState) BitcoinLendingDelete(lendid fields.BitcoinSyslendId) error
delete
func (*ChainState) BitcoinLendingUpdate ¶
func (cs *ChainState) BitcoinLendingUpdate(lendid fields.BitcoinSyslendId, stoitem *stores.BitcoinSystemLending) error
to update
func (*ChainState) BitcoinSystemLending ¶
func (cs *ChainState) BitcoinSystemLending(lendid fields.BitcoinSyslendId) (*stores.BitcoinSystemLending, error)
Diamondlending query
func (*ChainState) BlockStore ¶
func (cs *ChainState) BlockStore() interfacev2.BlockStore
chain data store
func (*ChainState) BlockStoreRead ¶
func (cs *ChainState) BlockStoreRead() interfaces.BlockStoreRead
func (*ChainState) ChannelCreate ¶
func (*ChainState) ChannelDelete ¶
func (cs *ChainState) ChannelDelete(channel_id fields.ChannelId) error
func (*ChainState) ChannelUpdate ¶
func (*ChainState) Chaswap ¶
func (cs *ChainState) Chaswap(chaswap_id fields.HashHalfChecker) (*stores.Chaswap, error)
func (*ChainState) ChaswapCreate ¶
func (cs *ChainState) ChaswapCreate(chaswap_id fields.HashHalfChecker, chaswap *stores.Chaswap) error
func (*ChainState) ChaswapDelete ¶
func (cs *ChainState) ChaswapDelete(chaswap_id fields.HashHalfChecker) error
func (*ChainState) ChaswapUpdate ¶
func (cs *ChainState) ChaswapUpdate(chaswap_id fields.HashHalfChecker, chaswap *stores.Chaswap) error
func (*ChainState) CheckTxHash ¶
func (cs *ChainState) CheckTxHash(txhx fields.Hash) (bool, error)
Check whether the transaction is linked
func (*ChainState) Close ¶
func (cs *ChainState) Close()
func (*ChainState) ContainTxHash ¶
func (cs *ChainState) ContainTxHash(txhx fields.Hash, blkhei fields.BlockHeight) error
Write include transaction hash
func (*ChainState) Diamond ¶
func (cs *ChainState) Diamond(diamond fields.DiamondName) (*stores.Diamond, error)
func (*ChainState) DiamondDel ¶
func (cs *ChainState) DiamondDel(diamond_name fields.DiamondName) error
func (*ChainState) DiamondLendingCreate ¶
func (cs *ChainState) DiamondLendingCreate(dmdid fields.DiamondSyslendId, stoitem *stores.DiamondSystemLending) error
Create diamond lending
func (*ChainState) DiamondLendingDelete ¶
func (cs *ChainState) DiamondLendingDelete(dmdid fields.DiamondSyslendId) error
delete
func (*ChainState) DiamondLendingUpdate ¶
func (cs *ChainState) DiamondLendingUpdate(dmdid fields.DiamondSyslendId, stoitem *stores.DiamondSystemLending) error
to update
func (*ChainState) DiamondSet ¶
func (cs *ChainState) DiamondSet(diamond_name fields.DiamondName, diamond *stores.Diamond) error
func (*ChainState) DiamondSystemLending ¶
func (cs *ChainState) DiamondSystemLending(dmdid fields.DiamondSyslendId) (*stores.DiamondSystemLending, error)
Diamondlending query
func (*ChainState) Fork ¶
func (cs *ChainState) Fork() (interfacev2.ChainState, error)
interface api
func (*ChainState) GetPendingBlockHash ¶
func (cs *ChainState) GetPendingBlockHash() fields.Hash
func (*ChainState) GetPendingBlockHeight ¶
func (cs *ChainState) GetPendingBlockHeight() uint64
func (*ChainState) GetPendingSubmitStoreDiamond ¶
func (cs *ChainState) GetPendingSubmitStoreDiamond() (*stores.DiamondSmelt, error)
func (*ChainState) IncompleteSaveLastestBlockHeadAndMeta ¶
func (cs *ChainState) IncompleteSaveLastestBlockHeadAndMeta() error
func (*ChainState) IncompleteSaveLastestDiamond ¶
func (cs *ChainState) IncompleteSaveLastestDiamond() error
func (*ChainState) IncompleteSaveTotalSupply ¶
func (cs *ChainState) IncompleteSaveTotalSupply() error
func (*ChainState) IsDatabaseVersionRebuildMode ¶
func (cs *ChainState) IsDatabaseVersionRebuildMode() bool
func (*ChainState) IsInTxPool ¶
func (cs *ChainState) IsInTxPool() bool
func (*ChainState) LoadValidatedSatoshiGenesis ¶
func (cs *ChainState) LoadValidatedSatoshiGenesis(trsno int64) (*stores.SatoshiGenesis, bool)
Get the verified BTC transfer log, return the obtained content and whether verification is required
func (*ChainState) LockblsCreate ¶
Create linear lock
func (*ChainState) LockblsDelete ¶
func (cs *ChainState) LockblsDelete(lkid fields.LockblsId) error
delete
func (*ChainState) LockblsUpdate ¶
Release (take out any available quota)
func (*ChainState) MergeCoverWriteChainState ¶
func (cs *ChainState) MergeCoverWriteChainState(src *ChainState) error
merge write
func (*ChainState) NewSubBranchTemporaryChainState ¶
func (cs *ChainState) NewSubBranchTemporaryChainState() (*ChainState, error)
fork sub
func (*ChainState) ReadLastestBlockHeadAndMeta ¶
func (cs *ChainState) ReadLastestBlockHeadAndMeta() (interfacev2.Block, error)
func (*ChainState) ReadLastestBlockHeadMetaForRead ¶
func (cs *ChainState) ReadLastestBlockHeadMetaForRead() (interfaces.BlockHeadMetaRead, error)
func (*ChainState) ReadLastestDiamond ¶
func (cs *ChainState) ReadLastestDiamond() (*stores.DiamondSmelt, error)
func (*ChainState) ReadMoveBTCTxHashByNumber ¶
func (cs *ChainState) ReadMoveBTCTxHashByNumber(number uint32) ([]byte, error)
func (*ChainState) ReadMoveBTCTxHashByTrsNo ¶
func (cs *ChainState) ReadMoveBTCTxHashByTrsNo(trsno uint32) ([]byte, error)
block data store
func (*ChainState) ReadTotalSupply ¶
func (cs *ChainState) ReadTotalSupply() (*stores.TotalSupply, error)
func (*ChainState) ReadTransactionBytesByHash ¶
func (cs *ChainState) ReadTransactionBytesByHash(txhx fields.Hash) (fields.BlockHeight, []byte, error)
func (*ChainState) ReadTxBelongHeightByHash ¶
func (cs *ChainState) ReadTxBelongHeightByHash(txhx fields.Hash) (fields.BlockHeight, error)
Check the height of the block to which the exchange belongs
func (*ChainState) RemoveTxHash ¶
func (cs *ChainState) RemoveTxHash(txhx fields.Hash) error
Remove transaction
func (*ChainState) SaveMoveBTCBelongTxHash ¶
func (cs *ChainState) SaveMoveBTCBelongTxHash(trsno uint32, txhash []byte) error
block data store
func (*ChainState) SetBlockStore ¶
func (cs *ChainState) SetBlockStore(store interfacev2.BlockStore) error
func (*ChainState) SetDatabaseVersionRebuildMode ¶
func (cs *ChainState) SetDatabaseVersionRebuildMode(set bool)
Recovery mode
func (*ChainState) SetInTxPool ¶
func (cs *ChainState) SetInTxPool(stat bool)
func (*ChainState) SetLastestBlockHeadAndMeta ¶
func (cs *ChainState) SetLastestBlockHeadAndMeta(blockmeta interfacev2.Block) error
func (*ChainState) SetLastestDiamond ¶
func (cs *ChainState) SetLastestDiamond(diamond *stores.DiamondSmelt) error
func (*ChainState) SetPendingBlockHash ¶
func (cs *ChainState) SetPendingBlockHash(hash fields.Hash)
func (*ChainState) SetPendingBlockHeight ¶
func (cs *ChainState) SetPendingBlockHeight(height uint64)
func (*ChainState) SetPendingSubmitStoreDiamond ¶
func (cs *ChainState) SetPendingSubmitStoreDiamond(diamond *stores.DiamondSmelt) error
func (*ChainState) SubmitDataStoreWriteToInvariableDisk ¶
func (cs *ChainState) SubmitDataStoreWriteToInvariableDisk(block interfacev2.Block) error
submit to write disk
func (*ChainState) UpdateSetTotalSupply ¶
func (cs *ChainState) UpdateSetTotalSupply(totalobj *stores.TotalSupply) error
func (*ChainState) UserLending ¶
func (cs *ChainState) UserLending(lendid fields.UserLendingId) (*stores.UserLending, error)
Diamondlending query
func (*ChainState) UserLendingCreate ¶
func (cs *ChainState) UserLendingCreate(lendid fields.UserLendingId, stoitem *stores.UserLending) error
Create diamond lending
func (*ChainState) UserLendingDelete ¶
func (cs *ChainState) UserLendingDelete(lendid fields.UserLendingId) error
delete
func (*ChainState) UserLendingUpdate ¶
func (cs *ChainState) UserLendingUpdate(lendid fields.UserLendingId, stoitem *stores.UserLending) error
to update
type ChainStateConfig ¶
type ChainStateConfig struct { Datadir string BTCMoveCheckEnable bool BTCMoveCheckLogsURL string // Database rebuild mode DatabaseVersionRebuildMode bool }
func NewChainStateConfig ¶
func NewChainStateConfig(cnffile *sys.Inicnf) *ChainStateConfig
func NewEmptyChainStateConfig ¶
func NewEmptyChainStateConfig() *ChainStateConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.