Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 1.82 KB

README.md

File metadata and controls

64 lines (39 loc) · 1.82 KB

StreamingFast Golang Client Library

A GraphQL client library to consume dfuse API https://streamingfast.io (dfuse docs).

Installation

go get github.com/streamingfast/client-go

Features

What you get by using this library:

  • StreamingFast API Token issuance & management (auto-refresh, expiration handling, storage, etc)
  • StreamingFast GraphQL over gRPC API (planned)
  • StreamingFast gRPC API helpers (planned)

Quick Start

Notice You should replace the sequence of characters Paste your API key here in the script above with your actual API key obtained from https://app.dfuse.io. You are connecting to a local unauthenticated dfuse instance or to a dfuse Community Edition (EOSIO only)? Replace apiKey: "<Paste your API key here>" pass option dfuse.WithoutAuthentication when creating your client.

Common

package main

import (

)

func main() {
    client, err := StreamingFast.NewClient("mainnet.eos.dfuse.io", "<Paste your API key here>")
    if err != nil { panic(err) }

    tokenInfo, err := client.GetAPITokenInfo(context.Background())
    if err != nil { panic(err) }

    // Use `tokenInfo.Token` and use it to connect to dfuse's API (`fmt.Sprintf("Bearer %s", tokenInfo.Token)`)
}

References

Contributing

Issues and PR in this repo related strictly to the Golang client library.

Report any protocol-specific issues in their respective repositories

Please first refer to the general StreamingFast contribution guide, if you wish to contribute to this code base.

This codebase uses unit tests extensively, please write and run tests.

License

Apache 2.0