https://github.com/gjeanmart/safe-ganache-node
https://github.com/gjeanmart/safe-ganache-node
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gjeanmart/safe-ganache-node
- Owner: gjeanmart
- Created: 2025-03-09T14:04:14.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T14:38:05.000Z (3 months ago)
- Last Synced: 2025-03-09T15:24:35.662Z (3 months ago)
- Language: TypeScript
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Safe x Ganache x Hardhat Docker container
[](https://hub.docker.com/r/gjeanmart/safe-ganache-node)
A Docker container for launching a local Ethereum node using Ganache and deploying Safe's singleton contracts deterministically. This ensures contracts remain deployed across node restarts without requiring redeployment.
### Getting started
**Example with Docker**
```shell
$ docker run --name safe-ganache-node --rm \
-p 8545:8545 \
-e CHAIN_ID=1337 \
-ti gjeanmart/safe-ganache-node:latest
```**Example with Docker Compose**
```yaml
node:
image: gjeanmart/safe-ganache-node:latest
ports:
- 8545:8545
environment:
MNEMONIC: ${MNEMONIC}
CHAIN_ID: ${CHAIN_ID}
volumes:
- ./data/ganache:/db
healthcheck:
test: curl -sf -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' localhost:8545
interval: 5s
timeout: 5s
retries: 5
```### Environment Variables
| ENV_VAR | default value | description |
|--------------------|-------------------------------------------------------------|---------------------------------------------------------------------|
| DB | /db | Path to the directory where the chain database is stored |
| MNEMONIC | test test test test test test test test test test test junk | HD wallet mnemonic for generating initial addresses |
| RPC_PORT | 8545 | Port for the RPC server |
| CHAIN_ID | 1337 | Chain ID of the network |
| GANACHE_EXTRA_ARGS | | Additional arguments for the Ganache command |### Development
Install dependencies
```shell
$ yarn
```Run with Docker Compose
```shell
$ docker compose up
```