Created
October 5, 2022 21:42
-
-
Save Olanetsoft/d535d0781251049ebbea070c5b99296d to your computer and use it in GitHub Desktop.
Setup provider - Getting Started on StarkNet with Infura
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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