Run Ethereum smart contracts on Hyperledger Fabric-X.
fabric-x-evm adds an Ethereum-style JSON-RPC API and a native EVM to Fabric, so
you can deploy unmodified Solidity contracts and use the tooling you already
know - Hardhat, Foundry, MetaMask - against a permissioned, enterprise
blockchain.
By embedding the EVM inside Fabric you get the Ethereum contract ecosystem and
developer experience while keeping Fabric’s enterprise strengths: fine-grained
access control, privacy, deterministic consensus, and high performance. Existing
Ethereum assets, skills, and tools carry over with no rewrite — lowering the
barrier for organizations that want Ethereum compatibility in a permissioned
setting.
Highlights
Drop-in EVM - deploy existing Solidity contracts without modification.
Standard JSON-RPC - point any Ethereum client at :8545 (chain ID 4011 / 0xfab).
Familiar tooling - Hardhat, Foundry, MetaMask, and block explorers just work.
Fabric trust model - endorsement, consensus, and access control preserved.
Fabric and Fabric-X - deploy into any existing or new network to add EVM capabilities.
Try it out
The fastest way to see Fabric-X EVM in action is in the samples repository. It includes a full
network, a block explorer, and a token deploy-and-transfer demo. No need to clone or build this repo.
Any config field can be overridden at runtime without editing the file. The
variable name is GATEWAY_<SECTION>_<FIELD>, uppercased with dots and hyphens
replaced by underscores. For example:
The Ethereum conformance suite (make eth-tests, TestEthereumTests) runs the
ethereum/execution-specs state-test fixtures (Osaka+). The fixtures are fetched
on demand — downloaded and checksum-verified into a gitignored
testdata/execution-specs-tests/ directory — so no submodule init is required:
make eth-tests
Local
The simplest integration tests don’t require a Fabric network, but still
exercise the basic functionality of creating read/write sets out of EVM
transactions, and subsequently reading them.
make test-local
Fabric-X
Generate the crypto material once:
make init-x
Then start the Fabric-X testcontainer and create the namespace, run the
integration tests against it, and stop it again:
make start-x
make test-x
make stop-x
The container does not keep state.
Fablo
Start the network, run the integration tests, and stop it again:
make start-fablo
make test-fablo
make stop-fablo
Build your own contracts
Because the gateway speaks standard Ethereum JSON-RPC, any Solidity tutorial
works unchanged — just point the tool’s network at the gateway instead of a
public testnet:
Setting
Value
RPC URL
http://localhost:8545
Chain ID
4011
Gas
free — no account funding needed
Accounts
any key works
Good starting points, pointed at the URL above:
Foundry — deploy with forge create --rpc-url http://localhost:8545 ... or send transactions with cast send --rpc-url http://localhost:8545 ....
Hardhat — add a network entry in hardhat.config.js with url: "http://localhost:8545" and chainId: 4011, then deploy as usual.
MetaMask — add a custom network with the RPC URL and chain ID to interact from the browser.
A few things differ from a public chain — see Compatibility
for the details (gas/fee fields are stubbed, access control is Fabric’s, etc.).
For a complete worked example, see the
samples repo.
License
This repository uses different licenses for different components:
Go code: All Go source code in this repository is released under LGPL-3.0-or-later (see LICENSE.LGPL3)
Scripts: All scripts are released under Apache-2.0 (see LICENSE.Apache2)
SPDX License Expression
SPDX-License-Identifier: Apache-2.0 AND LGPL-3.0-or-later
fabric-x-evm
Run Ethereum smart contracts on Hyperledger Fabric-X.
fabric-x-evm adds an Ethereum-style JSON-RPC API and a native EVM to Fabric, so you can deploy unmodified Solidity contracts and use the tooling you already know - Hardhat, Foundry, MetaMask - against a permissioned, enterprise blockchain.
By embedding the EVM inside Fabric you get the Ethereum contract ecosystem and developer experience while keeping Fabric’s enterprise strengths: fine-grained access control, privacy, deterministic consensus, and high performance. Existing Ethereum assets, skills, and tools carry over with no rewrite — lowering the barrier for organizations that want Ethereum compatibility in a permissioned setting.
Highlights
:8545(chain ID4011/0xfab).Try it out
The fastest way to see Fabric-X EVM in action is in the samples repository. It includes a full network, a block explorer, and a token deploy-and-transfer demo. No need to clone or build this repo.
👉 hyperledger/fabric-x-samples → evm
Documentation
Building and running from source
This section is for developing against locally built code. If you just want to use the chain, the samples repo above is the easier path.
You’ll need Go and Docker (or Podman) for the Fabric-X network.
Build the
fxevmbinary:Bring up a local Fabric-X network (committer + application namespace):
Then run the gateway from your local build, pointed at that network. The sample config uses paths relative to
integration/, so run it from there:The gateway now serves Ethereum JSON-RPC at http://localhost:8545 (chain ID
4011) — point any Ethereum tooling at it. Stop the network with:Configuration
The gateway is configured via a YAML file passed to the
startcommand with-c:See
integration/fabx.yamlfor a complete annotated example. The top-level sections are:loggingnetworkfabricorfabric-x)gatewayendorsersEnvironment variable overrides
Any config field can be overridden at runtime without editing the file. The variable name is
GATEWAY_<SECTION>_<FIELD>, uppercased with dots and hyphens replaced by underscores. For example:Testing
Unit tests
Integration tests
The Ethereum conformance suite (
make eth-tests,TestEthereumTests) runs theethereum/execution-specsstate-test fixtures (Osaka+). The fixtures are fetched on demand — downloaded and checksum-verified into a gitignoredtestdata/execution-specs-tests/directory — so no submodule init is required:Local
The simplest integration tests don’t require a Fabric network, but still exercise the basic functionality of creating read/write sets out of EVM transactions, and subsequently reading them.
Fabric-X
Generate the crypto material once:
Then start the Fabric-X testcontainer and create the namespace, run the integration tests against it, and stop it again:
The container does not keep state.
Fablo
Start the network, run the integration tests, and stop it again:
Build your own contracts
Because the gateway speaks standard Ethereum JSON-RPC, any Solidity tutorial works unchanged — just point the tool’s network at the gateway instead of a public testnet:
http://localhost:85454011Good starting points, pointed at the URL above:
forge create --rpc-url http://localhost:8545 ...or send transactions withcast send --rpc-url http://localhost:8545 ....hardhat.config.jswithurl: "http://localhost:8545"andchainId: 4011, then deploy as usual.A few things differ from a public chain — see Compatibility for the details (gas/fee fields are stubbed, access control is Fabric’s, etc.). For a complete worked example, see the samples repo.
License
This repository uses different licenses for different components:
LICENSE.LGPL3)LICENSE.Apache2)SPDX License Expression