2
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x0ed88dd40f380a805ed0ba1b5b0a9d8178321ab6da9e5c0cb247f5700337b173
Migrations: 0xcfc4ba0488f20c7a2bb24e735f43e240bf249bc8
Saving successful migration to network...
  ... 0x471a1036236241c302cfa7b8dfcd011e106e221202b7c8c2586c3bf2d28c5546
Saving artifacts...
Running migration: 2_deploy_contracts.js

/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38
        return new Error(message);
^
Error: Invalid JSON RPC response: undefined
    at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at RequestManager.send (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:61:1)
    at Eth.get [as accounts] (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/property.js:107:1)
    at module.exports (/home/josue/Desktop/projectX/ebay-on-ethereum-ipfs-starter-project/migrations/2_deploy_contracts.js:6:44)
    at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:82:1
    at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-require/require.js:101:1
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

and this my truffle js

var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "my seed word";
require('babel-register')

module.exports = {
  networks: {
    development: {
      host: '127.0.0.1',
      port: 8545,
      network_id: '*' // Match any network id
    },
    ropsten: {
      provider: function() {
        return new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/<mykey>")
      },
      network_id: 3
    }
  }
}
  • What does your 2_deploy_contracts.js looks like? – Ismael Feb 3 at 6:45
  • var EcommerceStore = artifacts.require("./EcommerceStore.sol"); module.exports = function(deployer) { deployer.deploy(EcommerceStore, web3.eth.accounts[9]); } – Josue Guessennd Feb 3 at 8:04
  • You can edit your own question to add more details. By default truffle-hdwallet-provider only provides 1 address. Are you using Truffle v5? – Ismael Feb 3 at 8:20
  • no i'm using truffle version 4.1.14 – Josue Guessennd Feb 3 at 10:49
  • Can you check the value of web3.eth.accounts[9]? – Ismael Feb 4 at 5:42

Your Answer

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

Browse other questions tagged or ask your own question.