Documentation
¶
Overview ¶
Package deploy is the target-agnostic deployment engine: manifest-driven, idempotent steps over a per-target Target implementation.
Index ¶
- Constants
- func ValidClientID(id string) bool
- type AttestationParams
- type BesuParams
- type BesuSource
- type BridgeSpec
- type Check
- type ClientParams
- type ClientRef
- type ClientSpec
- type CoreParams
- type CoreRef
- type GMPRef
- type IFTRateLimit
- type IFTRef
- type IFTSpec
- type MulticallRef
- type Report
- type Step
- func ClientSteps(t Target, dir, chainID string, spec ClientSpec) []Step
- func CoreSteps(t Target, dir, chainID string) []Step
- func GMPSteps(t Target, dir, chainID string) []Step
- func IFTBridgeSteps(t Target, dir, chainID, iftAddr, ctorOverride string, spec BridgeSpec) []Step
- func IFTSteps(t Target, dir, chainID string, spec IFTSpec) []Step
- type StepResult
- type Target
Constants ¶
const ( CheckOK = "ok" CheckFailed = "failed" )
Check statuses.
const ( ActionSkipped = "skipped" ActionExecuted = "executed" ActionPlanned = "planned" )
StepResult actions.
const GMPPortID = "gmpport"
GMPPortID is the fixed IBC port the ICS27-GMP app registers under (ICS27Lib.DEFAULT_PORT_ID). ICS27GMP.onRecvPacket requires this exact port, so the app is only reachable when registered here.
Variables ¶
This section is empty.
Functions ¶
func ValidClientID ¶
ValidClientID reports whether id is a valid custom client identifier: 4-128 chars, alphanumerics plus [-._+#<>\[\]], and not in the generated "client-"/"channel-" namespaces reserved by routers.
Types ¶
type AttestationParams ¶
type AttestationParams manifest.AttestationParams
AttestationParams are the constructor inputs for an attestation client, recorded in the manifest as they are.
type BesuParams ¶
type BesuParams struct {
IBCRouter common.Address
InitialHeight uint64
InitialConsensusState besumsgs.IBesuLightClientMsgsConsensusState
TrustingPeriod uint64
TrustLevel besumsgs.IBesuLightClientMsgsTrustThreshold
}
BesuParams are the constructor inputs for a Besu client. The trusting period is in seconds; the max clock drift is always besu.MaxClockDrift.
type BesuSource ¶
type BesuSource interface {
// BesuHead returns a recent sealed header with a timestamp at most
// notAfter.
BesuHead(ctx context.Context, notAfter uint64) (*besu.ParsedHeader, error)
}
BesuSource is implemented by targets whose chain runs Besu and can serve a sealed header, which a new client tracking them starts trusting.
type BridgeSpec ¶
BridgeSpec describes one IFT bridge to register on a token.
type Check ¶
type Check struct {
Name string `json:"name"`
Status string `json:"status"`
Detail string `json:"detail,omitempty"`
}
Check is one verification result.
type ClientParams ¶
type ClientParams interface {
// contains filtered or unexported methods
}
ClientParams are the constructor inputs of one client type.
type ClientRef ¶
type ClientRef struct {
Address string
}
ClientRef is the result of provisioning a light client contract.
type ClientSpec ¶
type ClientSpec struct {
ClientID string
CounterpartyChainID string
CounterpartyClientID string
Params ClientParams
}
ClientSpec describes one light client to provision and register.
type CoreParams ¶
type CoreParams struct {
ChainID string
}
CoreParams parameterizes core-stack provisioning.
type IFTRateLimit ¶
IFTRateLimit is an IFT token's rate limit: each direction lets up to Capacity base units through when full, and refills completely over Window seconds.
func (IFTRateLimit) Equal ¶
func (l IFTRateLimit) Equal(o IFTRateLimit) bool
Equal reports whether l and o are the same rate limit.
type IFTRef ¶
type IFTRef struct {
Address string // proxy
}
IFTRef is the result of provisioning an IFT token.
type IFTSpec ¶
type IFTSpec struct {
Owner string
Name string
Symbol string
// RateLimit is set on the token after deployment; IFT rejects every
// transfer until it has one. Nil leaves it to the owner, which must then
// set it itself.
RateLimit *IFTRateLimit
}
IFTSpec describes one IFT token to deploy.
type MulticallRef ¶
MulticallRef is the deployed multicall proxy and its implementation.
type Report ¶
type Report struct {
Checks []Check `json:"checks"`
}
Report is the outcome of verifying a manifest against live chain state.
type Step ¶
type Step struct {
Name string
Done func(ctx context.Context) (bool, error)
Run func(ctx context.Context) error
}
Step is one idempotent deployment step. A nil Done means never pre-satisfied.
func ClientSteps ¶
func ClientSteps(t Target, dir, chainID string, spec ClientSpec) []Step
ClientSteps provisions and registers one light client on chainID's router and records it in the manifest. Requires the core step to have run.
func CoreSteps ¶
CoreSteps provisions the core routing stack on one chain and records it in the chain's manifest.
func GMPSteps ¶
GMPSteps provisions the ICS27-GMP app on chainID's router and records it in the manifest. Requires the core step to have run.
func IFTBridgeSteps ¶
func IFTBridgeSteps(t Target, dir, chainID, iftAddr, ctorOverride string, spec BridgeSpec) []Step
IFTBridgeSteps deploys the EVM send-call constructor (unless an override is supplied or one is already recorded) and registers a bridge on iftAddr pointing at spec.CounterpartyIFT over spec.ClientID. Requires core and a registered client on chainID. The bridge is recorded on the manifest token matching iftAddr when one exists.
type StepResult ¶
StepResult records what happened to one step.
type Target ¶
type Target interface {
// ProvisionCore deploys the core routing stack.
ProvisionCore(ctx context.Context, p CoreParams) (CoreRef, error)
// ProvisionMulticall deploys a multicall governed by the core's access manager.
ProvisionMulticall(ctx context.Context, accessManager string) (MulticallRef, error)
// ProvisionClient deploys a light client governed by router, without
// registering it.
ProvisionClient(ctx context.Context, router string, spec ClientSpec) (ClientRef, error)
// RegisterClient registers a provisioned client on the router and returns
// the registered client ID.
RegisterClient(ctx context.Context, router string, spec ClientSpec, client ClientRef) (string, error)
// ClientRegistered reports whether clientID is registered on router,
// returning the registered client address when it is.
ClientRegistered(ctx context.Context, router, clientID string) (string, bool, error)
// HasCode reports whether an on-chain artifact exists at address.
HasCode(ctx context.Context, address string) (bool, error)
// Head returns the chain's current height and timestamp (seconds).
Head(ctx context.Context) (height, timestamp uint64, err error)
// Verify checks a manifest's recorded deployment against live chain
// state.
Verify(ctx context.Context, m *manifest.Manifest) (Report, error)
// ProvisionGMP deploys the ICS27-GMP app (account logic + impl + proxy).
ProvisionGMP(ctx context.Context, router, accessManager string) (GMPRef, error)
// RegisterApp registers app on the router under port.
RegisterApp(ctx context.Context, router, app, port string) error
// AppRegistered reports whether an app is registered at port, returning its
// address when it is.
AppRegistered(ctx context.Context, router, port string) (string, bool, error)
// ProvisionIFT deploys an IFT token governed by the GMP app.
ProvisionIFT(ctx context.Context, gmp string, spec IFTSpec) (IFTRef, error)
// SetIFTRateLimit sets an IFT token's rate limit. Only the token owner
// may.
SetIFTRateLimit(ctx context.Context, ift string, limit IFTRateLimit) error
// IFTRateLimit returns an IFT token's configured rate limit.
IFTRateLimit(ctx context.Context, ift string) (IFTRateLimit, error)
// ProvisionSendCallConstructor deploys the stateless EVM IFT send-call
// constructor and returns its address.
ProvisionSendCallConstructor(ctx context.Context) (string, error)
// RegisterIFTBridge registers a bridge on an IFT token.
RegisterIFTBridge(ctx context.Context, ift string, spec BridgeSpec) error
// IFTBridge reports whether a bridge for clientID exists on the token,
// returning its counterparty IFT address and send-call constructor when it
// does.
IFTBridge(ctx context.Context, ift, clientID string) (counterparty, constructor string, registered bool, err error)
}
Target deploys and wires IBC on one deployment-target ecosystem. Provision* verbs use the target's idiomatic tooling; the rest are IBC wiring and reads.