{"id":1692,"date":"2023-03-25T22:47:18","date_gmt":"2023-03-25T14:47:18","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1692"},"modified":"2023-04-23T21:44:29","modified_gmt":"2023-04-23T13:44:29","slug":"ethereum-learning-5-geth-command-line-environment","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/ethereum-learning-5-geth-command-line-environment\/","title":{"rendered":"\u4ee5\u592a\u574a\u5b66\u4e605\uff1aGeth\u547d\u4ee4\u884c\u73af\u5883"},"content":{"rendered":"<h2>Geth\u5b98\u65b9<\/h2>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/geth.ethereum.org\/\">https:\/\/geth.ethereum.org\/<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/geth.ethereum.org\/downloads\/\">https:\/\/geth.ethereum.org\/downloads\/<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/ethereum.github.io\/go-ethereum\/downloads\/\">https:\/\/ethereum.github.io\/go-ethereum\/downloads\/<\/a><\/li>\n<\/ul>\n<p><!-- more --><\/p>\n<h2>Geth\u547d\u4ee4\u884c\u73af\u5883<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u547d\u4ee4<\/th>\n<th style=\"text-align: center;\">\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;\">\u5f15\u5bfc\u548c\u521d\u59cb\u5316\u4e00\u4e2a\u65b0\u7684\u521b\u59cb\u533a\u5757<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">account<\/td>\n<td style=\"text-align: center;\">\u7ba1\u7406\u8d26\u6237<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">console<\/td>\n<td style=\"text-align: center;\">\u542f\u52a8\u4ea4\u4e92\u5f0fJavaScript\u73af\u5883<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">attach<\/td>\n<td style=\"text-align: center;\">\u542f\u52a8\u4ea4\u4e92\u5f0fJavaScript\u73af\u5883\uff08\u8fde\u63a5\u5230\u8282\u70b9\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">version<\/td>\n<td style=\"text-align: center;\">\u6253\u5370\u7248\u672c\u53f7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">help<\/td>\n<td style=\"text-align: center;\">\u663e\u793a\u4e00\u4e2a\u547d\u4ee4\u5217\u8868\u6216\u67d0\u4e2a\u6307\u5b9a\u547d\u4ee4\u7684\u5e2e\u52a9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u521b\u4e16\u7eaa\u533a\u5757\u914d\u7f6e\uff08\u53730\u53f7\u5757\uff09\uff0c\u901a\u8fc7init\u547d\u4ee4\u521d\u59cb\u5316<\/h3>\n<p>\u683c\u5f0f\uff1ainit [command options] [arguments&#8230;]<\/p>\n<pre><code class=\"language-shell\">geth --datadir D:\\ethereum\\data init genesis.json<\/code><\/pre>\n<p>genesis.json<\/p>\n<pre><code class=\"language-json\">{\n  &quot;config&quot;: {\n    &quot;chainId&quot;: 100,\n    &quot;homesteadBlock&quot;: 0,\n    &quot;eip155Block&quot;: 0,\n    &quot;eip158Block&quot;: 0\n  },\n  &quot;alloc&quot;      : {},\n  &quot;coinbase&quot;   : &quot;0x0000000000000000000000000000000000000000&quot;,\n  &quot;difficulty&quot; : &quot;0x800&quot;,\n  &quot;extraData&quot;  : &quot;&quot;,\n  &quot;gasLimit&quot;   : &quot;0x8000000&quot;,\n  &quot;nonce&quot;      : &quot;0x0000000000000042&quot;,\n  &quot;mixhash&quot;    : &quot;0x0000000000000000000000000000000000000000000000000000000000000000&quot;,\n  &quot;parentHash&quot; : &quot;0x0000000000000000000000000000000000000000000000000000000000000000&quot;,\n  &quot;timestamp&quot;  : &quot;0x00&quot;\n}<\/code><\/pre>\n<h3>\u901a\u8fc7\u7f51\u7edc\u7f16\u53f7networkid\u542f\u52a8Geth\u5e76\u8fdb\u5165\u547d\u4ee4\u884c\u73af\u5883<\/h3>\n<pre><code class=\"language-shell\">geth --datadir D:\\ethereum\\data --networkid 100 console\ngeth --datadir D:\\ethereum\\data --maxpeers 100 --networkid 100 console<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Geth\u5b98\u65b9 https:\/\/geth.ethereum.org\/ https:\/\/geth.ethereum [&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-1692","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\/1692","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=1692"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1692\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}