混音坚固不返回私人以太坊链的结果
我刚刚开始学习以太坊和混音,这个问题对您来说似乎很愚蠢。
我尝试在嵌入了混音IDE内部的JavaScript VM上以下代码,并且它的工作原理完全不错,但是它无法返回我早日设置的私有链上的字符串,即使它没有报告任何错误。我使用的坚固代码如下。
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;
contract Greeter {
function greet() external pure returns(string memory) {
return "Hello, World!";
}
}
有人可以提供一些我可能出错的想法吗? ps i已设置miner.start()
,并使用以下脚本来启动私人链:
geth --datadir data --networkid 18810100026 --port 60000 --rpc --rpcport 8100 --rpcaddr 0.0.0.0 --bootnodes enode://****73c2e56ed109f7ab559bc0df26e01e4a72c4eef660d0853e8c241a737b43bd7f7da32d22e272fe187f7063d9559691@****:30301 --rpcapi eth,web3,miner,admin,personal,net --rpccorsdomain "*"```
geth version is 1.7.3
I have just started learning ethereum and remix, and this question might seem stupid to you.
I tried following codes on javascript vm embedded inside remix ide, and it works totally fine, but it fails to return the string on a private chain I set up early, even though it does not report any errors. The solidity code I'm using is as follows.
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;
contract Greeter {
function greet() external pure returns(string memory) {
return "Hello, World!";
}
}
Can anybody provide some idea where I might go wrong?
P.S. I have set miner.start()
, and use following script to start the private chain:
geth --datadir data --networkid 18810100026 --port 60000 --rpc --rpcport 8100 --rpcaddr 0.0.0.0 --bootnodes enode://****73c2e56ed109f7ab559bc0df26e01e4a72c4eef660d0853e8c241a737b43bd7f7da32d22e272fe187f7063d9559691@****:30301 --rpcapi eth,web3,miner,admin,personal,net --rpccorsdomain "*"```
geth version is 1.7.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为有两个事实可能导致这样的错误,
geth
更新为当前最新版本。因此,我进行了两次修改以解决此类问题,
geth
更新为1.10.17,Puppeth
,如下所示,
此后解决了问题。
I think there were two fact that might lead to such an error
geth
to the current latest version.So I made two modifications to solve such a problem
geth
to 1.10.17puppeth
,which are as follows
The problem was solved thereafter.
我认为您的合同还可以!
我将您的代码复制到Remix 0.23.3上的新合同,然后返回奇迹功能:“您好,世界!”
也许您在另一个版本中使用混音IDE,或者您的IDE具有错误。
我建议您将另一个吹牛用于混音或另一个IDE以实现固体,例如hardhat https://hardhat.org/
我的结果问候:

i think your contract is ok!
i copy your code in to new contract on Remix 0.23.3, and return greet function: "Hello, World!"
Maybe you use remix ide in another version or your ide has bugs.
I suggest you use another brower for remix or another ide for solidity like hardhat https://hardhat.org/
my result for greet:
