LogoLogo
Package RegistryThe Graph
  • Introduction
  • Getting Started
  • Tutorials
    • Develop Your First Substreams
      • on EVM
      • on Solana
        • Transactions & Instructions
        • Account Changes
      • on Cosmos
        • Injective
        • MANTRA
      • on Starknet
      • on Stellar
    • Publishing a Substreams Package
  • How-To Guides
    • Developing Substreams
      • on EVM
        • Exploring Ethereum
          • Mapping Blocks
          • Filter Transactions
          • Retrieve Events of a Smart Contract
      • on Solana
        • Explore Solana
          • Filter Instructions
          • Filter Transactions
        • SPL Token Tracker
        • NFT Trades
        • DEX Trades
      • on Cosmos
        • Injective
          • Simple Substreams Example
          • Foundational Modules
          • Dojo DEX USDT Volume Subgraph Example
    • Using a Substreams Sink
      • Substreams:SQL
      • Substreams:Subgraph
        • Triggers
        • Graph Out
      • Substreams:Stream
        • JavaScript
        • Go
      • Substreams:PubSub
      • Community Sinks
        • MongoDB
        • Files
        • Key-Value Store
        • Prometheus
    • EVM Extensions
      • Making eth_calls
    • Getting Started Using Rust and Protobuf
      • Rust
        • Option struct
        • Result struct
      • Protobuf Schemas
    • From Yellowstone to Substreams
  • Reference Material
    • Chains and endpoints
      • Ethereum Data Model
    • Never Miss Data
    • Development Container Reference
    • Substreams CLI
      • Install the CLI
      • Authentication
      • Substreams CLI reference
    • Substreams Components
      • Packages
      • Modules
        • Module types
        • Inputs
        • Output
        • Module handlers
        • Module handler creation
        • Indexes
        • Keys in stores
        • Dynamic data sources
        • Aggregation Windows
        • Parameterized Modules
      • Manifests Reference
    • Substreams Architecture
    • Graph-Node
      • Local Development
      • Publish to The Graph Network
    • Indexer Reference
      • Test Substreams Locally
    • Logging, Debugging & Testing
    • Change log
    • FAQ
  • Decentralized Indexing
    • What is The Graph?
Powered by GitBook
On this page
  • Overview
  • Prerequisites
  • Step 1: Obtain a JWT Token
  • Step 2: Set the JWT Token as an Environment Variable
  • Unix-like Systems (macOS, Linux)
  • Step 3: Verify Authentication
  • Need Help?

Was this helpful?

Edit on GitHub
  1. Reference Material
  2. Substreams CLI

Authentication

PreviousInstall the CLINextSubstreams CLI reference

Last updated 14 days ago

Was this helpful?

This guide explains how to authenticate when running a Substreams package (.spkg) with a provider, specifically using The Graph Market.

Overview

Substreams require authentication to ensure secure and controlled access to providers. This guide focuses on obtaining and using a JWT token from The Graph Market to authenticate your Substreams execution.

Prerequisites

  • A Substreams package (.spkg) ready to deploy.

  • An account with .

Step 1: Obtain a JWT Token

To authenticate with The Graph Market, you need to generate a JWT token. Follow these steps:

  1. Log in to The Graph Market:

    • Visit .

    • Log in to your existing account or create a new one if you don't have an account.

  2. Access the Dashboard:

    • Click on Dashboard in the navigation menu or go directly to .

  3. Create a New API Key:

    • In the dashboard, click on Create New Key.

    • Input a recognizable name for future reference.

    • This is not the authentication token, but a key to generate tokens.

  4. Generate an API Token:

    • For security reasons, the API token is hidden. In the API TOKEN section, click the button besides the hidden token.

    • The system will generate a JWT token. Copy and save this token securely, as it will be required for authentication.

Step 2: Set the JWT Token as an Environment Variable

To authenticate Substreams on your local machine, you need to set the JWT token as an environment variable.

Unix-like Systems (macOS, Linux)

  1. Open a terminal on your machine.

  2. Set the environment variable using the following command:

    export SUBSTREAMS_API_TOKEN="<YOUR-JWT-TOKEN>"

    Replace <YOUR-JWT-TOKEN> with the JWT token you obtained earlier.

Step 3: Verify Authentication

To ensure that your authentication is set up correctly, you can run a test Substreams. Here's how:

  1. Run the following command in your terminal to get all the events on Ethereum Mainnet:

    substreams gui ethereum-common@v0.3.1 all_events --start-block=15000000
  2. Verify that the Substreams runs without errors, confirming that your authentication is successful.

Need Help?

If you encounter any issues or have questions, the StreamingFast team is available on to assist you.

Discord
The Graph Market
https://thegraph.market
https://thegraph.market/dashboard
Dashboard