bsc icon indicating copy to clipboard operation
bsc copied to clipboard

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })

Open ghost opened this issue 4 years ago • 11 comments

bsc: { provider: () => new HDWalletProvider(mnemonic, https://bsc-dataseed.binance.org), network_id: 56, confirmations: 10, timeoutBlocks: 200, skipDryRun: true },

truffle migrate --network bsc --reset

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })

ghost avatar Dec 09 '21 18:12 ghost

If you use truffle to deploy contracts on BSC

The recommended configuration

    bsc: {
      provider: () => {
        return new HDWalletProvider(mnemonic, "https://bsc-dataseed2.binance.org")
      },

      network_id: 56,
      skipDryRun: true,
      gasPrice: 10 * 1e9,
      timeoutBlocks: 1,
      confirmations: 0,
    },

Hardhat is highly recommended for deploying contracts on BSC

Example

  • https://github.com/smartcontractkit/hardhat-starter-kit/blob/main/deploy/00_Deploy_Mocks.js
  • https://github.com/smartcontractkit/hardhat-starter-kit/blob/main/README.md

Hardhat Docs

https://hardhat.org/getting-started/

Advice

The initial transition from Truffle to Hardhat is bound to be uncomfortable, and once you've stuck with Hardhat for 3 days, you'll never want to use Truffle again

SolidityGo avatar Dec 10 '21 04:12 SolidityGo

same issue :(

sonnh58 avatar Dec 19 '21 12:12 sonnh58

Please follow the Setting up the development environment Guide using Truffle:

bsc: { provider: () => new HDWalletProvider(mnemonic, https://bsc-dataseed1.binance.org), network_id: 56, confirmations: 10, timeoutBlocks: 200, skipDryRun: true }

https://docs.binance.org/smart-chain/developer/deploy/truffle-new.html

RumeelHussainbnb avatar Dec 21 '21 10:12 RumeelHussainbnb

@BinanceG11 why did you close this issue? I've been trying to use truffle migrate and still breaks.

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })

rafatuita avatar Jan 05 '22 12:01 rafatuita

@BinanceG11 didn't get the solution i have tried every possibility, Increase the gas and other thing for optimisation but unable to resolve it. There may be some sort of provider error (RPC endpoint).

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })

SibghatUllah1997 avatar Feb 07 '22 07:02 SibghatUllah1997

I had the same issue and changing RPC URL fixed that.

Specifically, I was on : https://bsc-dataseed.binance.org/ And changed to : https://bsc-dataseed1.binance.org

feloot avatar Feb 22 '22 08:02 feloot

Since yesterday (2022/02/22) i'm having this issue. I did change the node, made tweaks on settings, none of these help.

After a few seconds,

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })

bosswhale avatar Feb 23 '22 11:02 bosswhale

I have the issue too. I'm doing like this https://docs.binance.org/smart-chain/developer/deploy/truffle-new.html In the testnet this works however in the main does not want work

Unker avatar Feb 25 '22 21:02 Unker

I have the issue too. I'm doing like this https://docs.binance.org/smart-chain/developer/deploy/truffle-new.html In the testnet this works however in the main does not want work

same issue for me

CiroPython avatar Mar 15 '22 16:03 CiroPython

How to do! ! ! ! ! ! ! ! ! ! ! !

hyk2727 avatar Mar 23 '22 02:03 hyk2727

Anyone still having issues, refer to this solution here. Worked for me.

NeoXtreem avatar Jun 18 '22 04:06 NeoXtreem