From 5e917869c6512769a5cb7d13909aade565bfdc07 Mon Sep 17 00:00:00 2001 From: Christian van der Loo Date: Sat, 3 Sep 2022 17:29:16 -0400 Subject: [PATCH] feat: stripped out infura references, using local node --- packages/server/README.md | 4 +--- packages/server/src/clients/filecoin.ts | 11 ++--------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/server/README.md b/packages/server/README.md index 90dc98f..28f2583 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -4,6 +4,4 @@ The Crate Pinning Service exposes an endpoint which conforms to the [IPFS Pinnin ## Setup -Before running, add the `INFURA_PROJECT_ID` and `INFURA_PROJECT_SECRET` variables to your environment. The Infura project should be a Filecoin project. - -Additionally, set the `GOOGLE_APPLICATION_CREDENTIALS` variable for Firebase authentication. +Set the `GOOGLE_APPLICATION_CREDENTIALS` variable for Firebase authentication. diff --git a/packages/server/src/clients/filecoin.ts b/packages/server/src/clients/filecoin.ts index 2199038..005e37b 100644 --- a/packages/server/src/clients/filecoin.ts +++ b/packages/server/src/clients/filecoin.ts @@ -2,15 +2,8 @@ import { mainnet } from "@filecoin-shipyard/lotus-client-schema" import { NodejsProvider } from "@filecoin-shipyard/lotus-client-provider-nodejs" import { LotusRPC } from "@filecoin-shipyard/lotus-client-rpc" -const user = process.env["INFURA_PROJECT_ID"] -const pass = process.env["INFURA_PROJECT_SECRET"] - -const endpointURL = "https://filecoin.infura.io" -const provider = new NodejsProvider(endpointURL, { - authorizationHeader: `Basic ${Buffer.from(`${user}:${pass}`).toString( - "base64" - )}`, -}) +const endpointURL = process.env["FILECOIN_CLIENT_URL"] +const provider = new NodejsProvider(endpointURL) const client = new LotusRPC(provider, { schema: mainnet.fullNode }) export default client -- 2.51.2