🌳
pt0/deployF/ethF/doSyncNetherF.mts
2import * as _ from 'lodash-es'
3import { jwtPath } from './jwtPathF.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()
14 const action = getAction()
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',
28 `--JsonRpc.JwtSecretFile=${jwtPath}`,
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 = [
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 volumes
54 }),
55 ...await getExCliResources({action, name, sizeGb, nodePort})
56 ]
57 await guardOnlyRecreateDeploymentsResourcesAction({resources, action, cluster_name})