chainstatev2

package
v0.0.0-...-03c569e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

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) Balance

func (cs *ChainState) Balance(addr fields.Address) (*stores.Balance, error)

func (*ChainState) BalanceDel

func (cs *ChainState) BalanceDel(addr fields.Address) error

func (*ChainState) BalanceSet

func (cs *ChainState) BalanceSet(addr fields.Address, balance *stores.Balance) error

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) Channel

func (cs *ChainState) Channel(channelid fields.ChannelId) (*stores.Channel, error)

func (*ChainState) ChannelCreate

func (cs *ChainState) ChannelCreate(channel_id fields.ChannelId, channel *stores.Channel) error

func (*ChainState) ChannelDelete

func (cs *ChainState) ChannelDelete(channel_id fields.ChannelId) error

func (*ChainState) ChannelUpdate

func (cs *ChainState) ChannelUpdate(channel_id fields.ChannelId, channel *stores.Channel) error

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) Destory

func (cs *ChainState) Destory()

interface api

func (*ChainState) DestoryTemporary

func (cs *ChainState) DestoryTemporary()

destory temporary

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) Lockbls

func (cs *ChainState) Lockbls(lkid fields.LockblsId) (*stores.Lockbls, error)

Lockbls query

func (*ChainState) LockblsCreate

func (cs *ChainState) LockblsCreate(lkid fields.LockblsId, stoitem *stores.Lockbls) error

Create linear lock

func (*ChainState) LockblsDelete

func (cs *ChainState) LockblsDelete(lkid fields.LockblsId) error

delete

func (*ChainState) LockblsUpdate

func (cs *ChainState) LockblsUpdate(lkid fields.LockblsId, stoitem *stores.Lockbls) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL