Skip to content

DMDcoin/Diamond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diamond

This guide is designed for Ubuntu 24.04 LTS We recommend using Ubuntu 24.04 LTS Ubuntu 22.04 LTS or Ubuntu 20.04 LTS. Many community members report to run on a different Linux distribution successful but we dont provide step by step guides.

Validator Node Spec recommendation: 4 core 8 gb ram 200gb ssd (growing with blockchain size) and flatrate minimum 100 mbit (up&down) internet access with static IP address and port 17771 open for node to node communication

for normal full node non validator operation far lower requirement cpu/ram/bandwith wise possible but to compile the node still need like 4gb ram and ssd space requirements are the same


Step 1: Copy Required Files to Your Node Server

Download the necessary files from this repository onto your node server.
We recommend using git for easy downloads and updates.

# Install git
apt install git -y

# Clone the repository for the DMD Diamond mainnet
git clone https://github.com/DMDcoin/Diamond.git

# Switch into the new directory
cd Diamond

Step 2: Build the Diamond Node

Building the Diamond Node involves two steps:

  1. Preparing your machine to build the software.
  2. Running the build process.

Prepare the Build Environment

This setup is required only once:

./setup-build-from-source.sh

Build the Node

This script fetches the latest source version and builds the binaries.
Note: The process may take up to an hour depending on your machine's performance.

./build-from-source.sh

Quick Guide: Running a Full Node

To run a validator node without participating as a validator:

# Start the Diamond Node using the full node configuration
./diamond-node -c=fullnode.toml

Quick Guide: Running a Validator Node

Validator nodes require a dedicated unlocked account for the hbbft engine to sign block contributions.

Generate a Mining Key

Run the following command to create a mining key:

./dmd create_miner

This creates two files for your mining key:

  1. ./data/keys/dmd/dmd_miner_key.json (keystore format)
  2. ./data/network/key (private key format)

Configure the Validator Node

  1. Copy the template configuration file:

    cp template-validator.toml validator_node.toml
    
  2. Edit the configuration file:

    nano validator_node.toml
    
  3. Replace both instances of put your address here with the address generated by the dmd create_miner command.

  4. Search this sektion

[footprint] TODO: set the maximum amount of memory, you can spare for this diamond-node. if no other services are running, you can set this value to almost all of your available RAM

cache_size = 5120

And adapt the cache_size value to something around 2-3 GB lower than your system memory if u have a recomendet 8gb ram server the default value should be ok (if you have other memory-hungry services, maybe even lower; keep in mind low values decrease your performance, and low performance can create score loss)

  1. Start the Validator Node:

    ./start.sh
    

Verify Node Synchronization

Check the logs to confirm that your node is syncing with the blockchain.
The following log output indicates successful synchronization:

INFO import  Imported #1040 0xabfe…f189 (0 txs, 0.00 Mgas, 29 ms, 0.56 KiB)

For the latest block information, visit the block explorer.


Adding the Network to a Web3 Wallet

Use a wallet like MetaMask or the Brave Browser to connect to the DMD Diamond v4 Network. Any key management system that supports ethereum address schema can be used as long as it supports custom chain configuration and walletconnect to interact with dapps

Network Configuration:

To use your own RPC endpoint, start your node with:

./diamond-node -c=rpcnode.toml

Replace the RPC URL with your server's IP address.


Staking on Your Node

To stake on your node:

  1. Ensure your node is running.
  2. Have atleast **10,000 DMD available and a fraction of a DMD exctra for the fee of the stake validator collateral smartcontract interaction later (this coins should not be send towards the miner_address we created before! a misstake often reported in BETA)

Retrieve Your Public Key

Your public key can be found in the following locations:

  • ./public_key.txt
  • In the node startup log (under "Public node URL").

Stake Using the Diamond-UI

Visit the Diamond-UI and enter your public key.
Follow the instructions to set up a pool with a staking amount between **10,000 and 50,000 DMD

For more details: Diamond-UI Guide

If u own DMD Diamond v3 coins at snapshot block 1851895 u can claim them following the guide here https://claiming.bit.diamonds/ a tiny amount of DMD for enabling to interact with claiming can be requested here https://faucet.bit.diamonds/


Running Your Node Persistently

Using tmux

  1. Install tmux if it is not already installed:

    sudo apt install tmux -y
  2. Start a new tmux session:

    tmux new -s diamond-node
  3. Start the node in the session:

    ./start.sh
  4. Detach from the session (leave it running):

    Ctrl+b, d
  5. To reattach to the session:

    tmux attach -t diamond-node

Using screen

  1. Install screen if it is not already installed:

    sudo apt install screen -y
  2. Start a new screen session:

    screen -S diamond-node
  3. Run the node:

    ./start.sh
  4. Detach from the session:

    Ctrl+a, d
  5. To reattach to the session:

    screen -r diamond-node

Using pm2

  1. Install pm2 (for debian):

    apt update && apt install sudo curl && curl -sL https://raw.githubusercontent.com/Unitech/pm2/master/packager/setup.deb.sh | sudo -E bash -
  2. Start the node with pm2:

    pm2 start "./start.sh" --name diamond-node
  3. View logs:

    pm2 logs diamond-node
  4. Restart the node:

    pm2 restart diamond-node
  5. Stop the node:

    pm2 stop diamond-node
  6. List all running pm2 services:

    pm2 ls 
  7. Save the pm2 configuration to start automatically on reboot:

    pm2 save
    pm2 startup

    Important: Then copy/paste the displayed command onto the terminal details here.