MCPcopy Create free account
hub / github.com/subquery/subql / getGenesisHash

Function getGenesisHash

packages/cli/src/jsonrpc/index.ts:6–11  ·  view source on GitHub ↗
(endpoint: string)

Source from the content-addressed store, hash-verified

4import {HttpJsonRpcClient, WsJsonRpcClient} from './client';
5
6export async function getGenesisHash(endpoint: string): Promise<string> {
7 const client = endpoint.startsWith('ws') ? new WsJsonRpcClient(endpoint) : new HttpJsonRpcClient(endpoint);
8 const genesisBlock = await client.send<string>('chain_getBlockHash', [0]);
9 (client as WsJsonRpcClient).destroy?.();
10 return genesisBlock;
11}

Callers 1

jsonrpc.test.tsFile · 0.90

Calls 1

destroyMethod · 0.80

Tested by

no test coverage detected