tendermint/types/application.go

39 lines
860 B
Go
Raw Normal View History

2015-11-02 07:39:53 -08:00
package types
2016-02-28 19:19:29 -08:00
// Applications
2015-11-02 07:39:53 -08:00
type Application interface {
// Return application info
Info() (info string)
2015-11-02 07:39:53 -08:00
2015-11-27 10:14:46 -08:00
// Set application option (e.g. mode=mempool, mode=consensus)
SetOption(key string, value string) (log string)
2015-11-27 10:14:46 -08:00
// Append a tx
AppendTx(tx []byte) Result
2015-11-02 07:39:53 -08:00
// Validate a tx for the mempool
CheckTx(tx []byte) Result
2016-01-18 14:37:42 -08:00
// Query for state
Query(query []byte) Result
2016-05-05 13:58:10 -07:00
// Return the application Merkle root hash
Commit() Result
2015-11-02 07:39:53 -08:00
}
2016-02-28 19:19:29 -08:00
// Some applications can choose to implement BlockchainAware
type BlockchainAware interface {
2016-02-28 19:19:29 -08:00
// Initialize blockchain
// validators: genesis validators from TendermintCore
InitChain(validators []*Validator)
2016-02-28 19:19:29 -08:00
2016-03-26 22:35:23 -07:00
// Signals the beginning of a block
BeginBlock(height uint64)
// Signals the end of a block
2016-05-05 13:58:10 -07:00
// diffs: changed validators from app to TendermintCore
EndBlock(height uint64) (diffs []*Validator)
2016-02-28 19:19:29 -08:00
}