Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"POSTGRES_CONNECTIONSTRING": "Host=127.0.0.1;Port=5432;Database=nodeguard;Username=rw_dev;Password=rw_dev",
"POSTGRES_CONNECTIONSTRING": "Host=127.0.0.1;Port=25432;Database=nodeguard;Username=rw_dev;Password=rw_dev",
"BITCOIN_NETWORK": "REGTEST",
"MAXIMUM_WITHDRAWAL_BTC_AMOUNT": "21000000",
"NBXPLORER_ENABLE_CUSTOM_BACKEND": "true",
Expand Down
27 changes: 17 additions & 10 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.4'
version: "3.4"

name: nodeguard
services:
Expand All @@ -22,12 +22,16 @@ services:
platform: linux/amd64
hostname: nbxplorer
ports:
- "32838:32838"
- "32838:32838"
depends_on:
- nbxplorer_postgres
environment:
NBXPLORER_NETWORK: regtest
NBXPLORER_BIND: 0.0.0.0:32838
NBXPLORER_TRIMEVENTS: 10000
NBXPLORER_SIGNALFILESDIR: /datadir
#Keeping dbtrie for dev until it is fully removed since we would need to modify nbxplorer docker image to wait for the db to be ready
NBXPLORER_DBTRIE: 0
NBXPLORER_POSTGRES: Host=nbxplorer_postgres;Port=5432;Database=nbxplorer;Username=rw_dev;Password=rw_dev
NBXPLORER_CHAINS: "btc"
NBXPLORER_BTCRPCUSER: "polaruser"
Expand All @@ -36,7 +40,7 @@ services:
NBXPLORER_BTCNODEENDPOINT: host.docker.internal:19444
command: ["--noauth"]
volumes:
- "bitcoin_datadir:/root/.bitcoin"
- "bitcoin_datadir:/root/.bitcoin"

nbxplorer_postgres:
container_name: nbxplorer_postgres
Expand All @@ -51,12 +55,15 @@ services:
- nbxplorer_postgres_data:/var/lib/postgresql/data
ports:
- 35432:5432


healthcheck:
test: ["CMD", "pg_isready", "-U", "rw_dev"]
interval: 10s
timeout: 5s
retries: 5

volumes:
nodeguard_postgres_data:
bitcoin_datadir:
nbxplorer_datadir:
nbxplorer_postgres_data:
nodeguard_data_keys_dir:
nodeguard_postgres_data:
bitcoin_datadir:
nbxplorer_datadir:
nbxplorer_postgres_data:
nodeguard_data_keys_dir:
1 change: 1 addition & 0 deletions src/Proto/nodeguard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ message Utxo {
int64 amount = 1;
string outpoint = 2;
string address = 3;
int64 walletId = 4;
}

message GetUtxosResponse {
Expand Down
8 changes: 5 additions & 3 deletions src/Rpc/NodeGuardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public override async Task<RequestWithdrawalResponse> RequestWithdrawal(RequestW
throw new RpcException(new Status(StatusCode.Internal, "Derivation strategy not found"));

utxos = await _coinSelectionService.GetUTXOsByOutpointAsync(derivationStrategyBase, outpoints);

}

// Create destination objects for the withdrawal request
Expand Down Expand Up @@ -963,13 +963,15 @@ public override async Task<GetUtxosResponse> GetUtxos(GetUtxosRequest request, S
{
Amount = (Money)utxo.Value,
Outpoint = utxo.Outpoint.ToString(),
Address = utxo.Address.ToString()
Address = utxo.Address.ToString(),
WalletId = wallet.Id
}));
unconfirmed.AddRange(walletUtxos.Unconfirmed.UTXOs.Select(utxo => new Utxo()
{
Amount = (Money)utxo.Value,
Outpoint = utxo.Outpoint.ToString(),
Address = utxo.Address.ToString()
Address = utxo.Address.ToString(),
WalletId = wallet.Id
}));
}

Expand Down
Loading