service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 6 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)

	//
	GetDataFromDB([]byte) ([]byte, error)

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

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 *txlogic.TokenID) (uint64, error)
	Utxos(addr string, tid *txlogic.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