首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将solc链接到Geth

无法将solc链接到Geth
EN

Stack Overflow用户
提问于 2016-06-22 20:12:18
回答 1查看 659关注 0票数 1

我已经在ubuntu中安装了固态编译器(solc)。无法将solc链接到Geth

我们该怎么做呢?

下面是我完成的步骤:

代码语言:javascript
复制
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc

它将显示如下:

代码语言:javascript
复制
> eth.getCompilers()
[]

我想显示如下:

代码语言:javascript
复制
> eth.getCompilers()
['Solidity' ]
EN

回答 1

Stack Overflow用户

发布于 2016-06-26 16:14:26

由于您已经通过源代码安装了solc,因此只需使用which命令找到它:

代码语言:javascript
复制
0 ✓ user@hoster ~ $ which geth
/usr/bin/geth
0 ✓ user@hoster ~ $ which solc
/usr/bin/solc

现在,您可以使用setSolc()方法将其添加到geth

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37967686

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档