Documentation
¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Keeper
- func (k Keeper) BlockingSend(ctx sdk.Context, action vm.Jsonable) (string, error)
- func (k Keeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error
- func (k Keeper) ChargeForProvisioning(ctx sdk.Context, submitter, addr sdk.AccAddress, powerFlags []string) error
- func (k Keeper) CoreEvalProposal(ctx sdk.Context, p *types.CoreEvalProposal) error
- func (k Keeper) ExportSwingStore(ctx sdk.Context) []*vstoragetypes.DataEntry
- func (k Keeper) GetBeansOwing(ctx sdk.Context, addr sdk.AccAddress) sdk.Uint
- func (k Keeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Uint
- func (k Keeper) GetEgress(ctx sdk.Context, addr sdk.AccAddress) types.Egress
- func (k Keeper) GetMailbox(ctx sdk.Context, peer string) string
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetState(ctx sdk.Context) types.State
- func (k Keeper) GetStoreName() string
- func (k Keeper) InboundQueueLength(ctx sdk.Context) (int32, error)
- func (k Keeper) IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (bool, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PathToEncodedKey(path string) []byte
- func (k Keeper) PushAction(ctx sdk.Context, action vm.Jsonable) error
- func (k Keeper) PushHighPriorityAction(ctx sdk.Context, action vm.Jsonable) error
- func (k Keeper) SetBeansOwing(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint)
- func (k Keeper) SetEgress(ctx sdk.Context, egress *types.Egress) error
- func (k Keeper) SetMailbox(ctx sdk.Context, peer string, mailbox string)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetState(ctx sdk.Context, state types.State)
- func (k Keeper) UpdateQueueAllowed(ctx sdk.Context) error
- type Migrator
- type Querier
- func (k Querier) Egress(c context.Context, req *types.QueryEgressRequest) (*types.QueryEgressResponse, error)
- func (k Querier) Mailbox(c context.Context, req *types.QueryMailboxRequest) (*types.QueryMailboxResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- type SwingStoreExporter
- type SwingsetSnapshotter
- func (snapshotter *SwingsetSnapshotter) InitiateSnapshot(height int64) error
- func (snapshotter *SwingsetSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshots.ExtensionPayloadReader) error
- func (snapshotter *SwingsetSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshots.ExtensionPayloadWriter) (err error)
- func (snapshotter *SwingsetSnapshotter) SnapshotFormat() uint32
- func (snapshotter *SwingsetSnapshotter) SnapshotName() string
- func (snapshotter *SwingsetSnapshotter) SupportedFormats() []uint32
- func (snapshotter *SwingsetSnapshotter) WaitUntilSnapshotStarted() error
Constants ¶
const ( StoragePathActionQueue = "actionQueue" StoragePathHighPriorityQueue = "highPriorityQueue" StoragePathHighPrioritySenders = "highPrioritySenders" StoragePathBeansOwing = "beansOwing" StoragePathEgress = "egress" StoragePathMailbox = "mailbox" StoragePathCustom = "published" StoragePathBundles = "bundles" StoragePathSwingStore = "swingStore" )
Top-level paths for chain storage should remain synchronized with packages/internal/src/chain-storage-paths.js
const ( QueryEgress = "egress" QueryMailbox = "mailbox" LegacyQueryStorage = "storage" LegacyQueryKeys = "keys" )
query endpoints supported by the swingset Querier
const ExportDataFilename = "export-data.jsonl"
const ExportManifestFilename = "export-manifest.json"
The manifest filename must be synchronized with the JS export/import tooling
const ExportedFilesMode = 0644
const SnapshotFormat = 1
SnapshotFormat 1 is a proto message containing an artifact name, and the binary artifact data
const UntrustedExportDataArtifactName = "UNTRUSTED-EXPORT-DATA"
const UntrustedExportDataFilename = "untrusted-export-data.jsonl"
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data vstorage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper bankkeeper.Keeper, vstorageKeeper vstoragekeeper.Keeper, feeCollectorName string, callToController func(ctx sdk.Context, str string) (string, error), ) Keeper
NewKeeper creates a new IBC transfer Keeper instance
func (Keeper) BlockingSend ¶
BlockingSend sends a message to the controller and blocks the Golang process until the response. It is orthogonal to PushAction, and should only be used by SwingSet to perform block lifecycle events (BEGIN_BLOCK, END_BLOCK, COMMIT_BLOCK).
func (Keeper) ChargeBeans ¶
ChargeBeans charges the given address the given number of beans. It divides the beans into the number to debit immediately vs. the number to store in the beansOwing.
func (Keeper) ChargeForProvisioning ¶ added in v0.31.0
func (Keeper) CoreEvalProposal ¶
CoreEvalProposal tells SwingSet to evaluate the given JS code.
func (Keeper) ExportSwingStore ¶ added in v0.34.0
func (k Keeper) ExportSwingStore(ctx sdk.Context) []*vstoragetypes.DataEntry
func (Keeper) GetBeansOwing ¶
GetBeansOwing returns the number of beans that the given address owes to the FeeAccount but has not yet paid.
func (Keeper) GetBeansPerUnit ¶
GetBeansPerUnit returns a map taken from the current SwingSet parameters from a unit (key) string to an unsigned integer amount of beans.
func (Keeper) GetMailbox ¶
GetMailbox gets the entire mailbox struct for a peer
func (Keeper) GetStoreName ¶ added in v0.31.0
func (Keeper) InboundQueueLength ¶ added in v0.34.0
func (Keeper) IsHighPriorityAddress ¶ added in v0.34.0
func (Keeper) PathToEncodedKey ¶ added in v0.31.0
func (Keeper) PushAction ¶
PushAction appends an action to the controller's actionQueue.
func (Keeper) PushHighPriorityAction ¶ added in v0.34.0
PushAction appends an action to the controller's highPriorityQueue.
func (Keeper) SetBeansOwing ¶
SetBeansOwing sets the number of beans that the given address owes to the feeCollector but has not yet paid.
func (Keeper) SetEgress ¶
SetEgress sets the egress struct for a peer, and ensures its account exists
func (Keeper) SetMailbox ¶
SetMailbox sets the entire mailbox struct for a peer
type Migrator ¶ added in v0.34.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator handles in-place store migrations.
func NewMigrator ¶ added in v0.34.0
NewMigrator returns a new migrator based on the keeper.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) Egress ¶
func (k Querier) Egress(c context.Context, req *types.QueryEgressRequest) (*types.QueryEgressResponse, error)
func (Querier) Mailbox ¶
func (k Querier) Mailbox(c context.Context, req *types.QueryMailboxRequest) (*types.QueryMailboxResponse, error)
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
type SwingStoreExporter ¶ added in v0.34.0
type SwingStoreExporter interface {
ExportSwingStore(ctx sdk.Context) []*vstoragetypes.DataEntry
}
type SwingsetSnapshotter ¶ added in v0.34.0
type SwingsetSnapshotter struct {
// contains filtered or unexported fields
}
func NewSwingsetSnapshotter ¶ added in v0.34.0
func NewSwingsetSnapshotter(app *baseapp.BaseApp, exporter SwingStoreExporter, sendToController func(bool, string) (string, error)) SwingsetSnapshotter
func (*SwingsetSnapshotter) InitiateSnapshot ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) InitiateSnapshot(height int64) error
InitiateSnapshot synchronously initiates a snapshot for the given height. If a snapshot is already in progress, or if no snapshot manager is configured, this will fail. The snapshot operation is performed in a goroutine, and synchronized with the main thread through the `WaitUntilSnapshotStarted` method.
func (*SwingsetSnapshotter) RestoreExtension ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshots.ExtensionPayloadReader) error
RestoreExtension restores an extension state snapshot, the payload reader returns `io.EOF` when it reaches the extension boundaries. Implements ExtensionSnapshotter
func (*SwingsetSnapshotter) SnapshotExtension ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshots.ExtensionPayloadWriter) (err error)
SnapshotExtension writes extension payloads into the underlying protobuf stream. This operation is invoked by the snapshot manager in the goroutine started by `InitiateSnapshot`. Implements ExtensionSnapshotter
func (*SwingsetSnapshotter) SnapshotFormat ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) SnapshotFormat() uint32
SnapshotFormat returns the default format the extension snapshotter uses to encode the payloads when taking a snapshot. It's defined within the extension, different from the global format for the whole state-sync snapshot. Implements ExtensionSnapshotter
func (*SwingsetSnapshotter) SnapshotName ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) SnapshotName() string
SnapshotName returns the name of snapshotter, it should be unique in the manager. Implements ExtensionSnapshotter
func (*SwingsetSnapshotter) SupportedFormats ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) SupportedFormats() []uint32
SupportedFormats returns a list of formats it can restore from. Implements ExtensionSnapshotter
func (*SwingsetSnapshotter) WaitUntilSnapshotStarted ¶ added in v0.34.0
func (snapshotter *SwingsetSnapshotter) WaitUntilSnapshotStarted() error
WaitUntilSnapshotStarted synchronizes with a snapshot in progress, if any. The JS SwingStore export must have started before a new block is committed. The app must call this method before sending a commit action to SwingSet.
Waits for a just initiated snapshot to have started in its goroutine. If no snapshot is in progress (`InitiateSnapshot` hasn't been called or already completed), or if we previously checked if the snapshot had started, returns immediately.