Documentation
¶
Overview ¶
Copyright 2017-2018 OneLedger
Define aliases to enhance readability of the code ¶
Copyright 2017-2018 OneLedger ¶
AN ABCi application node to process transactions from Tendermint Consensus ¶
Copyright 2017-2018 OneLedger ¶
Implement all of the query mechanics for the node and the chain ¶
Copyright 2017 - 2018 OneLedger ¶
Handle setting any options for the node.
Index ¶
- Variables
- func AccountInfo(app Application, name string) interface{}
- func AccountKey(app Application, name string) interface{}
- func Balance(app Application, accountKey []byte) interface{}
- func GetBalance(app Application, account id.Account) string
- func HandleAccountKeyQuery(app Application, message []byte) interface{}
- func HandleAccountQuery(app Application, message []byte) interface{}
- func HandleBalanceQuery(app Application, message []byte) interface{}
- func HandleError(text string, path string, message []byte) interface{}
- func HandleIdentityQuery(app Application, message []byte) interface{}
- func HandleNodeNameQuery(app Application, message []byte) interface{}
- func HandleQuery(app Application, path string, message []byte) (buffer []byte)
- func HandleSwapAddressQuery(app Application, message []byte) interface{}
- func HandleUtxoQuery(app Application, message []byte) interface{}
- func HandleVersionQuery(app Application, message []byte) interface{}
- func IdentityInfo(app Application, name string) interface{}
- func NewBalanceFromString(amount string, currency string) data.Balance
- func RegisterLocally(app *Application, name string, scope string, chain data.ChainType, ...) bool
- func SetOption(app *Application, key string, value string) bool
- func SwapAddress(chain data.ChainType) interface{}
- func UtxoInfo(app Application, name string) interface{}
- type AdminParameters
- type Application
- func (app Application) BeginBlock(req RequestBeginBlock) ResponseBeginBlock
- func (app Application) CheckTx(tx []byte) ResponseCheckTx
- func (app Application) Commit() ResponseCommit
- func (app Application) DeliverTx(tx []byte) ResponseDeliverTx
- func (app Application) EndBlock(req RequestEndBlock) ResponseEndBlock
- func (app Application) GetAccounts() interface{}
- func (app Application) GetAdmin() interface{}
- func (app Application) GetChainID() interface{}
- func (app Application) GetContract() interface{}
- func (app Application) GetEvent() interface{}
- func (app Application) GetIdentities() interface{}
- func (app Application) GetStatus() interface{}
- func (app Application) GetUtxo() interface{}
- func (app Application) Info(req RequestInfo) ResponseInfo
- func (app Application) InitChain(req RequestInitChain) ResponseInitChain
- func (app Application) Initialize()
- func (app Application) Query(req RequestQuery) ResponseQuery
- func (app Application) SetOption(req RequestSetOption) ResponseSetOption
- func (app Application) SetupState(stateBytes []byte)
- type BasicState
- type RegisterArguments
- type RequestBeginBlock
- type RequestCheckTx
- type RequestDeliverTx
- type RequestEndBlock
- type RequestInfo
- type RequestInitChain
- type RequestQuery
- type RequestSetOption
- type ResponseBeginBlock
- type ResponseCheckTx
- type ResponseCommit
- type ResponseDeliverTx
- type ResponseEndBlock
- type ResponseInfo
- type ResponseInitChain
- type ResponseQuery
- type ResponseSetOption
Constants ¶
This section is empty.
Variables ¶
var ChainId string
Functions ¶
func AccountInfo ¶
func AccountInfo(app Application, name string) interface{}
AccountInfo returns the information for a given account
func AccountKey ¶
func AccountKey(app Application, name string) interface{}
func Balance ¶
func Balance(app Application, accountKey []byte) interface{}
func GetBalance ¶
func GetBalance(app Application, account id.Account) string
Get the balancd for an account
func HandleAccountKeyQuery ¶
func HandleAccountKeyQuery(app Application, message []byte) interface{}
Get the account information for a given user
func HandleAccountQuery ¶
func HandleAccountQuery(app Application, message []byte) interface{}
Get the account information for a given user
func HandleBalanceQuery ¶
func HandleBalanceQuery(app Application, message []byte) interface{}
Get the account information for a given user
func HandleError ¶
Return a nicely formatted error message
func HandleIdentityQuery ¶
func HandleIdentityQuery(app Application, message []byte) interface{}
Get the account information for a given user
func HandleNodeNameQuery ¶ added in v0.6.2
func HandleNodeNameQuery(app Application, message []byte) interface{}
func HandleQuery ¶
func HandleQuery(app Application, path string, message []byte) (buffer []byte)
Top-level list of all query types
func HandleSwapAddressQuery ¶ added in v0.5.0
func HandleSwapAddressQuery(app Application, message []byte) interface{}
func HandleUtxoQuery ¶
func HandleUtxoQuery(app Application, message []byte) interface{}
func HandleVersionQuery ¶
func HandleVersionQuery(app Application, message []byte) interface{}
func IdentityInfo ¶
func IdentityInfo(app Application, name string) interface{}
func NewBalanceFromString ¶ added in v0.6.2
func RegisterLocally ¶
func RegisterLocally(app *Application, name string, scope string, chain data.ChainType, publicKey id.PublicKeyED25519, privateKey id.PrivateKeyED25519) bool
Register Identities and Accounts from the user.
func SwapAddress ¶ added in v0.6.0
func UtxoInfo ¶
func UtxoInfo(app Application, name string) interface{}
Types ¶
type AdminParameters ¶ added in v0.6.2
type AdminParameters struct {
NodeAccountName string
}
type Application ¶
type Application struct {
types.BaseApplication
Admin data.Datastore // any administrative parameters
Status data.Datastore // current state of any composite transactions (pending, verified, etc.)
Identities *id.Identities // Keep a higher-level identity for a given user
Accounts *id.Accounts // Keep all of the user accounts locally for their node (identity management)
Utxo *data.ChainState // unspent transction output (for each type of coin)
Event data.Datastore // Event for any action that need to be tracked
Contract data.Datastore // contract for reuse.
LastHeader types.Header // Tendermint last header info
}
ApplicationContext keeps all of the upper level global values.
func NewApplication ¶
func NewApplication() *Application
NewApplicationContext initializes a new application
func (Application) BeginBlock ¶
func (app Application) BeginBlock(req RequestBeginBlock) ResponseBeginBlock
BeginBlock is called when a new block is started
func (Application) CheckTx ¶
func (app Application) CheckTx(tx []byte) ResponseCheckTx
CheckTx tests to see if a transaction is valid
func (Application) Commit ¶
func (app Application) Commit() ResponseCommit
Commit tells the app to make everything persistent
func (Application) DeliverTx ¶
func (app Application) DeliverTx(tx []byte) ResponseDeliverTx
DeliverTx accepts a transaction and updates all relevant data
func (Application) EndBlock ¶
func (app Application) EndBlock(req RequestEndBlock) ResponseEndBlock
EndBlock is called at the end of all of the transactions
func (Application) GetAccounts ¶
func (app Application) GetAccounts() interface{}
Access to the local persistent databases
func (Application) GetAdmin ¶
func (app Application) GetAdmin() interface{}
Access to the local persistent databases
func (Application) GetChainID ¶ added in v0.5.0
func (app Application) GetChainID() interface{}
func (Application) GetContract ¶ added in v0.5.2
func (app Application) GetContract() interface{}
func (Application) GetEvent ¶ added in v0.5.2
func (app Application) GetEvent() interface{}
func (Application) GetIdentities ¶
func (app Application) GetIdentities() interface{}
Access to the local persistent databases
func (Application) GetStatus ¶
func (app Application) GetStatus() interface{}
Access to the local persistent databases
func (Application) GetUtxo ¶
func (app Application) GetUtxo() interface{}
Access to the local persistent databases
func (Application) Info ¶
func (app Application) Info(req RequestInfo) ResponseInfo
Info returns the current block information
func (Application) InitChain ¶
func (app Application) InitChain(req RequestInitChain) ResponseInitChain
InitChain is called when a new chain is getting created
func (Application) Initialize ¶
func (app Application) Initialize()
Initial the state of the application from persistent data
func (Application) Query ¶
func (app Application) Query(req RequestQuery) ResponseQuery
Query returns a transaction or a proof
func (Application) SetOption ¶
func (app Application) SetOption(req RequestSetOption) ResponseSetOption
SetOption changes the underlying options for the ABCi app
func (Application) SetupState ¶
func (app Application) SetupState(stateBytes []byte)
Use the Genesis block to initialze the system
type BasicState ¶
type RegisterArguments ¶
Arguments for registration
type RequestBeginBlock ¶
type RequestBeginBlock = types.RequestBeginBlock
type RequestCheckTx ¶
type RequestCheckTx = types.RequestCheckTx
type RequestDeliverTx ¶
type RequestDeliverTx = types.RequestDeliverTx
type RequestEndBlock ¶
type RequestEndBlock = types.RequestEndBlock
type RequestInfo ¶
type RequestInfo = types.RequestInfo
type RequestInitChain ¶
type RequestInitChain = types.RequestInitChain
type RequestQuery ¶
type RequestQuery = types.RequestQuery
type RequestSetOption ¶
type RequestSetOption = types.RequestSetOption
type ResponseBeginBlock ¶
type ResponseBeginBlock = types.ResponseBeginBlock
type ResponseCheckTx ¶
type ResponseCheckTx = types.ResponseCheckTx
type ResponseCommit ¶
type ResponseCommit = types.ResponseCommit
type ResponseDeliverTx ¶
type ResponseDeliverTx = types.ResponseDeliverTx
type ResponseEndBlock ¶
type ResponseEndBlock = types.ResponseEndBlock
type ResponseInfo ¶
type ResponseInfo = types.ResponseInfo
type ResponseInitChain ¶
type ResponseInitChain = types.ResponseInitChain
type ResponseQuery ¶
type ResponseQuery = types.ResponseQuery
type ResponseSetOption ¶
type ResponseSetOption = types.ResponseSetOption