0

I am trying to deploy a contract on Arbitrum testnet using Infura as web3 provider.

In my profile with Infura I added Arbitrum as a network.

Then I do

const url ='https://arbitrum-rinkeby.infura.io/v3/my_project_id'

const web3Provider = new Web3.providers.HttpProvider(url);

However, when trying to deploy , I am getting error

Error: Chain with name arbitrum-rinkeby not supported

The same error happens if I just use "arbitrum" instead of arbitrum-rinkeby.

What is going on?

EDIT: here is the code I use for deployment

web3.eth.getTransactionCount(addr, (err,txCount) => { console.log("txCount=",txCount);

const txObject = { nonce: web3.utils.toHex(txCount), gasLimit: web3.utils.toHex(1500000), gasPrice: web3.utils.toHex(100000000), data: data.encodeABI() }

const tx = new Tx(txObject,{chain:'arbitrum-rinkeby', hardfork: 'petersburg'});

tx.sign(key);

const serializeTx = tx.serialize(); const raw = '0x'+serializeTx.toString('hex');

web3.eth.sendSignedTransaction(raw).on('receipt', console.log);

})

1
  • Hi! it would be good if you could post the code that you are trying to use so that we can have a better picture! Anyway I'll add some first impressions in the answers section =) Sep 19, 2022 at 12:43

1 Answer 1

1

Developer advocate at Chainstack here!

At first glance, it looks like the code you are using to create the provider instance doesn't work, try this:

const Web3 = require("web3"); 
const node_url = "NODE_URL"; 
const web3 = new Web3(node_url);

I was able to retrieve data without problems using this format.

Chainstack has a section in the docs dedicated to the Arbitrum API, you can use it to reference code examples!

The second point is that Rinkeby is considered deprecated and will shut down soon; it's even still on proof of work!

Check out this article about the merge where you can find which testnets are deprecated!

So my suggestion is to switch to the Arbitrum Goerli testnet. Then, if you have issues with your endpoint, you can try Chainstack for free!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.