dappnode / DNP_DAPPMANAGER

Dappnode package responsible for providing the Dappnode Package Manager
GNU General Public License v3.0
31 stars 39 forks source link

Staker components types improvement #2023

Open dappnodedev opened 2 months ago

dappnodedev commented 2 months ago

I suggest that we create a map that can provide the dnpName for each client depending on the network, something like this:

type StakerItemMap = Record<
  Network,
  {
    consensus: Record<string, string>;
    execution: Record<string, string>;
    signer: Record<string, string>;
    mevBoost?: string;
  }
>;

const stakerItemMap: StakerItemMap= {
  [Network.Mainnet]: {
    consensus: {
      Lodestar: "lodestar.dnp.dappnode.eth",
      Prysm: "prysm.dnp.dappnode.eth",
      Lighthouse: "lighthouse.dnp.dappnode.eth",
      Teku: "teku.dnp.dappnode.eth",
      Nimbus: "nimbus.dnp.dappnode.eth"
    },
    execution: {
      Geth: "geth.dnp.dappnode.eth",
      Besu: "besu.public.dappnode.eth",
      Erigon: "erigon.dnp.dappnode.eth",
      Nethermind: "nethermind.public.dappnode.eth"
    },
    signer: {
      Web3signer: "web3signer.dnp.dappnode.eth"
    },
    mevBoost: "mev-boost.dnp.dappnode.eth"
  },
  [Network.Prater]: {
    consensus: {
      Lodestar: "lodestar-prater.dnp.dappnode.eth",
      Prysm: "prysm-prater.dnp.dappnode.eth",
      Lighthouse: "lighthouse-prater.dnp.dappnode.eth",
      Teku: "teku-prater.dnp.dappnode.eth",
      Nimbus: "nimbus-prater.dnp.dappnode.eth"
    },
    execution: {
      Geth: "goerli-geth.dnp.dappnode.eth",
      Besu: "goerli-besu.dnp.dappnode.eth",
      Erigon: "goerli-erigon.dnp.dappnode.eth",
      Nethermind: "goerli-nethermind.dnp.dappnode.eth"
    },
    signer: {
      Web3signer: "web3signer-prater.dnp.dappnode.eth"
    },
    mevBoost: "mev-boost-goerli.dnp.dappnode.eth"
  },
  [Network.Holesky]: {
    consensus: {
      Lodestar: "lodestar-holesky.dnp.dappnode.eth",
      Prysm: "prysm-holesky.dnp.dappnode.eth",
      Lighthouse: "lighthouse-holesky.dnp.dappnode.eth",
      Teku: "teku-holesky.dnp.dappnode.eth",
      Nimbus: "nimbus-holesky.dnp.dappnode.eth"
    },
    execution: {
      Geth: "holesky-geth.dnp.dappnode.eth",
      Besu: "holesky-besu.dnp.dappnode.eth",
      Erigon: "holesky-erigon.dnp.dappnode.eth",
      Nethermind: "holesky-nethermind.dnp.dappnode.eth",
      Reth: "holesky-reth.dnp.dappnode.eth"
    },
    signer: {
      Web3signer: "web3signer-holesky.dnp.dappnode.eth"
    },
    mevBoost: "mev-boost-holesky.dnp.dappnode.eth"
  },
  [Network.Gnosis]: {
    consensus: {
      Lodestar: "lodestar-gnosis.dnp.dappnode.eth",
      Lighthouse: "lighthouse-gnosis.dnp.dappnode.eth",
      Teku: "teku-gnosis.dnp.dappnode.eth",
      Nimbus: "nimbus-gnosis.dnp.dappnode.eth"
    },
    execution: {
      Nethermind: "nethermind-xdai.dnp.dappnode.eth",
      Erigon: "gnosis-erigon.dnp.dappnode.eth"
    },
    signer: {
      Web3signer: "web3signer-gnosis.dnp.dappnode.eth"
    }
  },
  [Network.Lukso]: {
    consensus: {
      Prysm: "prysm-lukso.dnp.dappnode.eth",
      Teku: "teku-lukso.dnp.dappnode.eth"
    },
    execution: {
      Geth: "lukso-geth.dnp.dappnode.eth"
    },
    signer: {
      Web3signer: "web3signer-lukso.dnp.dappnode.eth"
    }
  }
};

The current approach is worse to maintain and to use I'd argue.