Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)
- func NewCreateTx(fee *types.Fee, body *Create) *types.Transaction
- func NewRegisterTx(fee *types.Fee, body *Register) *types.Transaction
- func NewRemoveTx(fee *types.Fee, body *Remove) *types.Transaction
- func NewUpdateTx(fee *types.Fee, body *Update) *types.Transaction
- type AllowedEndorsement
- type AppAuthPolicy
- type AppConfig
- type AppCreatedEvent
- type AppID
- func NewAppIDCreatorNonce(creator types.Address, nonce uint64) AppID
- func NewAppIDCreatorRoundIndex(creator types.Address, round uint64, index uint32) AppID
- func NewAppIDFromBech32(data string) (a AppID)
- func NewAppIDGlobalName(name string) AppID
- func NewAppIDRaw(ctx address.Context, data []byte) AppID
- type AppInstanceQuery
- type AppQuery
- type AppRemovedEvent
- type AppUpdatedEvent
- type Create
- type Event
- type FeePolicy
- type IdentifierScheme
- type Parameters
- type Register
- type Registration
- type Remove
- type StakeThresholds
- type Update
- type V1
Constants ¶
const ( // AppCreatedEventCode is the event code for the application created event. AppCreatedEventCode = 1 // AppUpdatedEventCode is the event code for the application updated event. AppUpdatedEventCode = 2 // AppRemovedEventCode is the event code for the application removed event. AppRemovedEventCode = 3 )
const ModuleName = "rofl"
ModuleName is the rofl module name.
Variables ¶
var ( // AppIDV0CRIContext is the unique context for v0 creator/round/index application identifiers. AppIDV0CRIContext = address.NewContext("oasis-sdk/rofl: cri app id", 0) // AppIDV0CNContext is the unique context for v0 creator/nonce application identifiers. AppIDV0CNContext = address.NewContext("oasis-sdk/rofl: cn app id", 0) // AppIDV0GlobalNameContext is the unique context for v0 global name application identifiers. AppIDV0GlobalNameContext = address.NewContext("oasis-sdk/rofl: global name app id", 0) // AppIDBech32HRP is the unique human readable part of Bech32 encoded application identifiers. AppIDBech32HRP = address.NewBech32HRP("rofl") )
Functions ¶
func DecodeEvent ¶
func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)
DecodeEvent decodes a rofl event.
func NewCreateTx ¶
func NewCreateTx(fee *types.Fee, body *Create) *types.Transaction
NewCreateTx generates a new rofl.Create transaction.
func NewRegisterTx ¶ added in v0.10.1
func NewRegisterTx(fee *types.Fee, body *Register) *types.Transaction
NewRegisterTx generates a new rofl.Register transaction.
func NewRemoveTx ¶
func NewRemoveTx(fee *types.Fee, body *Remove) *types.Transaction
NewRemoveTx generates a new rofl.Remove transaction.
func NewUpdateTx ¶
func NewUpdateTx(fee *types.Fee, body *Update) *types.Transaction
NewUpdateTx generates a new rofl.Update transaction.
Types ¶
type AllowedEndorsement ¶
type AllowedEndorsement struct { // Any specifies that any node can endorse the enclave. Any *struct{} `json:"any,omitempty" yaml:"any,omitempty"` // ComputeRole specifies that a compute node for the current runtime can endorse the enclave. ComputeRole *struct{} `json:"role_compute,omitempty" yaml:"role_compute,omitempty"` // ObserverRole specifies that an observer node for the current runtime can endorse the enclave. ObserverRole *struct{} `json:"role_observer,omitempty" yaml:"role_observer,omitempty"` // Entity specifies that a registered node from a specific entity can endorse the enclave. Entity *signature.PublicKey `json:"entity,omitempty" yaml:"entity,omitempty"` // Node specifies that a specific node can endorse the enclave. Node *signature.PublicKey `json:"node,omitempty" yaml:"node,omitempty"` }
AllowedEndorsement is an allowed endorsement policy.
type AppAuthPolicy ¶
type AppAuthPolicy struct { // Quotes is a quote policy. Quotes quote.Policy `json:"quotes" yaml:"quotes"` // Enclaves is the set of allowed enclave identities. Enclaves []sgx.EnclaveIdentity `json:"enclaves" yaml:"enclaves"` // Endorsements is the set of allowed endorsements. Endorsements []AllowedEndorsement `json:"endorsements" yaml:"endorsements"` // Fees is the gas fee payment policy. Fees FeePolicy `json:"fees" yaml:"fees"` // MaxExpiration is the maximum number of future epochs for which one can register. MaxExpiration beacon.EpochTime `json:"max_expiration" yaml:"max_expiration"` }
AppAuthPolicy is the per-application ROFL policy.
type AppConfig ¶
type AppConfig struct { // ID is the application identifier. ID AppID `json:"id"` // Policy is the application authentication policy. Policy AppAuthPolicy `json:"policy"` // Admin is the application administrator address. Admin *types.Address `json:"admin"` // Stake is the staked amount. Stake types.BaseUnits `json:"stake"` }
AppConfig is a ROFL application configuration.
type AppCreatedEvent ¶
type AppCreatedEvent struct {
ID AppID `json:"id"`
}
AppCreatedEvent is an application created event.
type AppID ¶
AppID is the ROFL application identifier.
func NewAppIDCreatorNonce ¶ added in v0.10.3
NewAppIDCreatorNonce creates a new application identifier from the given creator/nonce tuple.
func NewAppIDCreatorRoundIndex ¶
NewAppIDCreatorRoundIndex creates a new application identifier from the given creator/round/index tuple.
func NewAppIDFromBech32 ¶
NewAppIDFromBech32 creates a new application identifier from the given bech-32 encoded string.
Panics in case of errors -- use UnmarshalText if you want to handle errors.
func NewAppIDGlobalName ¶
NewAppIDGlobalName creates a new application identifier from the given global name.
func NewAppIDRaw ¶
NewAppIDRaw creates a new application identifier from passed context and data.
func (AppID) MarshalBinary ¶
MarshalBinary encodes an application identifier into binary form.
func (AppID) MarshalText ¶
MarshalText encodes an application identifier into text form.
func (*AppID) UnmarshalBinary ¶
UnmarshalBinary decodes a binary marshaled application identifier.
func (*AppID) UnmarshalText ¶
UnmarshalText decodes a text marshaled application identifier.
type AppInstanceQuery ¶ added in v0.10.3
type AppInstanceQuery struct { // App is the application identifier. App AppID `json:"app"` // RAK is the Runtime Attestation Key. RAK types.PublicKey `json:"rak"` }
AppInstanceQuery is an application instance query.
type AppQuery ¶
type AppQuery struct { // ID is the application identifier. ID AppID `json:"id"` }
AppQuery is an application-related query.
type AppRemovedEvent ¶
type AppRemovedEvent struct {
ID AppID `json:"id"`
}
AppRemovedEvent is an application removed event.
type AppUpdatedEvent ¶
type AppUpdatedEvent struct {
ID AppID `json:"id"`
}
AppUpdatedEvent is an application updated event.
type Create ¶
type Create struct { // Policy is the application authentication policy. Policy AppAuthPolicy `json:"policy"` // Scheme is the identifier generation scheme. Scheme IdentifierScheme `json:"scheme"` }
Create new ROFL application call.
type Event ¶
type Event struct { AppCreated *AppCreatedEvent AppUpdated *AppUpdatedEvent AppRemoved *AppRemovedEvent }
Event is a rofl module event.
type FeePolicy ¶
type FeePolicy uint8
FeePolicy is a gas fee payment policy.
func (*FeePolicy) UnmarshalYAML ¶ added in v0.10.2
UnmarshalYAML implements yaml.Unmarshaler.
type IdentifierScheme ¶ added in v0.10.3
type IdentifierScheme uint8
IdentifierScheme is a ROFL application identifier generation scheme.
const ( CreatorRoundIndex IdentifierScheme = 0 CreatorNonce IdentifierScheme = 1 )
type Register ¶ added in v0.10.1
type Register struct { // App is the application identifier of the app the caller is registering for. App AppID `json:"app"` // EndorsedCapability is the endorsed TEE capability. EndorsedCapability node.EndorsedCapabilityTEE `json:"ect"` //nolint: misspell // Expiration is the epoch when the ROFL registration expires if not renewed. Expiration beacon.EpochTime `json:"expiration"` // ExtraKeys are the extra public keys to endorse (e.g. secp256k1 keys). // // All of these keys need to co-sign the registration transaction to prove ownership. ExtraKeys []types.PublicKey `json:"extra_keys"` }
Register a ROFL application instance call.
type Registration ¶
type Registration struct { // App is the application this enclave is registered for. App AppID `json:"app"` // NodeID is the identifier of the endorsing node. NodeID signature.PublicKey `json:"node_id"` // EntityID is the optional identifier of the endorsing entity. EntityID *signature.PublicKey `json:"entity_id,omitempty"` // RAK is the Runtime Attestation Key. RAK signature.PublicKey `json:"rak"` // REK is the Runtime Encryption Key. REK x25519.PublicKey `json:"rek"` // Expiration is the epoch when the ROFL registration expires if not renewed. Expiration beacon.EpochTime `json:"expiration"` // ExtraKeys are the extra public keys to endorse (e.g. secp256k1 keys). ExtraKeys []types.PublicKey `json:"extra_keys"` }
Registration is a ROFL enclave registration descriptor.
type Remove ¶
type Remove struct { // ID is the application identifier. ID AppID `json:"id"` }
Remove an existing ROFL application call.
type StakeThresholds ¶ added in v0.11.1
StakeThresholds contains staking thresholds for managing ROFL.
type Update ¶
type Update struct { // ID is the application identifier. ID AppID `json:"id"` // Policy is the application authentication policy. Policy AppAuthPolicy `json:"policy"` // Admin is the application administrator address. Admin *types.Address `json:"admin"` }
Update an existing ROFL application call.
type V1 ¶
type V1 interface { client.EventDecoder // Create generates a rofl.Create transaction. Create(policy AppAuthPolicy) *client.TransactionBuilder // Update generates a rofl.Update transaction. Update(id AppID, policy AppAuthPolicy, admin *types.Address) *client.TransactionBuilder // Remove generates a rofl.Remove transaction. Remove(id AppID) *client.TransactionBuilder // App queries the given application configuration. App(ctx context.Context, round uint64, id AppID) (*AppConfig, error) // AppInstance queries a specific registered instance of the given application. AppInstance(ctx context.Context, round uint64, id AppID, rak types.PublicKey) (*Registration, error) // AppInstances queries the registered instances of the given application. AppInstances(ctx context.Context, round uint64, id AppID) ([]*Registration, error) // StakeThresholds queries the stake information for managing ROFL. StakeThresholds(ctx context.Context, round uint64) (*StakeThresholds, error) // Parameters queries the module parameters. Parameters(ctx context.Context, round uint64) (*Parameters, error) // GetEvents returns all rofl events emitted in a given block. GetEvents(ctx context.Context, round uint64) ([]*Event, error) }
V1 is the v1 rofl module interface.
func NewV1 ¶
func NewV1(rc client.RuntimeClient) V1
NewV1 generates a V1 client helper for the rofl module.