Shared SourceHub (Cosmos / Tendermint) blockchain client code, configuration, and test harnesses that spin up Docker Compose stacks. Used by authz, bulletin, orbis-node, and integration tests.
src/blockchain/mod.rs re-exports:
| Item | Role |
|---|---|
ChainConfig / ChainConfigBuilder |
RPC, REST, gRPC URLs, gas, chain ID, account prefix |
SourceHubClient |
Queries + tx broadcast; optional TxSigner for signed txs |
TxSigner |
secp256k1 signing for Cosmos-style transactions |
acp |
Access-control policy types and verify/query helpers (used by authz) |
bulletin |
Bulletin-board chain messages (used by bulletin crate) |
bank, events |
Bank transfers and event subscriptions as needed by the client |
Typical wiring: build a ChainConfig (often via ChainConfigBuilder::default() with .grpc_url(), .rpc_url(), .rest_url(), .denom()), then SourceHubClient::new or SourceHubClient::with_signer.
src/lib.rs also defines:
SourceHubTestContainer— Startsdocker/docker-compose-sourcehub-test.ymlfrom the repo root, waits for RPC health, tears down on drop. ExposesSOURCEHUB_RPC_URL(http://localhost:26657) and REST API URL.IntegrationTestNetwork— Startsdocker/docker-compose-integration-test.yml(SourceHub + three orbis nodes). Exposes gRPC ports 50051–50053,ORBIS_INTEGRATION_CRYPTOsync with compile-timebls12-381/decaf377features, and helpers liketransform_p2p_addressfor container-to-container peer strings.
Both require Docker and curl (and nc for integration tests) on the host.
| Feature | Purpose |
|---|---|
bls12-381 |
Compile-time marker for crypto alignment in tests (e.g. integration test env defaults). |
decaf377 |
Same for decaf377 builds. |
These flags do not change blockchain APIs by themselves; they coordinate with orbis-node / cli-tool feature sets.
- Cosmos / Tendermint:
cosmrs,tendermint,tendermint-rpc,prost,tonic - HTTP:
reqwest - Keys:
k256,bip32 - Async:
tokio,async-trait,backoff,futures
cargo test -p commonDocker-backed tests live under src/blockchain/tests.rs and in authz / bulletin crates that depend on SourceHubTestContainer.