system

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AN = eos.AN
View Source
var ActN = eos.ActN
View Source
var PN = eos.PN

Functions

func NewNewAccount

func NewNewAccount(creator, newAccount eos.AccountName, publicKey ecc.PublicKey) *eos.Action

NewNewAccount returns a `newaccount` action that lives on the `eosio.system` contract.

func NewNonce

func NewNonce(nonce string) *eos.Action

NewNonce returns a `nonce` action that lives on the `eosio.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `eosio.system` contract.

func NewRegProducer

func NewRegProducer(producer eos.AccountName, producerKey ecc.PublicKey, params EOSIOParameters) *eos.Action

NewSetPriv returns a `setpriv` action that lives on the `eosio.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `eosio.system` contract.

func NewSetCodeTx

func NewSetCodeTx(account eos.AccountName, wasmPath, abiPath string) (out *eos.Transaction, err error)

func NewSetPriv

func NewSetPriv(account eos.AccountName) *eos.Action

NewSetPriv returns a `setpriv` action that lives on the `eosio.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `eosio.system` contract.

func NewSetProds

func NewSetProds(version uint32, producers []ProducerKey) *eos.Action

NewSetPriv returns a `setpriv` action that lives on the `eosio.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `eosio.system` contract.

func NewUpdateAuth

func NewUpdateAuth(account eos.AccountName, permission, parent eos.PermissionName, authority eos.Authority, usingPermission eos.PermissionName) *eos.Action

NewUpdateAuth creates an action from the `eosio.system` contract called `updateauth`.

usingPermission needs to be `owner` if you want to modify the `owner` authorization, otherwise `active` will do for the rest.

func NewVoteProducer

func NewVoteProducer(voter eos.AccountName, proxy eos.AccountName, producers ...eos.AccountName) *eos.Action

NewNonce returns a `nonce` action that lives on the `eosio.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `eosio.system` contract.

Types

type ClaimRewards

type ClaimRewards struct {
	Owner eos.AccountName `json:"owner"`
}

ClaimRewards repreents the `eosio.system::claimrewards` action

type DelegateBW

type DelegateBW struct {
	From         eos.AccountName `json:"from"`
	Receiver     eos.AccountName `json:"receiver"`
	StakeNet     eos.Asset       `json:"stake_net"`
	StakeCPU     eos.Asset       `json:"stake_cpu"`
	StakeStorage eos.Asset       `json:"stake_storage"`
}

DelegateBW represents the `eosio.system::delegatebw` action.

type DelegatedBandwidth

type DelegatedBandwidth struct {
	From         eos.AccountName `json:"from"`
	To           eos.AccountName `json:"to"`
	NetWeight    eos.Asset       `json:"net_weight"`
	CPUWeight    eos.Asset       `json:"cpu_weight"`
	StorageStake eos.Asset       `json:"storage_stake"`
	StorageBytes uint64          `json:"storage_bytes"`
}

type EOSIOGlobalState

type EOSIOGlobalState struct {
	EOSIOParameters
	TotalStorageBytesReserved uint64 `json:"total_storage_bytes_reserved"`
	TotalStorageStake         uint64 `json:"total_storage_stake"`
	PaymentPerBlock           uint64 `json:"payment_per_block"`
}

type EOSIOParameters

type EOSIOParameters struct {
	BasePerTransactionNetUsage     uint32 `json:"base_per_transaction_net_usage" yaml:"base_per_transaction_net_usage"`
	BasePerTransactionCPUUsage     uint32 `json:"base_per_transaction_cpu_usage" yaml:"base_per_transaction_cpu_usage"`
	BasePerActionCPUUsage          uint32 `json:"base_per_action_cpu_usage" yaml:"base_per_action_cpu_usage"`
	BaseSetcodeCPUUsage            uint32 `json:"base_setcode_cpu_usage" yaml:"base_setcode_cpu_usage"`
	PerSignatureCPUUsage           uint32 `json:"per_signature_cpu_usage" yaml:"per_signature_cpu_usage"`
	PerLockNetUsage                uint32 `json:"per_lock_net_usage" yaml:"per_lock_net_usage"`
	ContextFreeDiscountCPUUsageNum uint64 `json:"context_free_discount_cpu_usage_num" yaml:"context_free_discount_cpu_usage_num"`
	ContextFreeDiscountCPUUsageDen uint64 `json:"context_free_discount_cpu_usage_den" yaml:"context_free_discount_cpu_usage_den"`
	MaxTransactionCPUUsage         uint32 `json:"max_transaction_cpu_usage" yaml:"max_transaction_cpu_usage"`
	MaxTransactionNetUsage         uint32 `json:"max_transaction_net_usage" yaml:"max_transaction_net_usage"`

	MaxBlockCPUUsage       uint64 `json:"max_block_cpu_usage" yaml:"max_block_cpu_usage"`
	TargetBlockCPUUsagePct uint32 `json:"target_block_cpu_usage_pct" yaml:"target_block_cpu_usage_pct"` //< the target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling
	MaxBblockNetUsage      uint64 `json:"max_block_net_usage" yaml:"max_block_net_usage"`               //< the maxiumum net usage in instructions for a block
	TargetBlockNetUsagePct uint32 `json:"target_block_net_usage_pct" yaml:"target_block_net_usage_pct"` //< the target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion handling

	MaxTransactionLifetime       uint32 `json:"max_transaction_lifetime" yaml:"max_transaction_lifetime"`
	MaxTransactionExecTime       uint32 `json:"max_transaction_exec_time" yaml:"max_transaction_exec_time"`
	MaxAuthorityDepth            uint16 `json:"max_authority_depth" yaml:"max_authority_depth"`
	MaxInlineDepth               uint16 `json:"max_inline_depth" yaml:"max_inline_depth"`
	MaxInlineActionSize          uint32 `json:"max_inline_action_size" yaml:"max_inline_action_size"`
	MaxGeneratedTransactionCount uint32 `json:"max_generated_transaction_count" yaml:"max_generated_transaction_count"`

	// FIXME: does not appear in the `abi` for `eosio.system`.
	// MaxStorageSize uint64 `json:"max_storage_size" yaml:"max_storage_size"`
	PercentOfMaxInflationRate uint32 `json:"percent_of_max_inflation_rate" yaml:"percent_of_max_inflation_rate"`
	StorageReserveRatio       uint32 `json:"storage_reserve_ratio" yaml:"storage_reserve_ratio"`
}

EOSIOParameters are all the params that can be set on the system contract.

type NewAccount

type NewAccount struct {
	Creator  eos.AccountName `json:"creator"`
	Name     eos.AccountName `json:"name"`
	Owner    eos.Authority   `json:"owner"`
	Active   eos.Authority   `json:"active"`
	Recovery eos.Authority   `json:"recovery"`
}

NewAccount represents a `newaccount` action on the `eosio.system` contract. It is one of the rare ones to be hard-coded into the blockchain.

type Nonce

type Nonce struct {
	Value string `json:"value"`
}

Nonce represents the `eosio.system::nonce` action. It is used to add variability in a transaction, so you can send the same many times in the same block, without it having the same Tx hash.

type ProducerKey

type ProducerKey struct {
	ProducerName    eos.AccountName `json:"producer_name"`
	BlockSigningKey ecc.PublicKey   `json:"block_signing_key"`
}

type Refund

type Refund struct {
	Owner eos.AccountName `json:"owner"`
}

Refund represents the `eosio.system::refund` action

type RegProducer

type RegProducer struct {
	Producer    eos.AccountName `json:"producer"`
	ProducerKey []byte          `json:"producer_key"`
	Prefs       EOSIOParameters `json:"eosio_parameters"`
}

RegProducer represents the `eosio.system::regproducer` action

type RegProxy

type RegProxy struct {
	Proxy eos.AccountName `json:"proxy"`
}

RegProxy represents the `eosio.system::regproxy` action

type SetABI

type SetABI struct {
	Account eos.AccountName `json:"account"`
	ABI     eos.ABI         `json:"abi"`
}

SetABI represents the hard-coded `setabi` action.

type SetCode

type SetCode struct {
	Account   eos.AccountName `json:"account"`
	VMType    byte            `json:"vmtype"`
	VMVersion byte            `json:"vmversion"`
	Code      eos.HexBytes    `json:"bytes"`
}

SetCode represents the hard-coded `setcode` action.

type SetPriv

type SetPriv struct {
	Account eos.AccountName `json:"account"`
	IsPriv  bool            `json:"is_priv"`
}

SetPriv sets privileged account status. Used in the bios boot mechanism.

type SetProds

type SetProds struct {
	Version   uint32        `json:"version"`
	Producers []ProducerKey `json:"producers"`
}

SetProds is present in `eosio.bios` contract. Used only at boot time.

type TotalResources

type TotalResources struct {
}

type UndelegateBW

type UndelegateBW struct {
	From         eos.AccountName `json:"from"`
	Receiver     eos.AccountName `json:"receiver"`
	UnstakeNet   eos.Asset       `json:"unstake_net"`
	UnstakeCPU   eos.Asset       `json:"unstake_cpu"`
	UnstakeBytes uint64          `json:"unstake_bytes"`
}

UndelegateBW represents the `eosio.system::undelegatebw` action.

type UnregProducer

type UnregProducer struct {
	Producer eos.AccountName `json:"producer"`
}

UnregProducer represents the `eosio.system::unregprod` action

type UnregProxy

type UnregProxy struct {
	Proxy eos.AccountName `json:"proxy"`
}

UnregProxy represents the `eosio.system::unregproxy` action

type UpdateAuth

type UpdateAuth struct {
	Account    eos.AccountName    `json:"account"`
	Permission eos.PermissionName `json:"permission"`
	Parent     eos.PermissionName `json:"parent"`
	Data       eos.Authority      `json:"data"`
	Delay      uint32             `json:"delay"` // this represents what exactly?
}

UpdateAuth represents the hard-coded `updateauth` action.

If you change the `active` permission, `owner` is the required parent.

If you change the `owner` permission, there should be no parent.

type VoteProducer

type VoteProducer struct {
	Voter     eos.AccountName   `json:"voter"`
	Proxy     eos.AccountName   `json:"proxy"`
	Producers []eos.AccountName `json:"producers"`
}

VoteProducer represents the `eosio.system::voteproducer` action

Jump to

Keyboard shortcuts

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