Skip to content

Commit 9d114af

Browse files
committed
run lint formater
1 parent ab98267 commit 9d114af

File tree

5 files changed

+53
-29
lines changed

5 files changed

+53
-29
lines changed

packages/packages/generator/src/builders/chains/ethereum/configmap.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Chain, StarshipConfig } from '@starship-ci/types';
2+
import { ConfigMap } from 'kubernetesjs';
23

34
import * as helpers from '../../../helpers';
45
import { IGenerator } from '../../../types';
5-
import { ConfigMap } from 'kubernetesjs';
66

77
/**
88
* Generates the ConfigMap for Ethereum chain configuration
@@ -64,10 +64,12 @@ export class EthereumConfigMapGenerator implements IGenerator {
6464
},
6565
nonce: '0x0',
6666
timestamp: '0x677d172f',
67-
extraData: '0x0000000000000000000000000000000000000000000000000000000000000000',
67+
extraData:
68+
'0x0000000000000000000000000000000000000000000000000000000000000000',
6869
gasLimit: '0x47b760',
6970
difficulty: '0x1',
70-
mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
71+
mixHash:
72+
'0x0000000000000000000000000000000000000000000000000000000000000000',
7173
coinbase: '0x0000000000000000000000000000000000000000',
7274
alloc: {
7375
'0x0000000000000000000000000000000000000001': {
@@ -81,7 +83,8 @@ export class EthereumConfigMapGenerator implements IGenerator {
8183
},
8284
number: '0x0',
8385
gasUsed: '0x0',
84-
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
86+
parentHash:
87+
'0x0000000000000000000000000000000000000000000000000000000000000000',
8588
baseFeePerGas: '0x7',
8689
excessBlobGas: null as any,
8790
blobGasUsed: null as any
@@ -92,7 +95,7 @@ export class EthereumConfigMapGenerator implements IGenerator {
9295

9396
private generateBalances(chain: Chain): Record<string, { balance: string }> {
9497
const balances: Record<string, { balance: string }> = {};
95-
98+
9699
// Add balances from chain configuration if available
97100
if (chain.balances) {
98101
chain.balances.forEach((balance) => {
@@ -143,4 +146,4 @@ SLOTS_PER_EPOCH: 6
143146
# Deposit contract
144147
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242`;
145148
}
146-
}
149+
}

packages/packages/generator/src/builders/chains/ethereum/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export class EthereumBuilder implements IGenerator {
2020
// Filter ethereum chains
2121
const ethereumChains =
2222
this.config.chains?.filter(
23-
(chain) => chain.name === 'ethereum' || chain.name.startsWith('ethereum-')
23+
(chain) =>
24+
chain.name === 'ethereum' || chain.name.startsWith('ethereum-')
2425
) || [];
2526

2627
if (ethereumChains.length === 0) {
@@ -36,11 +37,13 @@ export class EthereumBuilder implements IGenerator {
3637
this.generators.push(new EthereumServiceGenerator(chain, this.config));
3738

3839
// StatefulSets
39-
this.generators.push(new EthereumStatefulSetGenerator(chain, this.config));
40+
this.generators.push(
41+
new EthereumStatefulSetGenerator(chain, this.config)
42+
);
4043
});
4144
}
4245

4346
generate(): Manifest[] {
4447
return this.generators.flatMap((generator) => generator.generate());
4548
}
46-
}
49+
}

packages/packages/generator/src/builders/chains/ethereum/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Chain, StarshipConfig } from '@starship-ci/types';
2+
import { Service } from 'kubernetesjs';
23

34
import * as helpers from '../../../helpers';
45
import { IGenerator } from '../../../types';
5-
import { Service } from 'kubernetesjs';
66

77
/**
88
* Generates the Service for Ethereum chain
@@ -58,4 +58,4 @@ export class EthereumServiceGenerator implements IGenerator {
5858
}
5959
];
6060
}
61-
}
61+
}

packages/packages/generator/src/builders/chains/ethereum/statefulset.ts

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { Chain, StarshipConfig } from '@starship-ci/types';
2+
import {
3+
Container,
4+
ResourceRequirements,
5+
StatefulSet,
6+
Volume
7+
} from 'kubernetesjs';
28

39
import * as helpers from '../../../helpers';
410
import { IGenerator } from '../../../types';
5-
import { Container, ResourceRequirements, StatefulSet, Volume } from 'kubernetesjs';
611

712
/**
813
* Generates the StatefulSet for Ethereum chain
@@ -85,7 +90,8 @@ export class EthereumStatefulSetGenerator implements IGenerator {
8590
}
8691

8792
private createInitGenesisBeaconContainer(chain: Chain): Container {
88-
const prysmctlImage = chain.config?.prysmctl?.image ||
93+
const prysmctlImage =
94+
chain.config?.prysmctl?.image ||
8995
'ghcr.io/hyperweb-io/starship/prysm/cmd/prysmctl:v5.2.0';
9096
const numValidators = chain.config?.validator?.numValidator || 1;
9197

@@ -94,7 +100,8 @@ export class EthereumStatefulSetGenerator implements IGenerator {
94100
image: prysmctlImage,
95101
imagePullPolicy: 'IfNotPresent',
96102
command: ['bash', '-c'],
97-
args: [`
103+
args: [
104+
`
98105
mkdir -p /ethereum/consensus /ethereum/execution
99106
cp /config/genesis.json /ethereum/execution/genesis.json
100107
cp /config/config.yaml /ethereum/consensus/config.yaml
@@ -111,7 +118,8 @@ prysmctl testnet generate-genesis \\
111118
112119
echo "Copy secrets over"
113120
cp /config/jwt.hex /etc/secrets/jwt.hex
114-
`.trim()],
121+
`.trim()
122+
],
115123
resources: this.getNodeResources(chain),
116124
volumeMounts: [
117125
{ name: 'secrets', mountPath: '/etc/secrets' },
@@ -127,10 +135,12 @@ cp /config/jwt.hex /etc/secrets/jwt.hex
127135
image: chain.image,
128136
imagePullPolicy: 'IfNotPresent',
129137
command: ['bash', '-c'],
130-
args: [`
138+
args: [
139+
`
131140
echo "Initializing genesis geth"
132141
geth --datadir /ethereum/execution init /ethereum/execution/genesis.json
133-
`.trim()],
142+
`.trim()
143+
],
134144
resources: this.getNodeResources(chain),
135145
volumeMounts: [
136146
{ name: 'secrets', mountPath: '/etc/secrets' },
@@ -166,7 +176,8 @@ geth --datadir /ethereum/execution init /ethereum/execution/genesis.json
166176
{ name: 'RPC_PORT', value: '8551' }
167177
],
168178
command: ['bash', '-c'],
169-
args: [`
179+
args: [
180+
`
170181
echo "Setting UDP buffer size"
171182
sysctl -w net.core.rmem_max=16777216
172183
sysctl -w net.core.wmem_max=16777216
@@ -196,7 +207,8 @@ geth --datadir /ethereum/execution --http \\
196207
--maxpeers=50 \\
197208
--nat=none \\
198209
--log.vmodule=engine=6
199-
`.trim()],
210+
`.trim()
211+
],
200212
resources: this.getNodeResources(chain),
201213
volumeMounts: [
202214
{ name: 'ethereum', mountPath: '/ethereum' },
@@ -217,7 +229,8 @@ geth --datadir /ethereum/execution --http \\
217229
}
218230

219231
private createBeaconChainContainer(chain: Chain): Container {
220-
const beaconImage = chain.config?.beacon?.image ||
232+
const beaconImage =
233+
chain.config?.beacon?.image ||
221234
'ghcr.io/hyperweb-io/starship/prysm/beacon-chain:v5.2.0';
222235

223236
return {
@@ -235,7 +248,8 @@ geth --datadir /ethereum/execution --http \\
235248
}
236249
],
237250
command: ['bash', '-c'],
238-
args: [`
251+
args: [
252+
`
239253
echo "Waiting 30 seconds for execution client to be ready..."
240254
sleep 30
241255
@@ -256,7 +270,8 @@ beacon-chain \\
256270
--suggested-fee-recipient=0x123463a4B065722E99115D6c222f267d9cABb524 \\
257271
--minimum-peers-per-subnet=0 \\
258272
--force-clear-db
259-
`.trim()],
273+
`.trim()
274+
],
260275
resources: this.getNodeResources(chain),
261276
volumeMounts: [
262277
{ name: 'ethereum', mountPath: '/ethereum' },
@@ -274,7 +289,8 @@ beacon-chain \\
274289
}
275290

276291
private createValidatorContainer(chain: Chain): Container {
277-
const validatorImage = chain.config?.validator?.image ||
292+
const validatorImage =
293+
chain.config?.validator?.image ||
278294
'ghcr.io/hyperweb-io/starship/prysm/validator:v5.2.0';
279295
const numValidators = chain.config?.validator?.numValidator || 1;
280296

@@ -293,7 +309,8 @@ beacon-chain \\
293309
}
294310
],
295311
command: ['bash', '-c'],
296-
args: [`
312+
args: [
313+
`
297314
echo "Waiting 15 seconds for execution client to be ready..."
298315
sleep 20
299316
mkdir -p /ethereum/consensus/validator
@@ -310,7 +327,8 @@ validator \\
310327
--monitoring-host=0.0.0.0 \\
311328
--monitoring-port=8081 \\
312329
--suggested-fee-recipient=0x0C46c2cAFE097b4f7e1BB868B89e5697eE65f934
313-
`.trim()],
330+
`.trim()
331+
],
314332
resources: this.getNodeResources(chain),
315333
volumeMounts: [
316334
{ name: 'ethereum', mountPath: '/ethereum' },
@@ -348,7 +366,7 @@ validator \\
348366

349367
private getNodeResources(chain: Chain): ResourceRequirements {
350368
// Use default resources or chain-specific resources
351-
const defaultResources = this.config.resources?.node
369+
const defaultResources = this.config.resources?.node;
352370

353371
return {
354372
requests: {
@@ -361,4 +379,4 @@ validator \\
361379
}
362380
};
363381
}
364-
}
382+
}

packages/packages/generator/src/builders/chains/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const chainBuilderRegistry: Record<
88
string,
99
new (config: StarshipConfig) => IGenerator
1010
> = {
11-
ethereum: EthereumBuilder,
11+
ethereum: EthereumBuilder
1212
};
1313

14-
function createBuilder(chainName: string, config: StarshipConfig): IGenerator {
14+
function createBuilder(chainName: string, config: StarshipConfig): IGenerator {
1515
const builder = chainBuilderRegistry[chainName] || CosmosBuilder;
1616
return new builder(config);
1717
}

0 commit comments

Comments
 (0)