首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:迁移kovan

错误:迁移kovan
EN

Ethereum用户
提问于 2019-09-12 13:11:07
回答 1查看 304关注 0票数 0

来自:松露迁移--处理事务时的网络kovan >> ProviderError: VM异常

代码语言:javascript
复制
>truffle migrate --reset --network kovan

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Compiling your contracts...
===========================
> Compiling .\contracts\Token.sol
> Artifacts written to D:\Blockchain Dev\t2\build\contracts
> Compiled successfully using:
   - solc: 0.5.8+commit.23d335f2.Emscripten.clang

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Migrations dry-run (simulation)
===============================
> Network name:    'kovan-fork'
> Network id:      42
> Block gas limit: 0x7a1200


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > block number:        13446679
   > block timestamp:     1568292923
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86826832679724222
   > gas used:            246393
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.000492786 ETH

   -------------------------------------
   > Total cost:         0.000492786 ETH


2_deploy_smartcontract.js
=========================

   Deploying 'Token'
   -----------------
   > block number:        13446681
   > block timestamp:     1568292936
   > account:             0x7D163E973E31a7532dB7EfeeAaaE360FEBD48126
   > balance:             99.999477718
   > gas used:            261141
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.000522282 ETH


   Deploying 'Shop'
   ----------------
   > block number:        13446682
   > block timestamp:     1568292946
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86661835279724222
   > gas used:            797964
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.001595928 ETH

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-core-helpers\src\errors.js:42:1)
    at t.InvalidResponse [as onreadystatechange] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-providers-http\src\index.js:92:1)
    at t._a [as dispatchEvent] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:27:61)
    at t.dispatchEvent [as _setReadyState] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:208:1)
    at t._setReadyState [as _onHttpRequestError] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:349:1)
    at ClientRequest._onHttpRequestError (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:252:47)
    at ClientRequest.emit (events.js:197:13)
    at TLSSocket.socketErrorListener (_http_client.js:397:9)
    at TLSSocket.emit (events.js:197:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)
   -------------------------------------
   > Total cost:          0.00211821 ETH


Summary
=======
> Total deployments:   3
> Final cost:          0.002610996 ETH

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Starting migrations...
======================
> Network name:    'kovan'
> Network id:      42
> Block gas limit: 0x7a1200


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > transaction hash:    0x71f1ecd87d73ac93b1a0b851cbec1ee14ea33f4c6e8d1f0337c5f2a735238565
   > Blocks: 1            Seconds: 5
   > contract address:    0x99B3B76E319A398B7f31C425Bf86bf3F9A00e1ef
   > block number:        13446694
   > block timestamp:     1568292972
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86353325279724222
   > gas used:            261393
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.00522786 ETH


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00522786 ETH


2_deploy_smartcontract.js
=========================

   Deploying 'Token'
   -----------------
   > transaction hash:    0x6a66f4e346b295ae6a7b930049dcf2a78d1f60466acc28e06a2f6d382bdc2a21
   > Blocks: 2            Seconds: 5
   > contract address:    0x55eAe6a8AA8d78E76E23469D60fCA9D871acf737
   > block number:        13446699
   > block timestamp:     1568292992
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.85716997279724222
   > gas used:            276141
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.00552282 ETH


   Deploying 'Shop'
   ----------------
   > transaction hash:    0xcbc525179d836c872fcc4abf4554580bff9407a89f0b47b83494c6854d2f5b2b
   > Blocks: 1            Seconds: 5
   > contract address:    0x35599a6CA54496cfA5F6E57aCf7D59b0c27376A1
   > block number:        13446703
   > block timestamp:     1568293008
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.84091069279724222
   > gas used:            812964
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.01625928 ETH

Error: Error: Error: invalid address (arg="_to", coderType="address", value=undefined)
    at Object.run (C:\Users\WINDOWS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:92:1)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

Truffle v5.0.33 (core: 5.0.33)

Node v11.12.0

PS D:\Blockchain Dev\t2>
EN

回答 1

Ethereum用户

回答已采纳

发布于 2019-09-13 09:37:01

看起来与前一个问题中的问题相同。您应该将最后两个参数(0和2)添加到HDWalletProvider(mnemonic, link, 0, 2)原因,因为您的帐户1是未定义的,因为它没有被提供程序解锁。您还可以尝试使用console.log(accounts)来检查未锁定帐户的数量。

另外,我仍然看到Migrations的试运行(模拟)--这意味着您还没有关闭它。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/75889

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档