swingset

package
v0.0.0-...-2ca7ea6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = types.ModuleName
	RouterKey  = types.RouterKey
	StoreKey   = types.StoreKey
)
View Source
const (
	ConfigPrefix                = "swingset"
	FlagSlogfile                = ConfigPrefix + ".slogfile"
	FlagVatSnapshotArchiveDir   = ConfigPrefix + ".vat-snapshot-archive-dir"
	FlagVatTranscriptArchiveDir = ConfigPrefix + ".vat-transcript-archive-dir"

	SnapshotRetentionOptionDebug       = "debug"
	SnapshotRetentionOptionOperational = "operational"

	TranscriptRetentionOptionArchival    = "archival"
	TranscriptRetentionOptionOperational = "operational"
)
View Source
const DefaultConfigTemplate = `` /* 2003-byte string literal not displayed */

DefaultConfigTemplate defines a default TOML configuration section for the SwingSet VM. Values are pulled from a "Swingset" property, in accord with CustomAppConfig from ../../daemon/cmd/root.go. See https://github.com/cosmos/cosmos-sdk/issues/20097 for auto-synchronization ideas.

View Source
const (
	SwingStoreUpdateExportData = "swingStoreUpdateExportData"
)

Variables

View Source
var (
	NewKeeper            = keeper.NewKeeper
	NewQuerier           = keeper.NewQuerier
	NewMsgDeliverInbound = types.NewMsgDeliverInbound
	NewMsgProvision      = types.NewMsgProvision
	NewMailbox           = types.NewMailbox
	RegisterCodec        = types.RegisterCodec
)
View Source
var DefaultSwingsetConfig = SwingsetConfig{
	SlogFile:               "",
	MaxVatsOnline:          50,
	VatSnapshotRetention:   "operational",
	VatTranscriptRetention: "default",
}

Functions

func AfterCommitBlock

func AfterCommitBlock(keeper Keeper) error

func BeginBlock

func BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, keeper Keeper) error

func CommitBlock

func CommitBlock(keeper Keeper) error

func DefaultGenesisState

func DefaultGenesisState() *types.GenesisState

func EndBlock

func EndBlock(ctx sdk.Context, req abci.RequestEndBlock, keeper Keeper) ([]abci.ValidatorUpdate, error)

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper, swingStoreExportsHandler *SwingStoreExportsHandler, swingStoreExportDir string) *types.GenesisState

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, swingStoreExportsHandler *SwingStoreExportsHandler, swingStoreExportDir string, data *types.GenesisState) bool

InitGenesis initializes the (Cosmos-side) SwingSet state from the GenesisState. Returns whether the app should send a bootstrap action to the controller.

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler returns a handler for "swingset" type messages.

func NewPortHandler

func NewPortHandler(k Keeper) vm.PortHandler

NewPortHandler returns a port handler for a swingset Keeper.

func NewSwingSetProposalHandler

func NewSwingSetProposalHandler(k keeper.Keeper) govv1beta1.Handler

NewSwingSetProposalHandler defines the SwingSet proposal handler

func ValidateGenesis

func ValidateGenesis(data *types.GenesisState) error

Types

type ActionContext

type ActionContext = types.ActionContext

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k Keeper, swingStoreExportsHandler *SwingStoreExportsHandler, setBootstrapNeeded func(), ensureControllerInited func(sdk.Context), swingStoreExportDir string) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the sdk.Querier for deployment module

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

func (AppModule) Route

func (am AppModule) Route() sdk.Route

func (*AppModule) SetSwingStoreExportDir

func (am *AppModule) SetSwingStoreExportDir(dir string)

For testing purposes

type AppModuleBasic

type AppModuleBasic struct {
}

app module Basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the deployment

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

Get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

Get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

func (AppModuleBasic) RegisterInterfaces

func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

Validation check of the Genesis

type Egress

type Egress = types.Egress

type ExtensionSnapshotter

type ExtensionSnapshotter = keeper.ExtensionSnapshotter

type InboundQueueRecord

type InboundQueueRecord = types.InboundQueueRecord

type Keeper

type Keeper = keeper.Keeper

type MsgDeliverInbound

type MsgDeliverInbound = types.MsgDeliverInbound

type MsgProvision

type MsgProvision = types.MsgProvision

type Params

type Params = types.Params

type SwingStoreExportsHandler

type SwingStoreExportsHandler = keeper.SwingStoreExportsHandler

type SwingsetConfig

type SwingsetConfig struct {
	// SlogFile is the path at which a SwingSet log "slog" file should be written.
	// If relative, it is interpreted against the application home directory
	SlogFile string `mapstructure:"slogfile" json:"slogfile,omitempty"`

	// MaxVatsOnline is the maximum number of vats that the SwingSet kernel will have online
	// at any given time.
	MaxVatsOnline int `mapstructure:"max-vats-online" json:"maxVatsOnline,omitempty"`

	// VatSnapshotRetention controls retention of vat snapshots,
	// and has values analogous to those of export `artifactMode` (cf.
	// ../../../../packages/swing-store/docs/data-export.md#optional--historical-data ).
	// * "debug": keep all snapshots
	// * "operational": keep only the last snapshot
	VatSnapshotRetention string `mapstructure:"vat-snapshot-retention" json:"vatSnapshotRetention,omitempty"`

	// VatTranscriptRetention controls retention of vat transcript spans,
	// and has values analogous to those of export `artifactMode` (cf.
	// ../../../../packages/swing-store/docs/data-export.md#optional--historical-data ).
	// * "archival": keep all transcript spans
	// * "operational": keep only necessary transcript spans (i.e., since the
	//   last snapshot of their vat)
	// * "default": determined by `pruning` ("archival" if `pruning` is
	//   "nothing", otherwise "operational")
	VatTranscriptRetention string `mapstructure:"vat-transcript-retention" json:"vatTranscriptRetention,omitempty"`

	// VatSnapshotArchiveDir controls archival of gzipped vat snapshots.
	VatSnapshotArchiveDir string `mapstructure:"vat-snapshot-archive-dir" json:"vatSnapshotArchiveDir,omitempty"`

	// VatTranscriptArchiveDir controls archival of historical (i.e., closed) vat
	// transcript spans to gzipped files.
	VatTranscriptArchiveDir string `mapstructure:"vat-transcript-archive-dir" json:"vatTranscriptArchiveDir,omitempty"`
}

SwingsetConfig defines configuration for the SwingSet VM. "mapstructure" tag data is used to direct reads from app.toml; "json" tag data is used to populate init messages for the VM. This should be kept in sync with SwingsetConfigShape in ../../../../packages/cosmic-swingset/src/chain-main.js. TODO: Consider extensions from docs/env.md.

func SwingsetConfigFromViper

func SwingsetConfigFromViper(resolvedConfig servertypes.AppOptions) (*SwingsetConfig, error)

Directories

Path Synopsis
cli
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

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