我已经在ubuntu中安装了固态编译器(solc)。无法将solc链接到Geth。
我们该怎么做呢?
下面是我完成的步骤:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc它将显示如下:
> eth.getCompilers()
[]我想显示如下:
> eth.getCompilers()
['Solidity' ]发布于 2016-06-26 16:14:26
由于您已经通过源代码安装了solc,因此只需使用which命令找到它:
0 ✓ user@hoster ~ $ which geth
/usr/bin/geth
0 ✓ user@hoster ~ $ which solc
/usr/bin/solc现在,您可以使用setSolc()方法将其添加到geth:
0 ✓ user@hoster ~ $ geth attach
Welcome to the Geth JavaScript console!
instance: Geth/v1.4.7-stable-667a386d/linux/go1.6.2/JIT
coinbase: 0xfcae7970392f510a985a7eaccd3820b7759d65d9
at block: 1757738 (Thu, 23 Jun 2016 18:33:28 CEST)
datadir: /home/user/.ethereum
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> eth.getCompilers()
[]
> admin.setSolc("/usr/bin/solc")
"solc, the solidity compiler commandline interface\nVersion: 0.3.5-5f97274a/Release-Linux/g++/Interpreter\n\npath: /usr/bin/solc"
> eth.getCompilers()
["Solidity"]
> 现在它被连接起来了。另请参见questions tagged with solc on ethereum stack exchange。
https://stackoverflow.com/questions/37967686
复制相似问题