/* * Copyright 2013 Google Inc. * Copyright 2014 Andreas Schildbach * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.bitcoinj.params; import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.core.Utils; import static com.google.common.base.Preconditions.checkState; /** * Parameters for the testnet, a separate public instance of Bitcoin that has relaxed rules suitable for development * and testing of applications and new Bitcoin versions. */ public class TestNet3Params extends NetworkParameters { public TestNet3Params() { super(); id = ID_TESTNET; // Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 packetMagic = 0x0b110907; interval = INTERVAL; targetTimespan = TARGET_TIMESPAN; maxTarget = Utils.decodeCompactBits(0x1d00ffffL); port = 18333; addressHeader = 111; p2shHeader = 196; acceptableAddressCodes = new int[] { addressHeader, p2shHeader }; dumpedPrivateKeyHeader = 239; genesisBlock.setTime(1296688602L); genesisBlock.setDifficultyTarget(0x1d00ffffL); genesisBlock.setNonce(414098458); spendableCoinbaseDepth = 100; subsidyDecreaseBlockCount = 210000; String genesisHash = genesisBlock.getHashAsString(); checkState(genesisHash.equals("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")); alertSigningKey = Utils.HEX.decode("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); dnsSeeds = new String[] { "testnet-seed.alexykot.me", // Alex Kotenko "testnet-seed.bitcoin.schildbach.de", // Andreas Schildbach "testnet-seed.bitcoin.petertodd.org" // Peter Todd }; } private static TestNet3Params instance; public static synchronized TestNet3Params get() { if (instance == null) { instance = new TestNet3Params(); } return instance; } @Override public String getPaymentProtocolId() { return PAYMENT_PROTOCOL_ID_TESTNET; } }