Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devguide/p2p_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ When started for the first time, programs don’t know the IP addresses of any a
seed.bitcoin.sipa.be. 60 IN A 203.0.113.183
[...]

The DNS seeds are maintained by Bitcoin community members: some of them provide dynamic DNS seed servers which automatically get IP addresses of active nodes by scanning the `network <../devguide/p2p_network.html>`__; others provide static DNS seeds that are updated manually and are more likely to provide IP addresses for inactive nodes. In either case, nodes are added to the DNS seed if they run on the default Bitcoin ports of 8333 for mainnet or 18333 for testnet.
The DNS seeds are maintained by Bitcoin community members: some of them provide dynamic DNS seed servers which automatically get IP addresses of active nodes by scanning the `network <../devguide/p2p_network.html>`__; others provide static DNS seeds that are updated manually and are more likely to provide IP addresses for inactive nodes. In either case, nodes are added to the DNS seed if they run on the default Bitcoin ports of 8333 for mainnet or 48333 for testnet4.

DNS seed results are not authenticated and a malicious seed operator or `network <../devguide/p2p_network.html>`__ `man-in-the-middle <https://en.wikipedia.org/wiki/Man-in-the-middle_attack>`__ attacker can return only IP addresses of nodes controlled by the attacker, isolating a program on the attacker’s own `network <../devguide/p2p_network.html>`__ and allowing the attacker to feed it bogus transactions and blocks. For this reason, programs should not rely on DNS seeds exclusively.

Expand Down
2 changes: 1 addition & 1 deletion examples/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Once installed, you’ll have access to three programs: ``bitcoind``, ``bitcoin-

- ``bitcoin-qt`` provides a combination full Bitcoin peer and wallet frontend. From the Help menu, you can access a console where you can enter the `RPC <../reference/rpc/index.html>`__ commands used throughout this document.

- ``bitcoind`` is more useful for programming: it provides a full peer which you can interact with through `RPCs <../reference/rpc/index.html>`__ to port 8332 (or 18332 for testnet).
- ``bitcoind`` is more useful for programming: it provides a full peer which you can interact with through `RPCs <../reference/rpc/index.html>`__ to port 8332 (48332 for testnet4, 18443 for regtest, 38332 for signet).

- ``bitcoin-cli`` allows you to send `RPC <../reference/rpc/index.html>`__ commands to ``bitcoind`` from the command line. For example, ``bitcoin-cli help``

Expand Down
6 changes: 3 additions & 3 deletions examples/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Bitcoin Core provides testing tools designed to let developers test their applic
Testnet
~~~~~~~

When run with no arguments, all Bitcoin Core programs default to Bitcoin’s main `network <../devguide/p2p_network.html>`__ (:term:`mainnet <Mainnet>`). However, for development, it’s safer and cheaper to use Bitcoin’s test `network <../devguide/p2p_network.html>`__ (testnet) where the satoshis spent have no real-world value. Testnet also relaxes some restrictions (such as standard transaction checks) so you can test functions which might currently be disabled by default on mainnet.
When run with no arguments, all Bitcoin Core programs default to Bitcoin’s main `network <../devguide/p2p_network.html>`__ (:term:`mainnet <Mainnet>`). However, for development, it’s safer and cheaper to use Bitcoin’s test `network <../devguide/p2p_network.html>`__ (testnet4) where the satoshis spent have no real-world value. Testnet also relaxes some restrictions (such as standard transaction checks) so you can test functions which might currently be disabled by default on mainnet.

To use testnet, use the argument ``-testnet`` with ``bitcoin-cli``, ``bitcoind`` or ``bitcoin-qt`` or add ``testnet=1`` to your ``bitcoin.conf`` file as `described earlier <../examples/index.html>`__. To get free satoshis for testing, use `Piotr Piasecki’s testnet faucet <https://tpfaucet.appspot.com/>`__. Testnet is a public resource provided for free by members of the community, so please don’t abuse it.
To use testnet, use the argument ``-testnet4`` with ``bitcoin-cli``, ``bitcoind`` or ``bitcoin-qt`` or add ``testnet4=1`` to your ``bitcoin.conf`` file as `described earlier <../examples/index.html>`__. To get free satoshis for testing, use `Piotr Piasecki’s testnet faucet <https://tpfaucet.appspot.com/>`__. Testnet4 is a public resource provided for free by members of the community, so please don’t abuse it.

Regtest Mode
~~~~~~~~~~~~

For situations where interaction with random peers and blocks is unnecessary or unwanted, Bitcoin Core’s regression test mode (regtest mode) lets you instantly create a brand-new private block chain with the same basic rules as testnet—but one major difference: you choose when to create new blocks, so you have complete control over the environment.
For situations where interaction with random peers and blocks is unnecessary or unwanted, Bitcoin Core’s regression test mode (regtest mode) lets you instantly create a brand-new private block chain with the same basic rules as testnet4—but one major difference: you choose when to create new blocks, so you have complete control over the environment.

Many developers consider regtest mode the preferred way to develop new applications. The following example will let you create a regtest environment after you first `configure bitcoind <../examples/index.html>`__.

Expand Down
6 changes: 3 additions & 3 deletions reference/p2p_networking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ All `peer-to-peer <../devguide/p2p_network.html>`__ communication occurs entirel
Constants And Defaults
~~~~~~~~~~~~~~~~~~~~~~

The following constants and defaults are taken from Bitcoin Core’s `chainparams.cpp <https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp>`__ source code file.
The following constants and defaults are taken from Bitcoin Core’s `chainparams.cpp <https://github.com/bitcoin/bitcoin/blob/master/src/kernel/chainparams.cpp>`__ source code file.

+--------------------------------------------+--------------+------------------------------------------+------------+
| `Network <../devguide/p2p_network.html>`__ | Default Port | :term:`Start String <Start string>` | Max nBits |
+============================================+==============+==========================================+============+
| Mainnet | 8333 | 0xf9beb4d9 | 0x1d00ffff |
+--------------------------------------------+--------------+------------------------------------------+------------+
| Testnet | 18333 | 0x0b110907 | 0x1d00ffff |
| Testnet | 48333 | 0x1c163f28 | 0x1d00ffff |
+--------------------------------------------+--------------+------------------------------------------+------------+
| Regtest | 18444 | 0xfabfb5da | 0x207fffff |
+--------------------------------------------+--------------+------------------------------------------+------------+

Note: the testnet start string and nBits above are for testnet3; the original testnet used a different string and higher (less difficult) nBits.
Note: the testnet start string and nBits above are for testnet4; the original testnet used a different string and higher (less difficult) nBits.

Command line parameters can change what port a node listens on (see ``-help``). Start strings are hardcoded constants that appear at the start of all messages sent on the Bitcoin `network <../devguide/p2p_network.html>`__; they may also appear in data files such as Bitcoin Core’s block database. The nBits displayed above are in big-endian order; they’re sent over the `network <../devguide/p2p_network.html>`__ in little-endian order.

Expand Down