2

I need to deploy my smart contract to BSC Testnet

I always got this :

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
I tried to change the RPC specified here https://docs.binance.org/smart-chain/developer/rpc.html#rate-limit

All of them, yet still the same.

One thing is, I tried to deploy it to ropsten instead just for fun. And it is success. Is there any problem with BSC Testnet RPC nowadays ?

Here is my snip for truffle-config.js

        testnet: {
            provider: () => new HDWalletProvider(mnemonic, `https://data-seed-prebsc-1-s2.binance.org:8545`),
            network_id: 97, // 3 for ropsten, 97 for bsc test
            confirmations: 2,
            timeoutBlocks: 2000,
            skipDryRun: true,
            networkCheckTimeout: 1000000
        },

I searched, some people use websocket (wss), some change the RPC Url, some add the networkCheckTimeout. I tried all of them (except wss, since I don't see it is provided by BSC Testnet). But nothing work.

Any suggestion ? Thank you

5

If you compile a lot of files, truffle ask for the lastest block. Since BSC testnet limits the amount of request you can make, it hangs and then you get a timeout. I solved this issue just compiling my code first and for deploy, using --compile-none.

truffle deploy --network testnet --reset --compile-none
2
  • 1
    Thank you for the response. I might try it when there is another chance. For now, I had abandoned truffle and use remix instead. No problem at all with remix and somehow, it is also faster. So, I dont think I'll be back to use truffle for a while.
    – Lyn
    May 28 at 0:25
  • Seriously truffle got an issue. Correct that remix will work without an issue but not truffle.
    – NinjaMAN
    Aug 16 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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