private static Network InitStratisTest()
        {
            Block.BlockSignature  = true;
            Transaction.TimeStamp = true;

            var consensus = Network.StratisMain.Consensus.Clone();

            consensus.PowLimit = new Target(uint256.Parse("0000ffff00000000000000000000000000000000000000000000000000000000"));

            // 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;
            var magic = BitConverter.ToUInt32(messageStart, 0); //0x5223570;

            var genesis = Network.StratisMain.GetGenesis();

            genesis.Header.Time        = 1493909211;
            genesis.Header.Nonce       = 2433759;
            genesis.Header.Bits        = consensus.PowLimit;
            consensus.HashGenesisBlock = genesis.GetHash(consensus.NetworkOptions);

            Assert(consensus.HashGenesisBlock == uint256.Parse("0x00000e246d7b73b88c9ab55f2e5e94d9e22d471def3df5ea448f5576b1d156b9"));

            consensus.DefaultAssumeValid = new uint256("0x12ae16993ce7f0836678f225b2f4b38154fa923bd1888f7490051ddaf4e9b7fa"); // 218810

            var builder = new NetworkBuilder()
                          .SetName("StratisTest")
                          .SetRootFolderName(StratisRootFolderName)
                          .SetDefaultConfigFilename(StratisDefaultConfigFilename)
                          .SetConsensus(consensus)
                          .SetMagic(magic)
                          .SetGenesis(genesis)
                          .SetPort(26178)
                          .SetRPCPort(26174)
                          .SetTxFees(10000, 60000, 10000)
                          .SetBase58Bytes(Base58Type.PUBKEY_ADDRESS, new byte[] { (65) })
                          .SetBase58Bytes(Base58Type.SCRIPT_ADDRESS, new byte[] { (196) })
                          .SetBase58Bytes(Base58Type.SECRET_KEY, new byte[] { (65 + 128) })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_NO_EC, new byte[] { 0x01, 0x42 })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_EC, new byte[] { 0x01, 0x43 })
                          .SetBase58Bytes(Base58Type.EXT_PUBLIC_KEY, new byte[] { (0x04), (0x88), (0xB2), (0x1E) })
                          .SetBase58Bytes(Base58Type.EXT_SECRET_KEY, new byte[] { (0x04), (0x88), (0xAD), (0xE4) })

                          .AddDNSSeeds(new[]
            {
                new DNSSeedData("testnode1.stratisplatform.com", "testnode1.stratisplatform.com"),
                new DNSSeedData("testnode2.stratis.cloud", "testnode2.stratis.cloud"),
                new DNSSeedData("testnode3.stratisplatform.com", "testnode3.stratisplatform.com")
            });

            builder.AddSeeds(new[] { new NetworkAddress(IPAddress.Parse("51.141.28.47"), builder.Port) });     // the c# testnet node

            return(builder.BuildAndRegister());
        }
示例#2
0
        private static Network InitStratisTest()
        {
            Block.BlockSignature  = true;
            Transaction.TimeStamp = true;

            var consensus = Network.StratisMain.Consensus.Clone();

            consensus.PowLimit = new Target(uint256.Parse("0000ffff00000000000000000000000000000000000000000000000000000000"));

            // 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 pchMessageStart = new byte[4];

            pchMessageStart[0] = 0x71;
            pchMessageStart[1] = 0x31;
            pchMessageStart[2] = 0x21;
            pchMessageStart[3] = 0x11;
            var magic = BitConverter.ToUInt32(pchMessageStart, 0);             //0x5223570;

            var genesis = Network.StratisMain.GetGenesis().Clone();

            genesis.Header.Time        = 1493909211;
            genesis.Header.Nonce       = 2433759;
            genesis.Header.Bits        = consensus.PowLimit;
            consensus.HashGenesisBlock = genesis.GetHash();

            assert(consensus.HashGenesisBlock == uint256.Parse("0x00000e246d7b73b88c9ab55f2e5e94d9e22d471def3df5ea448f5576b1d156b9"));

            var builder = new NetworkBuilder()
                          .SetName("StratisTest")
                          .SetConsensus(consensus)
                          .SetMagic(magic)
                          .SetGenesis(genesis)
                          .SetPort(26178)
                          .SetRPCPort(26174)
                          .SetTxFees(10000, 40000, 10000)
                          .SetBase58Bytes(Base58Type.PUBKEY_ADDRESS, new byte[] { (65) })
                          .SetBase58Bytes(Base58Type.SCRIPT_ADDRESS, new byte[] { (196) })
                          .SetBase58Bytes(Base58Type.SECRET_KEY, new byte[] { (65 + 128) })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_NO_EC, new byte[] { 0x01, 0x42 })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_EC, new byte[] { 0x01, 0x43 })
                          .SetBase58Bytes(Base58Type.EXT_PUBLIC_KEY, new byte[] { (0x04), (0x88), (0xB2), (0x1E) })
                          .SetBase58Bytes(Base58Type.EXT_SECRET_KEY, new byte[] { (0x04), (0x88), (0xAD), (0xE4) })

#if !NOSOCKET
                          .AddDNSSeeds(new[]
            {
                new DNSSeedData("stratisplatform.com", "testnode1.stratisplatform.com"),
            });

            builder.AddSeeds(new[] { new NetworkAddress(IPAddress.Parse("51.141.51.129"), builder._Port) });                     // the c# testnet node
#endif

                          return(builder.BuildAndRegister());
        }
        private static Network InitStratisMain()
        {
            Block.BlockSignature  = true;
            Transaction.TimeStamp = true;

            var consensus = new Consensus();

            consensus.NetworkOptions = new NetworkOptions()
            {
                IsProofOfStake = true
            };
            consensus.GetPoWHash = (n, h) => Crypto.HashX13.Instance.Hash(h.ToBytes(options: n));

            consensus.SubsidyHalvingInterval      = 210000;
            consensus.MajorityEnforceBlockUpgrade = 750;
            consensus.MajorityRejectBlockOutdated = 950;
            consensus.MajorityWindow = 1000;
            consensus.BuriedDeployments[BuriedDeployments.BIP34] = 227931;
            consensus.BuriedDeployments[BuriedDeployments.BIP65] = 388381;
            consensus.BuriedDeployments[BuriedDeployments.BIP66] = 363725;
            consensus.BIP34Hash                     = new uint256("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
            consensus.PowLimit                      = new Target(new uint256("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
            consensus.PowTargetTimespan             = TimeSpan.FromSeconds(14 * 24 * 60 * 60); // two weeks
            consensus.PowTargetSpacing              = TimeSpan.FromSeconds(10 * 60);
            consensus.PowAllowMinDifficultyBlocks   = false;
            consensus.PowNoRetargeting              = false;
            consensus.RuleChangeActivationThreshold = 1916; // 95% of 2016
            consensus.MinerConfirmationWindow       = 2016; // nPowTargetTimespan / nPowTargetSpacing

            consensus.BIP9Deployments[BIP9Deployments.TestDummy] = new BIP9DeploymentsParameters(28, 1199145601, 1230767999);
            consensus.BIP9Deployments[BIP9Deployments.CSV]       = new BIP9DeploymentsParameters(0, 1462060800, 1493596800);
            consensus.BIP9Deployments[BIP9Deployments.Segwit]    = new BIP9DeploymentsParameters(1, 0, 0);

            consensus.LastPOWBlock = 12500;

            consensus.ProofOfStakeLimit   = new BigInteger(uint256.Parse("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").ToBytes(false));
            consensus.ProofOfStakeLimitV2 = new BigInteger(uint256.Parse("000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff").ToBytes(false));

            consensus.CoinType = 105;

            consensus.DefaultAssumeValid = new uint256("0x5acb513b96dcb727fbe85c7d50a1266e6414cdd4c3ae66d01313c34a81b466a2"); // 602240

            Block genesis = CreateStratisGenesisBlock(1470467000, 1831645, 0x1e0fffff, 1, Money.Zero);

            consensus.HashGenesisBlock = genesis.GetHash(consensus.NetworkOptions);

            // 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] = 0x70;
            messageStart[1] = 0x35;
            messageStart[2] = 0x22;
            messageStart[3] = 0x05;
            var magic = BitConverter.ToUInt32(messageStart, 0); //0x5223570;

            Assert(consensus.HashGenesisBlock == uint256.Parse("0x0000066e91e46e5a264d42c89e1204963b2ee6be230b443e9159020539d972af"));
            Assert(genesis.Header.HashMerkleRoot == uint256.Parse("0x65a26bc20b0351aebf05829daefa8f7db2f800623439f3c114257c91447f1518"));

            var builder = new NetworkBuilder()
                          .SetName("StratisMain")
                          .SetConsensus(consensus)
                          .SetMagic(magic)
                          .SetGenesis(genesis)
                          .SetPort(16178)
                          .SetRPCPort(16174)
                          .SetTxFees(10000, 60000, 10000)

                          .AddDNSSeeds(new[]
            {
                new DNSSeedData("seednode1.stratisplatform.com", "seednode1.stratisplatform.com"),
                new DNSSeedData("seednode2.stratis.cloud", "seednode2.stratis.cloud"),
                new DNSSeedData("seednode3.stratisplatform.com", "seednode3.stratisplatform.com"),
                new DNSSeedData("seednode4.stratis.cloud", "seednode4.stratis.cloud")
            })

                          .SetBase58Bytes(Base58Type.PUBKEY_ADDRESS, new byte[] { (63) })
                          .SetBase58Bytes(Base58Type.SCRIPT_ADDRESS, new byte[] { (125) })
                          .SetBase58Bytes(Base58Type.SECRET_KEY, new byte[] { (63 + 128) })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_NO_EC, new byte[] { 0x01, 0x42 })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_EC, new byte[] { 0x01, 0x43 })
                          .SetBase58Bytes(Base58Type.EXT_PUBLIC_KEY, new byte[] { (0x04), (0x88), (0xB2), (0x1E) })
                          .SetBase58Bytes(Base58Type.EXT_SECRET_KEY, new byte[] { (0x04), (0x88), (0xAD), (0xE4) })
                          .SetBase58Bytes(Base58Type.PASSPHRASE_CODE, new byte[] { 0x2C, 0xE9, 0xB3, 0xE1, 0xFF, 0x39, 0xE2 })
                          .SetBase58Bytes(Base58Type.CONFIRMATION_CODE, new byte[] { 0x64, 0x3B, 0xF6, 0xA8, 0x9A })
                          .SetBase58Bytes(Base58Type.STEALTH_ADDRESS, new byte[] { 0x2a })
                          .SetBase58Bytes(Base58Type.ASSET_ID, new byte[] { 23 })
                          .SetBase58Bytes(Base58Type.COLORED_ADDRESS, new byte[] { 0x13 })
                          .SetBech32(Bech32Type.WITNESS_PUBKEY_ADDRESS, "bc")
                          .SetBech32(Bech32Type.WITNESS_SCRIPT_ADDRESS, "bc");

            var seed       = new[] { "101.200.198.155", "103.24.76.21", "104.172.24.79" };
            var fixedSeeds = new List <NetworkAddress>();
            // Convert the pnSeeds array into usable address objects.
            Random   rand    = new Random();
            TimeSpan oneWeek = TimeSpan.FromDays(7);

            for (int i = 0; i < seed.Length; i++)
            {
                // It'll only connect to one or two seed nodes because once it connects,
                // it'll get a pile of addresses with newer timestamps.
                NetworkAddress addr = new NetworkAddress();
                // Seed nodes are given a random 'last seen time' of between one and two
                // weeks ago.
                addr.Time     = DateTime.UtcNow - (TimeSpan.FromSeconds(rand.NextDouble() * oneWeek.TotalSeconds)) - oneWeek;
                addr.Endpoint = Utils.ParseIpEndpoint(seed[i], builder.Port);
                fixedSeeds.Add(addr);
            }

            builder.AddSeeds(fixedSeeds);
            return(builder.BuildAndRegister());
        }
示例#4
0
        private static Network InitStratisMain()
        {
            Block.BlockSignature  = true;
            Transaction.TimeStamp = true;

            var consensus = new Consensus();

            consensus.SubsidyHalvingInterval      = 210000;
            consensus.MajorityEnforceBlockUpgrade = 750;
            consensus.MajorityRejectBlockOutdated = 950;
            consensus.MajorityWindow = 1000;
            consensus.BuriedDeployments[BuriedDeployments.BIP34] = 227931;
            consensus.BuriedDeployments[BuriedDeployments.BIP65] = 388381;
            consensus.BuriedDeployments[BuriedDeployments.BIP66] = 363725;
            consensus.BIP34Hash                     = new uint256("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
            consensus.PowLimit                      = new Target(new uint256("000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); // ODN
            consensus.PowTargetTimespan             = TimeSpan.FromSeconds(14 * 24 * 60 * 60);                                                     // two weeks
            consensus.PowTargetSpacing              = TimeSpan.FromSeconds(10 * 60);
            consensus.PowAllowMinDifficultyBlocks   = false;
            consensus.PowNoRetargeting              = false;
            consensus.RuleChangeActivationThreshold = 1916; // 95% of 2016
            consensus.MinerConfirmationWindow       = 2016; // nPowTargetTimespan / nPowTargetSpacing

            consensus.BIP9Deployments[BIP9Deployments.TestDummy] = new BIP9DeploymentsParameters(28, 1199145601, 1230767999);
            consensus.BIP9Deployments[BIP9Deployments.CSV]       = new BIP9DeploymentsParameters(0, 1462060800, 1493596800);
            consensus.BIP9Deployments[BIP9Deployments.Segwit]    = new BIP9DeploymentsParameters(1, 0, 0);

            consensus.LastPOWBlock = 12500;

            consensus.ProofOfStakeLimit   = new BigInteger(uint256.Parse("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").ToBytes(false));
            consensus.ProofOfStakeLimitV2 = new BigInteger(uint256.Parse("000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff").ToBytes(false));

            consensus.CoinType = 105;

            var genesis = CreateStratisGenesisBlock(1503532800, 36151509, consensus.PowLimit.ToCompact(), 1, Money.Zero);             // ODN

            consensus.HashGenesisBlock = genesis.GetHash();

            var pchMessageStart = new byte[4];             // ODN

            pchMessageStart[0] = 0x4f;
            pchMessageStart[1] = 0x64;
            pchMessageStart[2] = 0x6e;
            pchMessageStart[3] = 0x31;
            var magic = BitConverter.ToUInt32(pchMessageStart, 0);

            assert(consensus.HashGenesisBlock == uint256.Parse("0x0000006dd8a92f58e952fa61c9402b74a381a69d1930fb5cc12c73273fab5f0a"));             // ODN
            assert(genesis.Header.HashMerkleRoot == uint256.Parse("0x062e0ef40ca83213f645710bf497cc68220d42ac2254d31bbc8fb64a4d207209"));          // ODN

            var builder = new NetworkBuilder()
                          .SetName("StratisMain")
                          .SetConsensus(consensus)
                          .SetMagic(magic)
                          .SetGenesis(genesis)
                          .SetPort(56660)       // ODN
                          .SetRPCPort(56661)    // ODN
                          .SetTxFees(10000, 60000, 10000)
#if !NOSOCKET
                          .AddDNSSeeds(new[]
            {
                new DNSSeedData("obsidianblockchain1.westeurope.cloudapp.azure.com", "obsidianblockchain1.westeurope.cloudapp.azure.com"),
                new DNSSeedData("obsidianblockchain2.westeurope.cloudapp.azure.com", "obsidianblockchain2.westeurope.cloudapp.azure.com"),
                new DNSSeedData("obsidianseednode1.westeurope.cloudapp.azure.com", "obsidianseednode1.westeurope.cloudapp.azure.com")
            })
#endif

                                                                                            //vAlertPubKey = Encoders.Hex.DecodeData("0486bce1bac0d543f104cbff2bd23680056a3b9ea05e1137d2ff90eeb5e08472eb500322593a2cb06fbf8297d7beb6cd30cb90f98153b5b7cce1493749e41e0284");

                          .SetBase58Bytes(Base58Type.PUBKEY_ADDRESS, new byte[] { (75) })   // ODN
                          .SetBase58Bytes(Base58Type.SCRIPT_ADDRESS, new byte[] { (125) })
                          .SetBase58Bytes(Base58Type.SECRET_KEY, new byte[] { (75 + 128) }) // ODN
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_NO_EC, new byte[] { 0x01, 0x42 })
                          .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_EC, new byte[] { 0x01, 0x43 })
                          .SetBase58Bytes(Base58Type.EXT_PUBLIC_KEY, new byte[] { (0x04), (0x88), (0xC2), (0x1E) })       // ODN
                          .SetBase58Bytes(Base58Type.EXT_SECRET_KEY, new byte[] { (0x04), (0x88), (0xB2), (0xDD) })       // ODN
                          .SetBase58Bytes(Base58Type.PASSPHRASE_CODE, new byte[] { 0x2C, 0xE9, 0xB3, 0xE1, 0xFF, 0x39, 0xE2 })
                          .SetBase58Bytes(Base58Type.CONFIRMATION_CODE, new byte[] { 0x64, 0x3B, 0xF6, 0xA8, 0x9A })
                          .SetBase58Bytes(Base58Type.STEALTH_ADDRESS, new byte[] { 0x2a })
                          .SetBase58Bytes(Base58Type.ASSET_ID, new byte[] { 23 })
                          .SetBase58Bytes(Base58Type.COLORED_ADDRESS, new byte[] { 0x13 })
                          .SetBech32(Bech32Type.WITNESS_PUBKEY_ADDRESS, "bc")
                          .SetBech32(Bech32Type.WITNESS_SCRIPT_ADDRESS, "bc");

#if !NOSOCKET
            var seed        = new[] { "138.68.191.239", "104.131.9.93", "139.59.173.104" };      // ODN
            var vFixedSeeds = new List <NetworkAddress>();
            // Convert the pnSeeds array into usable address objects.
            Random   rand     = new Random();
            TimeSpan nOneWeek = TimeSpan.FromDays(7);
            for (int i = 0; i < seed.Length; i++)
            {
                // It'll only connect to one or two seed nodes because once it connects,
                // it'll get a pile of addresses with newer timestamps.
                NetworkAddress addr = new NetworkAddress();
                // Seed nodes are given a random 'last seen time' of between one and two
                // weeks ago.
                addr.Time     = DateTime.UtcNow - (TimeSpan.FromSeconds(rand.NextDouble() * nOneWeek.TotalSeconds)) - nOneWeek;
                addr.Endpoint = Utils.ParseIpEndpoint(seed[i], builder._Port);
                vFixedSeeds.Add(addr);
            }

            builder.AddSeeds(vFixedSeeds);
#endif
            return(builder.BuildAndRegister());
        }
示例#5
0
        private static Network InitStratisTest()
        {
            Block.BlockSignature = true;
            Transaction.TimeStamp = true;

            var consensus = Network.StratisMain.Consensus.Clone();
            consensus.PowLimit = new Target(uint256.Parse("0000ffff00000000000000000000000000000000000000000000000000000000"));

            // 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;
            var magic = BitConverter.ToUInt32(messageStart, 0); //0x5223570; 

            var genesis = Network.StratisMain.GetGenesis();
            genesis.Header.Time = 1493909211;
            genesis.Header.Nonce = 2433759;
            genesis.Header.Bits = consensus.PowLimit;
            consensus.HashGenesisBlock = genesis.GetHash(consensus.NetworkOptions);

            Assert(consensus.HashGenesisBlock == uint256.Parse("0x00000e246d7b73b88c9ab55f2e5e94d9e22d471def3df5ea448f5576b1d156b9"));

            consensus.DefaultAssumeValid = new uint256("0x98fa6ef0bca5b431f15fd79dc6f879dc45b83ed4b1bbe933a383ef438321958e"); // 372652

            var builder = new NetworkBuilder()
                .SetName("StratisTest")
                .SetRootFolderName(StratisRootFolderName)
                .SetDefaultConfigFilename(StratisDefaultConfigFilename)
                .SetConsensus(consensus)
                .SetMagic(magic)
                .SetGenesis(genesis)
                .SetPort(26178)
                .SetRPCPort(26174)
                .SetMaxTimeOffsetSeconds(StratisMaxTimeOffsetSeconds)
                .SetMaxTipAge(StratisDefaultMaxTipAgeInSeconds)
                .SetTxFees(10000, 60000, 10000)
                .SetBase58Bytes(Base58Type.PUBKEY_ADDRESS, new byte[] { (65) })
                .SetBase58Bytes(Base58Type.SCRIPT_ADDRESS, new byte[] { (196) })
                .SetBase58Bytes(Base58Type.SECRET_KEY, new byte[] { (65 + 128) })
                .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_NO_EC, new byte[] { 0x01, 0x42 })
                .SetBase58Bytes(Base58Type.ENCRYPTED_SECRET_KEY_EC, new byte[] { 0x01, 0x43 })
                .SetBase58Bytes(Base58Type.EXT_PUBLIC_KEY, new byte[] { (0x04), (0x88), (0xB2), (0x1E) })
                .SetBase58Bytes(Base58Type.EXT_SECRET_KEY, new byte[] { (0x04), (0x88), (0xAD), (0xE4) })

                .AddDNSSeeds(new[]
                {
                    new DNSSeedData("testnet1.stratisplatform.com", "testnet1.stratisplatform.com"),
                    new DNSSeedData("testnet2.stratisplatform.com", "testnet2.stratisplatform.com"),
                    new DNSSeedData("testnet3.stratisplatform.com", "testnet3.stratisplatform.com"),
                    new DNSSeedData("testnet4.stratisplatform.com", "testnet4.stratisplatform.com")
                });

            builder.AddSeeds(new[]
            {
                new NetworkAddress(IPAddress.Parse("51.140.231.125"), builder.Port), // danger cloud node
                new NetworkAddress(IPAddress.Parse("13.70.81.5"), 3389), // beard cloud node  
                new NetworkAddress(IPAddress.Parse("191.235.85.131"), 3389), // fassa cloud node  
                new NetworkAddress(IPAddress.Parse("52.232.58.52"), 26178), // neurosploit public node
            }); 

            return builder.BuildAndRegister();
        }