- Create an EC2 instance for snapshot downloading
- Depending of cpu cores, uncompress faster
- Estimate instance costs there: https://aws.amazon.com/ru/ec2/pricing/on-demand/
- Connect
ssh -i key.pem ubuntu@1.2.3.4
- Create and attach EC2 volume gp3, min 1.5tb, better 2tb, 8000 IOPS, 250MB/s
- Estimate GB size and costs https://calculator.aws/#/createCalculator/EBS
- Attach volume to low-cost instance
- Prepare attached volume to usage:
- Based on this guide https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
- Short steps to do are:
npm init -y
npm i ethers
Set provider
let provider = new ethers.providers.JsonRpcProvider("https://bscrpc.com", 56) // bsc
// let provider = new ethers.providers.WebSocketProvider("wss://..........", 56) // bsc
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 ( | |
"context" | |
"crypto/ecdsa" | |
"crypto/elliptic" | |
"encoding/json" | |
"github.com/ethereum/go-ethereum/common" | |
"github.com/ethereum/go-ethereum/core/types" | |
"github.com/ethereum/go-ethereum/ethclient" | |
"github.com/ethereum/go-ethereum/log" | |
"io/ioutil" |
- ~40GB space needed for state
- Actual X,P,C chains state for recent 100blocks.
- Really cheap (~30$) to start own state-sync-node compared to BSC full-node (700$+).
- Pending transactions is rare event. ~1-10% pending txes will be catched.
- Not enough to become validator
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 {ethers, providers, Wallet} from "ethers"; | |
import {FlashbotsBundleProvider, FlashbotsBundleResolution} from "@flashbots/ethers-provider-bundle"; | |
import {parseUnits} from "ethers/lib/utils"; | |
export async function timeout(ms: number) { | |
return new Promise(res => setTimeout(res, ms)) | |
} | |
const polygonRpc = 'https://rpc.ankr.com/polygon' | |
const privateKey = '0x123123...' |