Git Product home page Git Product logo

digiasset-core's Introduction

Table of Contents

  1. Install Ubuntu
  2. Increase Swap Size
  3. Install DigiByte
  4. Install Dependencies
  5. Install VCPKG
  6. Install Standard C++ Dependencies
  7. Update CMAKE
  8. Install IPFS
  9. Set IPFS to Run on Boot
  10. Build DigiAsset Core
  11. Configure DigiAsset Core
  12. Set DigiAsset Core to Run at Boot
  13. Upgrading DigiAsset Core
  14. Documentation
  15. Other Notes
  16. Special Thanks

License: MIT

Install Ubuntu

Ideally this should work on all OS. So far it has only been tested on:

  • Ubuntu 20.04LTS - app works but google tests don't compile
  • Ubuntu 22.04LTS - all functions

The instructions below are specifically writen for Ubuntu 22.04 LTS any other OS may have slightly different instructions needed.

Install ubuntu server using default settings.

Increase swap size

Default install had a 4GB swap file but DigiByte core kept crashing during sync so I increased it to 8GB

sudo swapoff /swap.img
sudo dd if=/dev/zero bs=1M count=8192 oflag=append conv=notrunc of=/swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo nano /etc/fstab

place the following at the end(if swap.img is already there replace it)

/swapfile       none    swap    sw      0       0

Install DigiByte

wget wget https://github.com/DigiByte-Core/digibyte/releases/download/v7.17.3/digibyte-7.17.3-x86_64-linux-gnu.tar.gz
tar -xf digibyte-7.17.3-x86_64-linux-gnu.tar.gz
rm digibyte-7.17.3-x86_64-linux-gnu.tar.gz
mkdir .digibyte
nano .digibyte/digibyte.conf
rpcuser=user
rpcpassword=pass11
rpcbind=127.0.0.1
rpcport=14022
whitelist=127.0.0.1
rpcallowip=127.0.0.1
listen=1
server=1
txindex=1
addnode=191.81.59.115
addnode=175.45.182.173
addnode=45.76.235.153
addnode=24.74.186.115
addnode=24.101.88.154
addnode=8.214.25.169
addnode=47.75.38.245

to get digibyte to run on boot do the following

sudo nano /etc/systemd/system/digibyted.service
[Unit]
Description=DigiByte's distributed currency daemon
After=network.target

[Service]
User=<your-username>
Group=<your-username>

Type=forking
PIDFile=/home/<your-username>/.digibyte/digibyted.pid
ExecStart=/home/<your-username>/digibyte-7.17.2/bin/digibyted -daemon -pid=/home/<your-username>/.digibyte/digibyted.pid \
-conf=/home/<your-username>/.digibyte/digibyte.conf -datadir=/home/<your-username>/.digibyte -disablewallet

Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5

[Install]
WantedBy=multi-user.target

replace

Enable the service on boot

sudo systemctl enable digibyted.service

Start the service

sudo systemctl start digibyted.service

Install Dependencies

sudo apt update
sudo apt upgrade
sudo apt-get install cmake libcurl4-openssl-dev libjsoncpp-dev golang-go libjsonrpccpp-dev libjsonrpccpp-tools libsqlite3-dev build-essential pkg-config zip unzip libssl-dev
sudo apt install libboost-all-dev

Install VCPKG

wget -qO vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz
sudo mkdir /opt/vcpkg
sudo tar xf vcpkg.tar.gz --strip-components=1 -C /opt/vcpkg
rm vcpkg.tar.gz
sudo /opt/vcpkg/bootstrap-vcpkg.sh
sudo ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg

Install Standard C++ Dependencies

Warning: The following steps build a lot of code and can take a long time to complete

sudo vcpkg install sqlite3

Update CMAKE

wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-x86_64.sh
chmod +x cmake-3.27.7-linux-x86_64.sh
sudo ./cmake-3.27.7-linux-x86_64.sh --prefix=/usr/local
export PATH=/usr/local/cmake-3.27.7-linux-x86_64/bin:$PATH
nano ~/.bashrc

at the end of the file add

export PATH=/usr/local/cmake-3.27.7-linux-x86_64/bin:$PATH

Install IPFS

wget https://dist.ipfs.tech/kubo/v0.22.0/kubo_v0.22.0_linux-amd64.tar.gz
tar -xvzf kubo_v0.22.0_linux-amd64.tar.gz
cd kubo
sudo bash install.sh
ipfs init
ipfs daemon

this step will list out a lot of data of importance is the line that says "RPC API server listening on" it is usually port 5001 note it down if it is not. You can now see IPFS usage at localhost:5001/webui in your web browser(if not headless). Press Ctrl+C to stop the daemon

Set IPFS to run on boot

cd ~
sudo nano /etc/systemd/system/ipfs.service

edit the file to look like this

[Unit]
Description=IPFS Daemon
After=network.target

[Service]
ExecStart=/usr/local/bin/ipfs daemon
User=<your-username>
Restart=always

[Install]
WantedBy=multi-user.target

replace

sudo systemctl daemon-reload
sudo systemctl enable ipfs.service
sudo systemctl start ipfs.service

Build DigiAsset Core

git clone -b master --recursive https://github.com/DigiAsset-Core/DigiAsset_Core.git
cd DigiAsset_Core
git submodule update --init --recursive
mkdir build
cd build
cmake -B . -S .. -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .
mv src/digiasset_core ../bin
mv cli/digiasset_core-cli ../bin
mv web/digiasset_core-web ../bin
cd ../bin
  • if you wish to build the test scripts add to first cmake -DBUILD_TEST=ON

Configure DigiAsset Core

The first time you run DigiAsset Core it will ask you several questions to set up your config file. Run DigiAsset Core using

./digiasset_core

This will create bin/config.cfg the wizard creates only the basic config for a full list of config options see example.cfg

Make sure DigiAsset Core is running correctly and then press ctrl+c to stop it and continue with instructions.


Set DigiAsset Core to run at boot

sudo nano /etc/systemd/system/digiasset_core.service
[Unit]
Description=DigiAsset Core
After=network.target digibyted.service

[Service]
User=<your-username>
Group=<your-username>

Type=simple
ExecStart=/home/<your-username>/DigiAsset_Core/bin/digiasset_core
WorkingDirectory=/home/<your-username>/DigiAsset_Core/bin

Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5

[Install]
WantedBy=multi-user.target

replace

Enable the service on boot

sudo systemctl enable digiasset_core.service

Start the service

sudo systemctl start digiasset_core.service

Upgrading DigiAsset Core

When a new version is available you can upgrade by running the following commands

cd DigiAsset_Core/bin
./digiasset_core-cli shutdown
sudo systemctl stop digiasset_core.service
cd ..
git pull
git submodule update --init --recursive
cd build
cmake -B . -S .. -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .
mv src/digiasset_core ../bin
mv cli/digiasset_core-cli ../bin
mv web/digiasset_core-web ../bin
cd ../bin
sudo systemctl start digiasset_core.service

Documentation

To access documentation run the digiasset_core-web application then go to http://127.0.0.1:8090/

Other Notes

  • If submitting pull requests please utilize the .clang-format file to keep things standardized.

Special Thanks

Major Financial Support:

RevGenetics Longevity Supplements

digiasset-core's People

Contributors

mctrivia avatar renzodd avatar sbosvk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.