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

Add monero support #61

Merged
merged 24 commits into from
Nov 25, 2024
Merged

Add monero support #61

merged 24 commits into from
Nov 25, 2024

Conversation

elvece
Copy link
Member

@elvece elvece commented Apr 9, 2024

@elvece elvece changed the title base setup for monero Add monero support Apr 9, 2024
@gStart9
Copy link
Member

gStart9 commented Oct 9, 2024

We are so, so close. One thing I found is if I disable Monero's RPC username/password in config, that change is not reflected here:

cat /datadir/start9/config.yaml 
lightning:
  type: c-lightning
altcoins:
  monero:
    status: enabled
    username: monero
    password: CrXvmz8aJvGLjTgdR4MhwA
advanced:
  sync-start-height: -1

which affects how monero-wallet-rpc is built in the btcpay container and makes btcpay's wallet rpc fail. If monero disables it, can you blank the user/pass on config.yaml's altcoins.monero? Then we could probably even get rid of the requirement that credentials be enabled in monero's startos config, because monero itself and monero-wallet-rpc both don't care whether there's a password or not. Alternatively, we could not store this in the btcpay config and always look at /mnt/monerod/start9/config.yaml since it should be mounted if monero integration is turned on in btcpay.

@elvece
Copy link
Member Author

elvece commented Oct 31, 2024

We are so, so close. One thing I found is if I disable Monero's RPC username/password in config, that change is not reflected here:

cat /datadir/start9/config.yaml 
lightning:
  type: c-lightning
altcoins:
  monero:
    status: enabled
    username: monero
    password: CrXvmz8aJvGLjTgdR4MhwA
advanced:
  sync-start-height: -1

which affects how monero-wallet-rpc is built in the btcpay container and makes btcpay's wallet rpc fail. If monero disables it, can you blank the user/pass on config.yaml's altcoins.monero? Then we could probably even get rid of the requirement that credentials be enabled in monero's startos config, because monero itself and monero-wallet-rpc both don't care whether there's a password or not. Alternatively, we could not store this in the btcpay config and always look at /mnt/monerod/start9/config.yaml since it should be mounted if monero integration is turned on in btcpay.

This has now been implemented and tested! Solution was to look at mounted monerod's config since we cannot optionally remove pointers for a case like this.

@elvece elvece marked this pull request as ready for review October 31, 2024 02:19
@gStart9
Copy link
Member

gStart9 commented Oct 31, 2024

I seem to have an issue building it:

$ make
Building package for aarch64...
mkdir -p docker-images
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform=linux/arm64/v8 --tag start9/btcpayserver/main:2.0.0.1 --build-arg ARCH=aarch64 --build-arg PLATFORM=arm64 -o type=docker,dest=docker-images/aarch64.tar -f ./Dockerfile .
[+] Building 12.9s (18/43)                                                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                                                   0.0s
 => => transferring dockerfile: 4.86kB                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/btcpayserver/btcpayserver:2.0.0-altcoins                                                                                                    0.4s
 => [internal] load metadata for docker.io/nicolasdorier/nbxplorer:2.5.9                                                                                                               0.4s
 => [internal] load metadata for docker.io/btcpayserver/monero:0.18.3.3                                                                                                                0.4s
 => [internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim                                                                                                        0.1s
 => [internal] load .dockerignore                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                        0.0s
 => [internal] load build context                                                                                                                                                      0.1s
 => => transferring context: 171.68kB                                                                                                                                                  0.1s
 => CACHED https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-aarch64.tar.xz                                                                          0.3s
 => CACHED https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-noarch.tar.xz                                                                           0.3s
 => CACHED [monero-wallet-rpc 1/1] FROM docker.io/btcpayserver/monero:0.18.3.3@sha256:f8a5a1ef40a8475caa47832e4a52419ea44864c4165db38fcf1dae8b1b81e17c                                 0.1s
 => => resolve docker.io/btcpayserver/monero:0.18.3.3@sha256:f8a5a1ef40a8475caa47832e4a52419ea44864c4165db38fcf1dae8b1b81e17c                                                          0.0s
 => [stage-3  1/25] FROM docker.io/btcpayserver/btcpayserver:2.0.0-altcoins@sha256:551c509b0ee2791a5ef2587ab420bf8489a85ceaaaa490572cc0ea17fcb8e62d                                    0.1s
 => => resolve docker.io/btcpayserver/btcpayserver:2.0.0-altcoins@sha256:551c509b0ee2791a5ef2587ab420bf8489a85ceaaaa490572cc0ea17fcb8e62d                                              0.0s
 => [nbx-builder 1/1] FROM docker.io/nicolasdorier/nbxplorer:2.5.9@sha256:d355391de5f1ad41034d63e5df7b258df4e9d0e8cfd15171adb59a54bd398c27                                             0.0s
 => => resolve docker.io/nicolasdorier/nbxplorer:2.5.9@sha256:d355391de5f1ad41034d63e5df7b258df4e9d0e8cfd15171adb59a54bd398c27                                                         0.0s
 => CACHED https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-symlinks-arch.tar.xz                                                                    0.3s
 => [actions-builder 1/6] FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim@sha256:cab0284cce7bc26d41055d0ac5859a69a8b75d9a201cd226999f4f00cc983f13                                  0.1s
 => => resolve mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim@sha256:cab0284cce7bc26d41055d0ac5859a69a8b75d9a201cd226999f4f00cc983f13                                                  0.0s
 => CACHED [stage-3  2/25] COPY --from=nbx-builder /app /nbxplorer                                                                                                                     0.0s
 => CACHED [actions-builder 2/6] WORKDIR /actions                                                                                                                                      0.0s
 => [actions-builder 3/6] COPY . .                                                                                                                                                     4.0s
 => ERROR [actions-builder 4/6] RUN dotnet restore "utils/actions/actions.csproj" -a arm64                                                                                             7.0s
------
 > [actions-builder 4/6] RUN dotnet restore "utils/actions/actions.csproj" -a arm64:
#0 6.186 /usr/share/dotnet/sdk/8.0.403/Sdks/Microsoft.NET.Sdk.Web/Sdk/Sdk.props(18,50): error MSB4184: The expression "[MSBuild]::GetTargetPlatformIdentifier('')" cannot be evaluated. Exception has been thrown by the target of an invocation. [/actions/utils/actions/actions.csproj]
------
Dockerfile:9
--------------------
   7 |     WORKDIR /actions
   8 |     COPY . .
   9 | >>> RUN dotnet restore "utils/actions/actions.csproj" -a $TARGETARCH
  10 |     WORKDIR "/actions"
  11 |     RUN dotnet build "utils/actions/actions.csproj" -c Release -a $TARGETARCH -o /actions/build
--------------------
ERROR: failed to solve: process "/bin/sh -c dotnet restore \"utils/actions/actions.csproj\" -a $TARGETARCH" did not complete successfully: exit code: 1
make: *** [Makefile:64: docker-images/aarch64.tar] Error 1
make: *** Deleting file 'docker-images/aarch64.tar'

I had just done the qemu raindance so I don't think that's the problem.

Dockerfile Outdated
@@ -10,7 +10,7 @@ RUN dotnet restore "utils/actions/actions.csproj" -a $TARGETARCH
WORKDIR "/actions"
RUN dotnet build "utils/actions/actions.csproj" -c Release -a $TARGETARCH -o /actions/build

FROM --platform=$BUILDPLATFORM btcpayserver/btcpayserver:1.13.5-altcoins
FROM --platform=$BUILDPLATFORM btcpayserver/btcpayserver:2.0.0-altcoins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bug in btcpayserver:2.0.0-altcoins perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, i changed something in the build, working on it

@elvece elvece linked an issue Oct 31, 2024 that may be closed by this pull request
1 task
@gStart9
Copy link
Member

gStart9 commented Oct 31, 2024

Awesome! Seems to work great!

@elvece elvece linked an issue Nov 1, 2024 that may be closed by this pull request
1 task
@elvece
Copy link
Member Author

elvece commented Nov 3, 2024

In further testing, came across a few bugs on a fresh setup with the wallet, I've resolved all but one, expressing as this log for the wallet rpc. It seems to be connected fine, but the error is concerning and I don't recall it previously existing:
E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon

@elvece
Copy link
Member Author

elvece commented Nov 20, 2024

In further testing, came across a few bugs on a fresh setup with the wallet, I've resolved all but one, expressing as this log for the wallet rpc. It seems to be connected fine, but the error is concerning and I don't recall it previously existing: E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon

This persists on occasion in the monero wallet rpc logs, but it does not impact functionality at all.

@gStart9
Copy link
Member

gStart9 commented Nov 20, 2024

Can confirm, it was doing that on mine too. I'm not sure why exactly, it's as if the monero-wallet-rpc periodically loses contact with the monero daemon running in the monero container. But as you state, it doesn't seem to actually affect anything. Maybe it will be better in v036, but for now I'm not sure there's anything to do.

I made a script to query the monero daemon from the btcpay container to try and just confirm that that's what's happening by seeing if the times when it is unavailable match up with what's in the btcpay log. I'll share the results here.

@elvece elvece merged commit 09ff6d6 into master Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat]: upload plugins > 1 MB [feat]: Enable Monero XMR payments on BTCPay Server
2 participants