Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains - Omit embedded publish git dirs and empty placeholders from index Made-with: Cursor
This commit is contained in:
42
scripts/op-stack/init-operator-workdirs.sh
Normal file
42
scripts/op-stack/init-operator-workdirs.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROLE="${1:-}"
|
||||
if [[ "$ROLE" != "deployer" && "$ROLE" != "ops" ]]; then
|
||||
echo "Usage: $0 <deployer|ops>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BOOTSTRAP_ROOT="${OP_STACK_BOOTSTRAP_ROOT:-/opt/op-stack-bootstrap}"
|
||||
STATE_ROOT="${OP_STACK_STATE_ROOT:-/var/lib/op-stack}"
|
||||
CONFIG_ROOT="${OP_STACK_CONFIG_ROOT:-/etc/op-stack}"
|
||||
SERVICE_USER="${OP_STACK_SERVICE_USER:-opstack}"
|
||||
SERVICE_GROUP="${OP_STACK_SERVICE_GROUP:-opstack}"
|
||||
|
||||
install -d -m 750 \
|
||||
"$STATE_ROOT/artifacts/mainnet" \
|
||||
"$STATE_ROOT/artifacts/sepolia" \
|
||||
"$STATE_ROOT/logs/mainnet" \
|
||||
"$STATE_ROOT/logs/sepolia"
|
||||
|
||||
if [[ "$ROLE" == "deployer" ]]; then
|
||||
install -d -m 750 "$STATE_ROOT/deployer/mainnet" "$STATE_ROOT/deployer/sepolia"
|
||||
if [[ ! -f "$STATE_ROOT/artifacts/pinned-versions.manifest.yaml" ]]; then
|
||||
cp "$BOOTSTRAP_ROOT/config/op-stack-superchain/pinned-versions.manifest.example.yaml" \
|
||||
"$STATE_ROOT/artifacts/pinned-versions.manifest.yaml"
|
||||
chmod 640 "$STATE_ROOT/artifacts/pinned-versions.manifest.yaml"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$ROLE" == "ops" ]]; then
|
||||
install -d -m 750 "$STATE_ROOT/runtime/mainnet" "$STATE_ROOT/runtime/sepolia"
|
||||
fi
|
||||
|
||||
chown -R "$SERVICE_USER:$SERVICE_GROUP" "$STATE_ROOT"
|
||||
chown root:"$SERVICE_GROUP" "$CONFIG_ROOT"/*.env "$CONFIG_ROOT/jwt.hex"
|
||||
|
||||
cat <<EOF
|
||||
Initialized OP Stack $ROLE workdirs
|
||||
artifacts: $STATE_ROOT/artifacts
|
||||
logs: $STATE_ROOT/logs
|
||||
EOF
|
||||
Reference in New Issue
Block a user