diff --git a/.github/workflows/validate-config-schema.yml b/.github/workflows/validate-config-schema.yml new file mode 100644 index 0000000..f0b5884 --- /dev/null +++ b/.github/workflows/validate-config-schema.yml @@ -0,0 +1,34 @@ +name: Validate JSON Schema + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + validate_json: + runs-on: ubuntu-latest + + steps: + # Checkout the repository code + - name: Checkout code + uses: actions/checkout@v4 + + # Set up Node.js to install ajv-cli + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "18.x" + + # Install ajv-cli globally + - name: Install ajv-cli + run: npm install -g ajv-cli + + # Validate JSON against schema + - name: Validate config.json with schema.json + run: | + ajv validate -s config/config.schema.json -d config/config.json --strict=true diff --git a/config/config.json b/config/config.json new file mode 100644 index 0000000..3299e8e --- /dev/null +++ b/config/config.json @@ -0,0 +1,126 @@ +{ + "apis": { + "execution": { + "httpRpc": { + "port": 8545 + }, + "wsRpc": { + "port": 8546 + }, + "engine": { + "port": 8551 + } + }, + "consensus": { + "beacon": { + "port": 3500 + }, + "validator": { + "port": 3500, + "auth": { + "prysm": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg", + "lighthouse": "api-token-0x0200e6ce18e26fd38caca7ae1bfb9e2bba7efb20ed2746ad17f2f6dda44603152d", + "teku": "cd4892ca35d2f5d3e2301a65fc7aa660", + "lodestar": "api-token-0x7fd16fff6453982a5d8bf14617e7823b68cd18ade59985befe64e0a659300e7d", + "nimbus": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg" + } + } + }, + "signer": { + "web3signer": { + "port": 9000 + }, + "brain": { + "port": 3000 + } + }, + "mev-boost": { + "mev-boost": { + "port": 18550 + } + } + }, + "networks": { + "mainnet": { + "jwt": "7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e4000000001", + "packages": { + "execution": [ + "geth.dnp.dappnode.eth", + "nethermind.public.dappnode.eth", + "besu.public.dappnode.eth", + "erigon.dnp.dappnode.eth", + "reth.dnp.dappnode.eth" + ], + "consensus": [ + "prysm.dnp.dappnode.eth", + "lighthouse.dnp.dappnode.eth", + "teku.dnp.dappnode.eth", + "lodestar.dnp.dappnode.eth", + "nimbus.dnp.dappnode.eth" + ], + "signer": ["web3signer.dnp.dappnode.eth"], + "mev-boost": ["mev-boost.dnp.dappnode.eth"] + } + }, + "holesky": { + "jwt": "7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e4000004268", + "packages": { + "execution": [ + "holesky-geth.dnp.dappnode.eth", + "holesky-nethermind.dnp.dappnode.eth", + "holesky-besu.dnp.dappnode.eth", + "holesky-erigon.dnp.dappnode.eth", + "holesky-reth.dnp.dappnode.eth" + ], + "consensus": [ + "prysm-holesky.dnp.dappnode.eth", + "lighthouse-holesky.dnp.dappnode.eth", + "teku-holesky.dnp.dappnode.eth", + "lodestar-holesky.dnp.dappnode.eth", + "nimbus-holesky.dnp.dappnode.eth" + ], + "signer": ["web3signer-holesky.dnp.dappnode.eth"], + "mev-boost": ["mev-boost-holesky.dnp.dappnode.eth"] + } + }, + "gnosis": { + "jwt": "7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e4000000064", + "packages": { + "execution": [ + "nethermind-xdai.dnp.dappnode.eth", + "gnosis-erigon.dnp.dappnode.eth" + ], + "consensus": [ + "gnosis-beacon-chain-prysm.dnp.dappnode.eth", + "lighthouse-gnosis.dnp.dappnode.eth", + "teku-gnosis.dnp.dappnode.eth", + "lodestar-gnosis.dnp.dappnode.eth", + "nimbus-gnosis.dnp.dappnode.eth" + ], + "signer": ["web3signer-gnosis.dnp.dappnode.eth"], + "mev-boost": [] + } + }, + "lukso": { + "jwt": "7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e400000002a", + "packages": { + "execution": ["lukso-geth.dnp.dappnode.eth"], + "consensus": [ + "prysm-lukso.dnp.dappnode.eth", + "teku-lukso.dnp.dappnode.eth" + ], + "signer": ["web3signer-lukso.dnp.dappnode.eth"], + "mev-boost": [] + } + }, + "sepolia": { + "jwt": "7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e4000aa36a7", + "packages": { + "execution": ["sepolia-geth.dnp.dappnode.eth"], + "consensus": ["prysm-sepolia.dnp.dappnode.eth"], + "signer": [], + "mev-boost": [] + } + } + } +} diff --git a/config/config.schema.json b/config/config.schema.json new file mode 100644 index 0000000..01a44ea --- /dev/null +++ b/config/config.schema.json @@ -0,0 +1,260 @@ +{ + "type": "object", + "properties": { + "apis": { + "type": "object", + "properties": { + "execution": { + "type": "object", + "properties": { + "httpRpc": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + }, + "wsRpc": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + }, + "engine": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + } + }, + "required": ["httpRpc", "wsRpc", "engine"] + }, + "consensus": { + "type": "object", + "properties": { + "beacon": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + }, + "validator": { + "type": "object", + "properties": { + "port": { "type": "integer" }, + "auth": { + "type": "object", + "properties": { + "prysm": { "type": "string" }, + "lighthouse": { "type": "string" }, + "teku": { "type": "string" }, + "lodestar": { "type": "string" }, + "nimbus": { "type": "string" } + }, + "required": [ + "prysm", + "lighthouse", + "teku", + "lodestar", + "nimbus" + ] + } + }, + "required": ["port", "auth"] + } + }, + "required": ["beacon", "validator"] + }, + "signer": { + "type": "object", + "properties": { + "web3signer": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + }, + "brain": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + } + }, + "required": ["web3signer", "brain"] + }, + "mev-boost": { + "type": "object", + "properties": { + "mev-boost": { + "type": "object", + "properties": { + "port": { "type": "integer" } + }, + "required": ["port"] + } + }, + "required": ["mev-boost"] + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + }, + "networks": { + "type": "object", + "properties": { + "mainnet": { + "type": "object", + "properties": { + "jwt": { "type": "string" }, + "packages": { + "type": "object", + "properties": { + "execution": { + "type": "array", + "items": { "type": "string" } + }, + "consensus": { + "type": "array", + "items": { "type": "string" } + }, + "signer": { + "type": "array", + "items": { "type": "string" } + }, + "mev-boost": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + } + }, + "required": ["jwt", "packages"] + }, + "holesky": { + "type": "object", + "properties": { + "jwt": { "type": "string" }, + "packages": { + "type": "object", + "properties": { + "execution": { + "type": "array", + "items": { "type": "string" } + }, + "consensus": { + "type": "array", + "items": { "type": "string" } + }, + "signer": { + "type": "array", + "items": { "type": "string" } + }, + "mev-boost": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + } + }, + "required": ["jwt", "packages"] + }, + "gnosis": { + "type": "object", + "properties": { + "jwt": { "type": "string" }, + "packages": { + "type": "object", + "properties": { + "execution": { + "type": "array", + "items": { "type": "string" } + }, + "consensus": { + "type": "array", + "items": { "type": "string" } + }, + "signer": { + "type": "array", + "items": { "type": "string" } + }, + "mev-boost": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + } + }, + "required": ["jwt", "packages"] + }, + "lukso": { + "type": "object", + "properties": { + "jwt": { "type": "string" }, + "packages": { + "type": "object", + "properties": { + "execution": { + "type": "array", + "items": { "type": "string" } + }, + "consensus": { + "type": "array", + "items": { "type": "string" } + }, + "signer": { + "type": "array", + "items": { "type": "string" } + }, + "mev-boost": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + } + }, + "required": ["jwt", "packages"] + }, + "sepolia": { + "type": "object", + "properties": { + "jwt": { "type": "string" }, + "packages": { + "type": "object", + "properties": { + "execution": { + "type": "array", + "items": { "type": "string" } + }, + "consensus": { + "type": "array", + "items": { "type": "string" } + }, + "signer": { + "type": "array", + "items": { "type": "string" } + }, + "mev-boost": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["execution", "consensus", "signer", "mev-boost"] + } + }, + "required": ["jwt", "packages"] + } + }, + "required": ["mainnet", "holesky", "gnosis", "lukso", "sepolia"] + } + }, + "required": ["apis", "networks"] +}