Skip to content
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

Joinmarket emulator #5

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ The fields are as follows:
- `anon_score_target` is the target anon score of the wallet.
- `redcoin_isolation` is a boolean value indicating whether the wallet should use redcoin isolation.

## Engine
You can run the simulation with different CoinJoin protocols. Currently, Wasabi and Joinmarket are supported.
The default protocol is Wasabi. To run the simulation with Joinmarket, use the `--engine joinmarket` option.


## Advanced usage

Expand Down
4 changes: 2 additions & 2 deletions containers/btc-node/mine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ fi
while true
do
sleep $(($RANDOM % 60 + 30))
ADDR=$(curl -s -u user:password --data-binary '{"jsonrpc": "2.0", "method": "getnewaddress", "params": ["wallet"]}' -H 'content-type: text/plain;' http://localhost:18443 | jq -r '.result')
curl -s -u user:password --data-binary "{\"jsonrpc\": \"2.0\", \"method\": \"generatetoaddress\", \"params\": [1, \"$ADDR\"]}" -H 'content-type: text/plain;' http://localhost:18443 > /dev/null
ADDR=$(curl -s -u user:password --data-binary '{"jsonrpc": "2.0", "method": "getnewaddress", "params": ["wallet"]}' -H 'content-type: text/plain;' http://localhost:18443/wallet/wallet | jq -r '.result')
curl -s -u user:password --data-binary "{\"jsonrpc\": \"2.0\", \"method\": \"generatetoaddress\", \"params\": [1, \"$ADDR\"]}" -H 'content-type: text/plain;' http://localhost:18443> /dev/null
done
3 changes: 3 additions & 0 deletions containers/irc-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM inspircd/inspircd-docker:latest

COPY inspircd.conf /inspircd/conf/inspircd.conf
46 changes: 46 additions & 0 deletions containers/irc-server/inspircd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<server name="irc.example.com" description="JoinMarket IRC Server" id="1AB">
<admin name="Admin" email="[email protected]" nick="admin">

# Bindings
<bind address="*" port="6667" type="clients">
# Uncomment the following lines if you want SSL support
#
# <bind address="*" port="6697" type="clients" ssl="openssl">

# Logging
<log method="file" type="*" level="rawio" target="/inspircd/logs/inspircd.log">

# Modules
#<module name="m_whois.so">
<module name="m_ircv3.so">
# <module name="m_autojoin.so">
# Include other necessary modules
# For SSL support, include the SSL module
#
# <module name="m_ssl_openssl.so">

# Autojoin Channel Configuration
<autojoin channel="#joinmarket-pit" key="" modes="+nt">

# Channel Configuration
<channel name="#joinmarket-pit" modes="+nt">

# You can set channel-specific settings here
# Example: Set the channel topic
# <topic setby="admin" time="0">Welcome to the JoinMarket Pit!</topic>

# Class Configuration
<class name="clients" pingfreq="90" maxclients="500" sendq="262144" recvq="8192">

<type name="NetAdmin">

# Oper Configuration
<oper name="oper" password="password" host="*" type="NetAdmin">


# Security and Limits
<connect allow="*" timeout="60" flood="20" threshold="1" pingfreq="90" recvq="8192" softsendq="512" fakelag="Yes">

# Other configurations as needed
<options suffixquit="Quit message">

26 changes: 26 additions & 0 deletions containers/joinmarket-client-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM joinmarket-test


# Copy the config file to the right place

# Starts the RPC server
# RUN python3 /jm/clientserver/scripts/jmwalletd.py

RUN useradd -ms /bin/sh joinmarket
USER 1000:1000

# Create the SSL directory and generate the SSL certificates
RUN mkdir -p /home/joinmarket/.joinmarket/ssl \
&& openssl req -newkey rsa:2048 -nodes -keyout /home/joinmarket/.joinmarket/ssl/key.pem \
-x509 -days 365 -out /home/joinmarket/.joinmarket/ssl/cert.pem -subj "/C=US/ST=State/L=City/O=Organization/OU=Unit/CN=localhost"

# Generates the empty wallet, so we can place the config there
RUN python3 /jm/clientserver/scripts/wallet-tool.py generate; exit 0

COPY --chown=joinmarket:joinmarket run.sh /home/joinmarket/
COPY --chown=joinmarket:joinmarket joinmarket.cfg /home/joinmarket/.joinmarket/
RUN chmod +x /home/joinmarket/run.sh
WORKDIR /home/joinmarket

CMD ["./run.sh"]

Loading