service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 3 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 reader utxos
	ListAllUtxos() (map[types.OutPoint]*types.UtxoWrap, error)
	// LoadUtxoByPubKeyScript([]byte) (map[types.OutPoint]*types.UtxoWrap, error)
	LoadUtxoByAddress(types.Address) (map[types.OutPoint]*types.UtxoWrap, error)

	// interface to read transactions
	LoadTxByHash(crypto.HashType) (*types.Transaction, error)

	//interface to reader block status
	GetBlockHeight() uint32
	GetBlockHash(uint32) (*crypto.HashType, error)
	LoadBlockByHash(crypto.HashType) (*types.Block, error)

	// address related search method
	GetTransactionsByAddr(types.Address) ([]*types.Transaction, error)
}

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(tx *types.Transaction, broadcast bool) error
	// GetTransactionsInPool gets all transactions in memory pool
	GetTransactionsInPool() []*types.Transaction
}

TxHandler defines basic operations txpool exposes

Jump to

Keyboard shortcuts

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