Requirements

  • OpenSSL 1.1.1+
  • OpenSSL development headers
  • GCC or Clang (GCC 8+ recommended)
  • Erlang OTP v24, with OpenSSL support
  • GNU Make
  • CMake (CMake version > 3.10.0)
  • SQLite3 headers (libsqlite3-dev on Ubuntu)
  • GNU MP (libgmp-dev on Ubuntu)

To install the dependencies on Ubuntu 22.04 or 20.04 (recommended), run:

sudo apt install libssl-dev libgmp-dev libsqlite3-dev make cmake gcc g++

On some systems you might need to install libncurses-dev.

Must be configured: File Descriptors Limit

The number of available file descriptors affects the rate at which your node can process data. Most operating systems default to assigning a low limit for user processes, we recommend increasing it.


You can check the current limit by executing ulimit -n.


On Linux, to set a bigger global limit, open /etc/sysctl.conf and add the following line:


fs.file-max=10000000


Execute sysctl -p to make the changes take effect.


You may also need to set a proper limit for the particular user. To set a user-level limit, open /etc/security/limits.conf and add the following line:


< Ubuntu os user > soft nofile 1000000


Open a new terminal session. To make sure the changes took effect, and the limit was increased, type ulimit -n. You can also change the limit for the current session via ulimit -n 10000000
If the above does not work, set


DefaultLimitNOFILE=1000000


in both /etc/systemd/user.conf and /etc/systemd/system.conf

After a system reboot, you need to reset it in the current window. ulimit -n 1000000

Step 1: Install the Erlang using the commands one by one:

sudo apt remove erlang

wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb

sudo dpkg -i erlang-solutions_2.0_all.deb

sudo apt update sudo

apt install erlang

Step 2: Download the repo:

git clone --recursive https://github.com/chives-network/chivesweave cd chivesweave

Step 3: Make a mainnet build:

./rebar3 as mainnet tar

mkdir mainnet_data_dir

./_build/mainnet/rel/chivesweave/bin/create-wallet mainnet_data_dir

Step 4: You will get your wallet and address:

You will then find the gzipped tarball at _build/mainnet/rel/chivesweave/chivesweave-x.y.z.tar.gz

Step 5: Running your node:

../_build/mainnet/rel/chivesweave/bin/start mine data_dir mainnet_data_dir mining_addr [YOUR_WALLET_ADDRESS] storage_module 0,[YOUR_WALLET_ADDRESS]

If you have small disk free space, you can use this command to start mine job:

./_build/mainnet/rel/chivesweave/bin/start mine data_dir mainnet_data_dir mining_addr [YOUR_WALLET_ADDRESS] storage_module 0,[YOUR_WALLET_ADDRESS] max_disk_pool_buffer_mb 10000

If you want to execute mine in the background:

nohup _build/mainnet/rel/chivesweave/bin/start mine data_dir mainnet_data_dir mining_addr [YOUR_WALLET_ADDRESS] storage_module 0,[YOUR_WALLET_ADDRESS] max_disk_pool_buffer_mb 10000 peer node1.chivesweave.net peer node2.chivesweave.net > output.log 2>&1 &

Step 6: View the logs:

./_build/mainnet/rel/chivesweave/bin/logs -f

Step 7: Stop the node:

./_build/mainnet/rel/chivesweave/bin/stop

As with mainnet peers, each peer must be run in its own physical or virtual environment (e.g. on its own machine or in its own container or virtual machine). If you try to run two nodes within the same environment you will get an error like Protocol 'inet_tcp': the name chivesweave@127.0.0.1 seems to be in use by another Erlang node