worker

package
v0.0.0-...-9318148 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const TxHandleTaskBatchSize uint64 = 500

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSynchronizer

type BaseSynchronizer struct {
	// contains filtered or unexported fields
}

func (*BaseSynchronizer) BatchBlockHandle

func (syncer *BaseSynchronizer) BatchBlockHandle(startBlock uint64, endBlock uint64) ([]*account.BlockResponse, error)

func (*BaseSynchronizer) Close

func (syncer *BaseSynchronizer) Close() error

func (*BaseSynchronizer) ScanBlockTransactions

func (syncer *BaseSynchronizer) ScanBlockTransactions(txHashList []string, blockNumber *big.Int, blockHash string, bank *ChannelBank, wg *sync.WaitGroup) error

func (*BaseSynchronizer) Start

func (syncer *BaseSynchronizer) Start() error

type BlockHeader

type BlockHeader struct {
	Number     *big.Int
	Hash       string
	ParentHash string
	Timestamp  uint64
}

type BlockHeaderBank

type BlockHeaderBank struct {
	// contains filtered or unexported fields
}

func NewBlockHeaderBank

func NewBlockHeaderBank(bufferSize int) *BlockHeaderBank

func (*BlockHeaderBank) Channel

func (bhb *BlockHeaderBank) Channel() <-chan BlockHeader

func (*BlockHeaderBank) Close

func (bhb *BlockHeaderBank) Close()

func (*BlockHeaderBank) Push

func (bhb *BlockHeaderBank) Push(bh BlockHeader)

type ChannelBank

type ChannelBank struct {
	// contains filtered or unexported fields
}

func NewChannelBank

func NewChannelBank(bufferSize int) *ChannelBank

NewChannelBank 创建一个新的 ChannelBank 实例

func (*ChannelBank) Channel

func (cb *ChannelBank) Channel() <-chan TransactionChannel

func (*ChannelBank) Close

func (cb *ChannelBank) Close()

func (*ChannelBank) Push

func (cb *ChannelBank) Push(tx TransactionChannel)

type Config

type Config struct {
	LoopIntervalMsec uint
	HeaderBufferSize uint
	StartHeight      *big.Int
	Confirmations    uint64
}

type Deposit

type Deposit struct {
	BaseSynchronizer
	// contains filtered or unexported fields
}

func NewDeposit

func NewDeposit(cfg *config.Config, db *database.DB, rpcClient *rpcclient.WalletChainAccountClient, shutdown context.CancelCauseFunc) (*Deposit, error)

func (*Deposit) BuildTransaction

func (deposit *Deposit) BuildTransaction(txMsg *account.TxMessage) (*database.Transactions, error)

func (*Deposit) Close

func (deposit *Deposit) Close() error

func (*Deposit) HandleDeposit

func (deposit *Deposit) HandleDeposit(txMsg *account.TxMessage) (*database.Deposits, error)

func (*Deposit) HandleInternalTx

func (deposit *Deposit) HandleInternalTx(txMsg *account.TxMessage) (*database.Internals, error)

func (*Deposit) HandleWithdraw

func (deposit *Deposit) HandleWithdraw(txMsg *account.TxMessage) (*database.Withdraws, error)

func (*Deposit) Start

func (deposit *Deposit) Start() error

type Internal

type Internal struct {
	// contains filtered or unexported fields
}

func NewInternal

func NewInternal(cfg *config.Config, db *database.DB, rpcClient *rpcclient.WalletChainAccountClient, shutdown context.CancelCauseFunc) (*Internal, error)

func (*Internal) Close

func (w *Internal) Close() error

func (*Internal) Start

func (w *Internal) Start() error

type TransactionChannel

type TransactionChannel struct {
	BusinessId      string
	BlockNumber     *big.Int
	BlockHash       string
	TxHash          string
	FromAddress     string
	ToAddress       string
	TokenAddress    string
	Amount          string
	TxFee           string
	TxStatus        uint8
	TxType          database.TransactionType
	ContractAddress string
}

type Withdraw

type Withdraw struct {
	// contains filtered or unexported fields
}

func NewWithdraw

func NewWithdraw(cfg *config.Config, db *database.DB, rpcClient *rpcclient.WalletChainAccountClient, shutdown context.CancelCauseFunc) (*Withdraw, error)

func (*Withdraw) Close

func (w *Withdraw) Close() error

func (*Withdraw) Start

func (w *Withdraw) Start() error

Jump to

Keyboard shortcuts

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