Skip to content

Instantly share code, notes, and snippets.

@Olanetsoft
Created October 5, 2022 21:42
Show Gist options
  • Save Olanetsoft/d535d0781251049ebbea070c5b99296d to your computer and use it in GitHub Desktop.
Save Olanetsoft/d535d0781251049ebbea070c5b99296d to your computer and use it in GitHub Desktop.
Setup provider - Getting Started on StarkNet with Infura
import dotenv from "dotenv";
import fs from "fs";
import { Account, Contract, ec, json, stark, Provider, number } from "starknet";
import readline from "readline";
dotenv.config();
// Initialize provider
const url = process.env.STARKNET_TESTNET_ENDPOINT;
console.log("Using Infura Starknet provider: ", url);
const provider = new Provider({
rpc: {
nodeUrl: url,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment