mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 19:02:01 +01:00
Fix Monero development environment with wallet load (#6066)
This commit is contained in:
parent
14113f9468
commit
5c2ff32842
7 changed files with 100 additions and 4 deletions
|
@ -310,6 +310,7 @@ services:
|
||||||
- "tor_datadir:/home/tor/.tor"
|
- "tor_datadir:/home/tor/.tor"
|
||||||
- "torrcdir:/usr/local/etc/tor"
|
- "torrcdir:/usr/local/etc/tor"
|
||||||
- "tor_servicesdir:/var/lib/tor/hidden_services"
|
- "tor_servicesdir:/var/lib/tor/hidden_services"
|
||||||
|
|
||||||
monerod:
|
monerod:
|
||||||
image: btcpayserver/monero:0.18.3.3
|
image: btcpayserver/monero:0.18.3.3
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -319,6 +320,7 @@ services:
|
||||||
- "monero_data:/home/monero/.bitmonero"
|
- "monero_data:/home/monero/.bitmonero"
|
||||||
ports:
|
ports:
|
||||||
- "18081:18081"
|
- "18081:18081"
|
||||||
|
|
||||||
monero_wallet:
|
monero_wallet:
|
||||||
image: btcpayserver/monero:0.18.3.3
|
image: btcpayserver/monero:0.18.3.3
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -330,6 +332,7 @@ services:
|
||||||
- "./monero_wallet:/wallet"
|
- "./monero_wallet:/wallet"
|
||||||
depends_on:
|
depends_on:
|
||||||
- monerod
|
- monerod
|
||||||
|
|
||||||
litecoind:
|
litecoind:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: btcpayserver/litecoin:0.18.1
|
image: btcpayserver/litecoin:0.18.1
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace BTCPayServer.Services.Altcoins.Monero.RPC.Models
|
||||||
|
{
|
||||||
|
public partial class OpenWalletErrorResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("code")] public int Code { get; set; }
|
||||||
|
[JsonProperty("message")] public string Message { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace BTCPayServer.Services.Altcoins.Monero.RPC.Models
|
||||||
|
{
|
||||||
|
public partial class OpenWalletRequest
|
||||||
|
{
|
||||||
|
[JsonProperty("filename")] public string Filename { get; set; }
|
||||||
|
[JsonProperty("password")] public string Password { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace BTCPayServer.Services.Altcoins.Monero.RPC.Models
|
||||||
|
{
|
||||||
|
public partial class OpenWalletResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("id")] public string Id { get; set; }
|
||||||
|
[JsonProperty("jsonrpc")] public string Jsonrpc { get; set; }
|
||||||
|
[JsonProperty("result")] public object Result { get; set; }
|
||||||
|
[JsonProperty("error")] public OpenWalletErrorResponse Error { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -70,6 +70,47 @@
|
||||||
},
|
},
|
||||||
"applicationUrl": "https://localhost:14142/"
|
"applicationUrl": "https://localhost:14142/"
|
||||||
},
|
},
|
||||||
|
"Altcoins": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"BTCPAY_EXPERIMENTALV2_CONFIRM": "true",
|
||||||
|
"BTCPAY_NETWORK": "regtest",
|
||||||
|
"BTCPAY_LAUNCHSETTINGS": "true",
|
||||||
|
"BTCPAY_PORT": "14142",
|
||||||
|
"BTCPAY_HttpsUseDefaultCertificate": "true",
|
||||||
|
"BTCPAY_VERBOSE": "true",
|
||||||
|
"BTCPAY_LTCEXPLORERURL": "http://127.0.0.1:32838/",
|
||||||
|
"BTCPAY_LBTCEXPLORERURL": "http://127.0.0.1:32838/",
|
||||||
|
"BTCPAY_BTCLIGHTNING": "type=clightning;server=tcp://127.0.0.1:30993/",
|
||||||
|
"BTCPAY_BTCEXTERNALLNDREST": "type=lnd-rest;server=http://lnd:lnd@127.0.0.1:35531/;allowinsecure=true",
|
||||||
|
"BTCPAY_BTCEXTERNALLNDSEEDBACKUP": "../BTCPayServer.Tests/TestData/LndSeedBackup/walletunlock.json",
|
||||||
|
"BTCPAY_BTCEXTERNALSPARK": "server=/spark/btc/;cookiefile=fake",
|
||||||
|
"BTCPAY_BTCEXTERNALCHARGE": "server=https://127.0.0.1:53280/mycharge/btc/;cookiefilepath=fake",
|
||||||
|
"BTCPAY_BTCEXTERNALRTL": "server=/rtl/api/authenticate/cookie;cookiefile=fake",
|
||||||
|
"BTCPAY_BTCEXTERNALTHUNDERHUB": "server=/thub/sso;cookiefile=fake",
|
||||||
|
"BTCPAY_BTCEXTERNALTORQ": "server=/torq/cookie-login;cookiefile=fake",
|
||||||
|
"BTCPAY_EXTERNALSERVICES": "totoservice:totolink;Lightning Terminal:/lit/;",
|
||||||
|
"BTCPAY_EXTERNALCONFIGURATOR": "passwordfile=testpwd;server=/configurator",
|
||||||
|
"BTCPAY_BTCEXPLORERURL": "http://127.0.0.1:32838/",
|
||||||
|
"BTCPAY_ALLOW-ADMIN-REGISTRATION": "true",
|
||||||
|
"BTCPAY_DISABLE-REGISTRATION": "false",
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
|
"BTCPAY_CHAINS": "btc,ltc,lbtc,xmr",
|
||||||
|
"BTCPAY_POSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
||||||
|
"BTCPAY_DEBUGLOG": "debug.log",
|
||||||
|
"BTCPAY_TORRCFILE": "../BTCPayServer.Tests/TestData/Tor/torrc",
|
||||||
|
"BTCPAY_SOCKSENDPOINT": "localhost:9050",
|
||||||
|
"BTCPAY_DOCKERDEPLOYMENT": "true",
|
||||||
|
"BTCPAY_RECOMMENDED-PLUGINS": "",
|
||||||
|
"BTCPAY_CHEATMODE": "true",
|
||||||
|
"BTCPAY_EXPLORERPOSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=nbxplorer",
|
||||||
|
"BTCPAY_XMR_DAEMON_URI": "http://127.0.0.1:18081",
|
||||||
|
"BTCPAY_XMR_WALLET_DAEMON_URI": "http://127.0.0.1:18082",
|
||||||
|
"BTCPAY_XMR_WALLET_DAEMON_WALLETDIR": "/path/to/monero_wallet"
|
||||||
|
},
|
||||||
|
"applicationUrl": "https://localhost:14142/"
|
||||||
|
},
|
||||||
"Altcoins-HTTPS": {
|
"Altcoins-HTTPS": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
|
@ -95,7 +136,7 @@
|
||||||
"BTCPAY_ALLOW-ADMIN-REGISTRATION": "true",
|
"BTCPAY_ALLOW-ADMIN-REGISTRATION": "true",
|
||||||
"BTCPAY_DISABLE-REGISTRATION": "false",
|
"BTCPAY_DISABLE-REGISTRATION": "false",
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"BTCPAY_CHAINS": "btc,ltc,lbtc",
|
"BTCPAY_CHAINS": "btc,ltc,lbtc,xmr",
|
||||||
"BTCPAY_POSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
"BTCPAY_POSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
||||||
"BTCPAY_SSHCONNECTION": "root@127.0.0.1:21622",
|
"BTCPAY_SSHCONNECTION": "root@127.0.0.1:21622",
|
||||||
"BTCPAY_SSHPASSWORD": "opD3i2282D",
|
"BTCPAY_SSHPASSWORD": "opD3i2282D",
|
||||||
|
@ -105,7 +146,10 @@
|
||||||
"BTCPAY_DOCKERDEPLOYMENT": "true",
|
"BTCPAY_DOCKERDEPLOYMENT": "true",
|
||||||
"BTCPAY_RECOMMENDED-PLUGINS": "",
|
"BTCPAY_RECOMMENDED-PLUGINS": "",
|
||||||
"BTCPAY_CHEATMODE": "true",
|
"BTCPAY_CHEATMODE": "true",
|
||||||
"BTCPAY_EXPLORERPOSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=nbxplorer"
|
"BTCPAY_EXPLORERPOSTGRES": "User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=39372;Database=nbxplorer",
|
||||||
|
"BTCPAY_XMR_DAEMON_URI": "http://127.0.0.1:18081",
|
||||||
|
"BTCPAY_XMR_WALLET_DAEMON_URI": "http://127.0.0.1:18082",
|
||||||
|
"BTCPAY_XMR_WALLET_DAEMON_WALLETDIR": "/path/to/monero_wallet"
|
||||||
},
|
},
|
||||||
"applicationUrl": "https://localhost:14142/"
|
"applicationUrl": "https://localhost:14142/"
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,10 +249,28 @@ namespace BTCPayServer.Services.Altcoins.Monero.UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = await _MoneroRpcProvider.WalletRpcClients[cryptoCode].SendCommandAsync<OpenWalletRequest, OpenWalletResponse>("open_wallet", new OpenWalletRequest
|
||||||
|
{
|
||||||
|
Filename = "wallet",
|
||||||
|
Password = viewModel.WalletPassword
|
||||||
|
});
|
||||||
|
if (response?.Error != null)
|
||||||
|
{
|
||||||
|
throw new Exception(response.Error.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ModelState.AddModelError(nameof(viewModel.AccountIndex), $"Could not open the wallet: {ex.Message}");
|
||||||
|
return View(viewModel);
|
||||||
|
}
|
||||||
|
|
||||||
return RedirectToAction(nameof(GetStoreMoneroLikePaymentMethod), new
|
return RedirectToAction(nameof(GetStoreMoneroLikePaymentMethod), new
|
||||||
{
|
{
|
||||||
cryptoCode,
|
cryptoCode,
|
||||||
StatusMessage = "View-only wallet files uploaded. If they are valid the wallet will soon become available."
|
StatusMessage = "View-only wallet files uploaded. The wallet will soon become available."
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
@model BTCPayServer.Services.Altcoins.Monero.UI.UIMoneroLikeStoreController.MoneroLikePaymentMethodListViewModel
|
@model BTCPayServer.Services.Altcoins.Monero.UI.UIMoneroLikeStoreController.MoneroLikePaymentMethodListViewModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
|
||||||
ViewData.SetActivePage("Monero Settings", "Monero Settings", "Monero Settings");
|
ViewData.SetActivePage("Monero Settings", "Monero Settings", "Monero Settings");
|
||||||
ViewData["NavPartialName"] = "../UIStores/_Nav";
|
ViewData["NavPartialName"] = "../UIStores/_Nav";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue