initial commit

This commit is contained in:
Jae Kwon
2015-11-02 07:39:53 -08:00
commit 0bd4061cf6
9 changed files with 674 additions and 0 deletions

31
types/application.go Normal file
View File

@ -0,0 +1,31 @@
package types
type Application interface {
// Echo a message
Echo(message string) (RetCode, string)
// Append a tx, which may or may not get committed
AppendTx(tx []byte) RetCode
// Return the application Merkle root hash
GetHash() ([]byte, RetCode)
// Set commit checkpoint
Commit() RetCode
// Rollback to the latest commit
Rollback() RetCode
// Set events reporting mode
SetEventsMode(mode EventsMode) RetCode
// Add event listener
AddListener(key string) RetCode
// Remove event listener
RemListener(key string) RetCode
// Get all events
GetEvents() []Event
}