Skip to content

Commit

Permalink
boot node is running
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed Aug 19, 2024
1 parent 6c0231f commit 8829a15
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
value: "0.0.0.0:{{ .Values.bootNode.service.p2pPort }}"
- name: P2P_UDP_LISTEN_ADDR
value: "0.0.0.0:{{ .Values.bootNode.service.p2pPort }}"
- name: VALIDATOR_PRIVATE_KEY
value: "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"
ports:
- containerPort: 8080
- containerPort: 40400
Expand Down
1 change: 1 addition & 0 deletions yarn-project/aztec.js/src/contract/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('Contract Class', () => {
l1ChainId: 1,
protocolVersion: 2,
l1ContractAddresses: l1Addresses,
enr: undefined,
protocolContractAddresses: {
classRegisterer: AztecAddress.random(),
feeJuice: AztecAddress.random(),
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ NETWORK_TEST:
ARG test
ARG chaos_values
ARG fresh_install
ARG force_build
LOCALLY
# Let docker compose know about the pushed tags above
ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD)
IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \
IF $force_build || \
! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \
! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"
WAIT
BUILD ../+export-e2e-test-images
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/p2p/src/service/discV5_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ export class DiscV5Service extends EventEmitter implements PeerDiscoveryService
}

public async start(): Promise<void> {
// Do this conversion once since it involves an async function call
this.bootstrapNodePeerIds = await Promise.all(this.bootstrapNodes.map(enr => ENR.decodeTxt(enr).peerId()));
if (this.currentState === PeerDiscoveryState.RUNNING) {
throw new Error('DiscV5Service already started');
}
Expand All @@ -103,6 +101,8 @@ export class DiscV5Service extends EventEmitter implements PeerDiscoveryService

// Add bootnode ENR if provided
if (this.bootstrapNodes?.length) {
// Do this conversion once since it involves an async function call
this.bootstrapNodePeerIds = await Promise.all(this.bootstrapNodes.map(enr => ENR.decodeTxt(enr).peerId()));
this.logger.info(`Adding bootstrap ENRs: ${this.bootstrapNodes.join(', ')}`);
try {
this.bootstrapNodes.forEach(enr => {
Expand Down
11 changes: 10 additions & 1 deletion yarn-project/validator-client/src/factory.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { type P2P } from '@aztec/p2p';

import { generatePrivateKey } from 'viem/accounts';

import { type ValidatorClientConfig } from './config.js';
import { ValidatorClient } from './validator.js';

export function createValidatorClient(config: ValidatorClientConfig, p2pClient: P2P) {
return config.disableValidator ? undefined : ValidatorClient.new(config, p2pClient);
if (config.disableValidator) {
return undefined;
}
// TODO: should this be exposed via a flag?
if (config.validatorPrivateKey === undefined || config.validatorPrivateKey === '') {
config.validatorPrivateKey = generatePrivateKey();
}
return ValidatorClient.new(config, p2pClient);
}

0 comments on commit 8829a15

Please sign in to comment.