When I am trying to call a Write function of the smart contract deployed on the rinkeby network using truffle, I get error Invalid JSON RPC response: ""
.
Can you please help with what is causing this issue and how to resolve it. It is a bit urgent. Thanks.
Content of my truffle.js file is:
const HDWalletProvider = require("truffle-hdwallet-provider-privkey");
const privKey = "my-address's private key from which i want to deploy it";
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
rinkeby: {
provider: function() {
return new HDWalletProvider(privKey, "https://rinkeby.infura.io/mytokenid");
},
network_id: 4,
gas: 7003605,
gasPrice: 21,
}
}
};