app

package
v0.1.7-beta-testnet Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHistorySize = -1

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

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseApp

type BaseApp struct {
	*StoreApp
	EthApp *EthermintApplication

	AbsentValidators    *stake.AbsentValidators
	ByzantineValidators []abci.Evidence
	PresentValidators   stake.Validators
	BackupValidators    stake.Validators
	// contains filtered or unexported fields
}

BaseApp - The ABCI application

func NewBaseApp

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

NewBaseApp extends a StoreApp with a handler and a ticker, which it binds to the proper abci calls

func (*BaseApp) BeginBlock

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

BeginBlock - ABCI

func (*BaseApp) CheckTx

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

CheckTx - ABCI

func (*BaseApp) Commit

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

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 - triggers Tick actions

func (*BaseApp) Info

func (app *BaseApp) 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.

type EthermintApplication

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

EthermintApplication implements an ABCI application #stable - 0.4.0

func NewEthermintApplication

func NewEthermintApplication(backend *api.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) 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) DeliverTx

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

func (*EthermintApplication) DeliverTxState

func (app *EthermintApplication) DeliverTxState() *state.StateDB

func (*EthermintApplication) EndBlock

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

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) 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 chainState
	Name string

	TotalUsedGasFee *big.Int
	// contains filtered or unexported fields
}

StoreApp contains a data store and all chainState 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 Chec kTx

func (*StoreApp) Commit

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

Commit implements abci.Application

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) GetDbHash

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

func (*StoreApp) GetOldDbHash

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

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) SetChainId

func (app *StoreApp) SetChainId(chainId string)

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

Jump to

Keyboard shortcuts

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