import { Client as RpcClient } from 'jayson/promise'; import { Logger, SubgraphDeploymentID } from '@graphprotocol/common-ts'; import { Client } from '@urql/core'; import { BlockPointer, ChainIndexingStatus, IndexingStatus } from './types'; import { AxiosInstance } from 'axios'; interface indexNode { id: string; deployments: string[]; } export interface SubgraphDeploymentAssignment { id: SubgraphDeploymentID; node: string; paused: boolean; } export interface IndexingStatusFetcherOptions { logger: Logger; statusEndpoint: string; } export interface SubgraphFeatures { network: string | null; } export declare enum SubgraphStatus { ACTIVE = "active", PAUSED = "paused", ALL = "all" } export declare const parseGraphQLIndexingStatus: (indexingStatus: any) => IndexingStatus; export declare const parseGraphQLChain: (chain: any) => ChainIndexingStatus; export declare const parseGraphQLBlockPointer: (block: any) => BlockPointer | null; export interface SubgraphDependencies { root: SubgraphDeploymentID; dependencies: SubgraphDependency[]; } export interface SubgraphDependency { base: SubgraphDeploymentID; block: number; } export declare class SubgraphManifestResolver { private ipfsBaseUrl; private ipfsClient; private logger; constructor(ipfsEndpoint: string, logger: Logger); /** * Resolves a subgraph's manifest. * * @param subgraphDeploymentId * @returns Promise */ resolve(subgraphDeploymentId: SubgraphDeploymentID): Promise; /** * Resolves a subgraph's manifest and its dependencies in the order that they need to be resolved. * * @param subgraphDeploymentId * @returns Promise */ resolveWithDependencies(subgraphDeploymentId: SubgraphDeploymentID): Promise; } export declare class GraphNode { admin: RpcClient; private queryBaseURL; private manifestResolver; private enableAutoGraft; status: Client; logger: Logger; constructor(logger: Logger, adminEndpoint: string, queryEndpoint: string, statusEndpoint: string, ipfsEndpoint: string, enableAutoGraft?: boolean); connect(): Promise; getQueryClient(deploymentIpfsHash: string): AxiosInstance; getQueryEndpoint(deploymentIpfsHash: string): string; statusEndpointConnected(): Promise; subgraphDeploymentAssignmentsByDeploymentID(subgraphStatus: SubgraphStatus, deploymentIDs: string[]): Promise; subgraphDeploymentsAssignments(subgraphStatus: SubgraphStatus): Promise; indexNodes(): Promise; create(name: string): Promise; deploy(name: string, deployment: SubgraphDeploymentID): Promise; pause(deployment: SubgraphDeploymentID): Promise; resume(deployment: SubgraphDeploymentID): Promise; reassign(deployment: SubgraphDeploymentID, node: string): Promise; ensure(name: string, deployment: SubgraphDeploymentID, currentAssignments?: SubgraphDeploymentAssignment[]): Promise; /** * Automatically deploy any dependencies of the subgraph, returning only when they are sync'd to the specified block. * * Note: All dependencies must be present on the same network as the root deployment. * * @param deployment * @param deploymentAssignments * @param name * @returns */ private autoGraftDeployDependencies; /** * Wait for the block to be synced, polling indexing status until it is * The Deployment should already be created and deployed to graph-node * This will resume a paused subgraph if the block height target is higher than the * current block height */ syncToBlock(blockHeight: number, subgraphDeployment: SubgraphDeploymentID, chainName: string | null): Promise; indexingStatus(deployments: SubgraphDeploymentID[]): Promise; proofOfIndexing(deployment: SubgraphDeploymentID, block: BlockPointer, indexerAddress: string): Promise; blockHashFromNumber(networkAlias: string, blockNumber: number): Promise; subgraphFeatures(subgraphDeploymentId: SubgraphDeploymentID): Promise; } export {};