Changeset View
Changeset View
Standalone View
Standalone View
doc/functional-tests.md
Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | |||||
- `mininode.py` contains all the definitions for objects that pass | - `mininode.py` contains all the definitions for objects that pass | ||||
over the network (`CBlock`, `CTransaction`, etc, along with the network-level | over the network (`CBlock`, `CTransaction`, etc, along with the network-level | ||||
wrappers for them, `msg_block`, `msg_tx`, etc). | wrappers for them, `msg_block`, `msg_tx`, etc). | ||||
- P2P tests have two threads. One thread handles all network communication | - P2P tests have two threads. One thread handles all network communication | ||||
with the bitcoind(s) being tested (using python's asyncore package); the other | with the bitcoind(s) being tested (using python's asyncore package); the other | ||||
implements the test logic. | implements the test logic. | ||||
- `NodeConn` is the class used to connect to a bitcoind. If you implement | - `P2PConnection` is the class used to connect to a bitcoind. `P2PInterface` | ||||
a callback class that derives from `NodeConnCB` and pass that to the | contains the higher level logic for processing P2P payloads and connecting to | ||||
`NodeConn` object, your code will receive the appropriate callbacks when | the Bitcoin Core node application logic. For custom behaviour, subclass the | ||||
events of interest arrive. | P2PInterface object and override the callback methods. | ||||
- Call `NetworkThread.start()` after all `NodeConn` objects are created to | - Call `NetworkThread.start()` after all `P2PInterface` objects are created to | ||||
start the networking thread. (Continue with the test logic in your existing | start the networking thread. (Continue with the test logic in your existing | ||||
thread.) | thread.) | ||||
- Can be used to write tests where specific P2P protocol behavior is tested. | - Can be used to write tests where specific P2P protocol behavior is tested. | ||||
Examples tests are `p2p-accept-block.py`, `p2p-compactblocks.py`. | Examples tests are `p2p-accept-block.py`, `p2p-compactblocks.py`. | ||||
#### Comptool | #### Comptool | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |