From 0375184ebcb4faf2bbe5c50be9ee72e284e120cd Mon Sep 17 00:00:00 2001
From: Andrew Camilleri <evilkukka@gmail.com>
Date: Thu, 3 Oct 2019 06:04:39 +0200
Subject: [PATCH] xmr (#203)

* add monero

* fix fragment

* fix image for monero

* fix volume mapping

* fix container name

* prune monero

* use newer monero image

* fix notifier execution args

* add compat flag to docker-compose up

* restrict monero to 1gb ram

* fix compat flag location

* fix links

* fix notifier call

* fix

* fix

* fix

* fix

* fix wallet

* remove testnet flag

* remove docker swarm compatibility flags
---
 .../docker-fragments/monero.yml               | 34 +++++++++++++++++++
 .../src/CryptoDefinition.cs                   |  5 +++
 2 files changed, 39 insertions(+)
 create mode 100644 docker-compose-generator/docker-fragments/monero.yml

diff --git a/docker-compose-generator/docker-fragments/monero.yml b/docker-compose-generator/docker-fragments/monero.yml
new file mode 100644
index 0000000..e1e29ca
--- /dev/null
+++ b/docker-compose-generator/docker-fragments/monero.yml
@@ -0,0 +1,34 @@
+version: "3"
+
+services:
+  monerod:
+    restart: unless-stopped
+    container_name: btcpayserver_monerod
+    image: kukks/monero:v0.14.1.2
+    entrypoint: monerod --rpc-bind-ip=0.0.0.0 --confirm-external-bind --rpc-bind-port=18081 --non-interactive --block-notify="/bin/sh ./scripts/notifier.sh -X GET http://btcpayserver:49392/monerolikedaemoncallback/block?cryptoCode=xmr&hash=%s" --hide-my-port --prune-blockchain
+    expose:
+      - "18081"
+    volumes:
+      - "xmr_data:/home/monero/.bitmonero"
+  monerod_wallet:
+    restart: unless-stopped
+    container_name: btcpayserver_monero_wallet
+    image: kukks/monero:v0.14.1.2
+    entrypoint: monero-wallet-rpc --rpc-bind-ip=0.0.0.0 --disable-rpc-login --confirm-external-bind --rpc-bind-port=18082 --non-interactive --trusted-daemon  --daemon-address=monerod:18081 --wallet-file=/wallet/wallet --password-file=/wallet/password --tx-notify="/bin/sh ./scripts/notifier.sh  -X GET http://btcpayserver:49392/monerolikedaemoncallback/tx?cryptoCode=xmr&hash=%s"
+    expose:
+      - "18082"
+    volumes:
+      - "xmr_wallet:/wallet"
+    depends_on:
+      - monerod
+  btcpayserver:
+    environment:
+      BTCPAY_CHAINS: "xmr"
+      BTCPAY_XMR_DAEMON_URI: http://monerod:18081
+      BTCPAY_XMR_WALLET_DAEMON_URI: http://monerod_wallet:18082
+      BTCPAY_XMR_WALLET_DAEMON_WALLETDIR: /root/xmr_wallet
+    volumes:
+      - "xmr_wallet:/root/xmr_wallet"
+volumes:
+  xmr_wallet:
+  xmr_data:
\ No newline at end of file
diff --git a/docker-compose-generator/src/CryptoDefinition.cs b/docker-compose-generator/src/CryptoDefinition.cs
index ef99dea..8f4486c 100644
--- a/docker-compose-generator/src/CryptoDefinition.cs
+++ b/docker-compose-generator/src/CryptoDefinition.cs
@@ -86,6 +86,11 @@ namespace DockerGenerator
                 {
                     Crypto = "mona",
                     CryptoFragment = "monacoin"
+                },
+                new CryptoDefinition()
+                {
+	                Crypto = "xmr",
+	                CryptoFragment = "monero"
                 }
             };
         }