☁️
Züs
  • About Züs
  • Concepts
    • Architecture
      • Mining on the Züs Blockchain
        • Onboarding a New Miner or Sharder
        • Block Production Protocol
        • Block Finalization
        • Merkle Patricia Trees(MPT) and Recovery
        • View Change and Distributed Key Generation(DKG)
      • Payment
      • Storage
      • Token Bridge Protocol
      • Resources
    • Tokenomics
      • Staking Process
      • Block Rewards
      • Delegation
    • Store
    • Earn
    • Build
    • NFT
  • Resources
    • Whitepapers
      • Tokenomics Paper
      • Architecture Paper
      • Storage Paper
    • Patents
      • NON-FUNGIBLE TOKEN BLOCKCHAIN PROCESSING
      • FREE STORAGE PROTOCOL FOR BLOCKCHAIN PLATFORM
      • TRANSFERRING CONTENT VIA PROXY RE-ENCRYPTION
      • STREAMING CONTENT VIA BLOCKCHAIN TECHNOLOGY
      • SPLIT-KEY WALLET ACCESS BETWEEN BLOCKCHAINS
      • ENFORCING SECURITY PARAMETERS SPECIFIED BY AN OWNER ON A BLOCKCHAIN PLATFORM
      • CLIENT AUTHENTICATION USING SPLIT KEY SIGNING ON A BLOCKCHAIN PLATFORM
      • BLOCKCHAIN CONTENT PURCHASING PROTOCOL
      • BLOCKCHAIN BASED PRIVACY COMPLIANCE PLATFORM
      • SYSTEMS AND METHODS OF SELF-ADMINISTERED PROTOCOLS ON A BLOCKCHAIN PLATFORM
      • SYSTEMS AND METHODS OF AGGREGATE SIGNING OF DIGITAL SIGNATURES ON MULTIPLE MESSAGES SIMULTANEOUSLY U
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR AUTOMATED ASSET BASED PROVISIONING OF RESOURCES
      • SYSTEMS AND METHODS OF SELF-FORKING BLOCKCHAIN PROTOCOL
      • SYSTEMS AND METHODS OF SUSTAINABILITY PROTOCOL USING DISTRIBUTED BLOCKCHAIN APPLICATION WITH IoT SEN
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR DISTRIBUTED APPLICATIONS
  • API Reference
    • Endpoints
      • Block
      • Client
      • Connection
      • DNS
      • File
      • Smart Contracts
      • Blobber Stats
      • Transactions
      • Miners and Sharders
        • Stats
        • State
        • Diagnostics
        • Configuration
        • Smart Contract State
        • Smart Contract Stats
        • Chain Stats
  • Hackathon
    • Register to Hackathon
      • How to Add Members to Hackathon Team
    • Repos
    • Documentation
  • Products
    • Bolt
      • Get Started
      • Stake
      • Activity
      • Buy ZCN
      • Sell ZCN
      • Send Tokens
      • Receive Tokens
      • Settings
        • Manage Profile
        • Wallet
        • Read Pool
      • Troubleshooting
    • Vult
      • Sign Up
      • Upload File
      • Upload an Encrypted File
      • Upload a File to a Folder
      • Share a Uploaded File
      • Move a Uploaded File
      • Delete a File
      • Make File Available Offline
      • Troubleshooting
    • Atlus
      • Dashboard Overview
      • Service Providers
      • Charts
        • Market Charts
        • Network Charts
        • Storage Charts
        • Züs Explainer
      • Blockchain
      • Server Map
    • Blimp
      • Sign Up
        • Buy ZCN for Storage
      • Use Blimp as Direct Storage
      • Use Blimp as S3 Server
        • S3 Operations
      • Use Blimp for Cloud Migration
      • Manage Allocations
        • Extend Size
        • Extend Duration
        • Add Blobber
        • Replace Blobber
        • Make allocation Immutable
        • Freeze Allocation
        • Cancel Allocation
    • Chimney
      • Get Started
      • Deploy Blobber on Own Server
      • Deploy Blobber on Rented Server
      • Stake Blobber
      • Add Blobber
      • Monitor Blobbers
      • Visualize Blobber Logs
      • View Blobber Rank
    • Chalk
      • Sign Up
      • Create NFT Collection
        • Buy ZCN for NFT via ERC token
        • Buy ZCN for NFT via Credit card
      • Explore NFT Collections
      • My NFTs
      • Profile
        • Withdraw Earnings
        • Manage Collections
  • Guides
    • Zus GO SDK
    • Zus JS SDK
    • Zbox CLI
      • Repo
      • Get Started
      • Creating and Managing Allocations
      • Uploading and Managing Files
      • Lock and Unlock Tokens
      • Tips and Troubleshooting
    • Zwallet CLI
      • Repo
      • Get Started
      • Zwallet Operations
      • Staking on miners and sharders
      • Burn and Mint Tokens using Zwallet
      • Troubleshooting
    • Add a Blobber
      • Repo
      • Getting Started
    • Add a Miner/Sharder
      • Repo
      • Getting Started
    • Setup a Blockchain
      • Repo
      • Quickstart
        • Understand the Script
      • Step 1: Set up the project
      • Step 2: Setup the network for Züs components
      • Step 3: Initialize and Build the Züs components
      • Step 4: Start Sharder and Miner Containers
      • Step 5 : Create a wallet using zwalletcli
      • Step 6: Starting the blobber containers
      • Step 7: Validate Züs deployment
      • Step 8: Creating an Allocation on Blobber
      • Restarting Sharder and Miner Containers with CleanDB.
      • Additional Tips and Troubleshooting
    • Glossary
  • Support
    • Help Center
      • Community
      • Issues on Github
      • Contact Us
Powered by GitBook
On this page
  • System requirements
  • Install zboxcli
  • Linux Installation
  • Windows Installation
  • macOS Installation
  • Building zboxcli
  • Building zboxcli for Windows
  • Building zboxcli for Mac and Linux
  • Configure Zbox network
  • Creating a Storage Allocation
  1. Guides
  2. Zbox CLI

Get Started

This section covers repository configuration, and installation.

PreviousZbox CLINextCreating and Managing Allocations

Last updated 1 year ago

System requirements

To properly build components, you must have a system with the following requirements:

  • Linux (Ubuntu Preferred) Version: 20.04 or Above Mac(Apple Silicon or Intel) Version: Big Sur or Above Windows : Windows 10 or Above

  • 4 vCPU, 4 GB Memory at minimum

  • 4 GB of space minimum for zbox build components and storage allocation.

Install zboxcli

Linux Installation

  1. Download the latest linux zboxcli archive release from .

  2. Open terminal and extract the downloaded archive to a specified directory using the command below.

tar -xzf zbox-linux.tar.gz --directory /usr/local/bin
  1. Provide execution privileges to the zbox executable.

chmod +x /usr/local/bin/zboxx

4. Navigate to the extracted directory path

cd /usr/local/bin
  1. Run the zbox executable type by using the command below.

./zbox

On successful installation you will see a help section similar to response below:

zbox is a decentralized storage application written on the 0Chain platform.                    

Usage:
  zbox [command]

Available Commands:
  add                Adds free storage assigner
  alloc-cancel       Cancel an allocation

Windows Installation

  1. Extract the executable from the archive zbox-windows.zip

  2. Now run the executable zbox.exe in windows command prompt.

  3. On successful installation, you will see a help section similar to response below :

zbox is a decentralized storage application written on the 0Chain platform.
                        

Usage:
  zbox [command]

Available Commands:
  add                Adds free storage assigner
  alloc-cancel       Cancel an allocation
  alloc-fini         Finalize an expired allocation

macOS Installation

  1. Open terminal and extract the downloaded archive to a specified directory using the commands below:

tar -xzf zbox-macos.tar.gz --directory /usr/local/bin

3. Provide execution privleges to the zbox executable.

chmod +x /usr/local/bin/zbox
  1. Navigate to extracted directory path .

cd /usr/local/bin
  1. Run the zbox executable using the command below.

./zbox

On successful installation you will see a help section :

zbox is a decentralized storage application written on the 0Chain platform.
                        Complete documentation is available at https://docs.0chain.net/0chain/

Usage:
  zbox [command]

Available Commands:
  add                Adds free storage assigner
  alloc-cancel       Cancel an allocation
  alloc-fini         Finalize an expired allocation

Building zboxcli

Building zboxcli for Windows

Windows 64bit (tested with Windows 11)

  1. Open MSYS2 MINGW64 shell from the windows start menu. The MINGW64 shell window should look similar to screenshot below.

  1. Install the following libraries:

pacman -S base-devel git gcc make
  1. Install clang, go for mingw64 and unzip

pacman -S  mingw-w64-x86_64-clang mingw-w64-x86_64-go unzip

Note: Restart mingw64 shell for Go to make changes.

  1. Set environment variables

export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
export PATH=$PATH:$GOROOT/bin

# use clang as a default compiler for CGO
go env -w "CC=/mingw64/bin/clang.exe"
  1. Clone zboxcli

git clone https://github.com/0chain/zboxcli.git
  1. Navigate to zboxcli directory and run the following command :

cd zboxcli
make install
  1. Unzip and copy dll's to zboxcli directory. The zboxcli directory will be available at the following path C:\msys64\home\<your_windows_username>\zboxcli if cloned under mingw64 shell.

  2. Now run the ./zbox command under zboxcli directory

./zbox

On a successful build you will see a help section.

Building zboxcli for Mac and Linux

1. Go Binaries

2. Build-Essential(Only required for linux)

The build essential package is required to build and make the zbox application. It includes the necessary GCC/g++ compilers and other essential critical libraries and utilities.

Run apt update command to update the packages

sudo apt update

Get build-essential package

sudo apt-get install build-essential
  1. Clone the zboxcli repository using the command

git clone https://github.com/0chain/zboxcli.git
  1. Navigate into zboxcli directory using

cd zboxcli
  1. Use the make install command to compile the source code .

make install

This might take a minute. Here is a sample response of successful make install command:

  1. Start the Zbox by navigating back to the zboxcli directory usingcd zboxcli and type

./zbox

On a successful build you will see a help section.

Configure Zbox network

  1. Make a new .zcn folder in the home directory of your system

mkdir $HOME/.zcn
cp network/config.yaml $HOME/.zcn/config.yaml
  1. Open the config.yaml file located at $HOME/.zcn path of your system.The contents should be similar to the file below.

---
block_worker: https://demo.zus.network/dns
signature_scheme: bls0chain
min_submit: 50
min_confirmation: 50
confirmation_chain_length: 3
max_txn_query: 5
query_sleep_time: 5
# # OPTIONAL - Uncomment to use/ Add more if you want
# preferred_blobbers:
#   - http://one.devnet-0chain.net:31051
#   - http://one.devnet-0chain.net:31052
#   - http://one.devnet-0chain.net:31053

Zbox connects to the Züs network using the block_worker field. These network details are automatically fetched from the blockWorker's network API. Preferred Blobbers are also present which you can uncomment for using specified storage providers for handling your files.

Creating a Storage Allocation

The section assumes you have successfully build zbox. zbox provides a long list of components to use. Let's begin with the allocation of storage space on the 0Chain decentralized network.

For creating a storage allocation using Zbox. You need to have a wallet with tokens available for performing allocations.

  1. Once the wallet is created and has an available balance, you can create a storage allocation by using the Zbox newallocationcommand. To understand the syntax type

./zbox newallocation --help

This will output the mandatory and optional flags that need to be added with the newallocationcommand. Here are the parameters :

Parameter
Description
Default
Valid Values

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

  1. For getting started we can create a basic allocation with default types. This will only require essential specifiers such as lock float. We will add a float value of 0.5 which will lock 0.5 tokens with the allocation. The complete command for creating an allocation would be:

./zbox newallocation --lock 0.5

​ Successful Response will create an allocation with allocation ID:

7. Verify the allocation by using the command.

./zbox listallocations
  1. Unzip and copy dll's to zboxcli directory. The zboxcli directory will be available at the following path C:\msys64\home\<your_windows_username>\zboxcli if cloned under mingw64 shell.

  2. Now run the ./zbox command under zboxcli directory

6.

7. .

Download the latest windows zboxcli archive release from .

5.

6.

Download the latest mac zboxcli archive release from .

6.

7.

Installing msys2 from .

Download necessary dll files as zip from .

11.

12.

Installation instructions for Mac and Linux can be found.

7.

8.

Configuration for the Züs network by default is stored in network/config.yaml file of the zbox github which we will copy to a new config.yaml file in our local system .

Note: For windows create a folder named .zcn at `C:\Users\<windows_username>`path. 2. Copyfrom zboxcli repo to .zcn directory

Note: In case you are configuring zbox network for the block_worker in config file above should be set to

Create and get test tokens into your wallet using the zwallet CLI tool. If you have not installed zwallet CLI check instructions for and .

If you are not able to create allocation and getting errors, check error causes .

Download necessary dll files as zip from .

here
here
here
here
here
repo
config.yaml
setting up blockchain locally
http://198.18.0.98:9091/
here
here
Linux Installation
macOS Installation
Windows Installation
Building zboxcli from source
Configure zbox network
Create a Storage Allocation
Configure zbox network
Create a Storage Allocation
Configure zbox network
Create a Storage Allocation
Configure zbox network
Create a Storage Allocation
Configure zbox network
Create a Storage Allocation
in TIps and Troubleshooting Section
installation
creating a wallet