Building the tool

Resources (PLEASE REMOVE)

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 here.

  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

6. Configure zbox network

7. .Create a Storage Allocation

Windows Installation

  1. Download the latest windows zboxcli archive release from here.

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

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

  4. 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

5. Configure zbox network

6. Create a Storage Allocation

macOS Installation

  1. Download the latest mac zboxcli archive release from here.

  2. 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

6. Configure zbox network

7. Create a Storage Allocation

Building zboxcli

Building zboxcli for Windows

Windows 64bit (tested with Windows 11)

  1. Installing msys2 from here.

  2. 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. Download necessary dll files as zip from here.

  2. 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.

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

./zbox

On a successful build you will see a help section.

11. Configure zbox network

12. Create a Storage Allocation

Building zboxcli for Mac and Linux

1. Go Binaries

Installation instructions for Mac and Linux can be found here.

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

3. Clone the zboxcli repository using the command

git clone https://github.com/0chain/zboxcli.git

4. Navigate into zboxcli directory using

cd zboxcli

5. 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:

6. 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.

Last updated