app

package
v0.0.0-...-cc24d94 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: AGPL-3.0 Imports: 188 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName       = "jinxprotocol"
	AppDaemonName = AppName + "d"
	ServiceName   = "validator"
)

Variables

View Source
var (
	// `Upgrades` defines the upgrade handlers and store loaders for the application.
	// New upgrades should be added to this slice after they are implemented.
	Upgrades = []upgrades.Upgrade{
		v3_0_0.Upgrade,
	}
	Forks = []upgrades.Fork{}
)
View Source
var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string
)

Functions

func BlockedAddresses

func BlockedAddresses() map[string]bool

BlockedAddresses returns all the app's blocked account addresses.

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func ModuleAccountAddrs

func ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, deducts fees from the first signer, and handles in-memory clob messages.

Link to default `AnteHandler` used by cosmos sdk: https://github.com/cosmos/cosmos-sdk/blob/3bb27795742dab2451b232bab02b82566d1a0192/x/auth/ante/ante.go#L25

func RegisterSwaggerAPI

func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func SetZerologDatadogErrorTrackingFormat

func SetZerologDatadogErrorTrackingFormat()

SetZerologDatadogErrorTrackingFormat sets custom error formatting for log tag values that are errors for the zerolog library. Converts them to a format that is compatible with datadog error tracking.

Types

type App

type App struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    *stakingkeeper.Keeper
	SlashingKeeper   slashingkeeper.Keeper
	DistrKeeper      distrkeeper.Keeper
	GovKeeper        *govkeeper.Keeper
	CrisisKeeper     *crisiskeeper.Keeper
	UpgradeKeeper    *upgradekeeper.Keeper
	ParamsKeeper     paramskeeper.Keeper
	// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCKeeper             *ibckeeper.Keeper
	ICAHostKeeper         icahostkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	TransferKeeper        ibctransferkeeper.Keeper
	RatelimitKeeper       ratelimitmodulekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper

	PricesKeeper pricesmodulekeeper.Keeper

	AssetsKeeper assetsmodulekeeper.Keeper

	BlockTimeKeeper blocktimemodulekeeper.Keeper

	BridgeKeeper bridgemodulekeeper.Keeper

	DelayMsgKeeper delaymsgmodulekeeper.Keeper

	FeeTiersKeeper feetiersmodulekeeper.Keeper

	PerpetualsKeeper *perpetualsmodulekeeper.Keeper

	VestKeeper vestmodulekeeper.Keeper

	RewardsKeeper rewardsmodulekeeper.Keeper

	StatsKeeper statsmodulekeeper.Keeper

	SubaccountsKeeper subaccountsmodulekeeper.Keeper

	ClobKeeper *clobmodulekeeper.Keeper

	SendingKeeper sendingmodulekeeper.Keeper

	EpochsKeeper epochsmodulekeeper.Keeper

	ModuleManager *module.Manager

	IndexerEventManager indexer_manager.IndexerEventManager
	Server              *daemonserver.Server

	PriceFeedClient    *pricefeedclient.Client
	LiquidationsClient *liquidationclient.Client
	BridgeClient       *bridgeclient.Client

	DaemonHealthMonitor *daemonservertypes.HealthMonitor
	// contains filtered or unexported fields
}

App extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func New

func New(
	logger log.Logger,
	db dbm.DB,
	snapshotDB dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) *App

New returns a reference to an initialized blockchain app

func (*App) AppCodec

func (app *App) AppCodec() codec.Codec

AppCodec returns an app codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*App) BeginBlocker

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

BeginBlocker application updates every begin block

func (*App) Close

func (app *App) Close() error

Close invokes an ordered shutdown of routines.

func (*App) Commiter

func (app *App) Commiter(ctx sdk.Context)

Commiter application updates every commit

func (*App) DefaultGenesis

func (app *App) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns a default genesis from the registered AppModuleBasic's.

func (*App) DisableHealthMonitorForTesting

func (app *App) DisableHealthMonitorForTesting()

DisableHealthMonitorForTesting disables the health monitor for testing.

func (*App) EndBlocker

func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker application updates every end block

func (*App) ExportAppStateAndValidators deprecated

func (app *App) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

Deprecated: This is a legacy feature of cosmos that is known to be unstable, so we explicitly do not support its usage.

func (*App) GetBaseApp

func (app *App) GetBaseApp() *baseapp.BaseApp

GetBaseApp returns the base app of the application

func (*App) InitChainer

func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer application update at chain initialization

func (*App) InterfaceRegistry

func (app *App) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns an InterfaceRegistry

func (*App) LegacyAmino

func (app *App) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns SimApp's amino codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*App) LoadHeight

func (app *App) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*App) RegisterAPIRoutes

func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*App) RegisterDaemonWithHealthMonitor

func (app *App) RegisterDaemonWithHealthMonitor(
	healthCheckableDaemon daemontypes.HealthCheckable,
	maxDaemonUnhealthyDuration time.Duration,
)

RegisterDaemonWithHealthMonitor registers a daemon service with the update monitor, which will commence monitoring the health of the daemon. If the daemon does not register, the method will panic.

func (*App) RegisterNodeService

func (app *App) RegisterNodeService(clientCtx client.Context)

RegisterNodeService registers the node service.

func (*App) RegisterTendermintService

func (app *App) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*App) RegisterTxService

func (app *App) RegisterTxService(clientCtx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

func (*App) SimulationManager

func (app *App) SimulationManager() *module.SimulationManager

SimulationManager always returns nil.

func (*App) TxConfig

func (app *App) TxConfig() client.TxConfig

TxConfig returns app's TxConfig

type DatadogErrorTrackingObject

type DatadogErrorTrackingObject struct {
	Stack   []map[string]string
	Message string
	Kind    string
}

func (DatadogErrorTrackingObject) MarshalZerologObject

func (obj DatadogErrorTrackingObject) MarshalZerologObject(e *zerolog.Event)

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Codec             codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.

func GetEncodingConfig

func GetEncodingConfig() EncodingConfig

GetEncodingConfig returns the EncodingConfig.

type GenesisState

type GenesisState map[string]json.RawMessage

The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions
	ClobKeeper clobtypes.ClobKeeper
}

HandlerOptions are the options required for constructing an SDK AnteHandler. Note: This struct is defined here in order to add `ClobKeeper`. We use struct embedding to include the normal cosmos-sdk `HandlerOptions`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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