Skip to content

Commit 6ce4332

Browse files
committed
Add wallet api rpc support
1 parent 14ac9c8 commit 6ce4332

File tree

10 files changed

+69
-84
lines changed

10 files changed

+69
-84
lines changed

Connector/xmr/rpcschemas/getaddressbalance_request.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

Connector/xmr/rpcschemas/getaddressbalance_response.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

Connector/xmr/rpcschemas/getaddressesbalance_request.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

Connector/xmr/rpcschemas/getaddressesbalance_response.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

docker-compose/testnet/xmr.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ services:
88
- ${BLOCKCHAIN_PATH}/bitmonero:/home/monero/.bitmonero
99
user: "${UID}:${GID}"
1010

11+
wallet:
12+
build: ../../packages/nodechain-monero-wallet
13+
image: monero-wallet
14+
command: --daemon-address=monerod:38081 --stagenet --disable-rpc-login --trusted-daemon --rpc-bind-port=38088 --non-interactive
15+
volumes:
16+
- ${BLOCKCHAIN_PATH}/bitmonero:/home/monero/.bitmonero
17+
depends_on:
18+
- monerod
19+
ports:
20+
- "60000:38088"
21+
1122
connector:
1223
build: ../../Connector
1324
environment:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
FROM ubuntu:latest
3+
# Create a user if required
4+
RUN useradd -r monero
5+
# Setup and cleanup of the packages required
6+
RUN apt-get update \
7+
&& apt-get install -y wget \
8+
&& rm -rf /var/lib/apt/lists/*
9+
# Declare the environment variables (version, path, data-dir etc)
10+
ENV MONERO_VERSION=0.17.2.3
11+
ENV MONERO_DATA=/home/monero/.bitmonero
12+
# Get the compiled binaries and extract them
13+
RUN wget https://dlsrc.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2
14+
RUN tar -xf *.tar.bz2 -C /opt
15+
# Cleanup the workspace
16+
RUN rm *.tar.bz2
17+
# Append the bin folder to the %PATH%
18+
ENV PATH=/opt/monero-x86_64-linux-gnu-v${MONERO_VERSION}:$PATH
19+
# Mount volume
20+
VOLUME ["/home/monero/.bitmonero"]
21+
# Expose required ports (both testnet & mainnet)
22+
EXPOSE 18088 28088 38088
23+
24+
COPY swapper-stagenet swapper
25+
COPY swapper-stagenet.keys swapper.keys
26+
# Copy and define the entrypoint
27+
COPY entrypoint.sh ./entrypoint.sh
28+
ENTRYPOINT ["sh", "/entrypoint.sh"]
29+
# Define the default command
30+
CMD ["monero-wallet-rpc"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ $(echo "$1" | cut -c1) = "-" ]; then
5+
echo "$0: assuming arguments for monero-wallet-rpc"
6+
7+
set -- monero-wallet-rpc "$@"
8+
fi
9+
10+
11+
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "monero-wallet-rpc" ]; then
12+
mkdir -p "$MONERO_DATA"
13+
chmod 700 "$MONERO_DATA"
14+
chown -R monero "$MONERO_DATA"
15+
mv swapper "$MONERO_DATA/swapper"
16+
mv swapper.keys "$MONERO_DATA/swapper.keys"
17+
18+
echo "$0: setting data directory to $MONERO_DATA"
19+
20+
set -- "$@" --log-file="$MONERO_DATA/debug.log" --wallet-file="$MONERO_DATA/swapper" --password="swapper"
21+
fi
22+
23+
echo
24+
exec "$@"
Binary file not shown.
Binary file not shown.

packages/nodechain-monerod/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ COPY --chown=monero:monero --from=build /root/monerod /home/monero/monerod
2424

2525
VOLUME /home/monero/.bitmonero
2626

27-
EXPOSE 18080 18081 38080 38081
27+
EXPOSE 18080 18081 18082 38080 38081
2828

2929

3030
COPY --chown=monero:monero entrypoint.sh ./entrypoint.sh
3131
RUN chmod +x entrypoint.sh
3232
ENTRYPOINT ["/home/monero/entrypoint.sh"]
3333

34-
ENTRYPOINT ["./monerod"]
34+
ENTRYPOINT ["./monerod"]
35+
36+
CMD ["monero-wallet-rpc"]

0 commit comments

Comments
 (0)