Documentation
¶
Index ¶
- Constants
- type APIL1Validator
- type BaseL1Validator
- type BuildGenesisArgs
- type BuildGenesisReply
- type Chain
- type GenesisPermissionlessValidator
- type GenesisValidator
- type Height
- type Owner
- type PermissionedValidator
- type PermissionlessValidator
- type PrimaryDelegator
- type Staker
- type StaticClient
- type StaticService
- type UTXO
Constants ¶
const ( ProposedHeightJSON = `"proposed"` // ProposedHeight is the reserved height: MaxUint64 means "the height the // next proposal will be built at" rather than a height. Supplying it as a // number is refused, so the sentinel can never collide with a real height. ProposedHeight = math.MaxUint64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIL1Validator ¶
type APIL1Validator struct {
NodeID ids.NodeID `json:"nodeID"`
Weight json.Uint64 `json:"weight"`
StartTime json.Uint64 `json:"startTime"`
BaseL1Validator
}
APIL1Validator is the representation of a L1 validator sent over APIs.
func (*APIL1Validator) MarshalZAP ¶ added in v1.36.178
func (x *APIL1Validator) MarshalZAP() ([]byte, error)
MarshalZAP writes APIL1Validator from constant offsets.
func (*APIL1Validator) UnmarshalZAP ¶ added in v1.36.178
func (x *APIL1Validator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads APIL1Validator out of the buffer that arrived.
type BaseL1Validator ¶
type BaseL1Validator struct {
ValidationID *ids.ID `json:"validationID,omitempty"`
// PublicKey is the compressed BLS public key of the validator
PublicKey *types.JSONByteSlice `json:"publicKey,omitempty"`
RemainingBalanceOwner *Owner `json:"remainingBalanceOwner,omitempty"`
DeactivationOwner *Owner `json:"deactivationOwner,omitempty"`
MinNonce *json.Uint64 `json:"minNonce,omitempty"`
// Balance is the remaining amount of LUX this L1 validator has for paying
// the continuous fee, according to the last accepted state. If the
// validator is inactive, the balance will be 0.
Balance *json.Uint64 `json:"balance,omitempty"`
}
BaseL1Validator is the representation of a base L1 validator without the common parts with a staker.
func (*BaseL1Validator) MarshalZAP ¶ added in v1.36.178
func (x *BaseL1Validator) MarshalZAP() ([]byte, error)
MarshalZAP writes BaseL1Validator from constant offsets.
func (*BaseL1Validator) UnmarshalZAP ¶ added in v1.36.178
func (x *BaseL1Validator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads BaseL1Validator out of the buffer that arrived.
type BuildGenesisArgs ¶ added in v1.1.11
type BuildGenesisArgs struct {
UTXOAssetID ids.ID `json:"utxoAssetID"`
NetworkID json.Uint32 `json:"networkID"`
UTXOs []UTXO `json:"utxos"`
Validators []GenesisPermissionlessValidator `json:"validators"`
Chains []Chain `json:"chains"`
Time json.Uint64 `json:"time"`
InitialSupply json.Uint64 `json:"initialSupply"`
Message string `json:"message"`
Encoding formatting.Encoding `json:"encoding"`
}
BuildGenesisArgs are the arguments used to create the genesis data of the Platform Chain. [NetworkID] is the ID of the network [UTXOs] are the UTXOs on the Platform Chain that exist at genesis. [Validators] are the validators of the primary network at genesis. [Chains] are the chains that exist at genesis. [Time] is the Platform Chain's time at network genesis.
func (*BuildGenesisArgs) MarshalZAP ¶ added in v1.36.178
func (x *BuildGenesisArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes BuildGenesisArgs from constant offsets.
func (*BuildGenesisArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *BuildGenesisArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads BuildGenesisArgs out of the buffer that arrived.
type BuildGenesisReply ¶ added in v1.1.11
type BuildGenesisReply struct {
Bytes string `json:"bytes"`
Encoding formatting.Encoding `json:"encoding"`
}
BuildGenesisReply is the reply from BuildGenesis
func (*BuildGenesisReply) MarshalZAP ¶ added in v1.36.178
func (x *BuildGenesisReply) MarshalZAP() ([]byte, error)
MarshalZAP writes BuildGenesisReply from constant offsets.
func (*BuildGenesisReply) UnmarshalZAP ¶ added in v1.36.178
func (x *BuildGenesisReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads BuildGenesisReply out of the buffer that arrived.
type Chain ¶ added in v1.1.11
type Chain struct {
GenesisData string `json:"genesisData"`
VMID ids.ID `json:"vmID"`
FxIDs []ids.ID `json:"fxIDs"`
Name string `json:"name"`
ChainID ids.ID `json:"netID"`
}
Chain defines a chain that exists at the network's genesis. [GenesisData] is the initial state of the chain. [VMID] is the ID of the VM this chain runs. [FxIDs] are the IDs of the Fxs the chain supports. [Name] is a human-readable, non-unique name for the chain. [ChainID] is the ID of the net that validates the chain
func (*Chain) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes Chain from constant offsets.
func (*Chain) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads Chain out of the buffer that arrived.
type GenesisPermissionlessValidator ¶ added in v1.1.11
type GenesisPermissionlessValidator struct {
GenesisValidator
RewardOwner *Owner `json:"rewardOwner,omitempty"`
DelegationFee json.Float32 `json:"delegationFee"`
ExactDelegationFee *json.Uint32 `json:"exactDelegationFee,omitempty"`
Staked []UTXO `json:"staked,omitempty"`
Signer *signer.ProofOfPossession `json:"signer,omitempty"`
}
GenesisPermissionlessValidator should to be used for genesis validators only.
func (*GenesisPermissionlessValidator) MarshalZAP ¶ added in v1.36.178
func (x *GenesisPermissionlessValidator) MarshalZAP() ([]byte, error)
MarshalZAP writes GenesisPermissionlessValidator from constant offsets.
func (*GenesisPermissionlessValidator) UnmarshalZAP ¶ added in v1.36.178
func (x *GenesisPermissionlessValidator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GenesisPermissionlessValidator out of the buffer that arrived.
type GenesisValidator ¶ added in v1.1.11
type GenesisValidator Staker
GenesisValidator should to be used for genesis validators only.
func (*GenesisValidator) MarshalZAP ¶ added in v1.36.178
func (x *GenesisValidator) MarshalZAP() ([]byte, error)
MarshalZAP writes GenesisValidator from constant offsets.
func (*GenesisValidator) UnmarshalZAP ¶ added in v1.36.178
func (x *GenesisValidator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GenesisValidator out of the buffer that arrived.
type Height ¶
Height is a block height, or the request to use whatever height the next proposal will be built at.
On the JSON edge that is three spellings of one field — a quoted number, the word "proposed", and null for "leave it as it is". In memory and on the plane it is one u64 with ProposedHeight as its sentinel, which is what it has always been: the second spelling is the reserved value and the third is the absence of the field. So this crosses as a u64 and needs nothing added to it. What a reader of the schema needs is to be TOLD which value is the sentinel, and that is said in the doc comment of every method that takes one.
func (Height) IsProposed ¶
func (Height) MarshalJSON ¶
func (*Height) UnmarshalJSON ¶
type Owner ¶
type Owner struct {
Locktime json.Uint64 `json:"locktime"`
Threshold json.Uint32 `json:"threshold"`
Addresses []string `json:"addresses"`
}
Owner is the repr. of a reward owner sent over APIs.
func (*Owner) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes Owner from constant offsets.
func (*Owner) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads Owner out of the buffer that arrived.
type PermissionedValidator ¶ added in v1.1.11
type PermissionedValidator struct {
Staker
// The owner the staking reward, if applicable, will go to
Connected bool `json:"connected"`
Uptime *json.Float32 `json:"uptime,omitempty"`
}
PermissionedValidator is the repr. of a permissioned validator sent over APIs.
type PermissionlessValidator ¶
type PermissionlessValidator struct {
Staker
BaseL1Validator
// Deprecated: RewardOwner has been replaced by ValidationRewardOwner and
// DelegationRewardOwner.
RewardOwner *Owner `json:"rewardOwner,omitempty"`
// The owner of the rewards from the validation period, if applicable.
ValidationRewardOwner *Owner `json:"validationRewardOwner,omitempty"`
// The owner of the rewards from delegations during the validation period,
// if applicable.
DelegationRewardOwner *Owner `json:"delegationRewardOwner,omitempty"`
PotentialReward *json.Uint64 `json:"potentialReward,omitempty"`
AccruedDelegateeReward *json.Uint64 `json:"accruedDelegateeReward,omitempty"`
DelegationFee json.Float32 `json:"delegationFee"`
ExactDelegationFee *json.Uint32 `json:"exactDelegationFee,omitempty"`
Uptime *json.Float32 `json:"uptime,omitempty"`
Connected *bool `json:"connected,omitempty"`
Staked []UTXO `json:"staked,omitempty"`
Signer *signer.ProofOfPossession `json:"signer,omitempty"`
// The delegators delegating to this validator
DelegatorCount *json.Uint64 `json:"delegatorCount,omitempty"`
DelegatorWeight *json.Uint64 `json:"delegatorWeight,omitempty"`
Delegators *[]PrimaryDelegator `json:"delegators,omitempty"`
}
PermissionlessValidator is the repr. of a permissionless validator sent over APIs.
func (*PermissionlessValidator) MarshalZAP ¶ added in v1.36.178
func (x *PermissionlessValidator) MarshalZAP() ([]byte, error)
MarshalZAP writes PermissionlessValidator from constant offsets.
func (*PermissionlessValidator) UnmarshalZAP ¶ added in v1.36.178
func (x *PermissionlessValidator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads PermissionlessValidator out of the buffer that arrived.
type PrimaryDelegator ¶
type PrimaryDelegator struct {
Staker
RewardOwner *Owner `json:"rewardOwner,omitempty"`
PotentialReward *json.Uint64 `json:"potentialReward,omitempty"`
}
PrimaryDelegator is the repr. of a primary network delegator sent over APIs.
func (*PrimaryDelegator) MarshalZAP ¶ added in v1.36.178
func (x *PrimaryDelegator) MarshalZAP() ([]byte, error)
MarshalZAP writes PrimaryDelegator from constant offsets.
func (*PrimaryDelegator) UnmarshalZAP ¶ added in v1.36.178
func (x *PrimaryDelegator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads PrimaryDelegator out of the buffer that arrived.
type Staker ¶
type Staker struct {
TxID ids.ID `json:"txID"`
StartTime json.Uint64 `json:"startTime"`
EndTime json.Uint64 `json:"endTime"`
Weight json.Uint64 `json:"weight"`
NodeID ids.NodeID `json:"nodeID"`
// Deprecated: Use Weight instead
StakeAmount *json.Uint64 `json:"stakeAmount,omitempty"`
}
APIStaker is the representation of a staker sent via APIs. [TxID] is the txID of the transaction that added this staker. [Amount] is the amount of tokens being staked. [StartTime] is the Unix time when they start staking [Endtime] is the Unix time repr. of when they are done staking [NodeID] is the node ID of the staker [Uptime] is the observed uptime of this staker
func (*Staker) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes Staker from constant offsets.
func (*Staker) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads Staker out of the buffer that arrived.
type StaticClient ¶ added in v1.1.11
type StaticClient interface {
BuildGenesis(
ctx context.Context,
args *BuildGenesisArgs,
options ...rpc.Option,
) (*BuildGenesisReply, error)
}
StaticClient for interacting with the platformvm static api
func NewStaticClient ¶ added in v1.1.11
func NewStaticClient(uri string) StaticClient
NewClient returns a platformvm client for interacting with the platformvm static api
type StaticService ¶ added in v1.1.11
type StaticService struct{}
StaticService defines the static API methods exposed by the platform VM
func (*StaticService) BuildGenesis ¶ added in v1.1.11
func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error
BuildGenesis build the genesis state of the Platform Chain (and thereby the Lux network.)
type UTXO ¶
type UTXO struct {
Locktime json.Uint64 `json:"locktime"`
Amount json.Uint64 `json:"amount"`
Address string `json:"address"`
Message string `json:"message"`
}
UTXO is a UTXO on the Platform Chain that exists at the chain's genesis.
func (UTXO) Compare ¶ added in v1.1.11
Compare is defined on UTXO (not *UTXO) because it is used as a Sortable[T] value type in slices.SortFunc.
func (*UTXO) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes UTXO from constant offsets.
func (*UTXO) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads UTXO out of the buffer that arrived.