app

package
v0.10.20 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 80 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCLIHome      = os.ExpandEnv("$HOME/.bnbcli")
	DefaultNodeHome     = os.ExpandEnv("$HOME/.bnbchaind")
	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 BNBAppGenState added in v0.10.15

func BNBAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)

AppGenState sets up the app_state and appends the cool app state

func BNBAppInit added in v0.10.15

func BNBAppInit() 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.BNBBeaconChainContext) 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 BNBBeaconChain added in v0.10.15

type BNBBeaconChain 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
}

BNBBeaconChain is the BNBChain ABCI application

func NewBNBBeaconChain added in v0.10.15

func NewBNBBeaconChain(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *BNBBeaconChain

NewBNBBeaconChain creates a new instance of the BNBBeaconChain.

func (*BNBBeaconChain) AccountHandler added in v0.10.15

func (app *BNBBeaconChain) AccountHandler(chainApp types.ChainApp, req abci.RequestQuery, path []string) *abci.ResponseQuery

func (*BNBBeaconChain) BeginBlocker added in v0.10.15

func (app *BNBBeaconChain) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)

func (*BNBBeaconChain) CheckTx added in v0.10.15

func (app *BNBBeaconChain) CheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)

func (*BNBBeaconChain) Commit added in v0.10.15

func (app *BNBBeaconChain) Commit() (res abci.ResponseCommit)

func (*BNBBeaconChain) DeliverTx added in v0.10.15

func (app *BNBBeaconChain) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)

Implements ABCI

func (*BNBBeaconChain) EndBlocker added in v0.10.15

func (*BNBBeaconChain) ExportAppStateAndValidators added in v0.10.15

func (app *BNBBeaconChain) ExportAppStateAndValidators() (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)

ExportAppStateAndValidators exports blockchain world state to json.

func (*BNBBeaconChain) GetCodec added in v0.10.15

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

GetCodec returns the app's Codec.

func (*BNBBeaconChain) GetContextForCheckState added in v0.10.15

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

GetContextForCheckState gets the context for the check state.

func (*BNBBeaconChain) GetRouter added in v0.10.15

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

GetRouter returns the app's Router.

func (*BNBBeaconChain) PreDeliverTx added in v0.10.15

func (app *BNBBeaconChain) PreDeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)

PreDeliverTx implements extended ABCI for concurrency PreCheckTx would perform decoding, signture and other basic verification

func (*BNBBeaconChain) Query added in v0.10.15

func (app *BNBBeaconChain) Query(req abci.RequestQuery) (res abci.ResponseQuery)

Query performs an abci query.

func (*BNBBeaconChain) RegisterQueryHandler added in v0.10.15

func (app *BNBBeaconChain) RegisterQueryHandler(prefix string, handler types.AbciQueryHandler)

RegisterQueryHandler registers an abci query handler, implements ChainApp.RegisterQueryHandler.

func (*BNBBeaconChain) WriteRecoveryChunk added in v0.10.15

func (app *BNBBeaconChain) 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 added in v0.10.4

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 added in v0.10.4

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