1import { deployTmpl } from "../k8sF/genericDeploymentF.mts"2import { jwtPath } from './jwtPathF.mts'3import { getEth2VolMounts, getExCliResources } from "./getExCliResourcesF.mts"4import { getKlusterCtx } from "../k8sF/ctxF/klusterCtxF.mts"5import { getAction } from '../ctxF/actionCtxF.mts'6import { guardOnlyRecreateDeploymentsResourcesAction } from "../k8sF/guardOnlyRecreateDeploymentsResourcesActionF.mts"8export const doSyncReth = async ({9 ethNetwork, sizeGb, rethNodePort: nodePort,10 rethV, full = true11}: {ethNetwork: string, sizeGb: number, rethNodePort: number, rethV: string, full?: boolean}) => {12 const {cluster_name} = getKlusterCtx()14 const name = `reth-${ethNetwork}`16 const args = [17 'node',18 `--chain=${ethNetwork}`,19 '--datadir=/data',20 `--port=${nodePort}`,21 `--discovery.port=${nodePort}`,22 '--http',23 '--http.addr=0.0.0.0',24 '--http.port=8545',25 '--http.api=eth,net,web3,txpool,trace',26 '--http.corsdomain=*',27 '--authrpc.addr=0.0.0.0',28 '--authrpc.port=8551',30 ]31 if (full) args.push('--full')33 const {volumeMounts, volumes} = getEth2VolMounts({name, ethNetwork})35 let resources = [36 deployTmpl({37 name,38 strategy: {39 type: "Recreate"40 },41 containers: [42 {43 name,44 args,45 image: `ghcr.io/paradigmxyz/reth:${rethV}`,46 volumeMounts47 }48 ],49 volumes50 }),51 ...await getExCliResources({action, name, sizeGb, nodePort})52 ]53 await guardOnlyRecreateDeploymentsResourcesAction({resources, action, cluster_name})54}