Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
SV2 Integration Tests
This library provides tools for building integration tests for Stratum V2 roles.
Additionally, the library includes pre-defined integration tests for various Stratum V2
roles/scenarios, which can be found in the tests folder.
Each role has a start_[role_name] function that can be called to run the respective role.
To assert the behavior of a role or the messages it exchanges with other roles, you can use the Sniffer module to listen to the messages between roles.
For examples on how to use the Sniffer helper, check out the sniffer_integration.rs module or
other tests in the tests folder.
All tests run in either regtest or signet network.
Bitcoin Core v30.2 binaries are downloaded from https://bitcoincore.org/bin/bitcoin-core-30.2/ and the Template provider (sv2-tp) binaries from https://github.com/stratum-mining/sv2-tp/releases.
Bitcoin Core runs via IPC, and sv2-tp provides Stratum V2 template distribution. These are the only external dependencies in our tests.
Running Tests Instructions
To run pre defined integration tests, use the following command:
Note: during the execution of the tests, the template-provider directory holds the downloaded
binaries (Bitcoin Core and sv2-tp), while test data directories are created in the system temp
directory.
Standalone mining_device Binary
The embedded integration_tests_sv2::mining_device module also exposes a standalone executable
binary again.
To build it:
The executable will be available at integration-tests/target/release/mining_device.
To run it directly through Cargo:
Writing Custom Integration Tests
- To write your own integration tests using this library, you can install the library as follows:
Then, create your own test by using the library as shown below:
use ;
use ;
;
async
License
MIT OR Apache-2.0