|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.bitcoin.core.NetworkParameters
public class NetworkParameters
NetworkParameters contains the data needed for working with an instantiation of a BitCoin chain. Currently there are only two, the production chain and the test chain. But in future as BitCoin evolves there may be more. You can create your own as long as they don't conflict.
Field Summary | |
---|---|
int |
addressHeader
First byte of a base58 encoded address. |
int |
dumpedPrivateKeyHeader
First byte of a base58 encoded dumped private key. |
Block |
genesisBlock
Genesis block for this chain. |
int |
interval
How many blocks pass between difficulty adjustment periods. |
long |
packetMagic
The header bytes that identify the start of a packet on this network. |
int |
port
Default TCP port on which to connect to nodes. |
BigInteger |
proofOfWorkLimit
What the easiest allowable proof of work should be. |
static int |
PROTOCOL_VERSION
The protocol version this library implements. |
int |
targetTimespan
How much time in seconds is supposed to pass between "interval" blocks. |
Constructor Summary | |
---|---|
NetworkParameters()
|
Method Summary | |
---|---|
static NetworkParameters |
prodNet()
The primary BitCoin chain created by Satoshi. |
static NetworkParameters |
testNet()
The test chain created by Gavin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PROTOCOL_VERSION
public Block genesisBlock
The first block in every chain is a well known constant shared between all BitCoin implemenetations. For a block to be valid, it must be eventually possible to work backwards to the genesis block by following the prevBlockHash pointers in the block headers.
The genesis blocks for both test and prod networks contain the timestamp of when they were created, and a message in the coinbase transaction. It says, "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks".
public BigInteger proofOfWorkLimit
public int port
public long packetMagic
public int addressHeader
Address
public int dumpedPrivateKeyHeader
DumpedPrivateKey
.
public int interval
public int targetTimespan
Constructor Detail |
---|
public NetworkParameters()
Method Detail |
---|
public static NetworkParameters testNet()
public static NetworkParameters prodNet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |