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
/// <summary>
/// Returns default data root directory name
/// </summary>
protected string DataRootDirName
protected override string DataRootDirName
{
get { return "DeStreamNode"; }
}
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using NBitcoin.BouncyCastle.Math;
using NBitcoin.DataEncoders;
......@@ -12,23 +11,22 @@ namespace NBitcoin
protected LinkedList<string> DeStreamWallets;
private LinkedListNode<string> DeStreamWalletsNode => this.DeStreamWallets.First;
public string DeStreamWallet => this.DeStreamWalletsNode.NextOrFirst().Value;
public bool IsDeStreamAddress(string address)
{
return this.DeStreamWallets.Contains(address);
}
public string DeStreamWallet => this.DeStreamWalletsNode.NextOrFirst().Value;
/// <summary>
///
/// </summary>
public double DeStreamFeePart { get; set; }
/// <summary>
/// Fee applied to all transactions
/// Fee applied to all transactions
/// </summary>
public double FeeRate { get; set; }
public bool IsDeStreamAddress(string address)
{
return this.DeStreamWallets.Contains(address);
}
}
}
......@@ -40,30 +38,39 @@ namespace NBitcoin.Networks
{
var initialWalletAddresses = new[]
{
"DC6UcLUzq645UeqCkdk4iJk9tvMVDQ2Ytd",
"D9CKCEtU5cJ5BReBwf4YnWpSqcC7tr1oXv",
"DU3cTLWubkzMRGoCSef1G1Jp1tj8z9TGPD",
"D95x2iYdVVUwY5RnPjBmDKiJHToTgHhdor",
"DPPnSDe416McZ2CKgmUagnJwXZuZ8b31ZM",
"DHdc7gkwZRpKPTZzEf8TBQEthmfxuAJoUM",
"DJzLTGxadMGnHqByQtyUW3zsLq5f7mSvJz",
"D7UwtqLsCNkKb94tb6TiagUHRgF4UDEXMt",
"D7a8q2Ldfmh1vBaGrANPFwyKU7oNKBRtQH",
"DDmLwBBEoerPy8nZCAxcoyzwGwBs9zUhFq"
"DEzex6Cq1SMAq3p83p5Qwhjy2dxCTPAVfr",
"DEaps8sntaCASk67ywscPkiLwrNQAD4e1b",
"DE1iWo2MSsEs2HjL813fSiNdELtFnyw1by",
"DEkf7nGEvjw2CyNCoTvzsNxsRn6ZVFGZkS",
"DEzX6oHMZVUD1qonkTSZFFjajGozsETwgs",
"DEcHCoeTRHKgGBwCzzdNvEegVW7Gp1VDK8",
"DEwTvJbTh8qrWtes3VYw14GnNNNV4P312b",
"DECAapLcscqNCU2ufDRbCFRMVkZyQLhL3w",
"DEBEVqQxXo3cFbk1on35tFjsDE5yHvGzy8",
"DEEPLTkkN4rCShkqez6cCdSYB54CU6A74z",
"DEK92CU1qa7TtPd6JdRqf2tNzxixZYDtB3"
};
const decimal initialCoins = 6000000000;
this.DeStreamWallets = new LinkedList<string>(new []
this.DeStreamWallets = new LinkedList<string>(new[]
{
"DQAa8Fg1ytS5wiXbn1qToRpe9wYSQhCAWc",
"DMoFqYQNfsoorMbmTbyErxk43ev9B2EuEe",
"DEdt7fEuAYQSbtE7ypsJJD7vC6HtZDeriP",
"DErzhYkCcXKKDEWLiWTgSBjmHKKnd2KL15",
"DEa4NHRZyU4PZSKLTdcagxJU8KT6ASAguh",
"DE5h7hdQbvCuhdfVNQWVN42T3MZEP8NHZm",
"DE5HrG9YaoLUHC1hb3jfrZphfcERiHJYjj",
"DEzeEUeNt2fDM6Xe3C8crbtiB2ZHtp7SYR",
"DET5PmzTvLW8bnm6ugmNWjPvnaWLV5dHnL",
"DEfwS3ojmhKtYCNpKyP64GiMTUb6gUBAa9",
"DEf6Ewa9y3598FdY7D7xMBGwdVvXTvuAPm",
"DEHgpa9iXfamEcQxLSUiQQATiRJPHNz2pb"
}.OrderBy(p => Guid.NewGuid()));
var messageStart = new byte[4];
messageStart[0] = 0x70;
messageStart[1] = 0x35;
messageStart[2] = 0x22;
messageStart[3] = 0x05;
messageStart[0] = 0x10;
messageStart[1] = 0xFE;
messageStart[2] = 0xFE;
messageStart[3] = 0x10;
uint magic = BitConverter.ToUInt32(messageStart, 0);
this.Name = "DeStreamMain";
......@@ -107,6 +114,8 @@ namespace NBitcoin.Networks
this.Consensus.DefaultAssumeValid =
new uint256("0x55a8205ae4bbf18f4d238c43f43005bd66e0b1f679b39e2c5c62cf6903693a5e"); // 795970
this.Consensus.MaxMoney = long.MaxValue;
this.Consensus.ProofOfWorkReward = Money.Zero;
this.Consensus.ProofOfStakeReward = Money.Zero;
this.Checkpoints = new Dictionary<int, CheckpointInfo>();
// TODO: Add genesis and premine block to Checkpoints
......@@ -135,11 +144,11 @@ namespace NBitcoin.Networks
this.DNSSeeds = new List<DNSSeedData>
{
new DNSSeedData("node1.destream.io", "node1.destream.io"),
new DNSSeedData("node2.destream.io", "node2.destream.io")
new DNSSeedData("seed1.destream.io", "seed1.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();
// Create the genesis block.
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using NBitcoin.Protocol;
namespace NBitcoin.Networks
......@@ -11,7 +9,8 @@ namespace NBitcoin.Networks
{
public DeStreamTest() //: base()
{
var initialWalletAddresses = new []{
var initialWalletAddresses = new[]
{
"TrpCjf3qT6QXckyXqF8nT1rCQzD2g8S6ES",
"Tqe8mF9go4eie1gukcchHRFKFEfd3X75dc",
"TqgsrrXENYgiginKbxvfTbeWRPYtR4NdMM",
......@@ -35,7 +34,7 @@ namespace NBitcoin.Networks
};
const decimal initialCoins = 6000000000;
this.DeStreamWallets = new LinkedList<string>(new []
this.DeStreamWallets = new LinkedList<string>(new[]
{
"TxLYmDJc9bdYLrcT8v3DhUQFD7vnd7hq5n",
"Ti4QCbGneeaYstSzy1Ak5c9QaWo7sHGznc",
......@@ -58,15 +57,15 @@ namespace NBitcoin.Networks
"ThRCqMSWZmp5VWVzob1pfjqje6SqosP8Uw",
"TxMpDfwHb5SZ9fzNMmeLthTd1D4BZ1EGyQ"
}.OrderBy(p => Guid.NewGuid()));
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
var messageStart = new byte[4];
messageStart[0] = 0x71;
messageStart[1] = 0x31;
messageStart[2] = 0x21;
messageStart[3] = 0x11;
messageStart[0] = 0xFD;
messageStart[1] = 0xFC;
messageStart[2] = 0xFC;
messageStart[3] = 0xFD;
uint magic = BitConverter.ToUInt32(messageStart, 0); // 0x11213171;
this.Name = "DeStreamTest";
......@@ -110,11 +109,7 @@ namespace NBitcoin.Networks
new DNSSeedData("testnode1.destream.io", "testnode1.destream.io")
};
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)
};
this.SeedNodes = new List<NetworkAddress>();
// Create the genesis block.
this.GenesisTime = 1470467000;
......@@ -127,11 +122,12 @@ namespace NBitcoin.Networks
this.Genesis = this.CreateDeStreamGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime,
this.GenesisNonce, this.GenesisBits, this.GenesisVersion, this.GenesisReward,
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.Bits = this.Consensus.PowLimit;
this.Consensus.HashGenesisBlock = this.Genesis.GetHash();
// Assert(this.Consensus.HashGenesisBlock == uint256.Parse("c5974b227ccb19ebd97578285a5937bb4bfb6dcdbf473966d8a2f9c714a8dbb0"));
// Assert(this.Genesis.Header.HashMerkleRoot == uint256.Parse("9e3fff58fb1ba15a69198e22d99572fa024afb754bfe1d3b8d28b86fd9de62df"));
}
......
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