-
-
Save dtbuchholz/15824378cd520bf9cdc868d502b571a2 to your computer and use it in GitHub Desktop.
spamming requests to polygon mumbai provider
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
// Env setup | |
import { connect } from "@tableland/sdk" | |
import dotenv from "dotenv" | |
import { ethers } from "ethers" | |
import fetch from "node-fetch" | |
dotenv.config() | |
globalThis.fetch = fetch | |
// Import private key & instantiate wallet / signer | |
const privateKey = process.env.WALLET_PRIVATE_KEY | |
const alchemyMumbaiKey = process.env.ALCHEMY_POLYGON_MUMBAI_API_KEY | |
const mumbaiUrl = `https://polygon-mumbai.g.alchemy.com/v2/${alchemyMumbaiKey}` | |
const provider = new ethers.providers.JsonRpcProvider(mumbaiUrl) | |
const wallet = new ethers.Wallet(privateKey, provider) | |
const signer = wallet.connect(provider) | |
// TBL | |
const tableland = await connect({ signer }) | |
const schema = "handle text primary key, address text, message text" | |
const prefix = "discord_bot" | |
// This is where things hang up, causing an undesired number of requests. | |
const { name } = await tableland.create(schema, { | |
prefix, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment