Skip to content

Build on Linux and Mac

Harshit Mehndiratta edited this page Nov 6, 2023 · 7 revisions

Build zbox on Linux/Mac/Windows

System requirements

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

  • Linux (Ubuntu Preferred) Version: 20.04 and Above
  • Mac(Apple Silicon or Intel) Version: Big Sur and Above
  • Windows : Build Instructions for Windows can be found here
  • 4 vCPU, 8 Gb Memory at minimum
  • 2 GB of space minimum for zwallet build components and storage allocation.

Prerequisites

Note: zwallet binaries are designed to function optimally with gcc 11 as the default compiler. Notably, Ubuntu 22 is equipped with gcc 11 by default. However, Ubuntu 20 initially comes with gcc 9. To upgrade the gcc version, execute the following commands:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install build-essential
sudo apt install gcc-11 g++-11

Go Binaries

Installation instructions for Mac, and Linux can be found here.

Git (Not Required for Mac)

Git is required to retrieve and clone the Zbox repository. Install Git by using the command

sudo apt install git

Building Zwallet

  1. Clone the zwallet Repository using the command
git clone https://github.com/0chain/zwalletcli.git
  1. Navigate into zwallet directory using
cd zwalletcli
  1. Use the make install command to compile the source code .
make install

Configure Zwallet network

Configuration for the Züs network by default is stored in network/config.yaml file of the zbox github repo which we will copy to a new config.yaml file in our local system . The config.yaml file and all the other Zbox component information will be stored in a .zcn folder located in the home directory of the file system.

  1. Make a new .zcn folder in the home Linux directory using
mkdir $HOME/.zcn

Note: For windows create a folder named .zcn at C:\Users\<windows_username>path.

  1. Copy the content from config.yaml to a new config.yaml file using
cp network/config.yaml $HOME/.zcn/config.yaml
  1. To verify whether the config.yaml exists and network configuration is stored properly. Check the config.yaml details using the command
nano config.yaml
  1. Open the config.yaml file located at $HOME/.zcn path of your system.
---
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.

Starting Zwallet

Start the Zwallet by navigating back to the zwalletcli directory using

cd zwalletcli

and type

./zwallet

On a successful run you will see a help section