Skip to content

Adapters

ConsensusOS ships with adapters for three blockchain networks. Each adapter is a standard plugin that communicates through the event bus and respects the frozen Plugin API v1 contract.

FactoryChainStatus
createXrplAdapter()XRPLImplemented
createEthereumAdapter()EthereumImplemented
createCosmosAdapter()CosmosImplemented

Register an adapter like any other plugin:

import {
CoreLoader,
createXrplAdapter,
createEthereumAdapter,
} from "@mcptoolshop/consensus-os";
const loader = new CoreLoader();
loader.register(createXrplAdapter());
loader.register(createEthereumAdapter());
await loader.boot();
Terminal window
npx consensusos adapters # List and query chain adapters

Every adapter implements the ChainAdapter interface, which provides a uniform abstraction across blockchain networks:

MethodDescription
connect(config)Connect to a chain network using ChainConfig (family, networkId, nodes)
disconnect()Disconnect from the chain network
getInfo()Get chain info (latest block, node version, chain-specific extras)
query(method, params)Execute a raw chain-specific query
healthCheck()Check connection health and latency

Connection states: disconnectedconnectingconnected (or error).

The AdapterRegistry manages adapter instances by chain family. Use it to register, look up, and iterate adapters when building multi-chain systems.

Chain adapters follow the same plugin pattern as all other modules. Extend BasePlugin, declare the adapter capability, and implement the ChainAdapter interface in your lifecycle hooks.

import { BasePlugin, ManifestBuilder } from "@mcptoolshop/consensus-os/plugin";
class MySolanaAdapter extends BasePlugin {
readonly manifest = ManifestBuilder.create("solana-adapter")
.name("Solana Adapter")
.version("1.0.0")
.capability("adapter")
.build();
protected async onStart() {
this.emit("solana-adapter.ready", { status: "connected" });
}
}

See the ADAPTER_GUIDE.md for a complete walkthrough.