BSC 测试网:Truffle Migrate ETIMEDOUT

Lyn*_*Lyn 6 blockchain smartcontracts binance-smart-chain

我需要将我的智能合约部署到 BSC 测试网

我总是得到这个:

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
Run Code Online (Sandbox Code Playgroud)

我尝试更改此处指定的 RPC https://docs.binance.org/smart-chain/developer/rpc.html#rate-limit

所有这些,却还是一样。

一件事是,我尝试将其部署到 ropsten 只是为了好玩。这就是成功。现在BSC Testnet RPC有什么问题吗?

这是我的 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
        },
Run Code Online (Sandbox Code Playgroud)

我搜索了一下,有些人使用websocket(wss),有些人更改RPC Url,有些人添加networkCheckTimeout。我尝试了所有这些(除了 wss,因为我没有看到它是由 BSC Testnet 提供的)。但没有任何作用。

有什么建议吗?谢谢

小智 0

bsc: {
  networkCheckTimeout: 999999,
  provider: () => new HDWalletProvider(mnemonic, `https://data-seed-prebsc-1-s1.binance.org:8545`),
  network_id: 97, // Ropsten's id
  gas: 5500000, // Ropsten has a lower block limit than mainnet
  confirmations: 10, // # of confs to wait between deployments. (default: 0)
  timeoutBlocks: 200, // # of blocks before a deployment times out  (minimum/default: 50)
  skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},
Run Code Online (Sandbox Code Playgroud)

添加网络超时应该有帮助