Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 819 Bytes

File metadata and controls

27 lines (17 loc) · 819 Bytes

Substreams Sink Examples - JS (Browser)

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:

  1. Install the dependencies.
npm run install
  1. Open the main.js and set your Substreams token in the TOKEN 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>"
  1. Run the server.
npm run dev
  1. Navigate to http://localhost:5173/. The application will start consuming Ethereum blocks.