尝试更新最新区块时遇到错误
Encountered an error while attempting to update latest block
我是区块链新手,我只是想将一个简单的智能合约部署到 ropsten 测试网。我使用了 https://github.com/t4sk/solidity-multi-sig-wallet 中的智能合约代码。我也在使用 truffle develop
提供的帐户
我的松露-config.js:
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # 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 )
},
mocha: {
timeout: 100000
},
compilers: {
solc: {
version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
// evmVersion: "byzantium"
// }
}
},
我使用的是 solidity:0.5.1
但是当我尝试使用 truffle migrate --network ropsten 部署它时,我收到以下两个错误
1.
This version of µWS is not compatible with your Node.js build:
Error: Cannot find module './uws_win32_x64_72.node'
Falling back to a NodeJS implementation; performance may be degraded.
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0x673a9a02662595075c6f3aa4dc904d24203cb8e460a3e20a630869c5155cb78c
> Blocks: 2 Seconds: 53
> contract address: 0xde674E126884c8F7Ddd94B5013065596b81fEd6d
> block number: 12075322
> block timestamp: 1647065140
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.830076836873988898
> gas used: 175087 (0x2abef)
> gas price: 2.500000028 gwei
> value sent: 0 ETH
> total cost: 0.000437717504902436 ETH
Pausing for 2 confirmations...
-------------------------------
C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848
var e = new Error('ETIMEDOUT')
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
at Timeout.<anonymous> (C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
at PollingBlockTracker._performSync (C:\Users\coolg\Desktop\hd_wallet\node_modules\eth-block-tracker\src\polling.js:51:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
同时在ropsten网络上创建了上述智能合约地址0xde674E126884c8F7Ddd94B5013065596b81fEd6d的交易。
编辑 1:
我已经用 wss://ropsten.infura.io/v3/${infuraKey}` 替换了提供者 link 并且第二个问题得到解决但现在它显示另一个错误
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0xb72aef24e5fc16395f1dc221965c4e2036b4d72babbe829f244f958d302baee5
> Blocks: 7 Seconds: 228
> contract address: 0xb81478b107D5B08B0F9ce8d0E404701a3D2292a0
> block number: 12076445
> block timestamp: 1647090364
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.828763684345799891
> gas used: 175087 (0x2abef)
> gas price: 2.500000007 gwei
> value sent: 0 ETH
> total cost: 0.000437717501225609 ETH
Pausing for 2 confirmations...
-------------------------------
> confirmation number: 3 (block: 12076452)
⠦ Saving migration to chain.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
它说交易可能仍在被开采,那么我怎么知道我的交易何时被开采?同时我可以调用部署在 ropsten_eth https://ropsten.etherscan.io/address/0xb81478b107d5b08b0f9ce8d0e404701a3d2292a0
上的智能合约的 fuctions/events
此处错误的问题可能是您要访问的地址。我搜索了问题可能是什么,并找到了两个线程,人们已经在其中描述了问题并找到了解决方案。很可能这些选项之一应该有助于解决问题。
第一个解是here。这个想法是用 wss
替换 https
。应该是这样的:
testnet: {
provider: () => new HDWalletProvider(mnemonic, `wss://ropsten.infura.io/v3/${infuraKey}`),
...
}
然后我又搜索了一些,发现了类似 this 的内容。 post 的作者说问题可能是由于 DNS 或 slow internet 造成的,并建议在配置中添加两个参数:
testnet: {
...,
networkCheckTimeoutnetworkCheckTimeout: 10000,
timeoutBlocks: 200
}
我是区块链新手,我只是想将一个简单的智能合约部署到 ropsten 测试网。我使用了 https://github.com/t4sk/solidity-multi-sig-wallet 中的智能合约代码。我也在使用 truffle develop
提供的帐户我的松露-config.js:
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # 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 )
},
mocha: {
timeout: 100000
},
compilers: {
solc: {
version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
// evmVersion: "byzantium"
// }
}
},
我使用的是 solidity:0.5.1
但是当我尝试使用 truffle migrate --network ropsten 部署它时,我收到以下两个错误
1.
This version of µWS is not compatible with your Node.js build:
Error: Cannot find module './uws_win32_x64_72.node'
Falling back to a NodeJS implementation; performance may be degraded.
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0x673a9a02662595075c6f3aa4dc904d24203cb8e460a3e20a630869c5155cb78c
> Blocks: 2 Seconds: 53
> contract address: 0xde674E126884c8F7Ddd94B5013065596b81fEd6d
> block number: 12075322
> block timestamp: 1647065140
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.830076836873988898
> gas used: 175087 (0x2abef)
> gas price: 2.500000028 gwei
> value sent: 0 ETH
> total cost: 0.000437717504902436 ETH
Pausing for 2 confirmations...
-------------------------------
C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848
var e = new Error('ETIMEDOUT')
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
at Timeout.<anonymous> (C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
at PollingBlockTracker._performSync (C:\Users\coolg\Desktop\hd_wallet\node_modules\eth-block-tracker\src\polling.js:51:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
同时在ropsten网络上创建了上述智能合约地址0xde674E126884c8F7Ddd94B5013065596b81fEd6d的交易。
编辑 1: 我已经用 wss://ropsten.infura.io/v3/${infuraKey}` 替换了提供者 link 并且第二个问题得到解决但现在它显示另一个错误
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0xb72aef24e5fc16395f1dc221965c4e2036b4d72babbe829f244f958d302baee5
> Blocks: 7 Seconds: 228
> contract address: 0xb81478b107D5B08B0F9ce8d0E404701a3D2292a0
> block number: 12076445
> block timestamp: 1647090364
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.828763684345799891
> gas used: 175087 (0x2abef)
> gas price: 2.500000007 gwei
> value sent: 0 ETH
> total cost: 0.000437717501225609 ETH
Pausing for 2 confirmations...
-------------------------------
> confirmation number: 3 (block: 12076452)
⠦ Saving migration to chain.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
它说交易可能仍在被开采,那么我怎么知道我的交易何时被开采?同时我可以调用部署在 ropsten_eth https://ropsten.etherscan.io/address/0xb81478b107d5b08b0f9ce8d0e404701a3d2292a0
上的智能合约的 fuctions/events此处错误的问题可能是您要访问的地址。我搜索了问题可能是什么,并找到了两个线程,人们已经在其中描述了问题并找到了解决方案。很可能这些选项之一应该有助于解决问题。
第一个解是here。这个想法是用 wss
替换 https
。应该是这样的:
testnet: {
provider: () => new HDWalletProvider(mnemonic, `wss://ropsten.infura.io/v3/${infuraKey}`),
...
}
然后我又搜索了一些,发现了类似 this 的内容。 post 的作者说问题可能是由于 DNS 或 slow internet 造成的,并建议在配置中添加两个参数:
testnet: {
...,
networkCheckTimeoutnetworkCheckTimeout: 10000,
timeoutBlocks: 200
}