Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e458fa9a61 | ||
|
|
6953b59032 | ||
|
|
c27fa064bd | ||
|
|
a63147588c |
@ -1,4 +1,4 @@
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.301-noble AS builder
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.202-noble AS builder
|
||||
WORKDIR /source
|
||||
COPY NBXplorer/NBXplorer.csproj NBXplorer/NBXplorer.csproj
|
||||
COPY NBXplorer.Client/NBXplorer.Client.csproj NBXplorer.Client/NBXplorer.Client.csproj
|
||||
@ -8,14 +8,12 @@ COPY . .
|
||||
RUN cd NBXplorer && \
|
||||
dotnet publish --output /app/ --configuration Release
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0.9-noble
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0.6-noble
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /datadir
|
||||
ENV NBXPLORER_DATADIR=/datadir
|
||||
VOLUME /datadir
|
||||
|
||||
COPY --from=builder "/app" .
|
||||
ENTRYPOINT ["dotnet", "NBXplorer.dll"]
|
||||
ENTRYPOINT ["dotnet", "NBXplorer.dll"]
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NBXplorer.Models
|
||||
@ -15,7 +14,6 @@ namespace NBXplorer.Models
|
||||
[JsonConverter(typeof(NBXplorer.JsonConverters.ScriptPubKeyTypeConverter))]
|
||||
public NBitcoin.ScriptPubKeyType? ScriptPubKeyType { get; set; }
|
||||
public string Passphrase { get; set; }
|
||||
[Obsolete("We will remove this feature in a future release.")]
|
||||
public bool ImportKeysToRPC { get; set; }
|
||||
public bool SavePrivateKeys { get; set; }
|
||||
public Dictionary<string, string> AdditionalOptions { get; set; }
|
||||
|
||||
@ -10,18 +10,6 @@ namespace NBXplorer.Models
|
||||
{
|
||||
public class TransactionMetadata
|
||||
{
|
||||
public class ChunkMetadata
|
||||
{
|
||||
[JsonProperty("fees", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(NBXplorer.JsonConverters.MoneyJsonConverter))]
|
||||
public Money Fees { get; set; }
|
||||
[JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public int Weight { get; set; }
|
||||
[JsonProperty("feeRate", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(NBitcoin.JsonConverters.FeeRateJsonConverter))]
|
||||
public FeeRate FeeRate { get; set; }
|
||||
}
|
||||
|
||||
[JsonProperty("vsize", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public int? VirtualSize { get; set; }
|
||||
[JsonProperty("fees", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
@ -30,10 +18,10 @@ namespace NBXplorer.Models
|
||||
[JsonProperty("feeRate", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(NBitcoin.JsonConverters.FeeRateJsonConverter))]
|
||||
public FeeRate FeeRate { get; set; }
|
||||
public ChunkMetadata Chunk { get; set; }
|
||||
public static TransactionMetadata Parse(string json) => JsonConvert.DeserializeObject<TransactionMetadata>(json);
|
||||
public string ToString(bool indented) => JsonConvert.SerializeObject(this, indented ? Formatting.Indented : Formatting.None);
|
||||
public override string ToString() => ToString(true);
|
||||
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, JToken> AdditionalData { get; set; } = new Dictionary<string, JToken>();
|
||||
}
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
<Description>Client API for the minimalist HD Wallet Tracker NBXplorer</Description>
|
||||
<PackageIcon>Bitcoin.png</PackageIcon>
|
||||
<PackageTags>bitcoin</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/btcpayserver/NBXplorer/</PackageProjectUrl>
|
||||
<PackageProjectUrl>https://github.com/dgarage/NBXplorer/</PackageProjectUrl>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/btcpayserver/NBXplorer</RepositoryUrl>
|
||||
<RepositoryUrl>https://github.com/dgarage/NBXplorer</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<LangVersion>12</LangVersion>
|
||||
@ -27,7 +27,7 @@
|
||||
<NoWarn>$(NoWarn);1591;1573;1572;1584;1570;3021</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NBitcoin" Version="10.0.6" />
|
||||
<PackageReference Include="NBitcoin" Version="10.0.1" />
|
||||
<PackageReference Include="NBitcoin.Altcoins" Version="6.0.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -37,7 +37,4 @@
|
||||
<None Include="..\README.md" Pack="true" PackagePath="\" />
|
||||
<None Include="Bitcoin.png" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.9" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0.301-noble AS builder
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0.202-noble AS builder
|
||||
WORKDIR /source
|
||||
COPY . .
|
||||
RUN cd NBXplorer.Tests && dotnet build
|
||||
|
||||
@ -11,9 +11,8 @@
|
||||
<EmbeddedResource Include="Scripts\generate-whale.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.9" />
|
||||
<PackageReference Include="NBitcoin.TestFramework" Version="5.0.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
|
||||
<PackageReference Include="NBitcoin.TestFramework" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
||||
@ -2197,6 +2197,15 @@ namespace NBXplorer.Tests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DoNothing()
|
||||
{
|
||||
using (var tester = CreateTester())
|
||||
{
|
||||
throw new Exception("Boom");
|
||||
}
|
||||
}
|
||||
|
||||
[FactWithTimeout]
|
||||
public async Task CanTrackSeveralTransactions()
|
||||
{
|
||||
@ -2724,14 +2733,6 @@ namespace NBXplorer.Tests
|
||||
Assert.NotNull(metadata.Fees);
|
||||
Assert.NotNull(metadata.FeeRate);
|
||||
Assert.NotNull(metadata.VirtualSize);
|
||||
Assert.NotNull(metadata.Chunk);
|
||||
Assert.NotNull(metadata.Chunk.Fees);
|
||||
Assert.NotEqual(0, metadata.Chunk.Fees.Satoshi);
|
||||
Assert.NotEqual(0, metadata.Chunk.Weight);
|
||||
Assert.NotNull(metadata.Chunk.FeeRate);
|
||||
// Those are equal because the chunk is composed of a single transaction
|
||||
Assert.Equal(metadata.Chunk.FeeRate, metadata.FeeRate);
|
||||
Assert.Equal((metadata.Chunk.Weight + 3) / 4, metadata.VirtualSize);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3262,7 +3263,7 @@ namespace NBXplorer.Tests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To understand this test, read https://github.com/btcpayserver/NBXplorer/blob/master/docs/Design.md
|
||||
/// To understand this test, read https://github.com/dgarage/NBXplorer/blob/master/docs/Design.md
|
||||
/// This create a specific graph of transaction and make sure that it computes the UTXO set as expected.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
|
||||
@ -19,7 +19,7 @@ services:
|
||||
postgres:
|
||||
image: postgres:18.1
|
||||
container_name: nbxplorertests_postgres_1
|
||||
command: [ "-c", "random_page_cost=1.0", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
||||
command: [ "-c", "random_page_cost=1.0", "-c", "shared_preload_libraries=pg_stat_statements" ]
|
||||
environment:
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
ports:
|
||||
|
||||
@ -291,7 +291,7 @@ namespace NBXplorer.Backend
|
||||
}
|
||||
var node = await Node.ConnectAsync(network.NBitcoinNetwork, ChainConfiguration.NodeEndpoint, nodeParams);
|
||||
Logger.LogInformation($"TCP Connection succeed, handshaking...");
|
||||
await node.VersionHandshakeAsync(handshakeTimeout.Token);
|
||||
node.VersionHandshake(handshakeTimeout.Token);
|
||||
Logger.LogInformation($"Handshaked");
|
||||
await node.SendMessageAsync(new SendHeadersPayload());
|
||||
|
||||
|
||||
@ -194,7 +194,7 @@ namespace NBXplorer.Configuration
|
||||
if (obsolete != string.Empty)
|
||||
{
|
||||
if (Directory.Exists(Path.Combine(DataDir, "db")))
|
||||
throw new ConfigException($"Options '{obsolete}' are not supported anymore, if you need to migrate an old instance to the new postgres backend, please use NBXplorer v2.5.2 and follow https://github.com/btcpayserver/NBXplorer/blob/master/docs/Postgres-Migration.md.");
|
||||
throw new ConfigException($"Options '{obsolete}' are not supported anymore, if you need to migrate an old instance to the new postgres backend, please use NBXplorer v2.5.2 and follow https://github.com/dgarage/NBXplorer/blob/master/docs/Postgres-Migration.md.");
|
||||
else
|
||||
Logs.Explorer.LogWarning($"Options '{obsolete}' is obsolete and ignored...");
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- For documentation see https://github.com/btcpayserver/NBXplorer/tree/master/docs/Postgres-Schema.md
|
||||
-- For documentation see https://github.com/dgarage/NBXplorer/tree/master/docs/Postgres-Schema.md
|
||||
-- This file contains additional comments about column meaning.
|
||||
|
||||
-- The main tables are blks, blks_txs, txs, ins, outs, ins_outs, descriptors, desriptors_scripts, scripts, wallets, wallets_descriptors, wallets_scripts.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">net10.0</TargetFramework>
|
||||
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">$(TargetFrameworkOverride)</TargetFramework>
|
||||
<Version>2.6.8</Version>
|
||||
<Version>2.6.5</Version>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\NBXplorer.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1705;1591;CS1591</NoWarn>
|
||||
<LangVersion>12</LangVersion>
|
||||
@ -35,12 +35,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Dapper" Version="2.1.79" />
|
||||
<PackageReference Include="Npgsql" Version="10.0.3" />
|
||||
<PackageReference Include="Dapper" Version="2.1.72" />
|
||||
<PackageReference Include="Npgsql" Version="10.0.2" />
|
||||
<PackageReference Include="NicolasDorier.CommandLine" Version="2.0.0" />
|
||||
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="2.0.0" />
|
||||
<PackageReference Include="NicolasDorier.StandardConfiguration" Version="2.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.6" />
|
||||
<ProjectReference Include="..\NBXplorer.Client\NBXplorer.Client.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ using System.Reflection;
|
||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NBitcoin;
|
||||
|
||||
[assembly: InternalsVisibleTo("NBXplorer.Tests")]
|
||||
namespace NBXplorer
|
||||
@ -20,7 +19,6 @@ namespace NBXplorer
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
ExtPubKey.SkipInvalidMasterExtPubKeyCheck = true;
|
||||
var version = typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
var processor = new ConsoleLoggerProcessor();
|
||||
Logs.Configure(new FuncLoggerFactory(i => new CustomerConsoleLogger(i, (a, b) => true, null, processor)));
|
||||
|
||||
@ -120,7 +120,11 @@ namespace NBXplorer
|
||||
if (await WithRetry(() => rpc.GetBlockCountAsync()) < rpc.Network.Consensus.CoinbaseMaturity)
|
||||
{
|
||||
logger.LogInformation($"Less than {rpc.Network.Consensus.CoinbaseMaturity} blocks, mining some block for regtest (you can disable with NBXPLORER_NOWARMUP=1)");
|
||||
await rpc.EnsureGenerateAsync(rpc.Network.Consensus.CoinbaseMaturity + 1);
|
||||
var dest = await rpc.GetNewAddressAsync();
|
||||
// Need to disable the wallet to workaround https://github.com/bitcoin/bitcoin/issues/33618
|
||||
await rpc.UnloadWalletAsync(rpc.CredentialString.WalletName);
|
||||
await rpc.GenerateToAddressAsync(rpc.Network.Consensus.CoinbaseMaturity + 1, dest);
|
||||
await rpc.LoadWalletAsync(rpc.CredentialString.WalletName);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -152,15 +156,8 @@ namespace NBXplorer
|
||||
=> new()
|
||||
{
|
||||
Fees = entry.BaseFee,
|
||||
Chunk = entry.ChunkFees is null || entry.ChunkWeight is 0 ? null :
|
||||
new TransactionMetadata.ChunkMetadata()
|
||||
{
|
||||
Fees = entry.ChunkFees,
|
||||
Weight = entry.ChunkWeight,
|
||||
FeeRate = GetFeeRate(entry.ChunkFees, ((entry.ChunkWeight + 3) / 4)),
|
||||
},
|
||||
VirtualSize = entry.VirtualSizeBytes,
|
||||
FeeRate = GetFeeRate(entry.BaseFee, entry.VirtualSizeBytes),
|
||||
FeeRate = GetFeeRate(entry.BaseFee, entry.VirtualSizeBytes)
|
||||
};
|
||||
|
||||
// This method fetch some information from getmempoolentry which may be useful for analysis, it's not critical to have it, so we don't want to fail the whole thing if it fails.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"title": "NBXplorer API",
|
||||
"description": "NBXplorer is a multi-cryptocurrency lightweight block explorer that does not index the whole blockchain. \nInstead, it listens to transactions and blocks from a trusted full node and indexes only addresses and \ntransactions that belong to tracked DerivationSchemes.\n\nBy default, NBXplorer is are using [Basic Authentication with a cookie file](https://github.com/btcpayserver/NBXplorer/blob/master/docs/API.md#authentication) for authentication.",
|
||||
"description": "NBXplorer is a multi-cryptocurrency lightweight block explorer that does not index the whole blockchain. \nInstead, it listens to transactions and blocks from a trusted full node and indexes only addresses and \ntransactions that belong to tracked DerivationSchemes.\n\nBy default, NBXplorer is are using [Basic Authentication with a cookie file](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#authentication) for authentication.",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"servers": [
|
||||
@ -14,11 +14,11 @@
|
||||
"tags": [
|
||||
{
|
||||
"name": "Groups",
|
||||
"description": "A group is a tracked source which serves as a logical method for grouping several tracked sources into a single entity. You can add or remove tracked sources to and from a group.\n\nFor more details, check out the documentation on [GitHub](https://github.com/btcpayserver/NBXplorer/blob/master/docs/API.md#groups)."
|
||||
"description": "A group is a tracked source which serves as a logical method for grouping several tracked sources into a single entity. You can add or remove tracked sources to and from a group.\n\nFor more details, check out the documentation on [GitHub](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#groups)."
|
||||
},
|
||||
{
|
||||
"name": "Derivations",
|
||||
"description": "A derivation scheme, (also called derivationStrategy) is a flexible way to define how to generate deterministic addresses for a wallet. NBXplorer will track any addresses on the `0/x`, `1/x` and `x` path.\n\nFor more details, check out the documentation on [GitHub](https://github.com/btcpayserver/NBXplorer/blob/master/docs/API.md#derivation-scheme)."
|
||||
"description": "A derivation scheme, (also called derivationStrategy) is a flexible way to define how to generate deterministic addresses for a wallet. NBXplorer will track any addresses on the `0/x`, `1/x` and `x` path.\n\nFor more details, check out the documentation on [GitHub](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#derivation-scheme)."
|
||||
}
|
||||
],
|
||||
"components": {
|
||||
@ -47,7 +47,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"example": "2-of-xpub1-xpub2",
|
||||
"description": "The derivation scheme ([See documentation](https://github.com/btcpayserver/NBXplorer/blob/master/docs/API.md#derivation-scheme))"
|
||||
"description": "The derivation scheme ([See documentation](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#derivation-scheme))"
|
||||
},
|
||||
"GroupId": {
|
||||
"name": "groupId",
|
||||
@ -107,31 +107,6 @@
|
||||
"description": "The estimated fee rate in satoshis per vByte. Only available if the transaction has been indexed when it was in the mempool.",
|
||||
"example": 20.0,
|
||||
"nullable": true
|
||||
},
|
||||
"chunk": {
|
||||
"type": "object",
|
||||
"description": "Fee metadata for the transaction chunk, as reported by Bitcoin Core mempool entry data.",
|
||||
"nullable": true,
|
||||
"properties": {
|
||||
"fees": {
|
||||
"type": "integer",
|
||||
"description": "Total fee of this chunk in satoshi.",
|
||||
"example": 2820,
|
||||
"nullable": true
|
||||
},
|
||||
"weight": {
|
||||
"type": "integer",
|
||||
"description": "Total chunk weight in weight units.",
|
||||
"example": 564,
|
||||
"nullable": true
|
||||
},
|
||||
"feeRate": {
|
||||
"type": "number",
|
||||
"description": "Chunk fee rate in satoshis per vByte.",
|
||||
"example": 20.0,
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -703,6 +678,11 @@
|
||||
"type": "string",
|
||||
"description": "Optional. The [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) passphrase to use with the mnemonic. This is also known as the 'wallet password'. Default is an empty string."
|
||||
},
|
||||
"importKeysToRPC": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Optional. If **true**, every time a new unused address is generated, the corresponding private key will be imported into the underlying node via RPC's `importprivkey`. Useful if you need to manage your wallet via the node's command-line interface or RPC calls. Default is **false**."
|
||||
},
|
||||
"savePrivateKeys": {
|
||||
"type": "boolean",
|
||||
"description": "Optional. If **true**, the private keys (mnemonic seed and derived keys) will be saved in NBXplorer's metadata under `Mnemonic`, `MasterHDKey`, and `AccountHDKey`. Be cautious when enabling this option, as storing private keys increases security risks."
|
||||
@ -3784,7 +3764,7 @@
|
||||
"/cryptos/{cryptoCode}/node/rpc": {
|
||||
"post": {
|
||||
"summary": "Proxy RPC call to the underlying node",
|
||||
"description": "Allows you to make RPC calls to the underlying cryptocurrency node (e.g., Bitcoin Core) via NBXplorer. This endpoint acts as a proxy, forwarding your RPC requests to the node and returning the node's responses.\n\nBy default, only a handful of RPC methods are authorized. You can use [configuration](https://github.com/btcpayserver/NBXplorer/blob/master/docs/API.md#configuration) `--btcexposerpc` or `NBXPLORER_BTCEXPOSERPC=1` to allow all methods.\n\nGo to [The JSON-RPC specification page](https://www.jsonrpc.org/specification) and the [Bitcoin Core RPC page](https://developer.bitcoin.org/reference/rpc) for more information.",
|
||||
"description": "Allows you to make RPC calls to the underlying cryptocurrency node (e.g., Bitcoin Core) via NBXplorer. This endpoint acts as a proxy, forwarding your RPC requests to the node and returning the node's responses.\n\nBy default, only a handful of RPC methods are authorized. You can use [configuration](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#configuration) `--btcexposerpc` or `NBXPLORER_BTCEXPOSERPC=1` to allow all methods.\n\nGo to [The JSON-RPC specification page](https://www.jsonrpc.org/specification) and the [Bitcoin Core RPC page](https://developer.bitcoin.org/reference/rpc) for more information.",
|
||||
"tags": [
|
||||
"Blockchain"
|
||||
],
|
||||
|
||||
26
README.md
26
README.md
@ -2,7 +2,7 @@
|
||||
|
||||
[](https://www.nuget.org/packages/NBxplorer.Client)
|
||||
[](https://hub.docker.com/r/nicolasdorier/nbxplorer/)
|
||||
[](https://circleci.com/gh/btcpayserver/NBXplorer)
|
||||
[](https://circleci.com/gh/dgarage/NBXplorer)
|
||||
|
||||
A minimalist UTXO tracker for HD wallets.
|
||||
The goal is to provide a flexible, .NET-based UTXO tracker for HD wallets.
|
||||
@ -14,24 +14,24 @@ This explorer is not intended to be exposed to the internet; it should be used a
|
||||
|
||||
## Typical usage
|
||||
|
||||
You start by [Creating a wallet (hot wallet)](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/GenerateWallet), or [Tracking a derivation scheme (cold wallet)](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/Track).
|
||||
You start by [Creating a wallet (hot wallet)](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/GenerateWallet), or [Tracking a derivation scheme (cold wallet)](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/Track).
|
||||
|
||||
Second, [Get the next unused address](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/GetUnused) to get paid.
|
||||
Second, [Get the next unused address](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/GetUnused) to get paid.
|
||||
|
||||
Listen to events through [Polling](https://btcpayserver.github.io/NBXplorer/#tag/Events/operation/GetLatest), [Long Polling](https://btcpayserver.github.io/NBXplorer/#tag/Events/operation/EventStream) or [Web Sockets](https://btcpayserver.github.io/NBXplorer/#tag/Events/operation/WebSocket).
|
||||
Listen to events through [Polling](https://dgarage.github.io/NBXplorer/#tag/Events/operation/GetLatest), [Long Polling](https://dgarage.github.io/NBXplorer/#tag/Events/operation/EventStream) or [Web Sockets](https://dgarage.github.io/NBXplorer/#tag/Events/operation/WebSocket).
|
||||
|
||||
You can then [List transactions](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/ListTransactionDerivationScheme), [List UTXOs](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/ListUTXOsDerivationScheme), or [Create a PSBT](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/CreatePSBT) for your app to sign.
|
||||
You can then [List transactions](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/ListTransactionDerivationScheme), [List UTXOs](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/ListUTXOsDerivationScheme), or [Create a PSBT](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/CreatePSBT) for your app to sign.
|
||||
|
||||
When the transaction is signed, [Broadcast it](https://btcpayserver.github.io/NBXplorer/#tag/Transactions/operation/Broadcast).
|
||||
When the transaction is signed, [Broadcast it](https://dgarage.github.io/NBXplorer/#tag/Transactions/operation/Broadcast).
|
||||
|
||||
You can also track multiple derivation schemes or individual addresses by [Creating a group](https://btcpayserver.github.io/NBXplorer/#tag/Groups/operation/Create).
|
||||
You can also track multiple derivation schemes or individual addresses by [Creating a group](https://dgarage.github.io/NBXplorer/#tag/Groups/operation/Create).
|
||||
|
||||
## General features
|
||||
|
||||
* Miniscript support via [Wallet Policies (BIP0388)](https://github.com/bitcoin/bips/blob/master/bip-0388.mediawiki).
|
||||
* Can pass arguments via environment variable, command line or configuration file
|
||||
* Automatically reconnect to your node if the connection goes temporarily down
|
||||
* An easy to use [REST API](https://btcpayserver.github.io/NBXplorer/) ([Overview](./docs/API.md).)
|
||||
* An easy to use [REST API](https://dgarage.github.io/NBXplorer/) ([Overview](./docs/API.md).)
|
||||
* Persistence via [Postgres](./docs/docs/Postgres-Schema.md)
|
||||
* Connect via RPC to broadcast transaction instead of using the P2P protocol like this example
|
||||
* Connect via RPC to your trusted node to get the proper fee rate.
|
||||
@ -67,7 +67,7 @@ It currently supports the following altcoins:
|
||||
* Ufo
|
||||
* Viacoin
|
||||
|
||||
Read our [API Specification](https://btcpayserver.github.io/NBXplorer/).
|
||||
Read our [API Specification](https://dgarage.github.io/NBXplorer/).
|
||||
|
||||
## Prerequisite
|
||||
|
||||
@ -119,7 +119,7 @@ Example, if you have ltc node and btc node on regtest (default configuration), a
|
||||
|
||||
## How to use the API?
|
||||
|
||||
Check [the API documentation](https://btcpayserver.github.io/NBXplorer/), you can then use any client library:
|
||||
Check [the API documentation](https://dgarage.github.io/NBXplorer/), you can then use any client library:
|
||||
|
||||
* [NBXplorer.NodeJS](https://github.com/junderw/NBXplorer.NodeJS) for NodeJS clients.
|
||||
* [NBXplorer.Client](https://www.nuget.org/packages/NBxplorer.Client) for .NET clients.
|
||||
@ -216,7 +216,7 @@ If you need to see old payments, you need to configure `--[crypto]startheight` t
|
||||
|
||||
[Postman](https://www.getpostman.com) is a useful tool for testing and experimenting with REST API's.
|
||||
|
||||
You can test the [NBXplorer API](https://btcpayserver.github.io/NBXplorer/) quickly and easily using Postman.
|
||||
You can test the [NBXplorer API](https://dgarage.github.io/NBXplorer/) quickly and easily using Postman.
|
||||
|
||||
If you use cookie authentication (enabled by default) in your locally run NBXplorer, you need to set that up in Postman:
|
||||
|
||||
@ -263,7 +263,7 @@ If you receive a 404 or timeout then Postman cannot see the endpoint
|
||||
|
||||
A better documentation is on the way, for now the only documentation is the client API in C# on [nuget](https://www.nuget.org/packages/NBxplorer.Client).
|
||||
The `ExplorerClient` classes allows you to query unused addresses, and the UTXO of an HD PubKey.
|
||||
You can take a look at [the tests](https://github.com/btcpayserver/NBXplorer/blob/master/NBXplorer.Tests/UnitTest1.cs) to see how it works.
|
||||
You can take a look at [the tests](https://github.com/dgarage/NBXplorer/blob/master/NBXplorer.Tests/UnitTest1.cs) to see how it works.
|
||||
|
||||
There is a simple use case documented on [Blockchain Programming in C#](https://programmingblockchain.gitbooks.io/programmingblockchain/content/wallet/web-api.html).
|
||||
|
||||
@ -296,7 +296,7 @@ Then run the tests.
|
||||
4. `Electrum protocol` is cumbersome for HD wallets.
|
||||
5. `Bitcoin Core RPC` is inflexible and difficult to use. It also scales poorly when a wallet has too many addresses or UTXOs.
|
||||
6. `Bitcoin Core RPC` supports multiple wallets but isn't designed to handle thousands of them. Having too many wallets will not scale.
|
||||
7. While NBXplorer exposes an [API](https://btcpayserver.github.io/NBXplorer/), it also allows you to query the data using the most expressive and flexible language designed for this purpose: [SQL](./docs/docs/Postgres-Schema.md).
|
||||
7. While NBXplorer exposes an [API](https://dgarage.github.io/NBXplorer/), it also allows you to query the data using the most expressive and flexible language designed for this purpose: [SQL](./docs/docs/Postgres-Schema.md).
|
||||
8. Alternative SaaS infrastructure providers depend on third parties, forcing you to compromise your privacy by sharing financial information while relinquishing control over API changes and service level agreements (SLAs).
|
||||
|
||||
## Licence
|
||||
|
||||
14
docs/API.md
14
docs/API.md
@ -4,7 +4,7 @@ NBXplorer is a multi crypto currency lightweight block explorer.
|
||||
|
||||
NBXplorer does not index the whole blockchain, rather, it listens transactions and blocks from a trusted full node and index only addresses and transactions which belongs to a `DerivationScheme` that you decide to track.
|
||||
|
||||
This document describes the concepts, while the [API endpoints are documented here](https://btcpayserver.github.io/NBXplorer/).
|
||||
This document describes the concepts, while the [API endpoints are documented here](https://dgarage.github.io/NBXplorer/).
|
||||
|
||||
## Table of content
|
||||
|
||||
@ -58,7 +58,7 @@ And there are three different types: `Derivation Schemes`, `Groups` and `Standal
|
||||
A derivation scheme, also called `derivationStrategy` internally, is a flexible way to define how to generate deterministic addresses for a wallet.
|
||||
|
||||
A derivation scheme tracked source's format is `DERIVATIONSCHEME:derivationScheme` (eg. `DERIVATIONSCHEME:xpub1`).
|
||||
You can create one by calling [Tracking derivation scheme](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/Track).
|
||||
You can create one by calling [Tracking derivation scheme](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/Track).
|
||||
|
||||
There are two types of derivation schemes:
|
||||
* [Standard](#standard-derivation-scheme), for simple and standard use cases (single sig, or multi sig)
|
||||
@ -130,7 +130,7 @@ Where:
|
||||
wsh(and_v(or_c(pk([973a74ba/48'/1'/0']tprv8gZh1wDxtsw28saCHAXAKGRStbAZpWAzuT13AVv5erS3CxHMNLmmJUFfpUKtvfBzQx5qajkzcHkghNp8kuPknDhMTwxPdzPA29NZQcr17ZT/**),or_c(pk([39bad04c/48'/1'/1']tprv8fkJnxvpWbmwWd8Ep6YdXoYrhp1WNDFLvVJKsioFwatwA2kyZtfpFhSqi84QGb83VXqPHWBiH4xV8rcrHz1WeWtk1gWS1MwJsE3dJWfp1Fj/**),v:older(1000))),pk([f19e9416/48'/1'/2']tprv8fuFjBofiYNzDW3GAyPeoMqDf2QdrQZxozJjAT74CxaeYkQv7cKZvrPLSTuB2Z6qX8nxfBbTQaGCzDpPzaH1jyV9RiRj8xVFmo34hFzsKb8/**)))
|
||||
```
|
||||
|
||||
When passing this derivation scheme to the API via a URL path (like when calling [Tracking derivation scheme](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/Track)), don’t forget to escape it properly.
|
||||
When passing this derivation scheme to the API via a URL path (like when calling [Tracking derivation scheme](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/Track)), don’t forget to escape it properly.
|
||||
|
||||
For example, if you need to track this policy, replace:
|
||||
|
||||
@ -146,7 +146,7 @@ For example, if you need to track this policy, replace:
|
||||
| `:` | `%3A` |
|
||||
| `*` | `%2A` |
|
||||
|
||||
The call to [Tracking derivation scheme](https://btcpayserver.github.io/NBXplorer/#tag/Derivations/operation/Track) would then be:
|
||||
The call to [Tracking derivation scheme](https://dgarage.github.io/NBXplorer/#tag/Derivations/operation/Track) would then be:
|
||||
```
|
||||
HTTP POST /v1/cryptos/BTC/derivations/wsh%28and_v%28or_c%28pk%28%5B973a74ba%2F48%27%2F1%27%2F0%27%5Dtprv8gZh1wDxtsw28saCHAXAKGRStbAZpWAzuT13AVv5erS3CxHMNLmmJUFfpUKtvfBzQx5qajkzcHkghNp8kuPknDhMTwxPdzPA29NZQcr17ZT%2F%2A%2A%29%2Cor_c%28pk%28%5B39bad04c%2F48%27%2F1%27%2F1%27%5Dtprv8fkJnxvpWbmwWd8Ep6YdXoYrhp1WNDFLvVJKsioFwatwA2kyZtfpFhSqi84QGb83VXqPHWBiH4xV8rcrHz1WeWtk1gWS1MwJsE3dJWfp1Fj%2F%2A%2A%29%2Cv%3Aolder%281000%29%29%29%2Cpk%28%5Bf19e9416%2F48%27%2F1%27%2F2%27%5Dtprv8fuFjBofiYNzDW3GAyPeoMqDf2QdrQZxozJjAT74CxaeYkQv7cKZvrPLSTuB2Z6qX8nxfBbTQaGCzDpPzaH1jyV9RiRj8xVFmo34hFzsKb8%2F%2A%2A%29%29%29%23adgpkx0s
|
||||
```
|
||||
@ -160,11 +160,11 @@ Additionally, specific addresses can be tracked through the group.
|
||||
Every address attached by a child tracked source will be added to the group, including all related UTXOs and transactions.
|
||||
|
||||
A group can have any number of children, and a group can also be a child of another group.
|
||||
Please note that all the children are returned by [Get a group](https://btcpayserver.github.io/NBXplorer/#tag/Groups/operation/Get). As such, it is advised not to add too many children to avoid slowing down this call.
|
||||
Please note that all the children are returned by [Get a group](https://dgarage.github.io/NBXplorer/#tag/Groups/operation/Get). As such, it is advised not to add too many children to avoid slowing down this call.
|
||||
|
||||
A group tracked source's format is `GROUP:groupid`.
|
||||
|
||||
You can create a new group by calling [Create a group](https://btcpayserver.github.io/NBXplorer/#tag/Groups/operation/Create).
|
||||
You can create a new group by calling [Create a group](https://dgarage.github.io/NBXplorer/#tag/Groups/operation/Create).
|
||||
|
||||
### <a name="addresses"></a>Standalone addresses
|
||||
|
||||
@ -172,7 +172,7 @@ This refers to a tracked source that monitors a single address. It functions sim
|
||||
|
||||
The address tracked source's format is `ADDRESS:bc1...`.
|
||||
|
||||
You can create one by calling [Tracking an address](https://btcpayserver.github.io/NBXplorer/#tag/Legacy/operation/TrackSingleAddress).
|
||||
You can create one by calling [Tracking an address](https://dgarage.github.io/NBXplorer/#tag/Legacy/operation/TrackSingleAddress).
|
||||
|
||||
## Authentication
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user