Installation
We recommend running Hubble on an always-on server that has Docker installed.
Requirements
Hubble can be installed in 30 minutes, and a full sync can take 1-2 hours to complete. You'll need a machine that has:
- 16 GB of RAM
- 4 CPU cores or vCPUs
- 300 GB of free storage
- A public IP address with ports 2282 & 2283 exposed (port 2281 is optional)
See tutorials for instructions on how to set up cloud providers to run Hubble.
You will need RPC endpoints for Ethereum nodes on L2 OP Mainnet, L1 Mainnet and L1 Goerli. We recommend using a service like Alchemy or Infura.
Install via Script
The install script is the simplest way to set up Hubble.
curl -sSL https://download.thehubble.xyz/bootstrap.sh | bash
If you're using macOS, you'll need to have docker installed and running.
Hubble will be installed into ~/hubble
and will be run via Docker in the background, along with Grafana and Prometheus for monitoring. If you have trouble with the script, try installing via docker.
Upgrading Hubble
Upgrade Hubble to the latest version by running
cd ~/hubble && ./hubble.sh upgrade
Install via Docker
Hubble can also be set up by running the docker image directly. To do this:
- Check out the latest release locally:
git clone -c advice.detachedHead=false -b @latest https://github.com/farcasterxyz/hub-monorepo.git
- From the root of this folder navigate to
apps/hubble
- Generate your identity key pair with docker compose.
docker compose run hubble yarn identity create
- Create a .env file in
apps/hubble
with your Ethereum RPC endpoints:
# Set this to your L1 Mainnet ETH RPC URL
ETH_MAINNET_RPC_URL=your-ETH-mainnet-RPC-URL
# Set this to your L2 Optimism Mainnet RPC URL
OPTIMISM_L2_RPC_URL=your-L2-optimism-RPC-URL
# Set this to your Farcaster FID
HUB_OPERATOR_FID=your-fid
Follow the instructions to set connect to a network.
Start Hubble with docker compose in detached mode:
docker compose up hubble -d
Docker compose will start a Hubble container that exposes ports for networking and writes data to .hub
and .rocks
directories. Hubble will now sync with the contracts and other hubble instances to download all messages on the network.
- To view the status of the sync and hubble, follow the logs
docker compose logs -f hubble
- Follow the instructions in the monitoring instructions to set up Grafana and view your Hub's status in real-time.
Upgrading Hubble
Navigate to apps/hubble
in hub-monorepo and run:
git fetch --tags --force && git checkout @latest # Checkout to the latest release
docker compose stop && docker compose up -d --force-recreate --pull always # Stop current container and start the upgraded one
Installing from source
Hubble can also be built and run directly from source without Docker.
Installing Dependencies
First, ensure that the following are installed globally on your machine:
Build
git clone https://github.com/farcasterxyz/hub-monorepo.git
to clone the repocd hub-monorepo
to enter the directoryyarn install
to install dependenciesyarn build
to build Hubble and its dependenciesyarn test
to ensure that the test suite runs correctly. If integration tests fail, rundocker compose up redis postgres
and retry.
Running Hubble
To run the Hubble commands, go to the Hubble app (cd apps/hubble
) and run the yarn
commands.
yarn identity create
to create an ID- Follow the instructions to set connect to a network
yarn start --eth-mainnet-rpc-url <your ETH-mainnet-RPC-URL> --l2-rpc-url <your Optimism-L2-RPC-URL> --hub-operator-fid <your FID>
Upgrading Hubble
To upgrade hubble, find the latest release tag and checkout that version and build.
git fetch --tags # to fetch the latest tags
git checkout @farcaster/hubble@latest # Or use a specific version.
yarn install && yarn build # in the root folder
Running commands
Check the logs to ensure your hub is running successfully:
docker compose logs -f hubble
Open up a shell inside the hubble container by running:
docker compose exec hubble /bin/sh
Troubleshooting
If upgrading from a non-docker deployment, make sure
.hub
and.rocks
directories are writable for all users.If upgrading from 1.3.3 or below, please set
ETH_MAINNET_RPC_URL=your-ETH-mainnet-RPC-URL
(if using docker) or provide the--eth-mainnet-rpc-url
flag (if not using docker)If you're changing your Hub from one network to another, you'll need to delete your database contents:
docker compose stop && docker compose run --rm hubble yarn dbreset
- To pull the image yourself, you can run:
# Get the latest image
docker pull farcasterxyz/hubble:latest
# Get a specific release (v1.4.0)
docker pull farcasterxyz/hubble@v1.4.0
- To set the Hub operator FID
- If you are running via docker or the script, please set this in your
.env
file:HUB_OPERATOR_FID=your-fid
- If you are running via source
yarn start --hub-operator-fid <your-fid>
- If you are running via docker or the script, please set this in your