flashbots / simple-arbitrage

Example arbitrage bot using Flashbots
1.97k stars 743 forks source link

New to Eth - Should be a quick fix: error: could not detect network #29

Closed Carlmcap closed 2 years ago

Carlmcap commented 2 years ago

I'm using this code as a learning module; however, I receive the following error when running the code.

Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.8)

I believe it comes from the following line 10 index.ts

const ETHEREUM_RPC_URL = process.env.ETHEREUM_RPC_URL || "http://127.0.0.1:8545"

Looking around online, I think it could be two things. (1) This is a local host (Like ganache or something), so I wont be able to run this code. Or (2) I am missing a dependency.

ANY help would be great, I have already learned a lot!!!

Kindest,

Carl M.

Carlmcap commented 2 years ago

const ETHEREUM_RPC_URL = process.env.ETHEREUM_RPC_URL || "http://127.0.0.1:8545/"

*** for any newcomers who get the same error. use your rpc HTTP. I used infura