The TRUF.NETWORK offers SDKs in Go, TypeScript/JavaScript, and Python to facilitate seamless integration with its decentralized platform for economic data streams.

SDK Overview

For detailed installation, usage, and API references, please refer to the respective SDK repositories:

What is a streamID?

A streamID is an identifier used in the TRUF.NETWORK (TN) to identify the deployed contract. It is a unique string generated from a descriptive name, such as an English name, to ensure easy reference and management of data streams.

SDK Capabilities

Each SDK provides comprehensive tools to interact with the TRUF.NETWORK, enabling operations such as:

  • Deploying primitive and composed streams
  • Inserting and retrieving records
  • Managing stream metadata
  • Handling stream permissions
  • Performing batch operations

Stream Deployment Permissions

To ensure the integrity and quality of data streams on the TRUF.NETWORK, the creation of new streams (both primitive and composed) is a permissioned operation. This process is governed by a system:network_writer role within the network’s role-based access control (RBAC) system.

Only wallets that are members of the system:network_writer role are authorized to deploy new streams using the SDKs.

How to get access:

If you are a partner or data provider interested in deploying streams on the TRUF.NETWORK, please contact our team. We will guide you through the process of obtaining the necessary permissions by granting your wallet the system:network_writer role.

Using SDKs with Your Local Node

This section is intended for node operators who are running a local TRUF.NETWORK node that is fully synced with the network. If your node is not connected to the network, queries will return empty results because your local database will not contain any data. Always ensure your node is synchronized before using it as an SDK endpoint. Follow the Node Operator Guide for instructions on connecting to the network and syncing data.

You can use any TRUF.NETWORK SDK (Go, TypeScript/JavaScript, Python) to interact with your own local node, not just the public gateway. This allows you to fetch data directly from your node, which is especially useful for node operators, validators, and developers.

Before you can fetch data from a stream using the SDKs, you need to know the stream’s ID and the data provider address. The easiest way to discover these is by using the TRUF.NETWORK Explorer.

Prerequisites

  1. Node is fully synced:
    Ensure your node is fully synchronized with the network and has all data available.
    See the Node Operator Guide for instructions on checking sync status.

  2. Local Endpoint:
    Your node should be running and exposing the HTTP API at http://localhost:8484 (the default).

Configuration

To use the SDKs with your local node, you need to configure the client to point to your local endpoint (http://localhost:8484) instead of the default public gateway. For detailed instructions and code examples, refer to the guide in the README of the respective SDK repository:

Additional Resources

For support or questions, please open an issue in the respective SDK repository or contact our support team.