Skip to content

Commit

Permalink
Added fetch "@lodestar/api";
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroyukiNaito committed Mar 1, 2024
1 parent 2b2e1e1 commit fcaf7ea
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/networks/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import {ENR} from "@chainsafe/enr";
import {SLOTS_PER_EPOCH} from "@lodestar/params";
import {ApiError, getClient} from "@lodestar/api";
import {ApiError, getClient, fetch} from "@lodestar/api";
import {getStateTypeFromBytes} from "@lodestar/beacon-node";
import {ChainConfig, ChainForkConfig} from "@lodestar/config";
import {Checkpoint} from "@lodestar/types/phase0";
Expand Down Expand Up @@ -101,7 +101,7 @@ export function getGenesisFileUrl(network: NetworkName): string | null {
* Fetches the latest list of bootnodes for a network
* Bootnodes file is expected to contain bootnode ENR's concatenated by newlines
*/
export async function fetchBootnodes(network: NetworkName): Promise<string[]> {
async function fetchBootnodes(network: NetworkName): Promise<string[]> {
const bootnodesFileUrl = getNetworkData(network).bootnodesFileUrl;
if (bootnodesFileUrl === null) {
return [];
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/util/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import yaml from "js-yaml";
import {fetch} from "@lodestar/api";
const {load, dump, FAILSAFE_SCHEMA, Type} = yaml;

import {mkdir} from "./fs.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {writeFile} from "node:fs/promises";
import path from "node:path";
import yaml from "js-yaml";
import {HttpClient} from "@lodestar/api";
import {HttpClient, fetch} from "@lodestar/api";
import {getClient} from "@lodestar/api/beacon";
import {chainConfigToJson} from "@lodestar/config";
import {BeaconClient, BeaconNodeGenerator, LighthouseAPI, RunnerType} from "../interfaces.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from "node:path";
import {getClient} from "@lodestar/api/beacon";
import {chainConfigToJson} from "@lodestar/config";
import {LogLevel} from "@lodestar/utils";
import {fetch} from "@lodestar/api";
import {BeaconArgs} from "../../../../src/cmds/beacon/options.js";
import {GlobalArgs} from "../../../../src/options/globalOptions.js";
import {LODESTAR_BINARY_PATH} from "../constants.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {writeFile} from "node:fs/promises";
import path from "node:path";
import {ZERO_HASH} from "@lodestar/state-transition";
import {fetch} from "@lodestar/api";
import {
EL_GENESIS_ACCOUNT,
EL_GENESIS_PASSWORD,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {writeFile} from "node:fs/promises";
import path from "node:path";
import {ZERO_HASH} from "@lodestar/state-transition";
import {fetch} from "@lodestar/api";
import {Eth1ProviderWithAdmin} from "../Eth1ProviderWithAdmin.js";
import {ExecutionClient, ExecutionNodeGenerator, JobOptions, RunnerType} from "../interfaces.js";
import {getNethermindChainSpec} from "../utils/execution_genesis.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {writeFile} from "node:fs/promises";
import yaml from "js-yaml";
import {getClient as keyManagerGetClient} from "@lodestar/api/keymanager";
import {chainConfigToJson} from "@lodestar/config";
import {fetch} from "@lodestar/api";
import {RunnerType, ValidatorClient, ValidatorNodeGenerator} from "../interfaces.js";
import {updateKeystoresPath} from "../utils/keys.js";
import {getNodeMountedPaths} from "../utils/paths.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {getClient as keyManagerGetClient} from "@lodestar/api/keymanager";
import {chainConfigToJson} from "@lodestar/config";
import {LogLevel} from "@lodestar/utils";
import {defaultOptions} from "@lodestar/validator";
import {fetch} from "@lodestar/api";
import {IValidatorCliArgs} from "../../../../src/cmds/validator/options.js";
import {GlobalArgs} from "../../../../src/options/globalOptions.js";
import {LODESTAR_BINARY_PATH} from "../constants.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/test/utils/testFileCache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import {ApiError, getClient} from "@lodestar/api";
import {ApiError, getClient, fetch} from "@lodestar/api";
import {NetworkName, networksChainConfig} from "@lodestar/config/networks";
import {createChainForkConfig, ChainForkConfig} from "@lodestar/config";
import {allForks} from "@lodestar/types";
Expand Down

0 comments on commit fcaf7ea

Please sign in to comment.