Documentation ¶
Index ¶
- Variables
- func AximchainAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func AximchainAppInit() server.AppInit
- func MakeCodec() *wire.Codec
- func NewSentryApplication(logger log.Logger, _ db.DB, _ io.Writer) abci.Application
- func PersistentPreRunEFn(context *config.AximchainContext) func(*cobra.Command, []string) error
- func SetUpgradeConfig(upgradeConfig *config.UpgradeConfig)
- type Aximchain
- func (app *Aximchain) AccountHandler(chainApp types.ChainApp, req abci.RequestQuery, path []string) *abci.ResponseQuery
- func (app *Aximchain) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
- func (app *Aximchain) CheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)
- func (app *Aximchain) Commit() (res abci.ResponseCommit)
- func (app *Aximchain) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
- func (app *Aximchain) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *Aximchain) ExportAppStateAndValidators() (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (app *Aximchain) GetCodec() *wire.Codec
- func (app *Aximchain) GetContextForCheckState() sdk.Context
- func (app *Aximchain) GetRouter() baseapp.Router
- func (app *Aximchain) PreDeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
- func (app *Aximchain) Query(req abci.RequestQuery) (res abci.ResponseQuery)
- func (app *Aximchain) RegisterQueryHandler(prefix string, handler types.AbciQueryHandler)
- func (app *Aximchain) WriteRecoveryChunk(hash abci.SHA256Sum, chunk *abci.AppStateChunk, isComplete bool) (err error)
- type GenesisAccount
- type GenesisState
- type SentryApplication
- func (app *SentryApplication) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *SentryApplication) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx
- func (app *SentryApplication) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo)
- func (app *SentryApplication) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
- func (app *SentryApplication) ReCheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)
- type SentryConfig
- type ValAddrCache
- func (vac *ValAddrCache) ClearCache()
- func (vac *ValAddrCache) GetAccAddr(ctx sdk.Context, consAddr sdk.ConsAddress) sdk.AccAddress
- func (vac *ValAddrCache) GetDistributionAddr(ctx sdk.Context, consAddr sdk.ConsAddress) sdk.AccAddress
- func (vac *ValAddrCache) SetAccAddr(consAddr sdk.ConsAddress, accAddr sdk.AccAddress)
- func (vac *ValAddrCache) SetDistributionAddr(consAddr sdk.ConsAddress, accAddr sdk.AccAddress)
Constants ¶
This section is empty.
Variables ¶
var ( DefaultCLIHome = os.ExpandEnv("$HOME/.axccli") DefaultNodeHome = os.ExpandEnv("$HOME/.axcchaind") Bech32PrefixAccAddr string )
default home directories for expected binaries
var ( Codec = MakeCodec() ServerContext = config.NewDefaultContext() )
var ( // each genesis validators will self delegate 10000e8 native tokens to become a validator DefaultSelfDelegationToken = sdk.NewCoin(types.NativeTokenSymbol, 10000e8) // we put 20% of the total supply to the stake pool DefaultMaxBondedTokenAmount int64 = types.NativeTokenTotalSupply // set default unbonding duration to 7 days DefaultUnbondingTime = 60 * 60 * 24 * 7 * time.Second // default max validators to 21 DefaultMaxValidators uint16 = 21 // min gov deposit DefaultGovMinDesposit = sdk.Coins{sdk.NewCoin(types.NativeTokenSymbol, 1000e8)} )
var ( DefaultCacheSize = 20000 DefaultMaxSurvive = 10 )
var DefaultKeyPass = "12345678"
DefaultKeyPass only for private test net
var SentryAppConfig = SentryConfig{DefaultCacheSize, DefaultMaxSurvive}
Functions ¶
func AximchainAppGenState ¶
func AximchainAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
AppGenState sets up the app_state and appends the cool app state
func AximchainAppInit ¶
func NewSentryApplication ¶
func PersistentPreRunEFn ¶
PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config object
func SetUpgradeConfig ¶
func SetUpgradeConfig(upgradeConfig *config.UpgradeConfig)
SetUpgradeConfig will overwrite default upgrade config
Types ¶
type Aximchain ¶
type Aximchain struct { *baseapp.BaseApp Codec *wire.Codec // keepers CoinKeeper bank.Keeper DexKeeper *dex.DexKeeper AccountKeeper auth.AccountKeeper TokenMapper tokens.Mapper ValAddrCache *ValAddrCache // keeper to process param store and update ParamHub *param.Keeper // contains filtered or unexported fields }
Aximchain is the AXCBeaconChain ABCI application
func NewAximchain ¶
func NewAximchain(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *Aximchain
NewAximchain creates a new instance of the Aximchain.
func (*Aximchain) AccountHandler ¶
func (app *Aximchain) AccountHandler(chainApp types.ChainApp, req abci.RequestQuery, path []string) *abci.ResponseQuery
func (*Aximchain) BeginBlocker ¶
func (app *Aximchain) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
func (*Aximchain) CheckTx ¶
func (app *Aximchain) CheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)
func (*Aximchain) Commit ¶
func (app *Aximchain) Commit() (res abci.ResponseCommit)
func (*Aximchain) DeliverTx ¶
func (app *Aximchain) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
Implements ABCI
func (*Aximchain) EndBlocker ¶
func (app *Aximchain) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
func (*Aximchain) ExportAppStateAndValidators ¶
func (app *Aximchain) ExportAppStateAndValidators() (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
ExportAppStateAndValidators exports blockchain world state to json.
func (*Aximchain) GetContextForCheckState ¶
GetContextForCheckState gets the context for the check state.
func (*Aximchain) PreDeliverTx ¶
func (app *Aximchain) PreDeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
PreDeliverTx implements extended ABCI for concurrency PreCheckTx would perform decoding, signture and other basic verification
func (*Aximchain) Query ¶
func (app *Aximchain) Query(req abci.RequestQuery) (res abci.ResponseQuery)
Query performs an abci query.
func (*Aximchain) RegisterQueryHandler ¶
func (app *Aximchain) RegisterQueryHandler(prefix string, handler types.AbciQueryHandler)
RegisterQueryHandler registers an abci query handler, implements ChainApp.RegisterQueryHandler.
func (*Aximchain) WriteRecoveryChunk ¶
type GenesisAccount ¶
type GenesisAccount struct { Name string `json:"name"` Address sdk.AccAddress `json:"address"` ConsensusAddr crypto.Address `json:"consensus_addr"` // only validator's account has this address }
GenesisAccount doesn't need pubkey or sequence
func NewGenesisAccount ¶
func NewGenesisAccount(aa *types.AppAccount, consensusAddr crypto.Address) GenesisAccount
NewGenesisAccount -
func (*GenesisAccount) ToAppAccount ¶
func (ga *GenesisAccount) ToAppAccount() (acc *types.AppAccount)
convert GenesisAccount to AppAccount
type GenesisState ¶
type GenesisState struct { Tokens []tokens.GenesisToken `json:"tokens"` Accounts []GenesisAccount `json:"accounts"` DexGenesis dex.Genesis `json:"dex"` ParamGenesis paramtypes.GenesisState `json:"param"` StakeData stake.GenesisState `json:"stake"` GovData gov.GenesisState `json:"gov"` GenTxs []json.RawMessage `json:"gentxs"` }
type SentryApplication ¶
type SentryApplication struct { abci.BaseApplication Codec *wire.Codec // contains filtered or unexported fields }
func (*SentryApplication) BeginBlock ¶
func (app *SentryApplication) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock
func (*SentryApplication) CheckTx ¶
func (app *SentryApplication) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx
func (*SentryApplication) Info ¶
func (app *SentryApplication) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo)
func (*SentryApplication) InitChain ¶
func (app *SentryApplication) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
func (*SentryApplication) ReCheckTx ¶
func (app *SentryApplication) ReCheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)
type SentryConfig ¶
type ValAddrCache ¶
type ValAddrCache struct {
// contains filtered or unexported fields
}
func NewValAddrCache ¶
func NewValAddrCache(stakeKeeper stake.Keeper) *ValAddrCache
func (*ValAddrCache) ClearCache ¶
func (vac *ValAddrCache) ClearCache()
func (*ValAddrCache) GetAccAddr ¶
func (vac *ValAddrCache) GetAccAddr(ctx sdk.Context, consAddr sdk.ConsAddress) sdk.AccAddress
func (*ValAddrCache) GetDistributionAddr ¶
func (vac *ValAddrCache) GetDistributionAddr(ctx sdk.Context, consAddr sdk.ConsAddress) sdk.AccAddress
func (*ValAddrCache) SetAccAddr ¶
func (vac *ValAddrCache) SetAccAddr(consAddr sdk.ConsAddress, accAddr sdk.AccAddress)
func (*ValAddrCache) SetDistributionAddr ¶
func (vac *ValAddrCache) SetDistributionAddr(consAddr sdk.ConsAddress, accAddr sdk.AccAddress)