1import { deployTmpl } from '../k8sF/genericDeploymentF.mts'2import * as _ from 'lodash-es'3import { jwtPath } from './jwtPathF.mts'4import { getEth2VolMounts, getExCliResources } from './getExCliResourcesF.mts'5import { getKlusterCtx } from '../k8sF/ctxF/klusterCtxF.mts'6import { getAction } from '../ctxF/actionCtxF.mts'7import { guardOnlyRecreateDeploymentsResourcesAction } from '../k8sF/guardOnlyRecreateDeploymentsResourcesActionF.mts'9export const doSyncNether = async ({10 ethNetwork, sizeGb, nethNodePort: nodePort,11 nethermindV, podResources, pruned,12}: {ethNetwork: string, sizeGb: number, nethNodePort: number, nethermindV: string, podResources?: object, pruned?: boolean}) => {13 const {cluster_name} = getKlusterCtx()15 const name = `nether-${ethNetwork}`17 const args = [18 `--config=mainnet`,19 `--datadir=/data`,20 `--Network.DiscoveryPort=${nodePort}`,21 `--Network.P2PPort=${nodePort}`,22 '--Sync.FastSync=true',23 '--Sync.SnapSync=true',24 '--Sync.FastBlocks=true',25 ...(pruned ? [] : ['--Sync.AncientBodiesBarrier=11052984', '--Sync.AncientReceiptsBarrier=11052984']),26 '--Merge.Enabled=true',27 '--JsonRpc.Enabled=true',29 '--JsonRpc.Host=0.0.0.0',30 '--JsonRpc.EngineHost=0.0.0.0',31 '--HealthChecks.Enabled=true',32 '--JsonRpc.EnabledModules=[web3,eth,subscribe,net]',33 '--JsonRpc.AdditionalRpcUrls=http://0.0.0.0:8551|http;ws|engine;eth;subscribe',34 ]36 const {volumeMounts, volumes} = getEth2VolMounts({name, ethNetwork})38 let resources = [39 deployTmpl({40 name,41 strategy: {42 type: 'Recreate'43 },44 containers: [45 {46 name,47 args,48 image: `nethermind/nethermind:${nethermindV}`,49 volumeMounts,50 resources: podResources,51 }52 ],53 volumes54 }),55 ...await getExCliResources({action, name, sizeGb, nodePort})56 ]57 await guardOnlyRecreateDeploymentsResourcesAction({resources, action, cluster_name})58}