当我试图使用松露调用部署在rinkeby网络上的智能契约的写函数时,我会得到error Invalid JSON RPC response: ""。
请您帮助解决造成这一问题的原因以及如何解决它。有点急事。谢谢。
我的truffle.js文件的内容是:
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,
}
}
};发布于 2018-09-21 07:29:28
GasPrice是在像Metamask这样的接口上用GWeis来测量的,但是在GasPrice是在Weis上的,所以21不是一个正确的值,因为太低了。
根据信托公司的文件:
缺省值为100000000000
要在测试网上部署,只需不要编写该字段。松露将自动识别网络的中介GasPrice,并将该值用作部署的GasPrice。
希望能帮上忙!
发布于 2018-09-21 06:31:38
除了gasPrice非常低之外,当我在使用呋喃时,我发现如果调用函数的方式有问题,如果将返回该错误。我对此还很陌生,但也许你的呼唤中有一件事是愤怒不认识的。如果您可以发布如何调用该函数,这可能会有所帮助。
https://ethereum.stackexchange.com/questions/58923
复制相似问题