Installation
We recommend running Hubble on an always on server that has Docker installed.
Requirements
Hubble can be installed in 30 minutes, but a full sync can take up to three hours to complete. You'll need a machine that has:
- 8 GB of RAM
- 2 CPU cores or vCPUs
- 20 GB of free storage
- A public IP address with ports 2282 - 2285 exposed
See tutorials for instructions on how to set up cloud providers to run Hubble.
You will need RPC endpoints for Ethereum nodes on L1 Mainnet and L1 Goerli. We recommend using a service like Alchemy or Infura.
Installing Hubble
- Check out the hub-monorepo locally.
- 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 to to your L1 Goerli ETH RPC URL
ETH_RPC_URL=your-ETH-RPC-URL
# Set this to you L1 Mainnet ETH RPC URL
ETH_MAINNET_RPC_URL=your-ETH-mainnet-RPC-URL
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.
Upgrading Hubble
Navigate to apps/hubble
in hub-monorepo and run:
git checkout main && git pull
docker compose stop && docker compose up -d --force-recreate --pull always
Running commands
Check the sync status to see how your Hub is doing:
docker compose exec hubble yarn status --watch --insecure
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
Monitoring Hubble
You can monitor your Hub by setting up grafana to monitor real time stats
- Start grafana and statsd
docker compose up statsd grafana
- Enable monitoring on your Hub by setting this in your
.env
STATSD_METRICS_SERVER=statsd:8125
If you are running hubble from source, you can pass this in as a command line argument
yarn start --statsd-metrics-server 127.0.0.1:8125
Open Grafana in a browser at
127.0.0.1:3000
. The default username/password isadmin
/admin
. You will need to change your password on first loginGo to
Settings -> Datasource -> Add new data source
and selectGraphite
. Set the URL tohttp://statsd:80
and clickSave & Test
to make sure it is workingGo to
Settings -> Dashboard -> Add New -> Import
, and in theImport from Panel JSON
, paste the contents of the Default Grafana Dashboard
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 reset your database with:
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
Installing from source
You can also build and run Hubble from source.
2.1 Installing Dependencies
First, ensure that the following are installed globally on your machine:
2.2 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
2.3 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 a ID- Follow the instructions to set connect to a network
yarn start --eth-rpc-url <your ETH-RPC-URL> --eth-mainnet-rpc-url <your ETH-mainnet-RPC-URL
2.3 Upgrading Hubble
To upgrade hubble, find the latest release tag and checkout that version and build.
git fetch --tags
to fetch the latest tagsgit checkout @farcaster/hubble@<verison>
to checkout the specific version. Replace the tag with the version you want to check out.yarn install && yarn build
to build Hubble.