Step 8: Creating an Allocation on Blobber
To create storage space on the blobber we have to use the zboxcli to interface with the blockchain.
Install zwalletcli ,create wallet(if you have not created one) and get test tokens into your wallet using the command below:
On Successful response:
Check Token balance in zwallet using the
Response-
Note : Before Proceeding further at least have 3 ZCN balance in the wallet. The tokens are required for staking before creating an allocation. Run ./zwallet faucet --methodName pour --input "{Pay day}"
command three times to get 3 ZCN tokens.
4. Once the wallet has an available balance, you have to lock tokens into stake pool .To lock tokens into stake pool you need a id of blobbers to stake which can be fetched using the zboxcli command
The sample response will show all the active blobbers:
5. Export Blobber IDs to variables.
6.Add tokens to the stake pools of all the active blobbers to allow them to accept allocations.
Sample Response:
7. Once the tokens are locked into stake pool you can create and fun storage allocation by using the zbox newallocation
command. To understand the syntax type
This will output the mandatory and optional flags that need to be added with the newallocation
command.
allocationFileName
local file to store allocation information
allocation.txt
file path
cost
returns the cost of the allocation, no allocation created
flag
data
number of data shards, effects upload and download speeds
2
int
expire
duration to allocation expiration
720h
duration
free_storage
free storage marker file.
file path
owner
owner's id, use for funding an allocation for another
string
owner_public_key
public key, use for funding an allocation for another
string
lock
lock write pool with given number of tokens
float
mcct
max challenge completion time
1h
duration
parity
number of parity shards, effects availability
2
int
read_price
filter blobbers by read price range
0-inf
range
size
size of space reserved on blobbers
2147483648
bytes
usd
give token value in USD
flag
write_price
filter blobbers by write price range
0-inf
range
7.For getting started we can create a basic allocation with 1 data
and parity
shard. Lock some tokens using lock float
variable(for example 0.5) .
The complete command would be :
Successful Response will create an allocation with allocation ID:
Note: For creating allocation with more data and parity shards, run more blobbers. The sum of data
and parity
shards should be equal or smaller than the number of running blobbers.
8.If you have successfully created an allocation verify it by running
You will see your allocation ID listed with the specified configuration:
Response:
Notes:
If you are not able to create allocation and getting "transaction not found on any of the sharders", check error causes in zbox Tips and Troubleshooting Section.
To upload files on an allocation, modify allocation and use advanced features check zboxcli documentation.
Last updated