app

package
v0.0.0-...-481a8b4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHistorySize = 10

DefaultHistorySize is how many blocks of history to store for ABCI queries

View Source
const (
	MinGasPrice = 2e9 // 2 Gwei
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseApp

type BaseApp struct {
	*StoreApp
	EthApp *EthermintApplication

	LastCommitInfo      abci.LastCommitInfo
	ByzantineValidators []abci.Evidence
	Random              *abci.VrfRandom
	// contains filtered or unexported fields
}

BaseApp - The ABCI application

func NewBaseApp

func NewBaseApp(store *StoreApp, ethApp *EthermintApplication, ethereum *eth.Ethereum) (*BaseApp, error)

BaseApp extends StoreApp, and dispatch tx to different modules via TxDispatcher

func (*BaseApp) BeginBlock

func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)

BeginBlock - ABCI

func (*BaseApp) CheckPtx

func (app *BaseApp) CheckPtx(txBytes []byte) abci.ResponseCheckTx

CheckTx - ABCI

func (*BaseApp) CheckTx

func (app *BaseApp) CheckTx(txBytes []byte, local bool) abci.ResponseCheckTx

CheckTx - ABCI

func (*BaseApp) Commit

func (app *BaseApp) Commit() (res abci.ResponseCommit)

func (*BaseApp) DeliverPtx

func (app *BaseApp) DeliverPtx(txBytes []byte) abci.ResponseDeliverTx

DeliverTx - ABCI

func (*BaseApp) DeliverTx

func (app *BaseApp) DeliverTx(txBytes []byte) abci.ResponseDeliverTx

DeliverTx - ABCI

func (*BaseApp) EndBlock

func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)

EndBlock - ABCI

func (*BaseApp) GetTx

func (app *BaseApp) GetTx(req abci.RequestGetTx) (res abci.ResponseGetTx)

GetTx hash(request hash), from(from type), to(to type) Response is the result, hash or tx: the result can be multi-hash or multi-tx

func (*BaseApp) InitState

func (app *BaseApp) InitState(module, key, value string) error

type EthermintApplication

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

EthermintApplication implements an ABCI application #stable - 0.4.0

func NewEthermintApplication

func NewEthermintApplication(backend *backend.Backend,
	client *rpc.Client, strategy *emtTypes.Strategy) (*EthermintApplication, error)

NewEthermintApplication creates a fully initialised instance of EthermintApplication #stable - 0.4.0

func (*EthermintApplication) BeginBlock

BeginBlock starts a new Ethereum block #stable - 0.4.0

func (*EthermintApplication) CheckPtx

CheckTx checks a transaction is valid but does not mutate the state #stable - 0.4.0

func (*EthermintApplication) CheckTx

CheckTx checks a transaction is valid but does not mutate the state #stable - 0.4.0

func (*EthermintApplication) CollectTx

func (app *EthermintApplication) CollectTx(tx *types.Transaction)

CollectTx invokes CollectTx on the strategy #unstable

func (*EthermintApplication) Commit

Commit commits the block and returns a hash of the current state #stable - 0.4.0

func (*EthermintApplication) DeliverPtx

DeliverTx executes a transaction against the latest state #stable - 0.4.0

func (*EthermintApplication) DeliverTx

DeliverTx executes a transaction against the latest state #stable - 0.4.0

func (*EthermintApplication) EndBlock

EndBlock accumulates rewards for the validators and updates them #stable - 0.4.0

func (*EthermintApplication) GetTotalUsedGasFee

func (app *EthermintApplication) GetTotalUsedGasFee() *big.Int

func (*EthermintApplication) GetUpdatedValidators

func (app *EthermintApplication) GetUpdatedValidators() abciTypes.ResponseEndBlock

GetUpdatedValidators returns an updated validator set from the strategy #unstable

func (*EthermintApplication) Info

func (*EthermintApplication) InitChain

InitChain initializes the validator set #stable - 0.4.0

func (*EthermintApplication) IsPtxEnabled

func (app *EthermintApplication) IsPtxEnabled() bool

func (*EthermintApplication) Query

Query queries the state of the EthermintApplication #stable - 0.4.0

func (*EthermintApplication) Receiver

func (app *EthermintApplication) Receiver() common.Address

Receiver returns the receiving address based on the selected strategy #unstable

func (*EthermintApplication) SetLogger

func (app *EthermintApplication) SetLogger(log tmLog.Logger)

SetLogger sets the logger for the ethermint application #unstable

func (*EthermintApplication) SetOption

SetOption sets a configuration option #stable - 0.4.0

func (*EthermintApplication) SetValidators

func (app *EthermintApplication) SetValidators(validators []*abciTypes.Validator)

SetValidators sets new validators on the strategy #unstable

type FromTo

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

type StoreApp

type StoreApp struct {
	// Name is what is returned from info
	Name string
	// contains filtered or unexported fields
}

StoreApp contains a data store and all info needed to perform queries and handshakes.

It should be embeded in another struct for CheckTx, DeliverTx and initializing state from the genesis.

func NewStoreApp

func NewStoreApp(appName, dbName string, cacheSize int, logger log.Logger) (*StoreApp, error)

NewStoreApp creates a data store to handle queries

func (*StoreApp) AddValChange

func (app *StoreApp) AddValChange(diffs []*abci.Validator)

AddValChange is meant to be called by apps on DeliverTx results, this is added to the cache for the endblock changeset

func (*StoreApp) Append

func (app *StoreApp) Append() sm.SimpleDB

Append returns the working state for DeliverTx

func (*StoreApp) Check

func (app *StoreApp) Check() sm.SimpleDB

Check returns the working state for CheckTx

func (*StoreApp) Commit

func (app *StoreApp) Commit() (res abci.ResponseCommit)

Commit implements abci.Application

func (*StoreApp) Committed

func (app *StoreApp) Committed() *sm.Bonsai

Committed returns the committed state, also exposing historical queries

func (*StoreApp) CommittedHeight

func (app *StoreApp) CommittedHeight() int64

CommittedHeight gets the last block height committed to the db

func (*StoreApp) EndBlock

func (app *StoreApp) EndBlock(_ abci.RequestEndBlock) (res abci.ResponseEndBlock)

EndBlock - ABCI Returns a list of all validator changes made in this block

func (*StoreApp) GetChainID

func (app *StoreApp) GetChainID() string

GetChainID returns the currently stored chain

func (*StoreApp) Hash

func (app *StoreApp) Hash() []byte

Hash gets the last hash stored in the database

func (*StoreApp) Info

func (app *StoreApp) Info(req abci.RequestInfo) abci.ResponseInfo

Info implements abci.Application. It returns the height and hash, as well as the abci name and version.

The height is the block that holds the transactions, not the apphash itself.

func (*StoreApp) InitChain

func (app *StoreApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)

InitChain - ABCI

func (*StoreApp) Logger

func (app *StoreApp) Logger() log.Logger

Logger returns the application base logger

func (*StoreApp) Query

func (app *StoreApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)

Query - ABCI

func (*StoreApp) SetOption

func (app *StoreApp) SetOption(res abci.RequestSetOption) abci.ResponseSetOption

SetOption - ABCI

func (*StoreApp) WorkingHeight

func (app *StoreApp) WorkingHeight() int64

WorkingHeight gets the current block we are writing

type TxDispatcher

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

func NewTxDispatcher

func NewTxDispatcher() *TxDispatcher

func (*TxDispatcher) CheckTx

func (*TxDispatcher) DeliverTx

func (*TxDispatcher) InitState

func (td *TxDispatcher) InitState(module string, key, value string, store state.SimpleDB) error

func (*TxDispatcher) RegisterTxHandler

func (td *TxDispatcher) RegisterTxHandler(txType string, handler types.TxHandler)

func (*TxDispatcher) UnregisterTxHandler

func (td *TxDispatcher) UnregisterTxHandler(txType string)

Jump to

Keyboard shortcuts

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