mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-01-28 22:48:07 -05:00
* Fix import mapping to work with built JS files This allows us to ship a Docker image that runs using `node` directly, rather than via `tsx`. * Remove use of top-level `await` expressions These were only used in tests and weren't critical. Switch away so we have the optional to convert to CommonJS if we need. * Switch all imports to use relative paths instead of ~ shortcut The ~ shortcut doesn't work in some contexts, which makes our lives more difficult when trying to output ESM. Since we were already using relative paths in some part of the codebase and not others, just switch to using relative paths everywhere for simplicity. * Switch imports to append .js extension And update Jest configuration to work with this extension. * Build single image instead of two separate ones We originally created the other image so that we could build an image using only packages published to NPM, but this proved problematic when wanting to test those changes without publishing. Since there are more situations where we'd want to ship an image using unpublished packages (i.e. for testing) remove the "public" image and update our "testing" image to also be used as the public image. However, a key difference is that the testing image will now run compiled JS instead of using a TypeScript interpreter.
36 lines
1.4 KiB
YAML
36 lines
1.4 KiB
YAML
# To start two peered hubs locally, run:
|
|
#
|
|
# `docker compose -f docker-compose-multinode.yml run yarn --cwd=apps/hubble identity create -N 2`
|
|
#
|
|
# Set $TEST_HUB1_ID and $TEST_HUB2_ID in your .env file to the paths generated by the previous command. Then run:
|
|
#
|
|
# `docker compose -f docker-compose-multinode.yml up`
|
|
#
|
|
# This is useful when testing protocol changes locally.
|
|
|
|
version: '3.9'
|
|
|
|
services:
|
|
hubble1:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.hubble
|
|
ports:
|
|
- '2282:2282'
|
|
- '2283:2283'
|
|
command: ["yarn", "--cwd=apps/hubble", "start", "--gossip-port", "2282", "--rpc-port", "2283", "--eth-rpc-url", "$ETH_RPC_URL", "--network", "3", "--db-name", "hubble1", "--process-file-prefix", "hubble1", "--id", "$TEST_HUB1_ID"]
|
|
volumes:
|
|
- ./apps/hubble/.hub:/home/node/app/apps/hubble/.hub
|
|
- ./apps/hubble/.rocks:/home/node/app/apps/hubble/.rocks
|
|
hubble2:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.hubble
|
|
ports:
|
|
- '2284:2284'
|
|
- '2285:2285'
|
|
command: ["yarn", "--cwd=apps/hubble", "start", "--gossip-port", "2284", "--rpc-port", "2285", "--eth-rpc-url", "$ETH_RPC_URL", "--network", "3", "-b", "/dns/hubble1/tcp/2282", "--db-name", "hubble2", "--process-file-prefix", "hubble2", "--id", "$TEST_HUB2_ID"]
|
|
volumes:
|
|
- ./apps/hubble/.hub:/home/node/app/apps/hubble/.hub
|
|
- ./apps/hubble/.rocks:/home/node/app/apps/hubble/.rocks
|