Documentation ¶
Overview ¶
Package app is the core menta application. It provides a base Tendermint ABCI environment with pluggable Services.
Index ¶
- Constants
- Variables
- func InitTendermint(homedir string)
- func LoadConfig(homedir string) (*cfg.Config, error)
- func TrapSignal(cleanupFunc func())
- type MentaApp
- func (app *MentaApp) AddService(service sdk.Service)
- func (app *MentaApp) BeginBlock(req abci.RequestBeginBlock) (resp abci.ResponseBeginBlock)
- func (app *MentaApp) CheckTx(checkTx abci.RequestCheckTx) abci.ResponseCheckTx
- func (app *MentaApp) Commit() abci.ResponseCommit
- func (app *MentaApp) CreateNode() *node.Node
- func (app *MentaApp) DeliverTx(dtx abci.RequestDeliverTx) abci.ResponseDeliverTx
- func (app *MentaApp) EndBlock(req abci.RequestEndBlock) (resp abci.ResponseEndBlock)
- func (app *MentaApp) Info(req abci.RequestInfo) abci.ResponseInfo
- func (app *MentaApp) InitChain(req abci.RequestInitChain) (resp abci.ResponseInitChain)
- func (app *MentaApp) Query(query abci.RequestQuery) abci.ResponseQuery
- func (app *MentaApp) Run()
- func (app *MentaApp) SetOption(req abci.RequestSetOption) abci.ResponseSetOption
Constants ¶
const ( // MENTAHOME is the default dir for tendermint configuration MENTAHOME = ".menta" // Home is for viper configuration Home = "home" )
Variables ¶
DefaultHomeDir for tendermint config
Functions ¶
func InitTendermint ¶
func InitTendermint(homedir string)
InitTendermint creates the initial configuration information if it doesn't exist
func LoadConfig ¶
LoadConfig using tendermint config
func TrapSignal ¶
func TrapSignal(cleanupFunc func())
TrapSignal Adapted from Cosmos SDK Note: Must add a select{} after this - see above
Types ¶
type MentaApp ¶
MentaApp contains all the basics needed to build a tendermint application
func NewApp ¶
NewApp returns a new instance of MentaApp where appname is the name of your application, and homedir is the path where menta/tendermint will store all the data and configuration information
func NewMockApp ¶
func NewMockApp() *MentaApp
NewMockApp creates a menta app that can be used for local testing without a full blown node and an in memory state tree
func (*MentaApp) AddService ¶ added in v0.3.0
AddService : registers your service with Menta
func (*MentaApp) BeginBlock ¶
func (app *MentaApp) BeginBlock(req abci.RequestBeginBlock) (resp abci.ResponseBeginBlock)
BeginBlock signals the start of processing a batch of transaction via DeliverTx
func (*MentaApp) CheckTx ¶
func (app *MentaApp) CheckTx(checkTx abci.RequestCheckTx) abci.ResponseCheckTx
CheckTx populates the mempool. Transactions are ran through the OnValidationHandler. If the pass, they will be considered for inclusion in a block and processed via DeliverTx
func (*MentaApp) Commit ¶
func (app *MentaApp) Commit() abci.ResponseCommit
Commit to state tree, refresh caches
func (*MentaApp) CreateNode ¶
CreateNode creates an embedded tendermint node for standalone mode
func (*MentaApp) DeliverTx ¶
func (app *MentaApp) DeliverTx(dtx abci.RequestDeliverTx) abci.ResponseDeliverTx
DeliverTx is the heart of processing transactions leading to a state transistion. This is where the your application logic lives via handlers
func (*MentaApp) EndBlock ¶
func (app *MentaApp) EndBlock(req abci.RequestEndBlock) (resp abci.ResponseEndBlock)
EndBlock signals the end of a block of txs. TODO: return changes to the validator set
func (*MentaApp) Info ¶
func (app *MentaApp) Info(req abci.RequestInfo) abci.ResponseInfo
Info checks the application state on startup. If the last block height known by the application is less than what tendermint says, then the application node will sync by replaying all transactions up to the current tendermint block height.
func (*MentaApp) InitChain ¶
func (app *MentaApp) InitChain(req abci.RequestInitChain) (resp abci.ResponseInitChain)
InitChain is ran once, on the very first run of the application chain.
func (*MentaApp) Query ¶
func (app *MentaApp) Query(query abci.RequestQuery) abci.ResponseQuery
Query *committed* state in the Tree This calls the handler where the path is the Service name return from Service.Route() and the key is the application specific key in storage
func (*MentaApp) SetOption ¶
func (app *MentaApp) SetOption(req abci.RequestSetOption) abci.ResponseSetOption
SetOption - not used