Docker compose example showcasing Web3Signer and Hashicorp Vault integration with TLS enabled.
- Ensure Docker is running
- A custom docker network named
w3s_networkexists or created:
docker network create w3s_network- For profiling: Linux host or Docker Desktop with 4GB+ memory allocated
Using a different terminal window, bring Hashicorp Vault up. See README for more details.
cd ./vault
docker compose upThe gen-keys docker compose can be used to set up BLS keys that will be loaded into
Web3Signer. Based on your testing needs, you can generate the following configurations:
- Generate and insert BLS Keys into Hashicorp Vault to be loaded via yaml config files. Generated in
./web3signer/config/keysdirectory. - Generate and insert BLS Keys into Hashicorp Proxy to be loaded via yaml config files. Generated in
./web3signer/config/keysdirectory. - Generate (Light) BLS keystores and password files to be loaded via yaml config files. Generated in
./web3signer/config/keysdirectory. - Generate (Light) BLS Keystores and password files to be bulkloaded. Generated in
./web3signer/config/keystoresdirectory.
You can mix and match the above configurations based on your testing needs.
The Keys can either be generated before starting Web3Signer or after it is running.
cd ./web3signer
docker compose upOr with custom web3siger image (and/or config file):
WEB3SIGNER_IMAGE=web3signer:keymanager_pr CONFIG_FILE_NAME=config-km.yaml docker compose up[!NOTE] If you are modifying SQL files and want to rebuild sql-copier image, run:
docker compose build --no-cache && docker compose upReload the Web3Signer configuration to load the keys (if generated after starting Web3Signer):
curl -X POST http://localhost:9000/reloadTo test Key Manager API:
CONFIG_FILE_NAME=config-km.yaml docker compose upFollowed by running import_keystores.sh which will upload keystores from ./config/keystores directory. They should
be uploaded to config/km/ks directory or skip storage on disk depending on the setting in config-km.yaml.
To generate Web3Signer's Java process heapdump from the host machine:
# Heap dump
docker exec ws-develop jcmd 1 GC.heap_dump /heapsumps/w3s_heapdump.hprof# From another terminal window
docker compose down
# Full cleanup
./scripts/clear-all.sh