Skip to content

Commit 46889d9

Browse files
committed
chore: rebrand package 'dashjoin'
1 parent 283bc50 commit 46889d9

File tree

3 files changed

+148
-19
lines changed

3 files changed

+148
-19
lines changed

README.md

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,137 @@
1-
# DashJoin.js
1+
# [DashJoin.js](https://github.com/dashhive/DashJoin.js)
2+
3+
A working reference implementation of Coin Join that can easily be ported to any
4+
language.
5+
6+
# Table of Contents
7+
8+
- RegTest Setup
9+
- Maturing Coins
10+
- Install
11+
- Running the Demo
12+
- Troubleshooting
13+
- Roadmap
14+
15+
# Prerequisites (RegTest)
16+
17+
## RegTest
18+
19+
You will need:
20+
21+
- Build Tools
22+
- Docker
23+
- Dashmate
24+
- RegTest
25+
26+
See <https://github.com/dashhive/DashJoin.js/issues/12>.
27+
28+
## Maturing the Coinbase
29+
30+
Before running the demo, generate some blocks:
31+
32+
```sh
33+
./bin/dash-cli-generateblocks 20
34+
```
35+
36+
You'll get some errors the first time you try to run the demo, generate even
37+
more blocks:
38+
39+
```sh
40+
./bin/dash-cli-generateblocks 105
41+
```
42+
43+
If you still get some errors on the 3rd run, just generate a few more for good
44+
measure:
45+
46+
```sh
47+
./bin/dash-cli-generateblocks 10
48+
```
49+
50+
## Install
51+
52+
```sh
53+
git clone https://github.com/dashhive/DashJoin.js.git
54+
pushd ./DashJoin.js/
55+
56+
npm ci --only=production
57+
```
58+
59+
## How to Run the Demo
60+
61+
1. Make sure the tests still pass: \
62+
(the tests replay known-good transactions from scratch)
63+
64+
```sh
65+
npm run test
66+
```
67+
68+
2. Then run the demo in two different screens:
69+
70+
```sh
71+
# in the FIRST screen
72+
node ./demo.js 'foo'
73+
```
74+
75+
```sh
76+
# in the SECOND screen
77+
node ./demo.js 'bar'
78+
```
79+
80+
3. You may need to watch the logs on each of the `dashd` instances to find
81+
which one has been chosen for the coinjoin service (the ids are
82+
non-deterministic / random):
83+
84+
```sh
85+
docker ps | grep 'dashd:' | grep '_local_[1-3]'
86+
87+
docker logs --since 1m -f e04133d8696b
88+
```
89+
90+
## Troubleshooting
91+
92+
There are two categories you're likely to encounter:
93+
94+
1. Coins / Coinbase / Block Height isn't mature. \
95+
For these, the solution is to generate more transactions, and try again: \
96+
(this functionality is documented only to work on Linux)
97+
```sh
98+
./bin/dash-cli-generateblocks 100
99+
```
100+
2. Disk space (or other system resources) is/are low. \
101+
All sorts of strange things will happen. Doing a reset may help.
102+
```sh
103+
~/dashmate/bin/dashmate group stop
104+
docker ps -aq | xargs docker stop
105+
```
106+
```sh
107+
~/dashmate/bin/dashmate group reset
108+
```
109+
```sh
110+
~/dashmate/bin/dashmate group start
111+
```
112+
You may need to `stop` and `start` a second time to get everything to come
113+
back up - it's not entirely deterministic. That said, just one `reset` should
114+
do.
115+
116+
Example immature coinbase error:
117+
118+
```json
119+
{
120+
"code": -26,
121+
"message": "bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 10"
122+
}
123+
```
124+
125+
Low disk space (below 90% or below 4gb free) can cause seemingly random and
126+
uncorrelatable errors, hangups, etc.
127+
128+
## This isn't a library (yet)
129+
130+
`demo.js` still has a lot of business logic that will need to be carefully
131+
teased out and abstracted to turn this into a library.
132+
133+
The parsers and packers are a good chunk of it, but the networking is all in
134+
`demo.js` for now.
135+
136+
The actual signing logic is in `dashtx` and the wallet logic is built from the
137+
other `dash*` libraries, which are complete and fit for general use.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"name": "dashjoin.js",
2+
"name": "dashjoin",
33
"version": "1.0.0",
44
"description": "A pure node.js implementation of DASH's CoinJoin/PrivateSend implementation.",
55
"main": "index.js",
6-
"directories": {
7-
"doc": "docs",
8-
"test": "tests"
9-
},
6+
"files": [
7+
"*.js"
8+
],
109
"scripts": {
1110
"demo": "./src/demo.js",
1211
"fmt": "npm run prettier",
@@ -18,23 +17,17 @@
1817
"url": "git+ssh://[email protected]/dashhive/DashJoin.js.git"
1918
},
2019
"keywords": [
21-
"dash",
22-
"coin",
23-
"join",
24-
"private",
25-
"send",
26-
"cryto",
27-
"currency"
20+
"Dash",
21+
"CoinJoin",
22+
"PrivateSend",
23+
"Crpytocurrency"
2824
],
29-
"author": "William Merfalen <[email protected]> (https://github.com/wmerfalen)",
25+
"author": "AJ ONeal <[email protected]> (https://therootcompany.com)",
3026
"license": "MIT",
3127
"bugs": {
3228
"url": "https://github.com/dashhive/DashJoin.js/issues"
3329
},
3430
"homepage": "https://github.com/dashhive/DashJoin.js#readme",
35-
"devDependencies": {
36-
"mocha": "^10.2.0"
37-
},
3831
"dependencies": {
3932
"@dashevo/dashcore-lib": "^0.20.6",
4033
"@dashincubator/secp256k1": "^1.7.1-5",

0 commit comments

Comments
 (0)