Commit e212673d authored by Sergei Zubov's avatar Sergei Zubov

Modify network settings

- Update magic bytes in testnet and mainnet;
- Update genesis and fee wallets addresses;
- Update seed nodes;
- Set POS and POW reward at mainnet;
- Change app root folder to DeStreamNode.
parent 4791d4b6
...@@ -20,7 +20,7 @@ namespace DeStream.Stratis.Bitcoin.Configuration ...@@ -20,7 +20,7 @@ namespace DeStream.Stratis.Bitcoin.Configuration
/// <summary> /// <summary>
/// Returns default data root directory name /// Returns default data root directory name
/// </summary> /// </summary>
protected string DataRootDirName protected override string DataRootDirName
{ {
get { return "DeStreamNode"; } get { return "DeStreamNode"; }
} }
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using NBitcoin.BouncyCastle.Math; using NBitcoin.BouncyCastle.Math;
using NBitcoin.DataEncoders; using NBitcoin.DataEncoders;
...@@ -15,13 +14,7 @@ namespace NBitcoin ...@@ -15,13 +14,7 @@ namespace NBitcoin
public string DeStreamWallet => this.DeStreamWalletsNode.NextOrFirst().Value; public string DeStreamWallet => this.DeStreamWalletsNode.NextOrFirst().Value;
public bool IsDeStreamAddress(string address)
{
return this.DeStreamWallets.Contains(address);
}
/// <summary> /// <summary>
///
/// </summary> /// </summary>
public double DeStreamFeePart { get; set; } public double DeStreamFeePart { get; set; }
...@@ -29,6 +22,11 @@ namespace NBitcoin ...@@ -29,6 +22,11 @@ namespace NBitcoin
/// Fee applied to all transactions /// Fee applied to all transactions
/// </summary> /// </summary>
public double FeeRate { get; set; } public double FeeRate { get; set; }
public bool IsDeStreamAddress(string address)
{
return this.DeStreamWallets.Contains(address);
}
} }
} }
...@@ -40,30 +38,39 @@ namespace NBitcoin.Networks ...@@ -40,30 +38,39 @@ namespace NBitcoin.Networks
{ {
var initialWalletAddresses = new[] var initialWalletAddresses = new[]
{ {
"DC6UcLUzq645UeqCkdk4iJk9tvMVDQ2Ytd", "DEzex6Cq1SMAq3p83p5Qwhjy2dxCTPAVfr",
"D9CKCEtU5cJ5BReBwf4YnWpSqcC7tr1oXv", "DEaps8sntaCASk67ywscPkiLwrNQAD4e1b",
"DU3cTLWubkzMRGoCSef1G1Jp1tj8z9TGPD", "DE1iWo2MSsEs2HjL813fSiNdELtFnyw1by",
"D95x2iYdVVUwY5RnPjBmDKiJHToTgHhdor", "DEkf7nGEvjw2CyNCoTvzsNxsRn6ZVFGZkS",
"DPPnSDe416McZ2CKgmUagnJwXZuZ8b31ZM", "DEzX6oHMZVUD1qonkTSZFFjajGozsETwgs",
"DHdc7gkwZRpKPTZzEf8TBQEthmfxuAJoUM", "DEcHCoeTRHKgGBwCzzdNvEegVW7Gp1VDK8",
"DJzLTGxadMGnHqByQtyUW3zsLq5f7mSvJz", "DEwTvJbTh8qrWtes3VYw14GnNNNV4P312b",
"D7UwtqLsCNkKb94tb6TiagUHRgF4UDEXMt", "DECAapLcscqNCU2ufDRbCFRMVkZyQLhL3w",
"D7a8q2Ldfmh1vBaGrANPFwyKU7oNKBRtQH", "DEBEVqQxXo3cFbk1on35tFjsDE5yHvGzy8",
"DDmLwBBEoerPy8nZCAxcoyzwGwBs9zUhFq" "DEEPLTkkN4rCShkqez6cCdSYB54CU6A74z",
"DEK92CU1qa7TtPd6JdRqf2tNzxixZYDtB3"
}; };
const decimal initialCoins = 6000000000; const decimal initialCoins = 6000000000;
this.DeStreamWallets = new LinkedList<string>(new [] this.DeStreamWallets = new LinkedList<string>(new[]
{ {
"DQAa8Fg1ytS5wiXbn1qToRpe9wYSQhCAWc", "DEdt7fEuAYQSbtE7ypsJJD7vC6HtZDeriP",
"DMoFqYQNfsoorMbmTbyErxk43ev9B2EuEe", "DErzhYkCcXKKDEWLiWTgSBjmHKKnd2KL15",
"DEa4NHRZyU4PZSKLTdcagxJU8KT6ASAguh",
"DE5h7hdQbvCuhdfVNQWVN42T3MZEP8NHZm",
"DE5HrG9YaoLUHC1hb3jfrZphfcERiHJYjj",
"DEzeEUeNt2fDM6Xe3C8crbtiB2ZHtp7SYR",
"DET5PmzTvLW8bnm6ugmNWjPvnaWLV5dHnL",
"DEfwS3ojmhKtYCNpKyP64GiMTUb6gUBAa9",
"DEf6Ewa9y3598FdY7D7xMBGwdVvXTvuAPm",
"DEHgpa9iXfamEcQxLSUiQQATiRJPHNz2pb"
}.OrderBy(p => Guid.NewGuid())); }.OrderBy(p => Guid.NewGuid()));
var messageStart = new byte[4]; var messageStart = new byte[4];
messageStart[0] = 0x70; messageStart[0] = 0x10;
messageStart[1] = 0x35; messageStart[1] = 0xFE;
messageStart[2] = 0x22; messageStart[2] = 0xFE;
messageStart[3] = 0x05; messageStart[3] = 0x10;
uint magic = BitConverter.ToUInt32(messageStart, 0); uint magic = BitConverter.ToUInt32(messageStart, 0);
this.Name = "DeStreamMain"; this.Name = "DeStreamMain";
...@@ -107,6 +114,8 @@ namespace NBitcoin.Networks ...@@ -107,6 +114,8 @@ namespace NBitcoin.Networks
this.Consensus.DefaultAssumeValid = this.Consensus.DefaultAssumeValid =
new uint256("0x55a8205ae4bbf18f4d238c43f43005bd66e0b1f679b39e2c5c62cf6903693a5e"); // 795970 new uint256("0x55a8205ae4bbf18f4d238c43f43005bd66e0b1f679b39e2c5c62cf6903693a5e"); // 795970
this.Consensus.MaxMoney = long.MaxValue; this.Consensus.MaxMoney = long.MaxValue;
this.Consensus.ProofOfWorkReward = Money.Zero;
this.Consensus.ProofOfStakeReward = Money.Zero;
this.Checkpoints = new Dictionary<int, CheckpointInfo>(); this.Checkpoints = new Dictionary<int, CheckpointInfo>();
// TODO: Add genesis and premine block to Checkpoints // TODO: Add genesis and premine block to Checkpoints
...@@ -135,11 +144,11 @@ namespace NBitcoin.Networks ...@@ -135,11 +144,11 @@ namespace NBitcoin.Networks
this.DNSSeeds = new List<DNSSeedData> this.DNSSeeds = new List<DNSSeedData>
{ {
new DNSSeedData("node1.destream.io", "node1.destream.io"), new DNSSeedData("seed1.destream.io", "seed1.destream.io"),
new DNSSeedData("node2.destream.io", "node2.destream.io") new DNSSeedData("seed2.destream.io", "seed2.destream.io")
}; };
string[] seedNodes = {"95.128.181.103", "95.128.181.80"}; string[] seedNodes = { };
this.SeedNodes = this.ConvertToNetworkAddresses(seedNodes, this.DefaultPort).ToList(); this.SeedNodes = this.ConvertToNetworkAddresses(seedNodes, this.DefaultPort).ToList();
// Create the genesis block. // Create the genesis block.
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Net;
using NBitcoin.Protocol; using NBitcoin.Protocol;
namespace NBitcoin.Networks namespace NBitcoin.Networks
...@@ -11,7 +9,8 @@ namespace NBitcoin.Networks ...@@ -11,7 +9,8 @@ namespace NBitcoin.Networks
{ {
public DeStreamTest() //: base() public DeStreamTest() //: base()
{ {
var initialWalletAddresses = new []{ var initialWalletAddresses = new[]
{
"TrpCjf3qT6QXckyXqF8nT1rCQzD2g8S6ES", "TrpCjf3qT6QXckyXqF8nT1rCQzD2g8S6ES",
"Tqe8mF9go4eie1gukcchHRFKFEfd3X75dc", "Tqe8mF9go4eie1gukcchHRFKFEfd3X75dc",
"TqgsrrXENYgiginKbxvfTbeWRPYtR4NdMM", "TqgsrrXENYgiginKbxvfTbeWRPYtR4NdMM",
...@@ -35,7 +34,7 @@ namespace NBitcoin.Networks ...@@ -35,7 +34,7 @@ namespace NBitcoin.Networks
}; };
const decimal initialCoins = 6000000000; const decimal initialCoins = 6000000000;
this.DeStreamWallets = new LinkedList<string>(new [] this.DeStreamWallets = new LinkedList<string>(new[]
{ {
"TxLYmDJc9bdYLrcT8v3DhUQFD7vnd7hq5n", "TxLYmDJc9bdYLrcT8v3DhUQFD7vnd7hq5n",
"Ti4QCbGneeaYstSzy1Ak5c9QaWo7sHGznc", "Ti4QCbGneeaYstSzy1Ak5c9QaWo7sHGznc",
...@@ -63,10 +62,10 @@ namespace NBitcoin.Networks ...@@ -63,10 +62,10 @@ namespace NBitcoin.Networks
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment. // a large 4-byte int at any alignment.
var messageStart = new byte[4]; var messageStart = new byte[4];
messageStart[0] = 0x71; messageStart[0] = 0xFD;
messageStart[1] = 0x31; messageStart[1] = 0xFC;
messageStart[2] = 0x21; messageStart[2] = 0xFC;
messageStart[3] = 0x11; messageStart[3] = 0xFD;
uint magic = BitConverter.ToUInt32(messageStart, 0); // 0x11213171; uint magic = BitConverter.ToUInt32(messageStart, 0); // 0x11213171;
this.Name = "DeStreamTest"; this.Name = "DeStreamTest";
...@@ -110,11 +109,7 @@ namespace NBitcoin.Networks ...@@ -110,11 +109,7 @@ namespace NBitcoin.Networks
new DNSSeedData("testnode1.destream.io", "testnode1.destream.io") new DNSSeedData("testnode1.destream.io", "testnode1.destream.io")
}; };
this.SeedNodes = new List<NetworkAddress> this.SeedNodes = new List<NetworkAddress>();
{
new NetworkAddress(IPAddress.Parse("95.128.181.196"), this.DefaultPort), //peak-srv-12
new NetworkAddress(IPAddress.Parse("40.121.9.206"), this.DefaultPort)
};
// Create the genesis block. // Create the genesis block.
this.GenesisTime = 1470467000; this.GenesisTime = 1470467000;
...@@ -127,7 +122,8 @@ namespace NBitcoin.Networks ...@@ -127,7 +122,8 @@ namespace NBitcoin.Networks
this.Genesis = this.CreateDeStreamGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime, this.Genesis = this.CreateDeStreamGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime,
this.GenesisNonce, this.GenesisBits, this.GenesisVersion, this.GenesisReward, this.GenesisNonce, this.GenesisBits, this.GenesisVersion, this.GenesisReward,
initialWalletAddresses); initialWalletAddresses);
this.Genesis.Header.Time = (uint) new DateTimeOffset(2018,09,24,16,13,00, TimeSpan.FromHours(3)).ToUnixTimeSeconds(); this.Genesis.Header.Time =
(uint) new DateTimeOffset(2018, 09, 24, 16, 13, 00, TimeSpan.FromHours(3)).ToUnixTimeSeconds();
this.Genesis.Header.Nonce = 2433759; this.Genesis.Header.Nonce = 2433759;
this.Genesis.Header.Bits = this.Consensus.PowLimit; this.Genesis.Header.Bits = this.Consensus.PowLimit;
this.Consensus.HashGenesisBlock = this.Genesis.GetHash(); this.Consensus.HashGenesisBlock = this.Genesis.GetHash();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment