Documentation
¶
Index ¶
- Constants
- type Application
- func (app *Application) CheckTx(txBytes []byte) types.ResponseCheckTx
- func (app *Application) Commit() types.ResponseCommit
- func (app *Application) DeliverTx(txBytes []byte) types.ResponseDeliverTx
- func (app *Application) Info() (resInfo types.ResponseInfo)
- func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)
- type LastBlockInfo
- type MongoQuery
- type PersistentApplication
- func (app *PersistentApplication) BeginBlock(req types.RequestBeginBlock) (resBeginBlock types.ResponseBeginBlock)
- func (app *PersistentApplication) CheckTx(tx []byte) types.ResponseCheckTx
- func (app *PersistentApplication) Commit() types.ResponseCommit
- func (app *PersistentApplication) DeliverTx(tx []byte) types.ResponseDeliverTx
- func (app *PersistentApplication) EndBlock(reqEndBlock types.RequestEndBlock) (resEndBlock types.ResponseEndBlock)
- func (app *PersistentApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo)
- func (app *PersistentApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain
- func (app *PersistentApplication) LoadLastBlock() (lastBlock LastBlockInfo)
- func (app *PersistentApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery
- func (app *PersistentApplication) SaveLastBlock(lastBlock LastBlockInfo)
- func (app *PersistentApplication) SetLogger(l *log.Logger)
- func (app *PersistentApplication) SetOption(reqSetOpt types.RequestSetOption) types.ResponseSetOption
Constants ¶
const ( CodeTypeOK uint32 = 0 CodeTypeEncodingError uint32 = 1 CodeTypeBadNonce uint32 = 2 CodeTypeUnknownRequest uint32 = 4 CodeTypeDeliverTxError uint32 = 5 CodeTypeCheckTxError uint32 = 6 CodeTypeQueryError uint32 = 7 CodeEmptySearchQuery uint32 = 8 CodeParseSearchQueryError uint32 = 9 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { types.BaseApplication // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication(dbHost, dbName string) *Application
func (*Application) CheckTx ¶
func (app *Application) CheckTx(txBytes []byte) types.ResponseCheckTx
CheckTx method responsible for check transaction on validity.
func (*Application) Commit ¶
func (app *Application) Commit() types.ResponseCommit
Commit method generates hash of current state.
func (*Application) DeliverTx ¶
func (app *Application) DeliverTx(txBytes []byte) types.ResponseDeliverTx
DeliverTx method responsible for deliver chosen transaction type.
func (*Application) Info ¶
func (app *Application) Info() (resInfo types.ResponseInfo)
Info method returns information about current state. All sizes represented in kilobytes.
func (*Application) Query ¶
func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)
Query method processes user's request. Search endpoint uses Mongo DB query syntax. For make search request uses MongoQuery struct. The limit and offset fields are optional. All mongo query places in query field of struct. Check mongo query syntax at: https://docs.mongodb.com/manual/tutorial/query-documents/
type LastBlockInfo ¶
type MongoQuery ¶
type MongoQuery struct { Query interface{} `json:"query,omitempty"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` }
MongoQuery is a struct for parse search query from a user.
type PersistentApplication ¶
type PersistentApplication struct {
// contains filtered or unexported fields
}
func NewPersistentApplication ¶
func NewPersistentApplication(dbHost, dbName string) *PersistentApplication
func (*PersistentApplication) BeginBlock ¶
func (app *PersistentApplication) BeginBlock(req types.RequestBeginBlock) (resBeginBlock types.ResponseBeginBlock)
BeginBlock method tracks the block hash and header information
func (*PersistentApplication) CheckTx ¶
func (app *PersistentApplication) CheckTx(tx []byte) types.ResponseCheckTx
func (*PersistentApplication) Commit ¶
func (app *PersistentApplication) Commit() types.ResponseCommit
func (*PersistentApplication) DeliverTx ¶
func (app *PersistentApplication) DeliverTx(tx []byte) types.ResponseDeliverTx
func (*PersistentApplication) EndBlock ¶
func (app *PersistentApplication) EndBlock(reqEndBlock types.RequestEndBlock) (resEndBlock types.ResponseEndBlock)
EndBlock method should in future update the validator set
func (*PersistentApplication) Info ¶
func (app *PersistentApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo)
func (*PersistentApplication) InitChain ¶
func (app *PersistentApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain
func (*PersistentApplication) LoadLastBlock ¶
func (app *PersistentApplication) LoadLastBlock() (lastBlock LastBlockInfo)
LoadLastBlock method load last confirmed block from DB
func (*PersistentApplication) Query ¶
func (app *PersistentApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery
func (*PersistentApplication) SaveLastBlock ¶
func (app *PersistentApplication) SaveLastBlock(lastBlock LastBlockInfo)
SaveLastBlock method saves appHash of loast confirmed block in DB
func (*PersistentApplication) SetLogger ¶
func (app *PersistentApplication) SetLogger(l *log.Logger)
func (*PersistentApplication) SetOption ¶
func (app *PersistentApplication) SetOption(reqSetOpt types.RequestSetOption) types.ResponseSetOption