Skip to content

Commit

Permalink
add docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
fyInALT committed Mar 26, 2024
1 parent ae904b6 commit b74825c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
6 changes: 5 additions & 1 deletion contracts/script/EigenLayerDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,12 @@ contract EigenLayerDeployer is Script {
vm.serializeAddress(output, "underlayingToken", tokenAddress);
vm.serializeAddress(output, "strategyBaseTVLLimits", address(strategyBaseTVLLimits));

string memory EIGENLAYER = "EIGENLAYER_ADDRESSES_OUTPUT_PATH";
string memory defaultPath = "./script/output/eigenlayer_deploy_output.json";
string memory deployedPath = vm.envOr(EIGENLAYER, defaultPath);
vm.createDir("./script/output", true);

string memory finalJson = vm.serializeString(output, "object", output);
vm.writeJson(finalJson, "./script/output/eigenlayer_deploy_output.json");
vm.writeJson(finalJson, deployedPath);
}
}
11 changes: 9 additions & 2 deletions contracts/script/MachServiceManagerDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ contract MachServiceManagerDeployer is Script {
EigenLayerContracts memory eigenLayerContracts;

{
string memory deployedEigenLayerAddresses = vm.readFile("./script/output/eigenlayer_deploy_output.json");
string memory EIGENLAYER = "EIGENLAYER_ADDRESSES_OUTPUT_PATH";
string memory defaultPath = "./script/output/eigenlayer_deploy_output.json";
string memory deployedPath = vm.envOr(EIGENLAYER, defaultPath);
string memory deployedEigenLayerAddresses = vm.readFile(deployedPath);

bytes memory deployedStrategyManagerData = vm.parseJson(deployedEigenLayerAddresses, ".strategyManager");
address deployedStrategyManager = abi.decode(deployedStrategyManagerData, (address));
Expand Down Expand Up @@ -219,6 +222,10 @@ contract MachServiceManagerDeployer is Script {
);
vm.stopBroadcast();

string memory MACH = "MACHAVS_ADDRESSES_OUTPUT_PATH";
string memory defaultMachPath = "./script/output/machavs_deploy_output.json";
string memory deployedMachPath = vm.envOr(MACH, defaultMachPath);

string memory output = "machAVS deployment output";
vm.serializeAddress(output, "machServiceManager", address(machServiceContract.machServiceManager));
vm.serializeAddress(output, "registryCoordinator", address(machServiceContract.registryCoordinator));
Expand All @@ -230,6 +237,6 @@ contract MachServiceManagerDeployer is Script {
vm.serializeAddress(output, "operatorStateRetriever", address(machServiceContract.operatorStateRetriever));
string memory finalJson = vm.serializeString(output, "object", output);
vm.createDir("./script/output", true);
vm.writeJson(finalJson, "./script/output/machavs_deploy_output.json");
vm.writeJson(finalJson, deployedMachPath);
}
}
10 changes: 10 additions & 0 deletions contracts/script/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

forge script ./script/EigenLayerDeployer.s.sol --broadcast -vvvv \
--private-key $OWNER_PRIVATE \
--rpc-url $RPC_URL

forge script ./script/MachServiceManagerDeployer.s.sol \
--private-key $OWNER_PRIVATE \
--broadcast -vvvv --rpc-url $RPC_URL

39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3"

networks:
mach-avs-network:
name: mach-avs-network
driver: bridge

services:
anvil:
image: ghcr.io/foundry-rs/foundry
container_name: anvil
ports:
# opening the port so we can easily cast to anvil from localhost
- "8545:8545"
- "8546:8546"
entrypoint: anvil
command: --host 0.0.0.0
networks:
- mach-avs-network

contracts-deploy:
image: ghcr.io/foundry-rs/foundry
container_name: contracts-deploy
working_dir: /app/
volumes:
- ./contracts:/app/
environment:
- OWNER_PRIVATE=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- RPC_URL=http://anvil:8545
entrypoint: sh /app/script/deploy.sh
depends_on:
anvil:
condition: service_started
networks:
- mach-avs-network

volumes:
prometheus_data: {}
grafana_data: {}

0 comments on commit b74825c

Please sign in to comment.