Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ There are many ways you can contribute: testing, sharing ideas, writing document

Want to get your hands dirty with code? Great! [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/developing.md](docs/developing.md) are where it's at.

For local development against a separately running `joinmarket-ng` backend, start `jmwalletd` and the jm-ng orderbook watcher first, then run Jam with `npm run dev`. Jam's default Vite proxy targets `https://127.0.0.1:28183` for `/api`, `wss://127.0.0.1:28283` for `/jmws`, and `http://127.0.0.1:8080` for `/obwatch`. If you are using Jam's regtest jm-ng services instead, run `npm run jm-ng:dev`.

## 🏛️ History

This project builds upon the [jm-web-client](https://github.com/JoinMarket-Org/jm-web-client) which was developed by [Shobhitaa](https://github.com/shobhitaa), [Abhishek](https://github.com/abhishek0405), and [waxwing](https://github.com/AdamISZ) himself. Many people contributed over time, some of which are [listed here](https://github.com/joinmarket-webui/jam/graphs/contributors).
Expand Down
5 changes: 3 additions & 2 deletions docker/regtest/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
JM_DIRECTORY_NODES=replaceme

JM_REF_DIRECTORY_NODES=replaceme
JM_NG_DIRECTORY_NODES=replaceme
JM_ALL_DIRECTORY_NODES=replaceme,replaceme
7 changes: 4 additions & 3 deletions docker/regtest/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ unlock_wallet() {
# param "--insecure": Is needed because a self-signed certificate is used in joinmarket regtest container
# param "--silent": Don't show progress meter or error messages (errors are reactivated with "--show-error").
# param "--show-error": When used with -s, --silent, it makes curl show an error message if it fails.
local unlock_result; unlock_result="$(curl "$base_url/api/v1/wallet/$wallet_name/unlock" --silent --show-error --insecure --data "$unlock_request_payload" | jq ".")"
local unlock_result; unlock_result="$(curl "$base_url/api/v1/wallet/$wallet_name/unlock" --silent --show-error --insecure -H "Content-Type: application/json" --data "$unlock_request_payload" | jq ".")"

local unlock_result_error_msg; unlock_result_error_msg=$(jq -r '. | select(.message != null) | .message' <<< "$unlock_result")
if [ "$unlock_result_error_msg" != "" ]; then
Expand Down Expand Up @@ -135,7 +135,7 @@ create_wallet() {
local wallet_password; wallet_password=${3:-}
local create_request_payload; create_request_payload="{\"password\":\"$wallet_password\",\"walletname\":\"$wallet_name\",\"wallettype\":\"sw-fb\"}"

local create_result; create_result="$(curl "$base_url/api/v1/wallet/create" --silent --show-error --insecure --data "$create_request_payload" | jq ".")"
local create_result; create_result="$(curl "$base_url/api/v1/wallet/create" --silent --show-error --insecure -H "Content-Type: application/json" --data "$create_request_payload" | jq ".")"

local create_result_error_msg; create_result_error_msg=$(jq -r '. | select(.message != null) | .message' <<< "$create_result")
if [ "$create_result_error_msg" != "" ]; then
Expand Down Expand Up @@ -222,7 +222,8 @@ verify_no_open_session_or_throw() {
fi

[ "$(jq -r '.session' <<< "$session_result")" != "false" ] && die "Please make sure no session is active."
[ "$(jq -r '.wallet_name' <<< "$session_result")" != "None" ] && die "Please make sure no wallet is active."
local session_wallet_name; session_wallet_name=$(jq -r '.wallet_name' <<< "$session_result")
[ "$session_wallet_name" != "None" ] && [ "$session_wallet_name" != "" ] && die "Please make sure no wallet is active."

return 0
}
Expand Down
110 changes: 99 additions & 11 deletions docker/regtest/docker-compose-common.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@

services:

joinmarket_native:
build:
context: ./dockerfile-deps/joinmarket/latest
dockerfile: Dockerfile
restart: unless-stopped
environment:
ENSURE_WALLET: "true"
REMOVE_LOCK_FILES: "true"
ENSURE_WALLET: 'true'
REMOVE_LOCK_FILES: 'true'
jm_blockchain_source: regtest
jm_network: testnet
jm_rpc_host: bitcoind
jm_rpc_port: 43782
jm_directory_nodes: ${JM_DIRECTORY_NODES:?You must set the onion address generated in prepare step to your .env file}
jm_directory_nodes: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
jm_socks5_host: tor
jm_socks5_port: 9050
jm_tor_control_host: tor
jm_tor_control_port: 9051
jm_minimum_makers: 1 # necessary to do coinjoins with this regtest setup; default is 4
jm_taker_utxo_age: 1 # faster testing of scheduler runs; default is 5
jm_maker_timeout_sec: 30 # easier testing of maker timeouts on regtest (and "Stall Monitor" retries); default is 60
expose:
- 62601 # obwatch
- 27183 # joinmarketd daemon
- 28183 # jmwalletd api
- 28283 # jmwalletd websocket
healthcheck:
test: ["CMD", "supervisorctl", "status"]
test: ['CMD', 'supervisorctl', 'status']
interval: 10s
timeout: 10s
retries: 20
Expand All @@ -35,20 +38,105 @@ services:
dockerfile: Dockerfile
restart: unless-stopped
environment:
ENSURE_WALLET: "true"
REMOVE_LOCK_FILES: "true"
ENSURE_WALLET: 'true'
REMOVE_LOCK_FILES: 'true'
jm_blockchain_source: regtest
jm_network: testnet
jm_rpc_host: bitcoind
jm_rpc_port: 43782
jm_directory_nodes: ${JM_DIRECTORY_NODES:?You must set the onion address generated in prepare step to your .env file}
jm_directory_nodes: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
jm_socks5_host: tor
jm_socks5_port: 9050
jm_tor_control_host: tor
jm_tor_control_port: 9051
jm_minimum_makers: 1 # necessary to do coinjoins with this regtest setup; default is 4
jm_taker_utxo_age: 1 # faster testing of scheduler runs; default is 5
expose:
- 80 # nginx
- 80 # nginx
- 28183 # jmwalletd api
healthcheck:
test: ['CMD', 'dinitctl', 'status', 'jmwalletd']
interval: 10s
timeout: 10s
retries: 20
start_period: 60s
start_interval: 3s

joinmarket_ng_native:
image: ghcr.io/joinmarket-ng/joinmarket-ng/jmwalletd:main
restart: unless-stopped
environment:
JOINMARKET_DATA_DIR: /root/.joinmarket-ng
JMWALLETD_HOST: 0.0.0.0
JMWALLETD_NO_TLS: ${JMWALLETD_NO_TLS:-false}
BITCOIN__BACKEND_TYPE: descriptor_wallet
BITCOIN__RPC_URL: http://bitcoind:43782
BITCOIN__RPC_USER: regtest
BITCOIN__RPC_PASSWORD: regtest
NETWORK_CONFIG__NETWORK: testnet
NETWORK_CONFIG__BITCOIN_NETWORK: regtest
NETWORK_CONFIG__DIRECTORY_SERVERS: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
DIRECTORY_NODES: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
OBWATCH_URL: http://joinmarket_ng_orderbook_watcher:8000
TOR__SOCKS_HOST: tor
TOR__SOCKS_PORT: 9050
TOR__CONTROL_HOST: tor
TOR__CONTROL_PORT: 9051
TOR__COOKIE_PATH: /var/lib/tor/control_auth_cookie
TAKER__MINIMUM_MAKERS: 1 # necessary to do coinjoins with this regtest setup
TAKER__MAKER_TIMEOUT_SEC: 30 # easier testing of maker timeouts on regtest
expose:
- 8000 # obwatch
- 28183 # jmwalletd api
- 28283 # jmwalletd websocket
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import socket,ssl,sys; s=socket.socket(); s.settimeout(5);\ntry:\n c=ssl.create_default_context(); c.check_hostname=False; c.verify_mode=ssl.CERT_NONE; c.wrap_socket(s, server_hostname='localhost').connect(('127.0.0.1',28183)); sys.exit(0)\nexcept Exception:\n pass\ntry:\n s=socket.socket(); s.settimeout(5); s.connect(('127.0.0.1',28183)); s.close(); sys.exit(0)\nexcept Exception:\n sys.exit(1)",
]
interval: 10s
timeout: 10s
retries: 20
start_period: 60s
start_interval: 3s

joinmarket_ng_peer:
image: ghcr.io/joinmarket-ng/joinmarket-ng/jmwalletd:main
restart: unless-stopped
environment:
JOINMARKET_DATA_DIR: /root/.joinmarket-ng
JMWALLETD_HOST: 0.0.0.0
JMWALLETD_NO_TLS: ${JMWALLETD_NO_TLS:-false}
BITCOIN__BACKEND_TYPE: descriptor_wallet
BITCOIN__RPC_URL: http://bitcoind:43782
BITCOIN__RPC_USER: regtest
BITCOIN__RPC_PASSWORD: regtest
NETWORK_CONFIG__NETWORK: testnet
NETWORK_CONFIG__BITCOIN_NETWORK: regtest
NETWORK_CONFIG__DIRECTORY_SERVERS: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
DIRECTORY_NODES: ${JM_ALL_DIRECTORY_NODES:?You must set the directory node addresses in generated env file}
OBWATCH_URL: http://joinmarket_ng_orderbook_watcher:8000
TOR__SOCKS_HOST: tor
TOR__SOCKS_PORT: 9050
TOR__CONTROL_HOST: tor
TOR__CONTROL_PORT: 9051
TOR__COOKIE_PATH: /var/lib/tor/control_auth_cookie
TAKER__MINIMUM_MAKERS: 1 # necessary to do coinjoins with this regtest setup
expose:
- 8000 # obwatch
- 28183 # jmwalletd api
- 28283 # jmwalletd websocket
healthcheck:
test: [ "CMD", "dinitctl", "status", "jmwalletd" ]
test:
[
'CMD',
'python',
'-c',
"import socket,ssl,sys; s=socket.socket(); s.settimeout(5);\ntry:\n c=ssl.create_default_context(); c.check_hostname=False; c.verify_mode=ssl.CERT_NONE; c.wrap_socket(s, server_hostname='localhost').connect(('127.0.0.1',28183)); sys.exit(0)\nexcept Exception:\n pass\ntry:\n s=socket.socket(); s.settimeout(5); s.connect(('127.0.0.1',28183)); s.close(); sys.exit(0)\nexcept Exception:\n sys.exit(1)",
]
interval: 10s
timeout: 10s
retries: 20
Expand Down
Loading
Loading