Skip to content

Initial Indexing using Envio #32

@mattiaslightstone

Description

@mattiaslightstone

Description

Create an index that uses envio indexer to keep track of all streams created.

Scope

Simply generate a Stream object for each CreateStream event.
Ensure that the following queries can be made from the graphql interface.

  • Fetch Streams by a set of stream_ids
  • Fetch Streams by a set of sender_assets
  • Fetch Streams by a set of receiver_assets

Configuration

Directory ./indexer
Contract Id 0x109981cc560daf5a8c27cbe33de7a35d179615b41c5de62e1903edb4e8e5213a
Abi Path contracts/token-streaming/out/debug/token-streaming-abi.json
Index Name PipelineStreams

Schema

Base off of the CreateStream event schema

pub struct CreateStream {
    pub stream_id: u64,
    pub sender: Identity,
    pub receiver: Identity,
    pub underlying_asset: AssetId,
    pub receiver_asset: AssetId,
    pub sender_asset: AssetId,
    pub deposit: u64,
    pub stream_size: u64,
    pub start_time: u64,
    pub stop_time: u64,
}

Add timestamp as the stream creation block timestamp (likely unixtime)
Add rate_per_second as a BigDecimal from stream_size(stop_time - start_time)
Rename stream_id to id

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions