Skip to content

Prereqs for Local RegTest Network => Build Tools, Docker, Dashmate #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
coolaj86 opened this issue Apr 2, 2024 · 1 comment
Open

Comments

@coolaj86
Copy link
Member

coolaj86 commented Apr 2, 2024

If you already have a group of configs in ~/.dashmate/, you can destroy the nodes and begin anew with:

./dashmate/bin/dashmate group stop
./dashmate/bin/dashmate group reset
./dashmate/bin/dashmate group start
  1. Install updates and prereqs
    sudo apt update &&
       sudo apt install -y build-essential curl git
    
    curl https://webi.sh/ | sh
    source ~/.config/envman/PATH.env
    
    webi [email protected] jq pathman serviceman
    source ~/.config/envman/PATH.env
    
    mkdir -p ~/bin/
    pathman add ~/bin/
    source ~/.config/envman/PATH.env
    And reduce the amount of logging to something reasonable so that it doesn't fill up the disk from all the docker container messages:
    /etc/systemd/journald.conf:
    [Journal]
    Compress=yes
    SystemMaxUse=500M
    SystemKeepFree=4G
    SystemMaxFileSize=50M
    SystemMaxFiles=100
    RuntimeMaxUse=1G
    RuntimeKeepFree=500M
    RuntimeMaxFileSize=1G
    RuntimeMaxFiles=1000
    sudo systemctl daemon-reload
    sudo systemctl restart systemd-journald
  2. Install docker as per Request for Docker Engine/Docker Compose webinstall/webi-installer-requests#28 (comment)
    with special attention to the sections including:
    • groupadd docker
    • --groupname=docker
    • and nesting=1 (if already running within a container, such as docker)
  3. Install dashmate as per dashmate setup local fails with Database already exists dashpay/platform#1736 (comment):
    ~/bin/dashmate-install:
    #!/bin/sh
    set -e
    set -u
    
    # NOTE: the latest version doesn't work with dash-cli v20.1.1
    #g_rel="v1.0.0-pr.1902.1"
    #g_file="dashmate-v1.0.0-pr.1902.1-f5fc6d074-linux-x64.tar.gz"
    g_rel="v1.0.0-dev.9"
    g_file="dashmate-v1.0.0-dev.9-d6688bef2-linux-x64.tar.gz"
    if ! test -f "${g_file}"; then
        curl -L -O 'https://github.com/dashpay/platform/releases/download'/"${g_rel}"/"${g_file}"
    fi
    echo "Extracting ${g_file}"
    tar xf "${g_file}"
  4. Create a regtest (a.k.a. "local") network
    ~/bin/dashmate-regtest-init:
    #!/bin/sh
    set -e
    set -u
    
    (
        cd ./dashmate/
        ./bin/dashmate setup --verbose --node-count=3 --debug-logs --miner-interval=0.5m local
    
        ./bin/dashmate group start
    
        ./bin/dashmate status core --config=local_seed
        ./bin/dashmate status core --config=local_1
        ./bin/dashmate status core --config=local_2
        ./bin/dashmate status core --config=local_3
    )
@coolaj86 coolaj86 pinned this issue Apr 8, 2024
@coolaj86 coolaj86 changed the title How to setup dashmate regtest network Prereqs for Local RegTest Network => Build Tools, Docker, Dashmate May 15, 2024
@coolaj86
Copy link
Member Author

Cruft

Just in case I need this later:

  1. Create some wallets (these names are part of the test code, not arbitrary yet):
    git clone https://github.com/dashhive/DashJoin.js.git
    pushd ./DashJoin.js/
    npm ci
    #!/bin/sh
    set -e
    set -u
    
    for b_username in foobar psend luke han chewie; do
        ./bin/wallet-create "${b_username}"
    done
    ./bin/dboot --make-junk-user
    
    ./bin/dboot --instance=base --create-wallets
    
    ./bin/dboot --instance=base --list-users
    
    # creates immature balances
    #for b_username in foobar psend luke han chewie; do
    #    ./bin/dboot --instance=base --generate-to="${b_username}"
    #done 
    
    # takes a few minutes
    ./bin/dboot --dash-for-all
    
    # takes a few seconds
    ./bin/dboot --create-denoms
    
    # matures balances of the other test fixture users
    ./bin/dboot --grind-junk-user
    
    # creates more coins, matures the previous balances, and imports the mature addresses
    for b_username in foobar psend luke han chewie; do
        #./bin/dboot --instance=base --generate-to="${b_username}"
        ./bin/dash-cli-wallet "${b_username}" getbalances
        ./bin/dboot --instance=base --import-addresses="${b_username}"
    done
    
    # creates some denominated coins for each user
    ./utils/denominate --users=foobar,psend,luke,han,chewie
    
    ./bin/dboot --instance=base --all-utxos
  2. Attempt a coinjoin. Supposed the minimum number of participants is only 2:
    Spork 22 introduced in Dash Core 0.16.0 expanded the maximum number of participants to 20 and also reduced the minimum number of participants to 2 for testnet/devnet/regtest networks. The spork was removed in Dash Core 0.17.0 which made the change permanent.
    # in one screen
    ./src/demo.js --instance=base --username=luke
    
    # in a second screen
    ./src/demo.js --instance=base --username=han

This should work to denominate in the way that ./src/demo.js expects:

./bin/dboot --split-utxos=luke

Limits:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant