自己搭建以太坊节点[区块链]
发布于 6 年前 作者 leiwei1991 17513 次浏览 来自 分享

geth是什么

  1. go-ethereum就是通常所说的 geth ,它是一个用Go语言实现运行在以太坊完整节点上的命令行接口,安装并运行了geth,你可以成为以太坊正式链的节点并且可以:
  • 挖矿得到真实的以太币
  • 在账户地址之间转移资金
  • 创建智能合约和发起交易
  • 查看所有历史区块
  • 还有很多很多功能
客户端种类

客户端 语言 开发者 最新版本 go-ethereum Go 以太坊基金会 go-ethereum-v1.4.9 Parity Rust Ethcore Parity-v1.2.1 cpp-ethereum C++ 以太坊基金会 cpp-ethereum-v1.2.9 pyethapp Python 以太坊基金会 pyethapp-v1.2.3 ethereumjs-lib Javascript 以太坊基金会 ethereumjs-lib-v3.0.0 Ethereum(J) Java <ether.camp> ethereumJ-v1.3.0-RC3-daoRescue2 ruby-ethereum Ruby Jan Xie ruby-ethereum-v0.9.3 ethereumH Haskell BlockApps 尚无Homestead 版本

使用go-ethereum

1. git clone https://github.com/ethereum/go-ethereum
2. cd go-ethereum 
3. make geth
4. build/bin/geth
  • 注意需要安装好go

启动节点

下面的命令行是加入以太坊ropsten测试网络,并且对外开放公网IP
nohup go-ethereum/build/bin/geth --testnet --rpc --rpcaddr 0.0.0.0  --rpcapi eth,net,web3 --syncmode fast --cache 1028 --datadir /data/block/ > /data/block/geth.log 2>&1 &

  • testnet (Ropsten network: pre-configured proof-of-work test network)
  • rpc (Enable the HTTP-RPC server)
  • rpcaddr (HTTP-RPC server listening interface (default: “localhost”))
  • rpcapi (API’s offered over the HTTP-RPC interface)
  • rpcport (HTTP-RPC server listening port (default: 8545))
  • port (Network listening port (default: 30303))
  • datadir (Data directory for the databases and keystore)
  • syncmode (Blockchain sync mode (“fast”, “full”, or “light”))
  • cache value (Megabytes of memory allocated to internal caching (min 16MB / database forced) (default: 128)) 优化性能

参考命令

1 回复

谢谢楼主分享!geth玩熟了,如果想做开发,推荐一个区块链新手适合的以太坊开发的入门教程: http://xc.hubwiz.com/course/5a952991adb3847553d205d1?affid=20180329cnode

另外一些对大家可能有用的课程:

  • python以太坊,主要是针对python围绕web3.py进行区块链以太坊应用开发的讲解。
  • web3j,主要是针对java和android程序员围绕web3j库进行区块链以太坊开发的讲解。
  • php以太坊,主要是介绍使用php进行智能合约开发交互,进行账号创建、交易、转账、代币开发以及过滤器和事件等内容。
  • 以太坊开发,主要是介绍使用node.js、mongodb、区块链、ipfs实现去中心化电商DApp实战,适合进阶。
回到顶部