system

package
v0.0.0-...-b2c0fe3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewBidname

func NewBidname(bidder, newname potato.AccountName, bid potato.Asset) *potato.Action

func NewBuyRAM

func NewBuyRAM(payer, receiver potato.AccountName, pocQuantity uint64) *potato.Action

func NewBuyRAMBytes

func NewBuyRAMBytes(payer, receiver potato.AccountName, bytes uint32) *potato.Action

NewBuyRAMBytes will buy at current market price a given number of bytes of RAM, and grant them to the `receiver` account.

func NewCancelDelay

func NewCancelDelay(cancelingAuth potato.PermissionLevel, transactionID potato.Checksum256) *potato.Action

NewCancelDelay creates an action from the `poc.system` contract called `canceldelay`.

`canceldelay` allows you to cancel a deferred transaction, previously sent to the chain with a `delay_sec` larger than 0. You need to sign with cancelingAuth, to cancel a transaction signed with that same authority.

func NewClaimRewards

func NewClaimRewards(owner potato.AccountName) *potato.Action

NewClaimRewards will buy at current market price a given number of bytes of RAM, and grant them to the `receiver` account.

func NewCustomNewAccount

func NewCustomNewAccount(creator, newAccount potato.AccountName, owner, active potato.Authority) *potato.Action

NewCustomNewAccount returns a `newaccount` action that lives on the `poc.system` contract. You can specify your own `owner` and `active` permissions.

func NewDelegateBW

func NewDelegateBW(from, receiver potato.AccountName, stakeCPU, stakeNet potato.Asset, transfer bool) *potato.Action

NewDelegateBW returns a `delegatebw` action that lives on the `poc.system` contract.

func NewDelegatedNewAccount

func NewDelegatedNewAccount(creator, newAccount potato.AccountName, delegatedTo potato.AccountName) *potato.Action

NewDelegatedNewAccount returns a `newaccount` action that lives on the `poc.system` contract. It is filled with an authority structure that delegates full control of the new account to an already existing account.

func NewDeleteAuth

func NewDeleteAuth(account potato.AccountName, permission potato.PermissionName) *potato.Action

NewDeleteAuth creates an action from the `poc.system` contract called `deleteauth`.

You cannot delete the `owner` or `active` permissions. Also, if a permission is still linked through a previous `updatelink` action, you will need to `unlinkauth` first.

func NewLinkAuth

func NewLinkAuth(account, code potato.AccountName, actionName potato.ActionName, requiredPermission potato.PermissionName) *potato.Action

NewLinkAuth creates an action from the `poc.system` contract called `linkauth`.

`linkauth` allows you to attach certain permission to the given `code::actionName`. With this set on-chain, you can use the `requiredPermission` to sign transactions for `code::actionName` and not rely on your `active` (which might be more sensitive as it can sign anything) for the given operation.

func NewNewAccount

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

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

func NewNonce

func NewNonce(nonce string) *potato.Action

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

func NewRefund

func NewRefund(owner potato.AccountName) *potato.Action

NewRefund returns a `refund` action that lives on the `poc.system` contract.

func NewRegProducer

func NewRegProducer(producer potato.AccountName, producerKey ecc.PublicKey, url string, location uint16) *potato.Action

NewRegProducer returns a `regproducer` action that lives on the `poc.system` contract.

func NewRegProxy

func NewRegProxy(proxy potato.AccountName, isProxy bool) *potato.Action

NewRegProxy returns a `regproxy` action that lives on the `poc.system` contract.

func NewRemoveProducer

func NewRemoveProducer(producer potato.AccountName) *potato.Action

NewRemoveProducer returns a `rmvproducer` action that lives on the `poc.system` contract. This is to be called by the consortium of BPs, to oust a BP from its place. If you want to unregister yourself as a BP, use `unregproducer`.

func NewSellRAM

func NewSellRAM(account potato.AccountName, bytes uint64) *potato.Action

NewSellRAM will sell at current market price a given number of bytes of RAM.

func NewSetABI

func NewSetABI(account potato.AccountName, abiPath string) (out *potato.Action, err error)

func NewSetCode

func NewSetCode(account potato.AccountName, wasmPath string) (out *potato.Action, err error)

func NewSetCodeTx

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

NewSetCodeTx is _deprecated_. Use NewSetContract instead, and build your transaction yourself.

func NewSetContract

func NewSetContract(account potato.AccountName, wasmPath, abiPath string) (out []*potato.Action, err error)

func NewSetPriv

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

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

func NewSetProds

func NewSetProds(producers []ProducerKey) *potato.Action

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

func NewSetRAM

func NewSetRAM(maxRAMSize uint64) *potato.Action

func NewSetRAMRate

func NewSetRAMRate(bytesPerBlock uint16) *potato.Action

func NewSetalimits

func NewSetalimits(account potato.AccountName, ramBytes, netWeight, cpuWeight int64) *potato.Action

NewSetalimits sets the account limits. Requires signature from `potato@active` account.

func NewUnDelegateBW

func NewUnDelegateBW(from, receiver potato.AccountName, unstakeCPU, unstakeNet potato.Asset) *potato.Action

UnDelegateBW returns a `undelegatebw` action that lives on the `poc.system` contract.

func NewUnlinkAuth

func NewUnlinkAuth(account, code potato.AccountName, actionName potato.ActionName) *potato.Action

NewUnlinkAuth creates an action from the `poc.system` contract called `unlinkauth`.

`unlinkauth` detaches a previously set permission from a `code::actionName`. See `linkauth`.

func NewUnregProducer

func NewUnregProducer(producer potato.AccountName) *potato.Action

NewUnregProducer returns a `unregproducer` action that lives on the `poc.system` contract.

func NewUpdateAuth

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

NewUpdateAuth creates an action from the `poc.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 potato.AccountName, proxy potato.AccountName, producers ...potato.AccountName) *potato.Action

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

Types

type Bidname

type Bidname struct {
	Bidder  potato.AccountName `json:"bidder"`
	Newname potato.AccountName `json:"newname"`
	Bid     potato.Asset       `json:"bid"` // specified in potato
}

Bidname represents the `potato.system_contract::bidname` action.

type BlockchainParameters

type BlockchainParameters struct {
	MaxBlockNetUsage               potato.Uint64 `json:"max_block_net_usage"`
	TargetBlockNetUsagePct         uint32        `json:"target_block_net_usage_pct"`
	MaxTransactionNetUsage         uint32        `json:"max_transaction_net_usage"`
	BasePerTransactionNetUsage     uint32        `json:"base_per_transaction_net_usage"`
	NetUsageLeeway                 uint32        `json:"net_usage_leeway"`
	ContextFreeDiscountNetUsageNum uint32        `json:"context_free_discount_net_usage_num"`
	ContextFreeDiscountNetUsageDen uint32        `json:"context_free_discount_net_usage_den"`
	MaxBlockCPUUsage               uint32        `json:"max_block_cpu_usage"`
	TargetBlockCPUUsagePct         uint32        `json:"target_block_cpu_usage_pct"`
	MaxTransactionCPUUsage         uint32        `json:"max_transaction_cpu_usage"`
	MinTransactionCPUUsage         uint32        `json:"min_transaction_cpu_usage"`
	MaxTransactionLifetime         uint32        `json:"max_transaction_lifetime"`
	DeferredTrxExpirationWindow    uint32        `json:"deferred_trx_expiration_window"`
	MaxTransactionDelay            uint32        `json:"max_transaction_delay"`
	MaxInlineActionSize            uint32        `json:"max_inline_action_size"`
	MaxInlineActionDepth           uint16        `json:"max_inline_action_depth"`
	MaxAuthorityDepth              uint16        `json:"max_authority_depth"`
	MaxGeneratedTransactionCount   uint32        `json:"max_generated_transaction_count"`
}

BlockchainParameters are all the params we can set through `setparams`.

type BuyRAM

type BuyRAM struct {
	Payer    potato.AccountName `json:"payer"`
	Receiver potato.AccountName `json:"receiver"`
	Quantity potato.Asset       `json:"quant"` // specified in POC
}

BuyRAM represents the `poc.system::buyram` action.

type BuyRAMBytes

type BuyRAMBytes struct {
	Payer    potato.AccountName `json:"payer"`
	Receiver potato.AccountName `json:"receiver"`
	Bytes    uint32             `json:"bytes"`
}

BuyRAMBytes represents the `potato.system::buyrambytes` action.

type CancelDelay

type CancelDelay struct {
	CancelingAuth potato.PermissionLevel `json:"canceling_auth"`
	TransactionID potato.Checksum256     `json:"trx_id"`
}

CancelDelay represents the native `canceldelay` action, through the system contract.

type ClaimRewards

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

ClaimRewards represents the `poc.system::claimwards` action.

type DelegateBW

type DelegateBW struct {
	From     potato.AccountName `json:"from"`
	Receiver potato.AccountName `json:"receiver"`
	StakeNet potato.Asset       `json:"stake_net"`
	StakeCPU potato.Asset       `json:"stake_cpu"`
	Transfer potato.Bool        `json:"transfer"`
}

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

type DeleteAuth

type DeleteAuth struct {
	Account    potato.AccountName    `json:"account"`
	Permission potato.PermissionName `json:"permission"`
}

DeleteAuth represents the native `deleteauth` action, reachable through the `poc.system` contract.

type LinkAuth

type LinkAuth struct {
	Account     potato.AccountName    `json:"account"`
	Code        potato.AccountName    `json:"code"`
	Type        potato.ActionName     `json:"type"`
	Requirement potato.PermissionName `json:"requirement"`
}

LinkAuth represents the native `linkauth` action, through the system contract.

type NewAccount

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

NewAccount represents a `newaccount` action on the `poc.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 `poc.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 PotatoGlobalState

type PotatoGlobalState struct {
	BlockchainParameters
	TotalStorageBytesReserved potato.Uint64 `json:"total_storage_bytes_reserved"`
	TotalStorageStake         potato.Uint64 `json:"total_storage_stake"`
	PaymentPerBlock           potato.Uint64 `json:"payment_per_block"`
}

type ProducerKey

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

type Refund

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

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

type RegProducer

type RegProducer struct {
	Producer    potato.AccountName `json:"producer"`
	ProducerKey ecc.PublicKey      `json:"producer_key"`
	URL         string             `json:"url"`
	Location    uint16             `json:"location"` // what,s the meaning of that anyway ?
}

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

type RegProxy

type RegProxy struct {
	Proxy   potato.AccountName `json:"proxy"`
	IsProxy bool               `json:"isproxy"`
}

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

type RemoveProducer

type RemoveProducer struct {
	Producer potato.AccountName `json:"producer"`
}

RemoveProducer represents the `poc.system::rmvproducer` action

type SellRAM

type SellRAM struct {
	Account potato.AccountName `json:"account"`
	Bytes   uint64             `json:"bytes"`
}

SellRAM represents the `poc.system::sellram` action.

type SetABI

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

SetABI represents the hard-coded `setabi` action.

type SetCode

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

SetCode represents the hard-coded `setcode` action.

type SetPriv

type SetPriv struct {
	Account potato.AccountName `json:"account"`
	IsPriv  potato.Bool        `json:"is_priv"`
}

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

type SetProds

type SetProds struct {
	Schedule []ProducerKey `json:"schedule"`
}

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

type SetRAM

type SetRAM struct {
	MaxRAMSize potato.Uint64 `json:"max_ram_size"`
}

SetRAM represents the hard-coded `setram` action.

type SetRAMRate

type SetRAMRate struct {
	BytesPerBlock uint16 `json:"bytes_per_block"`
}

SetRAMRate represents the system contract's `setramrate` action.

type Setalimits

type Setalimits struct {
	Account   potato.AccountName `json:"account"`
	RAMBytes  int64              `json:"ram_bytes"`
	NetWeight int64              `json:"net_weight"`
	CPUWeight int64              `json:"cpu_weight"`
}

Setalimits represents the `poc.system::setalimit` action.

type UnDelegateBW

type UnDelegateBW struct {
	From       potato.AccountName `json:"from"`
	Receiver   potato.AccountName `json:"receiver"`
	UnstakeNet potato.Asset       `json:"unstake_net_quantity"`
	UnstakeCPU potato.Asset       `json:"unstake_cpu_quantity"`
}

UnDelegateBW represents the `poc.system::undelegatebw` action.

type UnlinkAuth

type UnlinkAuth struct {
	Account potato.AccountName `json:"account"`
	Code    potato.AccountName `json:"code"`
	Type    potato.ActionName  `json:"type"`
}

UnlinkAuth represents the native `unlinkauth` action, through the system contract.

type UnregProducer

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

UnregProducer represents the `poc.system::unregproducer` action

type UpdateAuth

type UpdateAuth struct {
	Account    potato.AccountName    `json:"account"`
	Permission potato.PermissionName `json:"permission"`
	Parent     potato.PermissionName `json:"parent"`
	Auth       potato.Authority      `json:"auth"`
}

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     potato.AccountName   `json:"voter"`
	Proxy     potato.AccountName   `json:"proxy"`
	Producers []potato.AccountName `json:"producers"`
}

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

Jump to

Keyboard shortcuts

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