Git Product home page Git Product logo

dashchum's Introduction

Dash Chum

a simple HTML, CSS & JS test kit for Dash Mate

A lot of the work that went in to making this repo has been streamed and is available in this Dash Chum YouTube Playlist

The instructions below are meant to give you a working local Dash testnet / devnet. The purpose of which is to allow building on the Dash platform without needing to use real Dash (Ð).

This gives you a siloed Dash network and generates a wallet unique to your locally running network. You fund it via the Seed Node generated from Dashmate (see Usage).

Purpose

The purpose of this project is to test Dashmate and the Dash Platform, centered around implementing functional examples of the tutorials at https://dashplatform.readme.io/docs/tutorials-introduction

Once your system is setup with Docker, Node.js & Dashmate running correctly, Dash Chum should allow testing the following functionality:

Once your wallet is funded, these buttons will appear with the available next steps

  • Generate Identity (appears once wallet is funded)
  • Generate Contract (appears once Identity is created)
  • Submit Document (appears once contract is created)

Getting Started

System Prerequisites

You will need to install Docker, Node.js & dashmate, which can be achieved with the instructions below.

Docker & Node.js Installation - Linux

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh

# adds the docker group to your user
sudo usermod -aG docker $USER

# a workaround, alternatively logout / restart
newgrp docker

# Install Node.js
curl -sS https://webi.sh/node@16 | sh
source ~/.config/envman/PATH.env

If you skip the steps above (perhaps you already have them installed) and run into any issues with the dashmate setup, you may need to re-install Docker or Node.js.

Dashmate Installation & Setup

# Install Dashmate
npm i -g [email protected]

# Setup Dashmate
# won't work if newgrp / logout step is skipped

# if either of these steps fail,
# try re-running each once or twice
dashmate setup local

# generates a new wallet and returns
# public and private keypair and adds funds
dashmate wallet:mint 10 --config=local_seed

# If you already have a wallet you can fund it like this
dashmate wallet:mint 10 --address=REPLACE_WITH_DASH_ADDRESS --config=local_seed

dashmate group start

The official method from the Testnet Masternode Dash Docs also works, but was a little outdated at time of writing (Oct 2022).

WARNING DO NOT USE snap to install Docker on Ubuntu. See references 12

Configuration

You have two options for this stage. You can...

  1. Open up config.js and replace all occurences of dashmate with the IP address (Eg. 127.0.0.1 or 192.168.1.1), localhost or a domain pointing to wherever you're running Dashmate.

or

  1. Modify your hosts file and add an alias for dashmate
sudo vim /etc/hosts

# add a line to the bottom of the file like so
127.0.0.1  dashmate

# save and quit (:wq)

Clone & Install this project

git clone https://github.com/dashhive/dashchum.git
cd dashchum # change to this repo
npm install # install packages
npm start # run test server

Navigate to http://localhost:5555/

Funding your wallet

Once your wallet is setup (which should happen just by loading http://localhost:5555/ in your browser) you will need to add funds to it to generate an identity, a contract or submit a document.

That can be accomplished with the commands below.

# Get the balance of the dashmate seed node
docker exec -it dash_masternode_local_seed-core-1 dash-cli getbalance

# Send 100 dash from the seed node to your wallet
# Copy the Address from the first row in the table (in your browser)
docker exec -it dash_masternode_local_seed-core-1 dash-cli sendtoaddress "REPLACE_WITH_ADDRESS_FROM_BROWSER" 100

# replace "REPLACE_WITH_ADDRESS_FROM_BROWSER" with the address from http://localhost:5555
# it should look like "yMbdOiNzOCNKlJwj530ir7aJ4DtjFqVejz"

Reset Dashmate

You will likely find the need to reset 3 your dashmate (perhaps daily), this is a helper script that should get you a fresh version.

#!/bin/sh
# dashmate group stop
#docker stop $(docker ps -q) # in some scenarios this may be needed
docker rm -f -v $(docker ps -a -q) || true
docker system prune -f --volumes
rm -rf ~/.dashmate
dashmate setup local
dashmate wallet:mint 10 --config=local_seed # optional
dashmate wallet:mint 10 --address=REPLACE_WITH_DASH_ADDRESS --config=local_seed # optional

Stop Dashmate when not in use

Dashmate can take up a bit of system resources and can begin throwing errors the longer it runs. Consider stopping the services while its not in use.

# this should stop all the docker services
dashmate group stop

# just run this when you want to get going again
dashmate group start

Notes

Footnotes

  1. DO NOT USE snap to install Docker on Ubuntu. It may be hard / impossible to get docker working properly with dashmate without formatting your system and re-installing.

  2. Snap was a bad choice. https://youtu.be/V-0vEbE_INU?t=188

  3. if you see PoSe Penalty errors, you may need to reset your dashmate setup

dashchum's People

Contributors

jojobyte avatar

Stargazers

 avatar  avatar

Watchers

Rion Daniel Gull avatar

dashchum's Issues

dashmate doesn't start again once stopped

@jojobyte

so dashmate doesn't work once stopped on my pop os machine running 20.04.

i walked thorugh all the steps

after i moved money in the dashmate wallet i just decided to reset it

so after running this:

sudo docker exec -it dash_masternode_local_seed-core-1 dash-cli sendtoaddress "<the wallet address>" 100

I decided to reset

dashmate group stop

then i ran

dashmate setup local 

then when it didn't work

i followed all of the deleting instructions in between
and still got the same error:

✔ Set configuration preset
✔ Set the number of nodes
✔ Enable debug logs
✔ Set the core miner interval
✖ connect EACCES /var/run/docker.sock
◼ Configure Core nodes
◼ Configure Tenderdash nodes

let me know if you have any questions. thanks!

QA Feedback: Bugs

Some bugs caught while QA Testing by Spencer

  • dashmate setup local and dashmate group start BOTH had to be run multiple times
  • the wrong buttons show when there is a zero balance
  • when you push generate identity it [object Object]'s below
    • and stored [object Object] in local storage
  • Generate Contract: nothing on screen changed after update but the local storage changed

QA Feedback: Enhancements

Some feedback generated while QA Testing by Spencer

  • Clarify Configuration stage
  • Clarify Usage
  • Clarify what Dash Chum does and what you should expect to see in browser
  • Add reference to stopping dashmate group stop

issues mostly RESOLVED in past - nov 11, 2022 - testing claim

some notes
i've noticed on the readme
a few things we want to add
at the bottom

  • the 3 things you want to demo that it can do
    broken into bolded 2 or 3 worded bullets
  • and then the code below them broken up
    into steps so they are easy to read
    Bug 1
    the wrong buttons show when there is a zero balance
    bug 2
    i have no idea why a typical docker install doesn't work
    but 3
    you have to install the things 2 or 3 times sometimes for them to work when running dashmate
    bug 4
    when you push generate identity it
    [object Object]'s below
    Screenshot_from_2022-11-03_21-31-52
    bug 5
    nothing on screen changed after update
    but the local storage changed

Encrypted Friending in Dash Chum

Replicate the functionality of the Ionic DashPay Wallet using @noble/secp256k1 to create a connection between two identities that allows transferring funds between two accounts via Identity/Username rather than Address.

https://github.com/dashameter/dashpay-wallet/blob/master/src/lib/crypto/dashpay-crypto.js

The current module used by DashPay Wallet uses secp256k1 which has native dependencies. @noble/secp256k1 is written in TS/JS with no native dependencies.

Per conversation with AJ this may be of help to him with Wallet.js (& possibly CrowdNode SDK..?)

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.