MCPcopy Index your code
hub / github.com/Conflux-Chain/conflux-rust

github.com/Conflux-Chain/conflux-rust @v3.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0.3 ↗ · + Follow
17,723 symbols 73,840 edges 1,780 files 3,321 documented · 19% updated 1d agov3.0.3-testnet-fix · 2026-05-19★ 71960 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Conflux-Rust

Conflux-rust is a Rust-based implementation of the Conflux protocol. It is fast and reliable.

For Users

Please follow the Conflux Documentation to install and run Conflux.

For Developers

For a general overview of the crates, see Project Layout.

Contribution

Thank you for considering helping out with our source code. We appreciate any contributions, even the smallest fixes. Please read the guidelines on how to submit issues and pull requests. Note that if you want to propose significant changes to the Conflux protocol, please submit a CIP.

Building

The Minimum Supported Rust Version (MSRV) of this project is 1.90

See the doc for detailed instructions on how to build from source.

If you have modified any Rust code, please run the cargo_fmt.sh script before committing to format the code and ensure consistent code style.

Unit Tests

Unit tests come together with the Rust code. They can be invoked via cargo test --release --all. See the Getting Started page for more information.

Integration Tests

Integration tests are Python test scripts with the _test.py suffix in the tests directory and in the integration_tests/tests directory. To run these tests:

  1. Setting up and activating a NEW virtual env via source ./dev-support/activate_new_venv.sh. This command will create a new one with Python 3.11 to .venv and activate it each time you run it. Or you can simply run .venv/bin/activate to activate the created one.
  2. Install the required Python packages using bash ./dev-support/dep_pip3.sh in the root directory.
  3. Compile Conflux in release mode using cargo build --release
  4. Compile the consensus_bench binary using cd tools/consensus_bench && cargo build --release
  5. Fetch all submodule using git submodule update --remote --recursive --init.

Then, you can run all integration tests using:

  • python3 tests/test_all.py for tests in the tests directory
  • pytest ./integration_tests/tests -vv -n 6 --dist loadscope for tests in the integration_tests directory

As for running tests with coverage, please refer to Coverage.

Resources

License

GNU General Public License v3.0

Extension points exported contracts — how you extend this code

GetMaybeRequestId (Interface)
TODO: GetMaybeRequestId is part of Message due to the implementation of TODO: Throttled. Conceptually this class isn't p [9 …
crates/cfxcore/core/src/message.rs
OnChainConfig (Interface)
Trait to be implemented by a Rust struct representation of an on-chain config that is stored in storage as a serialized [8 …
crates/pos/types/types/src/on_chain_config/mod.rs
WrappedCreateFrom (Interface)
The purpose of this trait is to create a new value of a passed object, when the passed object is the value, simply move [6 …
crates/dbs/storage/src/utils/mod.rs
IsDefault (Interface)
This trait checks whether a variable equals to initialization value. For a variable equals to the initialization value, [7 …
crates/primitives/src/is_default.rs
MallocSizeOf (Interface)
Trait for measuring the "deep" heap usage of a data structure. This is the most commonly-used of the traits. [84 implementers]
crates/util/malloc_size_of/src/lib.rs
Precompile (Interface)
Native implementation of a built-in contract. [11 implementers]
crates/execution/executor/src/builtin/interface.rs
KeyPairGenerator (Interface)
Generates new keypair. [5 implementers]
crates/cfx_key/src/lib.rs
JobDispatcher (Interface)
Interface that can provide pow/blockchain-specific responses for the clients [4 implementers]
crates/stratum/src/traits.rs

Core symbols most depended-on inside this repo

new
called by 3391
crates/cfxcore/core/src/sync/mod.rs
unwrap
called by 3303
crates/primitives/src/storage.rs
new
called by 1614
crates/pos/common/channel/src/lib.rs
default
called by 1161
crates/cfxcore/core/src/genesis_block.rs
assert_equal
called by 1060
tests/test_framework/util.py
clone
called by 956
crates/cfxcore/core/src/pos/consensus/util/mock_time_service.rs
map
called by 873
crates/dbs/storage/src/impls/storage_db/sqlite.rs
clone
called by 638
crates/dbs/storage/src/impls/merkle_patricia_trie/maybe_in_place_byte_array.rs

Shape

Method 11,048
Function 3,443
Class 2,404
Enum 443
Interface 384
Route 1

Languages

Rust84%
Python14%
C++1%

Modules by API surface

crates/cfxcore/core/src/consensus/consensus_inner/mod.rs132 symbols
tests/conflux/rpc.py100 symbols
integration_tests/conflux/rpc.py100 symbols
crates/cfxcore/core/src/block_data_manager/mod.rs98 symbols
crates/network/src/service.rs91 symbols
tests/tg_archive_tests/health_check.py83 symbols
crates/cfxcore/core/benchmark/storage/src/main.rs82 symbols
crates/cfxcore/core/src/sync/synchronization_protocol_handler.rs81 symbols
crates/cfxcore/core/benchmark/storage/parity-snappy/rust-snappy/snappy-sys/snappy/snappy.cc81 symbols
crates/pos/types/types/src/transaction/mod.rs78 symbols
crates/pos/types/types/src/term_state.rs77 symbols
crates/pos/secure/storage/vault/src/lib.rs75 symbols

For agents

$ claude mcp add conflux-rust \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact