graphql

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation added in v0.0.5

type Allocation struct {
	ID      string
	Indexer struct {
		ID string
	}
	SubgraphDeployment struct {
		ID           string
		OriginalName string
	}
	Poi             string
	CreatedAtEpoch  int
	AllocatedTokens string
}

type ChainHeadBlock added in v0.0.9

type ChainHeadBlock struct {
	Number string `json:"number"`
}

type Chains added in v0.0.9

type Chains struct {
	ChainHeadBlock ChainHeadBlock `json:"chainHeadBlock"`
	LatestBlock    LatestBlock    `json:"latestBlock"`
	Network        string         `json:"network"`
}

type CostModel

type CostModel struct {
	Deployment string
	Model      string
	Variables  string
}

type Epoch added in v0.0.6

type Epoch struct {
	EndBlock   int    `json:"endBlock"`
	ID         string `json:"id"`
	StartBlock int    `json:"startBlock"`
}

type FatalError added in v0.0.9

type FatalError struct {
	Handler interface{} `json:"handler"`
}

type GeoLocation

type GeoLocation struct {
	Latitude  string
	Longitude string
}

type GraphNetwork added in v0.0.9

type GraphNetwork struct {
	CurrentEpoch int
}

type GraphService

type GraphService struct {
	Client *graphql.Client
}

GraphService stores graphql client

func (*GraphService) DeleteIndexingRule

func (gs *GraphService) DeleteIndexingRule(deploymentID string) (bool, error)

func (*GraphService) GetActiveAllocations added in v0.0.5

func (gs *GraphService) GetActiveAllocations(indexer string) ([]Allocation, error)

func (*GraphService) GetClosedAllocations added in v0.0.10

func (gs *GraphService) GetClosedAllocations(subgraph string, epoch int) ([]Allocation, error)

func (*GraphService) GetCurrentEpoch added in v0.0.6

func (gs *GraphService) GetCurrentEpoch() (GraphNetwork, error)

func (*GraphService) GetEpochInfo added in v0.0.9

func (gs *GraphService) GetEpochInfo(epochNumber int) (Epoch, error)

func (*GraphService) GetIndexerInfo added in v0.0.5

func (gs *GraphService) GetIndexerInfo(indexer string) (Indexer, error)

func (*GraphService) GetIndexingRule

func (gs *GraphService) GetIndexingRule(id string) (IndexingRule, error)

func (*GraphService) GetIndexingStatuses added in v0.0.9

func (gs *GraphService) GetIndexingStatuses() ([]IndexingStatus, error)

func (*GraphService) GetModelsWithVariables

func (gs *GraphService) GetModelsWithVariables() ([]CostModel, error)

func (*GraphService) GetProofOfIndexing added in v0.0.9

func (gs *GraphService) GetProofOfIndexing(blockNumber int, blockHash, indexerAddress, subgraph string) (ProofOfIndexing, error)

func (*GraphService) GetStatus

func (gs *GraphService) GetStatus() (Status, error)

GetStatus queries status

func (*GraphService) GetSubgraphDeploymentsSignalled added in v0.0.7

func (gs *GraphService) GetSubgraphDeploymentsSignalled() ([]SubgraphDeployment, error)

func (*GraphService) SetModel

func (gs *GraphService) SetModel(model CostModel) (CostModel, error)

type Indexer added in v0.0.5

type Indexer struct {
	StakedTokens    string
	AllocatedTokens string
	AvailableStake  string
}

type IndexerEndpoint

type IndexerEndpoint struct {
	URL     string
	Healthy bool
	Tests   []IndexerEndpointTest
}

type IndexerEndpointTest

type IndexerEndpointTest struct {
	Test            string
	Error           string
	PossibleActions []string
}

type IndexerRegistration

type IndexerRegistration struct {
	URL        string
	Address    string
	Registered bool
	Location   GeoLocation
}

type IndexingRule

type IndexingRule struct {
	Deployment              string
	AllocationAmount        string
	ParallelAllocations     int
	MaxAllocationPercentage string
	MinSignal               string
	MaxSignal               string
	MinStake                string
	MinAverageQueryFees     string
	Custom                  string
	DecisionBasis           string
}

type IndexingStatus added in v0.0.9

type IndexingStatus struct {
	Chains     []Chains   `json:"chains"`
	FatalError FatalError `json:"fatalError"`
	Node       string     `json:"node"`
	Subgraph   string     `json:"subgraph"`
	Health     string     `json:"health"`
}

type LatestBlock added in v0.0.9

type LatestBlock struct {
	Number string `json:"number"`
}

type ProofOfIndexing added in v0.0.9

type ProofOfIndexing string

type Status

type Status struct {
	IndexerRegistration IndexerRegistration
	IndexerEndpoints    struct {
		Service  IndexerEndpoint
		Channels IndexerEndpoint
		Status   IndexerEndpoint
	}
	IndexingRules []IndexingRule
}

type SubgraphDeployment added in v0.0.7

type SubgraphDeployment struct {
	ID              string `json:"id"`
	OriginalName    string `json:"originalName"`
	SignalAmount    string `json:"signalAmount"`
	SignalledTokens string `json:"signalledTokens"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL