This project includes both frontend and contracts. To begin, install dependencies:
- Node.js v20.11.0 or latest stable. We recommend using nvm to install.
- PNPM v8.15.7 or latest stable
- Docker v25.0.3 or latest stable
- Docker Compose v2.24.6 or latest stable
- Rust v1.76.0 or latest
stable
- Forc v0.49.3 with latest toolchain
- Visit the Fuel Explorer repo and fork the project.
- Then clone your forked copy to your local machine and get to work.
git clone https://github.com/FuelLabs/fuel-explorer
cd fuel-explorer
pnpm install
This command will start essential development services;
L1
local node (to handle ethereum blockchain);Fuel
local node (to handle L2 chain);Postgres
database (that we use to index data);
pnpm node:start
You can check more details in docker-compose.yml file.
Now that you have the local node running, you can start the frontend.
- Create a
.env
file based on the provided example in thepackages/app-explorer
directory
cp packages/app-explorer/.env.example packages/app-explorer/.env
- Start the frontend with the following command:
pnpm dev
After running that command, you can open http://localhost:3000 in your browser to view the explorer working.
- Use the following command to install
Playwright
along with its dependencies, includingChromium
pnpm exec playwright install --with-deps chromium
- Create a
.env
file based on the provided example in thepackages/graphql
directory
cp packages/graphql/.env.example packages/graphql/.env
- Start local node server
pnpm node:start
- Finally, you can run the E2E tests with the following command:
pnpm test:e2e
To make life easier we added as many useful scripts as possible to our package.json. These are some of the most used during development:
pnpm <command name>
Script | Description |
---|---|
dev |
Run the development server (frontend only) |
node:start |
Run the local network with fuel-core and the faucet API. |
node:stop |
Stop all containers without removing data |
node:clean |
Stop and remove all development containers that are running locally. |
node:restart |
Restart all containers without removing data |
test:e2e |
Run the E2E tests |
ts:check |
Run the TypeScript compiler |
Other scripts can be found in package.json.