본문으로 건너뛰기

Privileged

Module: Contracts API

Defines C++ Privileged API.

Classes

Name
structeosio::blockchain_parameters

Functions

Name
voidset_blockchain_parameters(const eosio::blockchain_parameters & params)
voidget_blockchain_parameters(eosio::blockchain_parameters & params)
voidget_resource_limits(name account, int64_t & ram_bytes, int64_t & net_weight, int64_t & cpu_weight)
voidset_resource_limits(name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight)
std::optional< uint64_t >set_proposed_producers(const std::vector< producer_key > & prods)
std::optional< uint64_t >set_proposed_producers(const std::vector< producer_authority > & prods)
boolis_privileged(name account)
voidset_privileged(name account, bool is_priv)
voidpreactivate_feature(const checksum256 & feature_digest)

Functions Documentation

function set_blockchain_parameters

void set_blockchain_parameters(
const eosio::blockchain_parameters & params
)

Parameters:

  • params - New blockchain parameters to set

Set the blockchain parameters

function get_blockchain_parameters

void get_blockchain_parameters(
eosio::blockchain_parameters & params
)

Parameters:

  • params - It will be replaced with the retrieved blockchain params

Retrieve the blolckchain parameters

function get_resource_limits

inline void get_resource_limits(
name account,
int64_t & ram_bytes,
int64_t & net_weight,
int64_t & cpu_weight
)

Parameters:

  • account - name of the account whose resource limit to get
  • ram_bytes - output to hold retrieved ram limit in absolute bytes
  • net_weight - output to hold net limit
  • cpu_weight - output to hold cpu limit

Get the resource limits of an account

function set_resource_limits

inline void set_resource_limits(
name account,
int64_t ram_bytes,
int64_t net_weight,
int64_t cpu_weight
)

Parameters:

  • account - name of the account whose resource limit to be set
  • ram_bytes - ram limit in absolute bytes
  • net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts)
  • cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts)

Set the resource limits of an account

function set_proposed_producers

std::optional< uint64_t > set_proposed_producers(
const std::vector< producer_key > & prods
)

Parameters:

  • producers - vector of producer keys

Return: an optional value of the version of the new proposed schedule if successful

Note: Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"

Proposes a schedule change using the legacy producer key format

function set_proposed_producers

inline std::optional< uint64_t > set_proposed_producers(
const std::vector< producer_authority > & prods
)

Parameters:

  • producers - vector of producer authorities

Return: an optional value of the version of the new proposed schedule if successful

Note: Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"

Proposes a schedule change using the more flexible key format

function is_privileged

inline bool is_privileged(
name account
)

Parameters:

  • account - name of the account to be checked

Return:

  • true if the account is privileged
  • false if the account is not privileged

Check if an account is privileged

function set_privileged

inline void set_privileged(
name account,
bool is_priv
)

Parameters:

  • account - name of the account whose privileged account to be set
  • is_priv - privileged status

Set the privileged status of an account

function preactivate_feature

inline void preactivate_feature(
const checksum256 & feature_digest
)

Parameters:

  • feature_digest - digest of the protocol feature to pre-activate

Pre-activate protocol feature


Updated on 2022-12-05 at 15:38:07 +0000