Пример #1
0
        public ApexTest()
        {
            this.Name                  = ApexNetwork.TestNetworkName;
            this.RootFolderName        = ApexNetwork.ChainName.ToLowerInvariant();
            this.DefaultConfigFilename = $"{ApexNetwork.ChainName.ToLowerInvariant()}.conf";
            this.DefaultPort           = 36001;
            this.RPCPort               = 36101;
            this.Base58Prefixes[(int)Base58Type.PUBKEY_ADDRESS] = new byte[] { 55 };  // P
            this.Base58Prefixes[(int)Base58Type.SCRIPT_ADDRESS] = new byte[] { 117 }; // p
            this.Magic      = 0x522357B;
            this.CoinTicker = "TAPX";

            this.Consensus.CoinType           = 3001;
            this.Consensus.DefaultAssumeValid = null;
            this.Consensus.PowLimit           = new Target(new uint256("0000ffff00000000000000000000000000000000000000000000000000000000"));
            this.Consensus.CoinbaseMaturity   = 10;
            this.Consensus.MaxMoney           = Money.Coins(20000000);

            this.Checkpoints = new Dictionary <int, CheckpointInfo>();
            this.DNSSeeds    = new List <DNSSeedData>();
            this.SeedNodes   = new List <NetworkAddress>();

            // Create the genesis block.
            this.GenesisTime    = 1528217189;
            this.GenesisNonce   = 9027;
            this.GenesisBits    = this.Consensus.PowLimit.ToCompact();
            this.GenesisVersion = 1;
            this.GenesisReward  = Money.Coins(50m);

            this.Genesis = ApexNetwork.CreateGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime, this.GenesisNonce, this.Consensus.PowLimit, this.GenesisVersion, this.GenesisReward);
            this.Consensus.HashGenesisBlock = this.Genesis.GetHash();
            Assert(this.Consensus.HashGenesisBlock.ToString() == "0000e451752bac9f67cb5d63fd32442ba42d42b1b2ea28131d91e1e3f29f523b");
            Assert(this.Genesis.Header.HashMerkleRoot == uint256.Parse("7326e99b152ce27951b0e9633c2663e8ddfd4006752d1721d579a22046e2d8fb"));
        }
Пример #2
0
        public ApexRegTest()
        {
            this.Name                  = ApexNetwork.RegTestNetworkName;
            this.RootFolderName        = ApexNetwork.ChainName.ToLowerInvariant();
            this.DefaultConfigFilename = $"{ApexNetwork.ChainName.ToLowerInvariant()}.conf";
            this.DefaultPort           = 36002;
            this.RPCPort               = 36102;
            this.Magic                 = 0x522357C;
            this.MinTxFee              = 0;
            this.FallbackFee           = 0;
            this.MinRelayTxFee         = 0;
            this.CoinTicker            = "TAPX";

            this.Consensus.CoinType = 3001;
            this.Consensus.PowAllowMinDifficultyBlocks = true;
            this.Consensus.PowNoRetargeting            = true;
            this.Consensus.PowLimit           = new Target(new uint256("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
            this.Consensus.DefaultAssumeValid = null; // turn off assumevalid for regtest.
            this.Consensus.CoinbaseMaturity   = 10;
            this.Consensus.MaxMoney           = Money.Coins(20000000);

            this.Base58Prefixes[(int)Base58Type.PUBKEY_ADDRESS] = new byte[] { 75 };  // X
            this.Base58Prefixes[(int)Base58Type.SCRIPT_ADDRESS] = new byte[] { 137 }; // x

            this.Checkpoints = new Dictionary <int, CheckpointInfo>();
            this.DNSSeeds    = new List <DNSSeedData>();
            this.SeedNodes   = new List <NetworkAddress>();

            // Create the genesis block.
            this.GenesisTime    = 1528217336;
            this.GenesisNonce   = 2;
            this.GenesisBits    = this.Consensus.PowLimit.ToCompact();
            this.GenesisVersion = 1;
            this.GenesisReward  = Money.Coins(50m);

            this.Genesis = ApexNetwork.CreateGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime, this.GenesisNonce, this.Consensus.PowLimit, this.GenesisVersion, this.GenesisReward);
            this.Consensus.HashGenesisBlock = this.Genesis.GetHash();
            Assert(this.Consensus.HashGenesisBlock.ToString() == "0688f8440feed473792edc56e365bb7ab20ae2d4e2010cfb8af4ccadaa53e611");
            Assert(this.Genesis.Header.HashMerkleRoot == uint256.Parse("a835d145c6011d3731b0ab5a8f2108f635a5197ccd2e69b74cac1dfa9007db4b"));
        }
Пример #3
0
        public ApexMain()
        {
            this.Name                  = ApexNetwork.MainNetworkName;
            this.RootFolderName        = ApexNetwork.ChainName.ToLowerInvariant();
            this.DefaultConfigFilename = $"{ApexNetwork.ChainName.ToLowerInvariant()}.conf";
            this.DefaultPort           = 36000;
            this.RPCPort               = 36100;
            this.Base58Prefixes[(int)Base58Type.PUBKEY_ADDRESS] = new byte[] { 23 }; // A
            this.Base58Prefixes[(int)Base58Type.SCRIPT_ADDRESS] = new byte[] { 83 }; // a
            this.Magic      = 0x522357A;
            this.CoinTicker = "APX";

            this.Consensus.CoinType           = 3000;
            this.Consensus.DefaultAssumeValid = null;
            this.Consensus.CoinbaseMaturity   = 50;
            this.Consensus.PremineReward      = Money.Coins(20000000);
            this.Consensus.ProofOfWorkReward  = Money.Zero;
            this.Consensus.ProofOfStakeReward = Money.Zero;
            this.Consensus.MaxReorgLength     = 0;
            this.Consensus.MaxMoney           = Money.Coins(20000000);

            this.Checkpoints = new Dictionary <int, CheckpointInfo>();
            this.DNSSeeds    = new List <DNSSeedData>();
            this.SeedNodes   = new List <NetworkAddress>();

            // Create the genesis block.
            this.GenesisTime    = 1528217223;
            this.GenesisNonce   = 58285;
            this.GenesisBits    = this.Consensus.PowLimit.ToCompact();
            this.GenesisVersion = 1;
            this.GenesisReward  = Money.Coins(50m);

            this.Genesis = ApexNetwork.CreateGenesisBlock(this.Consensus.ConsensusFactory, this.GenesisTime, this.GenesisNonce, this.Consensus.PowLimit, this.GenesisVersion, this.GenesisReward);
            this.Consensus.HashGenesisBlock = this.Genesis.GetHash();
            Assert(this.Consensus.HashGenesisBlock.ToString() == "000009a6434326a4851f0e95285351839c287182bd2b62ca8765ce30007605e1");
            Assert(this.Genesis.Header.HashMerkleRoot == uint256.Parse("070b7da316f93439d05240db30a9ca4f6019d550e0b6af9a8ac1b075726c9403"));
        }