file privileged.h

Functions

Type Name
void get_resource_limits (capi_name account, int64_t * ram_bytes, int64_t * net_weight, int64_t * cpu_weight)
void set_resource_limits (capi_name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight)
int64_t set_proposed_producers (char * producer_data, uint32_t producer_data_size)
int64_t set_proposed_producers_ex (uint64_t producer_data_format, char * producer_data, uint32_t producer_data_size)
bool is_privileged (capi_name account)
void set_privileged (capi_name account, bool is_priv)
void set_blockchain_parameters_packed (char * data, uint32_t datalen)
uint32_t get_blockchain_parameters_packed (char * data, uint32_t datalen)
void set_kv_parameters_packed (const char * data, uint32_t datalen)
void preactivate_feature (const struct capi_checksum256 * feature_digest)

Functions Documentation

function get_resource_limits

void get_resource_limits(
    capi_name account,
    int64_t * ram_bytes,
    int64_t * net_weight,
    int64_t * cpu_weight
)

Get the resource limits of an account

Parameters:

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

function set_resource_limits

void set_resource_limits(
    capi_name account,
    int64_t ram_bytes,
    int64_t net_weight,
    int64_t cpu_weight
)

Set the resource limits of an account

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)

function set_proposed_producers

int64_t set_proposed_producers(
    char * producer_data,
    uint32_t producer_data_size
)

Proposes a schedule change This is exactly equivalent to calling set_proposed_producers_ex(0, producer_data, producer_data_size)

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"

Parameters:

  • producer_data - packed data of produce_keys in the appropriate producer schedule order
  • producer_data_size - size of the data buffer

Returns:

-1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule

function set_proposed_producers_ex

int64_t set_proposed_producers_ex(
    uint64_t producer_data_format,
    char * producer_data,
    uint32_t producer_data_size
)

Proposes a schedule change with extended features Valid formats: 0 : serialized array of producer_key's. using this format is exactly equivalent to set_proposed_producers(producer_data, producer_data_size) 1 : serialized array of producer_authority's

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"

Parameters:

  • producer_data_format - format of the producer data blob
  • producer_data - packed data of representing the producer schedule in the format indicated.
  • producer_data_size - size of the data buffer

Returns:

-1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule

function is_privileged

bool is_privileged(
    capi_name account
)

Check if an account is privileged

Parameters:

  • account - name of the account to be checked

Returns:

true if the account is privileged

Returns:

false if the account is not privileged

function set_privileged

void set_privileged(
    capi_name account,
    bool is_priv
)

Set the privileged status of an account

Parameters:

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

function set_blockchain_parameters_packed

void set_blockchain_parameters_packed(
    char * data,
    uint32_t datalen
)

Set the blockchain parameters

Parameters:

  • data - pointer to blockchain parameters packed as bytes
  • datalen - size of the packed blockchain parameters

Precondition:

data is a valid pointer to a range of memory at least datalen bytes long that contains packed blockchain params data

function get_blockchain_parameters_packed

uint32_t get_blockchain_parameters_packed(
    char * data,
    uint32_t datalen
)

Retrieve the blolckchain parameters

Parameters:

  • data - output buffer of the blockchain parameters, only retrieved if sufficent size to hold packed data.
  • datalen - size of the data buffer, 0 to report required size.

Returns:

size of the blockchain parameters

Precondition:

data is a valid pointer to a range of memory at least datalen bytes long

Post

data is filled with packed blockchain parameters

function set_kv_parameters_packed

void set_kv_parameters_packed(
    const char * data,
    uint32_t datalen
)

Set the KV parameters

Parameters:

  • data - pointer to KV parameters packed as bytes
  • datalen - size of the packed KV parameters

Precondition:

data is a valid pointer to a range of memory at least datalen bytes long that contains packed KV params data

function preactivate_feature

void preactivate_feature(
    const struct capi_checksum256 * feature_digest
)

Pre-activate protocol feature

Parameters:

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

The documentation for this class was generated from the following file: libraries/eosiolib/capi/eosio/privileged.h