tendermint/types/application.go

41 lines
758 B
Go
Raw Normal View History

2015-11-02 07:39:53 -08:00
package types
type Application interface {
// For new socket connections
Open() AppContext
}
type AppContext interface {
2015-11-02 07:39:53 -08:00
// Echo a message
Echo(message string) string
// Return application 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) RetCode
2015-11-02 07:39:53 -08:00
// Append a tx, which may or may not get committed
AppendTx(tx []byte) ([]Event, RetCode)
2015-11-02 07:39:53 -08:00
// Return the application Merkle root hash
GetHash() ([]byte, RetCode)
// Set commit checkpoint
Commit() RetCode
// Rollback to the latest commit
Rollback() RetCode
// Add event listener
AddListener(key string) RetCode
// Remove event listener
RemListener(key string) RetCode
// Close this AppContext
Close() error
2015-11-02 07:39:53 -08:00
}