app

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2023 License: MPL-2.0 Imports: 75 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCLIHome      = os.ExpandEnv("$HOME/.axccli")
	DefaultNodeHome     = os.ExpandEnv("$HOME/.axcchaind")
	Bech32PrefixAccAddr string
)

default home directories for expected binaries

View Source
var (
	Codec         = MakeCodec()
	ServerContext = config.NewDefaultContext()
)
View Source
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)}
)
View Source
var (
	DefaultCacheSize  = 20000
	DefaultMaxSurvive = 10
)
View Source
var DefaultKeyPass = "12345678"

DefaultKeyPass only for private test net

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 AximchainAppInit() server.AppInit

func MakeCodec

func MakeCodec() *wire.Codec

MakeCodec creates a custom tx codec.

func NewSentryApplication

func NewSentryApplication(logger log.Logger, _ db.DB, _ io.Writer) abci.Application

func PersistentPreRunEFn

func PersistentPreRunEFn(context *config.AximchainContext) func(*cobra.Command, []string) error

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) GetCodec

func (app *Aximchain) GetCodec() *wire.Codec

GetCodec returns the app's Codec.

func (*Aximchain) GetContextForCheckState

func (app *Aximchain) GetContextForCheckState() sdk.Context

GetContextForCheckState gets the context for the check state.

func (*Aximchain) GetRouter

func (app *Aximchain) GetRouter() baseapp.Router

GetRouter returns the app's Router.

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

func (app *Aximchain) WriteRecoveryChunk(hash abci.SHA256Sum, chunk *abci.AppStateChunk, isComplete bool) (err error)

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 (*SentryApplication) CheckTx

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 SentryConfig struct {
	CacheSize  int
	MaxSurvive int
}

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)

Directories

Path Synopsis
pub
sub

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL