Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: format config files to suit helm chart #39

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions docker/scripts/gen-configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,67 @@ gen_config_contracts_toml() {
fi
}

# format_config_file will add "scrollConfig: |" to the first line and indent the rest
format_config_file() {
local file="$1"
local config_scroll_key="configScroll: |"
temp_file=$(mktemp)

{
echo $config_scroll_key
while IFS= read -r line; do
echo " $line"
done < "$file"
} > "$temp_file"

mv "$temp_file" "$file"
}

echo ""
echo "generating config-contracts.toml"
gen_config_contracts_toml

echo ""
echo "generating genesis.json"
echo "generating genesis.yaml"
forge script scripts/deterministic/GenerateGenesis.s.sol:GenerateGenesis || exit 1
format_config_file "./volume/genesis.yaml"

echo ""
echo "generating rollup-config.json"
echo "generating rollup-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateRollupConfig || exit 1
format_config_file "./volume/rollup-config.yaml"

echo ""
echo "generating coordinator-config.json"
echo "generating coordinator-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateCoordinatorConfig || exit 1
format_config_file "./volume/coordinator-config.yaml"

echo ""
echo "generating chain-monitor-config.json"
echo "generating chain-monitor-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateChainMonitorConfig || exit 1
format_config_file "./volume/chain-monitor-config.yaml"

echo ""
echo "generating bridge-history-config.json"
echo "generating bridge-history-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateBridgeHistoryConfig || exit 1
format_config_file "./volume/bridge-history-config.yaml"

echo ""
echo "generating balance-checker-config.json"
echo "generating balance-checker-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateBalanceCheckerConfig || exit 1
format_config_file "./volume/balance-checker-config.yaml"

echo ""
echo "generating frontend-config"
echo "generating frontend-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateFrontendConfig || exit 1
format_config_file "./volume/frontend-config.yaml"

echo ""
echo "generating rollup-explorer-backend-config.json"
echo "generating rollup-explorer-backend-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateRollupExplorerBackendConfig || exit 1
format_config_file "./volume/rollup-explorer-backend-config.yaml"

echo ""
echo "generating admin-system-backend-config.json"
echo "generating admin-system-backend-config.yaml"
forge script scripts/deterministic/GenerateConfigs.s.sol:GenerateAdminSystemBackendConfig || exit 1
format_config_file "./volume/admin-system-backend-config.yaml"
20 changes: 10 additions & 10 deletions scripts/deterministic/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ string constant CONFIG_PATH = "./volume/config.toml";
// output files
string constant CONFIG_CONTRACTS_PATH = "./volume/config-contracts.toml";
string constant GENESIS_ALLOC_JSON_PATH = "./volume/__genesis-alloc.json";
string constant GENESIS_JSON_PATH = "./volume/genesis.json";
string constant ROLLUP_CONFIG_PATH = "./volume/rollup-config.json";
string constant COORDINATOR_CONFIG_PATH = "./volume/coordinator-config.json";
string constant CHAIN_MONITOR_CONFIG_PATH = "./volume/chain-monitor-config.json";
string constant BRIDGE_HISTORY_CONFIG_PATH = "./volume/bridge-history-config.json";
string constant BALANCE_CHECKER_CONFIG_PATH = "./volume/balance-checker-config.json";
string constant FRONTEND_ENV_PATH = "./volume/frontend-config";
string constant ROLLUP_EXPLORER_BACKEND_CONFIG_PATH = "./volume/rollup-explorer-backend-config.json";
string constant ADMIN_SYSTEM_BACKEND_CONFIG_PATH = "./volume/admin-system-backend-config.json";
string constant GENESIS_JSON_PATH = "./volume/genesis.yaml";
string constant ROLLUP_CONFIG_PATH = "./volume/rollup-config.yaml";
string constant COORDINATOR_CONFIG_PATH = "./volume/coordinator-config.yaml";
string constant CHAIN_MONITOR_CONFIG_PATH = "./volume/chain-monitor-config.yaml";
string constant BRIDGE_HISTORY_CONFIG_PATH = "./volume/bridge-history-config.yaml";
string constant BALANCE_CHECKER_CONFIG_PATH = "./volume/balance-checker-config.yaml";
string constant FRONTEND_ENV_PATH = "./volume/frontend-config.yaml";
string constant ROLLUP_EXPLORER_BACKEND_CONFIG_PATH = "./volume/rollup-explorer-backend-config.yaml";
string constant ADMIN_SYSTEM_BACKEND_CONFIG_PATH = "./volume/admin-system-backend-config.yaml";

// plonk verifier configs
bytes32 constant V4_VERIFIER_DIGEST = 0x0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec;
bytes32 constant V4_VERIFIER_DIGEST = 0x0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec;
Loading