Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 7 Imported by: 0

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 added in v0.3.0

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

Jump to

Keyboard shortcuts

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