{"id":1690,"date":"2023-03-25T22:45:53","date_gmt":"2023-03-25T14:45:53","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1690"},"modified":"2023-04-23T21:46:10","modified_gmt":"2023-04-23T13:46:10","slug":"ethereum-learning-3-ethereum-client-compilation-and-installation-geth-and-ethereumj","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/ethereum-learning-3-ethereum-client-compilation-and-installation-geth-and-ethereumj\/","title":{"rendered":"\u4ee5\u592a\u574a\u5b66\u4e603\uff1a\u4ee5\u592a\u574a\u5ba2\u6237\u7aef\u7f16\u8bd1\u5b89\u88c5\uff08geth\u548cethereumj\uff09"},"content":{"rendered":"<h2>\u5ba2\u6237\u7aef\u5b89\u88c5\uff08Windows\uff09<\/h2>\n<p>\u57fa\u7840\u5de5\u5177\u4e0b\u8f7d\u5b89\u88c5\uff08\u7cfb\u7edf\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884cCmd\uff09<\/p>\n<p><!-- more --><\/p>\n<ul>\n<li>Chocolatey\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/chocolatey.org\/install\">https:\/\/chocolatey.org\/install<\/a><\/li>\n<li>Git\u7248\u672c\u63a7\u5236\u5de5\u5177\uff1achoco install git<\/li>\n<\/ul>\n<h3>Geth\u5ba2\u6237\u7aef<\/h3>\n<ul>\n<li>go\u8bed\u8a00\u8fd0\u884c\u73af\u5883\u642d\u5efa<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">choco install golang<\/code><\/pre>\n<ul>\n<li>MinGW\u7f16\u8bd1\u5668\u5b89\u88c5<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">choco install mingw<\/code><\/pre>\n<ul>\n<li>\u6e90\u4ee3\u7801\u4e0b\u8f7d\uff08geth\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/go-ethereum go-ethereum<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u3001\u5b89\u88c5geth<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">go install go-ethereum<\/code><\/pre>\n<ul>\n<li>\u9a8c\u8bc1<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">geth version<\/code><\/pre>\n<h3>ethereumj\u5ba2\u6237\u7aef<\/h3>\n<ul>\n<li>\n<p>\u5b89\u88c5JDK1.8<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u8f7dethereumj\u6e90\u4ee3\u7801<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/ethereumj<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff08Jar\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">.\/gradlew clean shadowJar<\/code><\/pre>\n<ul>\n<li>\u9a8c\u8bc1<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">java -jar ethereumj-core\/build\/libs\/ethereumjcore-*-all.jar --help<\/code><\/pre>\n<h2>\u5ba2\u6237\u7aef\u5b89\u88c5\uff08Linux\uff09<\/h2>\n<p>\u57fa\u7840\u5de5\u5177\u4e0b\u8f7d\u5b89\u88c5<\/p>\n<ul>\n<li>Git\u7248\u672c\u63a7\u5236\u5de5\u5177\uff1asudo apt-get install git<\/li>\n<\/ul>\n<h3>Geth\u5ba2\u6237\u7aef<\/h3>\n<ul>\n<li>go\u8bed\u8a00\u8fd0\u884c\u73af\u5883\u642d\u5efa<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">sudo apt-get install golang-1.9<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u5668\u5b89\u88c5<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">sudo apt-get install build-essential<\/code><\/pre>\n<ul>\n<li>\u6e90\u4ee3\u7801\u4e0b\u8f7d\uff08geth\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/go-ethereum<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u3001\u5b89\u88c5geth<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">cd go-ethereum\nmake geth<\/code><\/pre>\n<ul>\n<li>\u9a8c\u8bc1<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">build\/bin\/geth version<\/code><\/pre>\n<h3>ethereumj\u5ba2\u6237\u7aef<\/h3>\n<p>\u5b89\u88c5JDK1.8<\/p>\n<p>\u4e0b\u8f7dethereumj\u6e90\u4ee3\u7801<\/p>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/ethereumj<\/code><\/pre>\n<p>\u7f16\u8bd1\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff08Jar\uff09<\/p>\n<pre><code class=\"language-shell\">.\/gradlew clean shadowJar<\/code><\/pre>\n<p>\u9a8c\u8bc1<\/p>\n<pre><code class=\"language-shell\">java -jar ethereumj-core\/build\/libs\/ethereumjcore-*-all.jar --help<\/code><\/pre>\n<h2>\u5ba2\u6237\u7aef\u5b89\u88c5\uff08Mac\uff09<\/h2>\n<p>\u57fa\u7840\u5de5\u5177\u4e0b\u8f7d\u5b89\u88c5<\/p>\n<ul>\n<li>Git\u7248\u672c\u63a7\u5236\u5de5\u5177 \u547d\u4ee4\uff1abrew install git<\/li>\n<\/ul>\n<h3>Geth\u5ba2\u6237\u7aef<\/h3>\n<ul>\n<li>go\u8bed\u8a00\u8fd0\u884c\u73af\u5883\u642d\u5efa<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">brew install go<\/code><\/pre>\n<ul>\n<li>\u6e90\u4ee3\u7801\u4e0b\u8f7d\uff08geth\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/go-ethereum<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u3001\u5b89\u88c5geth<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">cd go-ethereum\nmake geth<\/code><\/pre>\n<ul>\n<li>\u9a8c\u8bc1<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">build\/bin\/geth version<\/code><\/pre>\n<h3>ethereumj\u5ba2\u6237\u7aef<\/h3>\n<ul>\n<li>\n<p>\u5b89\u88c5JDK1.8<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u8f7dethereumj\u6e90\u4ee3\u7801<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">git clone https:\/\/github.com\/ethereum\/ethereumj<\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff08Jar\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">.\/gradlew clean shadowJar<\/code><\/pre>\n<ul>\n<li>\u9a8c\u8bc1<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">java -jar ethereumj-core\/build\/libs\/ethereumjcore-*-all.jar --help<\/code><\/pre>\n<h2>Geth\u6e90\u4ee3\u7801\u76ee\u5f55\u7ed3\u6784\uff08\u90e8\u5206\uff09<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u76ee\u5f55\u540d\u79f0<\/th>\n<th style=\"text-align: center;\">\u529f\u80fd\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">init<\/td>\n<td style=\"text-align: center;\">\u63a7\u5236\u53f0(JavaScript\u89e3\u91ca\u8fd0\u884c\u65f6\u73af\u5883)\u7684\u5b9e\u73b0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">core<\/td>\n<td style=\"text-align: center;\">\u4ee5\u592a\u574a\u6838\u5fc3\u5305\uff0c\u5b9e\u73b0\u4e86\u4ee5\u592a\u574a\u5171\u8bc6\u534f\u8bae\u3002<br \/>\u6885\u514b\u5c14\u6811 (Merkle tree)\uff0c\u6570\u636e\u7ed3\u6784\u5b9a\u4e49\uff0c\u4ee5\u592a\u574a\u865a\u62df\u673a (Ethereum Virtual Machine)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">crypto<\/td>\n<td style=\"text-align: center;\">\u52a0\u5bc6\u7b97\u6cd5\u5b9e\u73b0\u5305<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">ethdb<\/td>\n<td style=\"text-align: center;\">LevelDB\u7684\u518d\u6b21\u5c01\u88c5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">mine<\/td>\n<td style=\"text-align: center;\">\u5b9e\u73b0\u4e86\u533a\u5757\u7684\u751f\u6210\u4ee5\u53ca\u6316\u77ff<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">net<\/td>\n<td style=\"text-align: center;\">\u901a\u4fe1\u6a21\u5757\uff0c\u6db5\u76d6\u4ee5\u4e0b\u529f\u80fd\u6a21\u5757\uff1a\u8282\u70b9\u901a\u4fe1\u7ba1\u7406\u3001P2P \u901a\u4fe1\u3001<br \/>\u5168\u8282\u70b9\u540c\u6b65\u3001\u5feb\u901f\u540c\u6b65\u62a5\u6587\u3001P2P\u901a\u4fe1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">vm<\/td>\n<td style=\"text-align: center;\">EVM\uff08\u4ee5\u592a\u574a\u865a\u62df\u673a\uff09\u6a21\u5757<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>ethereumj\u6e90\u4ee3\u7801\u76ee\u5f55\u7ed3\u6784\uff08\u90e8\u5206\uff09<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u76ee\u5f55\u540d\u79f0<\/th>\n<th style=\"text-align: center;\">\u529f\u80fd\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">config<\/td>\n<td style=\"text-align: center;\">\u914d\u7f6e\u7ba1\u7406\uff08\u8282\u70b9\u3001\u7f51\u7edc\u901a\u4fe1\u3001\u533a\u5757\u3001\u4ea4\u6613\u7b49\uff09\u6a21\u5757<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">core<\/td>\n<td style=\"text-align: center;\">\u6838\u5fc3\u6a21\u5757\uff0c\u6db5\u76d6\u8d26\u6237\u3001\u4ea4\u6613\u3001\u533a\u5757\u3001\u5171\u8bc6\u673a\u5236\u7684\u6570\u636e \u7ed3\u6784\u548c\u5b9e\u73b0\u903b\u8f91\u7b49<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">crypto<\/td>\n<td style=\"text-align: center;\">\u52a0\u5bc6\u7b97\u6cd5\u5b9e\u73b0\u5305<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">datasource<\/td>\n<td style=\"text-align: center;\">\u6570\u636e\u6e90\u6a21\u5757\uff0cLevelDB\u3001\u7f13\u5b58<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">mine<\/td>\n<td style=\"text-align: center;\">\u6316\u77ff\u6a21\u5757\uff0c\u6db5\u76d6\u5171\u8bc6\u7b97\u6cd5\u3001\u533a\u5757\u751f\u6210\u7b49<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">p2p<\/td>\n<td style=\"text-align: center;\">p2p\u7f51\u7edc\u534f\u8bae\u5b9e\u73b0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">vm<\/td>\n<td style=\"text-align: center;\">EVM\uff08\u4ee5\u592a\u574a\u865a\u62df\u673a\uff09\u6a21\u5757<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u5ba2\u6237\u7aef\u5b89\u88c5\uff08Windows\uff09 \u57fa\u7840\u5de5\u5177\u4e0b\u8f7d\u5b89\u88c5\uff08\u7cfb\u7edf\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884cCmd\uff09 Chocolatey\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[421],"tags":[422],"class_list":["post-1690","post","type-post","status-publish","format-standard","hentry","category-blockchain","tag-422"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1690"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1690\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}