Lock and Unlock Tokens

Challenge pool information

Use cp-info command to get the challenge pool brief information.

ParameterRequiredDescriptiondefaultValid values

allocation

yes

allocation id

string

json

no

print result in json format

false

boolean

Example:

./zbox cp-info --allocation 8695b9e7f986d4a447b64de020ba86f53b3b5e2c442abceb6cd65742702067dc

Response:

POOL ID: 6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7:challengepool:8695b9e7f986d4a447b64de020ba86f53b3b5e2c442abceb6cd65742702067dc
    BALANCE    |             START             |            EXPIRE             | FINIALIZED
+--------------+-------------------------------+-------------------------------+------------+
  0.0000002796 | 2021-04-17 00:27:23 +0700 +07 | 2021-05-24 00:29:23 +0700 +07 | false

Balance is the current challenge pool balance. Start,Expire time and the finalization are allocations related.

Create Read Pool

Use rp-create to create a read pool, rp-create has no parameters.

./zbox rp-create

Collect rewards

Use collect-reward to transfer reward tokens from a stake pool in which you have invested to your wallet.

You earn rewards for: Blobbers

  • File space used by allocation owners and associates.

  • A min lock demand for each allocation.

  • Block rewards. Each block a reward gets paid out to blobber stakeholders in the form of a random lottery. Validators

  • Payment for validating blobber challenge responses.

The stake pool keeps an account for all stakeholders to maintain accrued rewards. These rewards can be accessed using this collect-reward command.

ParameterRequiredDescriptiondefaultValid values

provider_type

no

blobber or validator

blobber

string

./zbox collect-reward --provider_type blobber

Read pool info

Use rp-info to get read pool information.

ParameterRequiredDescriptiondefaultValid values

json

no

print result in json format

false

boolean

./zbox rp-info

Lock tokens into read pool

Lock some tokens in read pool. ReadPool is not linked to specific allocations anymore. Each wallet has a singular, non-expiring, untethered ReadPool. Locked tokens in ReadPool can be unlocked at any time and returned to the original wallet balance.

  • If the user does not have a pre-existing read pool, then the smart-contract creates one.

Locked tokens can be used to pay for read access to file(s) stored with different allocations. To use these tokens the user must be the allocation owner, collaborator or have an auth ticket.

ParameterRequiredDescriptiondefaultValid values

fee

transaction fee

0

int

tokens

yes

tokens to lock

int

./zbox rp-lock --tokens 1

Unlock tokens from read pool

Use rp-unlock to unlock tokens from `read pool by ownership.

ParameterRequiredDescriptiondefaultValid values

fee

no

transaction fee

0

float

Unlocked tokens get returned to the original wallet balance.

Storage SC configurations

Show storage SC configuration.

ParameterRequiredDescriptiondefaultValid values

allocation

yes

allocation id

string

json

no

print result in json format

false

boolean

./zbox sc-config

Stake pool info

Use sp-info to get your stake pool information and settings.

ParameterRequiredDescriptiondefaultValid values

blobber_id

yes

id of blobber. Can be retrieved using List Blobbers command.

current client

string

json

no

print result in json format

false

boolean

./zbox sp-info --blobber_id <blobber_id>

Lock tokens into stake pool

Lock creates delegate pool for current client and a given provider (blobber or validator). The tokens locked for the provider stake can be unlocked any time, excluding times when the tokens held by opened offers. These tokens will earn rewards depending on the actions of the linked provider.

sp-lock returns the id of the new stake pool, this will be needed to reference to stake pool later.

ParameterRequiredDescriptiondefaultValid values

blobber_id

id of blobber

n/a

string

validator_id

id of validator

n/a

string

fee

no

transaction fee

0

float

tokens

yes

tokens to lock

float

To stake tokens for blobbers:

./zbox sp-lock --blobber_id <blobber_id> --tokens 1.0

To stake tokens for validators:

./zbox sp-lock --validator_id <validator_id> --tokens 1.0

Unlock tokens from stake pool

Unlock a stake pool by pool owner. If the stake pool cannot be unlocked as it would leave insufficient funds for opened offers, then sp-unlock tags the stake pool to be unlocked later. This tag prevents the stake pool affecting blobber allocation for any new allocations.

ParameterRequiredDescriptiondefaultValid values

blobber_id

id of blobber

n/a

string

validator_id

id of validator

n/a

string

fee

no

transaction fee

0

float

To unstake blobber tokens:

./zbox sp-unlock --blobber_id <blobber_id>

To unstake validator tokens:

./zbox sp-unlock --validator_id <validator_id> --pool_id <pool_id>

Stake pools info of user

Get information about all stake pools of current user.

ParameterRequiredDescriptiondefaultValid values

json

no

print result in json format

false

boolean

./zbox sp-user-info

Write pool info

Write pool information. Use allocation id to filter results to a singe allocation.

ParameterRequiredDescriptiondefaultValid values

allocation id

no

allocation id

string

json

no

print result in json format

false

boolean

For all write pools.

./zbox wp-info

Filtering by allocation.

./zbox wp-info --allocation <allocation_id>

Lock tokens into write pool

wp-lock can be used to lock tokens in a write pool associated with an allocation. All tokens will be divided between allocation blobbers depending on their write price.

  • Uses two different formats, you can either define a specific blobber to lock all tokens, or spread across all the allocations blobbers automatically.

  • If the user does not have a pre-existing read pool, then the smart-contract creates one.

Anyone can lock tokens with a write pool attached an allocation. These tokens can be used to pay for the allocation updates and min lock demand as needed. Any tokens moved into the challenge pool to underwrite blobbers' min lock demands return to the allocation's owner on closing the allocation.

ParameterRequiredDescriptiondefaultValid values

allocation id

no

allocation id

string

blobber

no

blobber id

string

duration

yes

duration for which to lock tokens

duration

fee

no

transaction fee

0

float

tokens

yes

number of tokens to lock

float

./zbox wp-lock --allocation <allocation_id> --duration 40m --tokens 1

Unlock tokens from write pool

wp-unlock unlocks an expired write pool. An expired write pool, associated with an allocation, can be locked until allocation finalization even if it's expired. It possible in cases where related blobber doesn't give their min lock demands. The finalization will pay the demand and unlock the pool.

ParameterRequiredDescriptiondefaultValid values

fee

no

transaction fee

0

float

./zbox wp-unlock

Last updated