Skip to content

Commit 35d395f

Browse files
authored
[chore] Add Node 22 to test matrix (#2033)
## Motivation We eventually want to release hubs on Node 22, since it's been out for a while. ## Merge Checklist - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [ ] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. - [x] All [commits have been signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits) <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the app version determination method, adjusts CI configurations for ARM support, and refactors the app version retrieval in `hubble.ts`. ### Detailed summary - Updated app version determination method in `hubble.ts` - Adjusted CI configurations for ARM support - Refactored app version retrieval using manual JSON parsing > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 8779669 commit 35d395f

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@farcaster/hubble": patch
3+
---
4+
5+
[chore] Determine app version via manual JSON.parse instead of import

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ jobs:
6161
- node_version: 20
6262
runs_on: 'warp-ubuntu-latest-x64-16x'
6363
- node_version: 21
64-
runs_on: 'warp-ubuntu-latest-arm64-16x'
64+
runs_on: 'warp-ubuntu-latest-arm64-16x' # Only works on ARM for now
65+
- node_version: 22
66+
runs_on: 'warp-ubuntu-latest-x64-16x'
6567

6668
runs-on: ${{ matrix.runs_on }}
6769
name: test (${{ matrix.node_version }})

apps/hubble/src/hubble.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { PruneEventsJobScheduler } from "./storage/jobs/pruneEventsJob.js";
4040
import { PruneMessagesJobScheduler } from "./storage/jobs/pruneMessagesJob.js";
4141
import { sleep } from "./utils/crypto.js";
4242
import { rsDbDestroy, rsValidationMethods } from "./rustfunctions.js";
43+
import { URL } from "node:url";
4344
import * as tar from "tar";
4445
import * as zlib from "zlib";
4546
import {
@@ -67,7 +68,6 @@ import StoreEventHandler from "./storage/stores/storeEventHandler.js";
6768
import { FNameRegistryClient, FNameRegistryEventsProvider } from "./eth/fnameRegistryEventsProvider.js";
6869
import { L2EventsProvider, OptimismConstants } from "./eth/l2EventsProvider.js";
6970
import { prettyPrintTable } from "./profile/profile.js";
70-
import packageJson from "./package.json" assert { type: "json" };
7171
import { createPublicClient, fallback, http } from "viem";
7272
import { mainnet, optimism } from "viem/chains";
7373
import { AddrInfo } from "@chainsafe/libp2p-gossipsub/types";
@@ -98,7 +98,9 @@ import { startupCheck, StartupCheckStatus } from "./utils/startupCheck.js";
9898

9999
export type HubSubmitSource = "gossip" | "rpc" | "eth-provider" | "l2-provider" | "sync" | "fname-registry";
100100

101-
export const APP_VERSION = packageJson.version;
101+
export const APP_VERSION = JSON.parse(
102+
fs.readFileSync(path.join(new URL(".", import.meta.url).pathname, "..", "./package.json")).toString(),
103+
).version;
102104
export const APP_NICKNAME = process.env["HUBBLE_NAME"] ?? "Farcaster Hub";
103105

104106
export const SNAPSHOT_S3_UPLOAD_BUCKET = "farcaster-snapshots";
@@ -725,9 +727,9 @@ export class Hub implements HubInterface {
725727
this.options.announceIp ?? undefined,
726728
);
727729
if (rpcAddressCheck.isErr()) {
728-
const errorMessage = `Error validating RPC address at port ${this.options.rpcPort}.
730+
const errorMessage = `Error validating RPC address at port ${this.options.rpcPort}.
729731
Please make sure RPC port value is valid and reachable from public internet.
730-
Reachable address is required for hub to perform diff sync via gRPC API and sync with the network.
732+
Reachable address is required for hub to perform diff sync via gRPC API and sync with the network.
731733
Hub operators may need to enable port-forwarding of traffic to hub's host and port if they are behind a NAT.
732734
`;
733735
log.warn(

0 commit comments

Comments
 (0)