Skip to main content

Crate taceo_nodes_common

Crate taceo_nodes_common 

Source
Expand description

Common utilities for MPC-node services.

This crate provides building blocks shared across nodes in the MPC network.

  • Environment – represents the deployment environment (prod / staging / test).
  • StartedServices – tracks whether all async background services have started, used to drive the /health endpoint.
  • spawn_shutdown_task / default_shutdown_signal – wiring for graceful shutdown via CTRL+C or SIGTERM.
  • version_info! – macro that returns a version string containing the crate name, semver version, and git hash.

§Optional Features

  • api (enabled by default) – exposes /health and /version Axum endpoints.
  • serde (enabled by default) – ser/de implementation for Environment.
  • aws (enabled by default) – adds a method to create a localstack configuration used for testing.
  • postgres (enabled by default) – postgres::PostgresConfig and postgres::pg_pool_with_schema for creating a sqlx connection pool pinned to a schema, with configurable retry behaviour.“
  • alloy (enabled by default) – web3::RpcProvider, web3::RpcProviderBuilder, and web3::RpcProviderConfig for building HTTP + WebSocket Ethereum RPC providers with automatic retry and failover, plus ERC-165 interface detection utilities.

Re-exports§

pub use git_version;

Modules§

api
See api::routes and api::routes_with_services. Health Check Endpoints
postgres
Configuration for a Postgres database.
web3
RPC provider utilities for interacting with Ethereum nodes.

Macros§

version_info
Macro to generate version information including the crate name, version, and git hash.

Structs§

StartedServices
A struct that keeps track of the health of all async services started by the service.

Enums§

Environment
The environment the service is running in.

Functions§

default_shutdown_signal
Returns a future that completes when the application should shut down.
localstack_aws_config
Creates an AWS SDK configuration for connecting to a LocalStack instance.
spawn_shutdown_task
Spawns a shutdown task and creates an associated CancellationToken. This task will complete when either the provided shutdown_signal futures completes or if some other tasks cancels the shutdown token. The associated shutdown token will be cancelled either way.