{"action":"created","issue":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/852","repository_url":"https://api.github.com/repos/trufflesuite/truffle","labels_url":"https://api.github.com/repos/trufflesuite/truffle/issues/852/labels{/name}","comments_url":"https://api.github.com/repos/trufflesuite/truffle/issues/852/comments","events_url":"https://api.github.com/repos/trufflesuite/truffle/issues/852/events","html_url":"https://github.com/trufflesuite/truffle/issues/852","id":306138685,"number":852,"title":"using infura in truffle and get Error: Invalid JSON RPC response: \"\"","user":{"login":"dc1996226","id":37468947,"avatar_url":"https://avatars3.githubusercontent.com/u/37468947?v=4","gravatar_id":"","url":"https://api.github.com/users/dc1996226","html_url":"https://github.com/dc1996226","followers_url":"https://api.github.com/users/dc1996226/followers","following_url":"https://api.github.com/users/dc1996226/following{/other_user}","gists_url":"https://api.github.com/users/dc1996226/gists{/gist_id}","starred_url":"https://api.github.com/users/dc1996226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dc1996226/subscriptions","organizations_url":"https://api.github.com/users/dc1996226/orgs","repos_url":"https://api.github.com/users/dc1996226/repos","events_url":"https://api.github.com/users/dc1996226/events{/privacy}","received_events_url":"https://api.github.com/users/dc1996226/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"cgewecke","id":7332026,"avatar_url":"https://avatars0.githubusercontent.com/u/7332026?v=4","gravatar_id":"","url":"https://api.github.com/users/cgewecke","html_url":"https://github.com/cgewecke","followers_url":"https://api.github.com/users/cgewecke/followers","following_url":"https://api.github.com/users/cgewecke/following{/other_user}","gists_url":"https://api.github.com/users/cgewecke/gists{/gist_id}","starred_url":"https://api.github.com/users/cgewecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgewecke/subscriptions","organizations_url":"https://api.github.com/users/cgewecke/orgs","repos_url":"https://api.github.com/users/cgewecke/repos","events_url":"https://api.github.com/users/cgewecke/events{/privacy}","received_events_url":"https://api.github.com/users/cgewecke/received_events","type":"User","site_admin":false},"assignees":[{"login":"cgewecke","id":7332026,"avatar_url":"https://avatars0.githubusercontent.com/u/7332026?v=4","gravatar_id":"","url":"https://api.github.com/users/cgewecke","html_url":"https://github.com/cgewecke","followers_url":"https://api.github.com/users/cgewecke/followers","following_url":"https://api.github.com/users/cgewecke/following{/other_user}","gists_url":"https://api.github.com/users/cgewecke/gists{/gist_id}","starred_url":"https://api.github.com/users/cgewecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgewecke/subscriptions","organizations_url":"https://api.github.com/users/cgewecke/orgs","repos_url":"https://api.github.com/users/cgewecke/repos","events_url":"https://api.github.com/users/cgewecke/events{/privacy}","received_events_url":"https://api.github.com/users/cgewecke/received_events","type":"User","site_admin":false}],"milestone":null,"comments":18,"created_at":"2018-03-17T08:20:50Z","updated_at":"2018-05-06T16:45:07Z","closed_at":null,"author_association":"NONE","body":"it is my first time to ask questions there ,please forgive my rudeness.\r\n\r\nI using metamask, infura, and truffle to try to deploy the contract (the pet-shop-tutorial) to the ropsten testnet, all gone well but this.\r\n\r\nthat is the error information:\r\n\r\n```shell\r\nduchendeMacBook-Air:pet-shop-tutorial duchen$ truffle migrate --network ropsten --reset\r\nUsing network 'ropsten'.\r\n\r\nRunning migration: 1_initial_migration.js\r\n  Replacing Migrations...\r\n  ... 0x8bf66529dd4eb0c36a89ecec783808effad37ec4bc6dda9f9fe1a7f7cc219f3d\r\n  Migrations: 0xb2ea93671103da9da0cc8018e4a262280e4944f0\r\nSaving successful migration to network...\r\n  ... 0xef35a32e4e13e9615c597527c082bb0f5cc32018bfa7a8ad4a03b9f8af9c59ce\r\nSaving artifacts...\r\nRunning migration: 2_deploy_contracts.js\r\n  Replacing Adoption...\r\n  ... 0x4340c9d747dd134da705a6cc192432b0b4b75d0138a01ef21f5c955958a2bb05\r\n  Adoption: 0x83544aff3420b9a1639fb9944449575f6135d915\r\nSaving successful migration to network...\r\n  ... 0x4774ad3d756e26aeaf047b5e19ae449ace957e3baf3578478c70c0aa951fa8e1\r\nSaving artifacts...\r\n/usr/local/lib/node_modules/truffle/build/cli.bundled.js:128857\r\nvar Module;if(!Module)Module=(typeof Module!==\"undefined\"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module[\"ENVIRONMENT\"]){if(Module[\"ENVIRONMENT\"]===\"WEB\"){ENVIRONMENT_IS_WEB=true}else if(Module[\"ENVIRONMENT\"]===\"WORKER\"){ENVIRONMENT_IS_WORKER=true}else if(Module[\"ENVIRONMENT\"]===\"NODE\"){ENVIRONMENT_IS_NODE=true}else if(Module[\"ENVIRONMENT\"]===\"SHELL\"){ENVIRONMENT_IS_SHELL=true}else{throw new Error(\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\")}}else{ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&\"function\"===\"function\"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!\r\n\r\nError: Invalid JSON RPC response: \"\"\r\n at Object.InvalidResponse (/Users/duchen/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)\r\n    at XMLHttpRequest.request.onreadystatechange (/Users/duchen/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)\r\n    at XMLHttpRequestEventTarget.dispatchEvent (/Users/duchen/node_modules/xhr2/lib/xhr2.js:64:18)\r\n    at XMLHttpRequest._setReadyState (/Users/duchen/node_modules/xhr2/lib/xhr2.js:354:12)\r\n    at XMLHttpRequest._onHttpRequestError (/Users/duchen/node_modules/xhr2/lib/xhr2.js:544:12)\r\n    at ClientRequest.<anonymous> (/Users/duchen/node_modules/xhr2/lib/xhr2.js:414:24)\r\n    at emitOne (events.js:116:13)\r\n    at ClientRequest.emit (events.js:211:7)\r\n    at TLSSocket.socketErrorListener (_http_client.js:387:9)\r\n    at emitOne (events.js:116:13)\r\n```\r\nand this is my code in truffle.js:\r\n```javascript\r\nvar HDWalletProvider = require(\"truffle-hdwallet-provider\");\r\nvar mnemonic = \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\";\r\nmodule.exports = {\r\n  // See <http://truffleframework.com/docs/advanced/configuration>\r\n  // for more about customizing your Truffle configuration!\r\n  networks: {\r\n    development: {\r\n      host: \"127.0.0.1\",\r\n      port: 7545,\r\n      network_id: \"*\" // Match any network id\r\n    },\r\n      ropsten: {\r\n      provider:function(){\r\n      return new HDWalletProvider(mnemonic, \"https://ropsten.infura.io/epDGgTgqhFlsPTwmmVC0\")\r\n      },\r\n      network_id: 3,\r\n      gas:499000,\r\n      gasPrice:1000000000000\r\n    }\r\n  }\r\n};\r\n```\r\n\r\nI followed the steps from http://truffleframework.com/tutorials/using-infura-custom-provider\r\nbut it seemed it has some problems, thank you for your answers."},"comment":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/comments/386892556","html_url":"https://github.com/trufflesuite/truffle/issues/852#issuecomment-386892556","issue_url":"https://api.github.com/repos/trufflesuite/truffle/issues/852","id":386892556,"user":{"login":"cgewecke","id":7332026,"avatar_url":"https://avatars0.githubusercontent.com/u/7332026?v=4","gravatar_id":"","url":"https://api.github.com/users/cgewecke","html_url":"https://github.com/cgewecke","followers_url":"https://api.github.com/users/cgewecke/followers","following_url":"https://api.github.com/users/cgewecke/following{/other_user}","gists_url":"https://api.github.com/users/cgewecke/gists{/gist_id}","starred_url":"https://api.github.com/users/cgewecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgewecke/subscriptions","organizations_url":"https://api.github.com/users/cgewecke/orgs","repos_url":"https://api.github.com/users/cgewecke/repos","events_url":"https://api.github.com/users/cgewecke/events{/privacy}","received_events_url":"https://api.github.com/users/cgewecke/received_events","type":"User","site_admin":false},"created_at":"2018-05-06T16:45:07Z","updated_at":"2018-05-06T16:45:07Z","author_association":"CONTRIBUTOR","body":"@roderik Oh good, and thank you! "}}
{"actor":{"display_login":"cgewecke"}}