Skip to main content

Set up your environment and start the local network

This guide takes you from zero to a working example contract deployed on a local ISBE network.


Prerequisites

ToolMinimum versionCheck
Node.js18node --version
npm9npm --version
Gitanygit --version
Dockeranydocker --version
  • Node.js: nodejs.org (LTS version recommended)
  • Docker: docker.com — must be running before starting the network

1. Clone the template

ISBE provides a template repository that already has the correct structure, required dependencies, and a working example contract:

git clone https://github.com/red-isbe/isbe-clients-template my-contract
cd my-contract
npm install
tip

npm install downloads @red-isbe/isbe-contracts along with Hardhat, TypeChain, and OpenZeppelin dependencies. This may take a minute.


2. Configure environment variables

cp .env_sample .env

The .env_sample already contains the correct credentials for the local network:

ACCOUNT_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
ACCOUNT_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
LOCALHOST_URL=http://localhost:8545

These are the Hardhat account #0 credentials, which are pre-funded and hold admin permissions on the local network's Diamond.

⚠️ These credentials are public. They are only valid for local development — never use them on mainnet or any environment with real value.


3. Start the local ISBE network

The template includes a full ISBE network that runs in Docker. From the repository root:

cd isbe-network-case
./startNetwork.sh

The script starts 4 Hyperledger Besu nodes with QBFT consensus. When it finishes, verify they are running:

docker ps

You should see something like:

CONTAINER ID   IMAGE                     COMMAND                  CREATED      STATUS                            PORTS                                                       NAMES
24705181db60 hyperledger/besu:latest "besu-entry.sh --con…" ... Up ... 0.0.0.0:8548->8548/tcp, 0.0.0.0:9549->9549/tcp, 0.0.0.0:30307->30307/tcp node4
7a10430e6928 hyperledger/besu:latest "besu-entry.sh --con…" ... Up ... 0.0.0.0:8547->8547/tcp, 0.0.0.0:9548->9548/tcp, 0.0.0.0:30306->30306/tcp node3
a1890c407fd0 hyperledger/besu:latest "besu-entry.sh --con…" ... Up ... 0.0.0.0:8546->8546/tcp, 0.0.0.0:9547->9547/tcp, 0.0.0.0:30305->30305/tcp node2
d24c318022a2 hyperledger/besu:latest "besu-entry.sh --con…" ... Up ... 0.0.0.0:8545->8545/tcp, 0.0.0.0:9545->9545/tcp, 0.0.0.0:30303->30303/tcp bootnode

4 containers in Up state. The bootnode exposes the RPC at http://localhost:8545 — that is what all Hardhat scripts connect to.

The ISBE Governance Diamond is pre-deployed in genesis at 0x00000000000000000000000000000000000015BE. You do not need to deploy it — it is available from the moment the network starts.

To stop the network when you are done:

./stopNetwork.sh

4. Compile the contracts

Back in the repository root:

cd ..
npx hardhat compile

You should see:

Generating typings for: N artifacts in dir: typechain-types for target: ethers-v6
Successfully generated N typings!
Compiled N Solidity files successfully (evm target: istanbul).

If there are errors, verify that npm install ran correctly and that your Node version is ≥ 18.


5. Deploy the example contract

The template includes a complete Modality 1 example — HashTimestamp — which records document hashes on the blockchain with their timestamp.

npx hardhat run scripts/hashtimestamp/deployHashTimestamp.ts --network isbe

The output shows the deployment addresses:

[1/3] deploy...
Implementation: 0x...
[2/3] setConfiguration...
[3/3] deployUseCase...

✓ Deployment complete
Proxy: 0x<your-proxy>
Resolver key: 0x...
Config ID: 0x...

The Proxy address is the one you interact with from now on.


6. Verify it works

npx hardhat console --network isbe
const proxy = await ethers.getContractAt(
'HashTimestampFacet',
'0x<your-proxy>'
)

await proxy.eip712Domain() // → name, chainId, verifying contract
await proxy.exists(ethers.ZeroHash) // → false

If eip712Domain() responds without reverting, the contract is correctly deployed and routed through the Diamond.


Next step

With the environment working and the example deployed:

  • Deployment modalities — Understand which modality fits your use case before writing your own contracts.
  • Practical guides — Code snippets for implementing storage, RBAC, and pause in your contract.