Skip to content

Commit

Permalink
Add Qtum support (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabura667 authored May 29, 2020
1 parent 7dacd8e commit 8715d3d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions NBXplorer.Client/NBXplorerNetworkProvider.Qtum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Text;

namespace NBXplorer
{
public partial class NBXplorerNetworkProvider
{
private void InitQtum(NetworkType networkType)
{
Add(new NBXplorerNetwork(NBitcoin.Altcoins.Qtum.Instance, networkType)
{
MinRPCVersion = 140200,
CoinType = networkType == NetworkType.Mainnet ? new KeyPath("2301'") : new KeyPath("1'")
});
}

public NBXplorerNetwork GetQTUM()
{
return GetFromCryptoCode(NBitcoin.Altcoins.Qtum.Instance.CryptoCode);
}
}
}
1 change: 1 addition & 0 deletions NBXplorer.Client/NBXplorerNetworkProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public NBXplorerNetworkProvider(NetworkType networkType)
InitColossus(networkType);
InitChaincoin(networkType);
InitLiquid(networkType);
InitQtum(networkType);
foreach (var chain in _Networks.Values)
{
chain.DerivationStrategyFactory ??= chain.CreateStrategyFactory();
Expand Down
4 changes: 4 additions & 0 deletions NBXplorer.Tests/ServerTester.Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ private void SetEnvironment()
//Network = NBitcoin.Altcoins.Colossus.Instance.Regtest;
//RPCSupportSegwit = false;

//CryptoCode = "QTUM";
//nodeDownloadData = NodeDownloadData.Qtum.v0_18_3;
//NBXplorerNetwork = _Provider.GetQTUM();

//CryptoCode = "LBTC";
//nodeDownloadData = NodeDownloadData.Elements.v0_18_1_1;
//NBXplorerNetwork = _Provider.GetLBTC();
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ It currently supports the following altcoins:
* Monacoin
* Monoeci
* Polis
* Qtum
* Terracoin
* Ufo
* Viacoin
Expand Down

0 comments on commit 8715d3d

Please sign in to comment.