Skip to content

Commit

Permalink
Use secondary connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbogle committed May 31, 2022
1 parent 85388af commit dd5b05d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/img-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as splToken from "@solana/spl-token";
import * as web3 from "@solana/web3.js";
import * as canvas from "canvas";

import { connectionFor } from "../common/connection";
import { secondaryConnectionFor } from "../common/connection";
import type { TokenData } from "../common/tokenData";
import { getTokenData } from "../common/tokenData";
import { drawLogo, drawShadow, drawText } from "./img-utils";
Expand All @@ -25,7 +25,7 @@ export async function getImage(
})`
);

const connection = connectionFor(cluster);
const connection = secondaryConnectionFor(cluster);
let tokenData: TokenData = {};
try {
tokenData = await getTokenData(connection, new web3.PublicKey(mintId));
Expand Down
4 changes: 2 additions & 2 deletions api/metadata-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { BorshAccountsCoder } from "@project-serum/anchor";
import * as web3 from "@solana/web3.js";
import fetch from "node-fetch";

import { connectionFor, secondaryConnectionFor } from "../common/connection";
import { secondaryConnectionFor } from "../common/connection";
import type { TokenData } from "../common/tokenData";
import { getTokenData } from "../common/tokenData";
import { getOwner } from "../common/utils";
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function getMetadata(
console.log(
`Getting metadata for mintId (${mintId}) uri (${metadataUri}) textParam (${textParam}) imgParam (${imgParam}) cluster (${cluster})`
);
const connection = connectionFor(cluster);
const connection = secondaryConnectionFor(cluster);
const tokenData = await getTokenData(
connection,
new web3.PublicKey(mintId),
Expand Down

0 comments on commit dd5b05d

Please sign in to comment.