This example consumes a Substreams package (specifically, the Ethereum Explorer) using the Substreams JS library in the browser.
The application uses Vite to set up a development servers. You can easily get started:
- Install the dependencies.
npm run install
- Open the
main.js
and set your Substreams token in theTOKEN
variable. If you have previously run the Substreams CLI, you can find the token at the$SUBSTREAMS_API_TOKEN
environment variable of your system.
const TOKEN = "<SUBSTREAMS-TOKEN>"
- Run the server.
npm run dev
- Navigate to
http://localhost:5173/
. The application will start consuming Ethereum blocks.