Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainReader

type ChainReader interface {
	// interface to read transactions
	LoadBlockInfoByTxHash(crypto.HashType) (*types.Block, *types.Transaction, error)
	ReadBlockFromDB(*crypto.HashType) (*types.Block, int, error)
	GetEvmByHeight(msg types.Message, height uint32) (*vm.EVM, func() error, error)
	GetLogs(from, to uint32, topicslist [][][]byte) ([]*types.Log, error)
	FilterLogs(logs []*types.Log, topicslist [][][]byte) ([]*types.Log, error)

	//
	GetDataFromDB([]byte) ([]byte, error)
	GetTxReceipt(*crypto.HashType) (*types.Receipt, error)

	//interface to reader block status
	GetBlockHeight() uint32
	GetBlockHash(uint32) (*crypto.HashType, error)
	EternalBlock() *types.Block
	TailBlock() *types.Block
	TailState() *state.StateDB
}

    ChainReader defines basic operations blockchain exposes

    type Server

    type Server interface {
    	// Run a server
    	Run() error
    	// Stop the service. It is blocked unitl the server is down.
    	Stop()
    
    	// Proc returns the goprocess of server is running
    	Proc() goprocess.Process
    }

      Server defines methods to start/stop a server

      type TxHandler

      type TxHandler interface {
      	ProcessTx(*types.Transaction, core.TransferMode) error
      	GetTxByHash(hash *crypto.HashType) (*types.TxWrap, bool)
      }

        TxHandler defines basic operations txpool exposes

        type WalletAgent

        type WalletAgent interface {
        	Balance(addr string, tid *types.TokenID) (uint64, error)
        	Utxos(addr string, tid *types.TokenID, amount uint64) ([]*rpcpb.Utxo, error)
        }

          WalletAgent defines functions an wallet service should provide