怎么分叉以太坊并变成自己的私链?
帅初写于 2016年2月11日
The core value proposition of Ethereum can be summarized with a single word: Synergy.
跟着咱们对区块链技能的深化了解,越来越多的企业和个人开发者认识到ethereum区块链渠道的价值,因为ethereum渠道开发言语是图灵齐备的,也给区块链相关运用的开发带来了更多的可拓展性,特别是依据ethereum的智能合约渠道,能够让开发者十分快速的布置自己的智能合约。
类似于R3CEV运用ethereum的区块链技能树立一个银行间的区块链服务,未来定会有公司和个人期望站在ethereum的膀子上,快速布置自己的区块链服务,一起还能运用ethereum生态系统内,很多开发者奉献的开源代码。 大大下降自己的布置本钱。
本文会简略介绍怎么分叉以太坊,并把它变成自己的私链。期望对行业的从业人员有些协助。
榜首部分:重命名(本文示例私链为: neochain)
1-下载以太坊源码: download ethereum: https://github.com/ethereum/go-ethereum/tree/release/1.3.32- 重命名代码:rename folder to go-neochain
3- 重命名相关文件和文件夹 rename files and folders:
- replace ethereum with neochain in files and folders filenames4- replace occurences of ethereum in the code (using text replace software like grepWin): 重命名ethereum 代码中的一切ethereum字符,并替换成neochain,详细替换项目如下:- replace eth with vch in files and folders filenames
- repalce github.com/ethereum/go-ethereum with github.com/neochain/go-neochain5- replace back nch_ with eth_ to restore api default functions calls- repalce ethereum with neochain in all files
- repalce ETHEREUM with NEOCHAIN in all files
- repalce Ethereum with Neochain in all files
- repalce ether with neochain in all files
- repalce Ether with Neochain in all files
- repalce eth with vch in all files
- repalce ETH with VCH in all files
把eth_替换成nch_,用来存储调用的API
6- replace back mnchod with method
替换method
7- replace back Mnchod with Method
替换Method
8- replace back wvec with weth to restore the word wheter
替换weth
9- replace default rpc port (we'll use port 7575):
修正RPC 端口,neochain 运用7575 端口10- replace default p2p port (we'll use port 17575):- in file go-neochain\cmd\utils\flags.go line 71
把以太坊默认端口8545修正成7575
replace: 替换
RPCPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: 8545,
}
with:
RPCPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: 7575,
}
在neochain_js.go 第4108行 也进行替换
- in file go-neochain\jsre\neochain_js.go line 4108
replace: 替换
var HttpProvider = function (host) https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
this.host = host || 'http://localhost:8545';
};
with:
var HttpProvider = function (host) https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
this.host = host || 'http://localhost:7575';
};
在admin_args.go 第130行也需求进行替换
- in file go-neochain\rpc\api\admin_args.go line 130
replace:
args.ListenPort = 8545
with:
args.ListenPort = 7575
在comms.go 127行也进行替换
in file go-neochain\rpc\comms\comms.go line 127
replace:
if strings.HasPrefix(endpoint, "rpc:") https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
parts := strings.Split(endpoint, ":")
addr := "http://localhost"
port := uint(8545)
if len(parts) >= 3 https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
addr = parts[1] + ":" + parts[2]
}
with:
if strings.HasPrefix(endpoint, "rpc:") https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
parts := strings.Split(endpoint, ":")
addr := "http://localhost"
port := uint(7575)
if len(parts) >= 3 https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
addr = parts[1] + ":" + parts[2]
}
替换ethereum的p2p端口,在neochain 中,咱们运用17575端口
- in file go-neochain\cmd\utils\flags.go line 31511- replace default discovery port (we'll use port 27575):replace: 替换
ListenPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "port",
Usage: "Network listening port",
Value: 30303,
}
with:
ListenPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "port",
Usage: "Network listening port",
Value: 17575,
}
替换ethereum的discovery port, 把30301端口替换成27575端口。neochain中咱们运用 27575端口。
- in go-neochain\cmd\bootnode\main.go line 37
replace:替换
listenAddr = flag.String("addr", ":30301", "listen address")
with:
listenAddr = flag.String("addr", ":27575", "listen address")
第二部分: 修正原始代码:
1- 停止ethereum的种子节点 disable default seed nodes:
替换成:
- in go-neochain\vch\backend.go line 71replace:
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
discover.MustParseNode("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303"), // IE
discover.MustParseNode("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"), // BR
discover.MustParseNode("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"), // SG
// VCH/DEV cpp-neochain (poc-9.vchdev.com)
discover.MustParseNode("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"),}
defaultTestNetBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
discover.MustParseNode("enode://e4533109cc9bd7604e4ff6c095f7a1d807e15b38e9bfeb05d3b7c423ba86af0a9e89abbf40bd9dde4250fef114cd09270fa4e224cbeef8b7bf05a51e8260d6b8@94.242.229.4:40404"),
discover.MustParseNode("enode://8c336ee6f03e99613ad21274f269479bf4413fb294d697ef15ab897598afb931f56beb8e97af530aee20ce2bcba5776f4a312bc168545de4d43736992c814592@94.242.229.203:30303"),}
2- 生成预挖的公钥和私钥对:create premine address keypair:
with:defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
}
defaultTestNetBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
}
3- 创立开创区块 create the genesis block string:
- 需求一个公钥地址,来发生neochain的开创区块,而且需求操控它的私钥来后面花费公钥上面的币。- 榜首步,经过一个随机数发生器,咱们来发生32位的私钥,最简略的做法便是经过下面指令发生:openssl rand -hex 32
- 第二步,咱们得到私钥为: eb1b1d5ffc51b07a64e622413479bb87xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (只展示出一部分)
- 第三步,咱们需求经过私钥来得到公钥,咱们树立一个新的文件 name: priv.txt , 然后仿制privatekey 到这个txt文件
- 第四步,咱们能够经过ethereum的客户端来发生公钥,运用一下指令: geth account import priv.txt (假如咱们没有ethereum客户端,咱们需求自己编译gvch而且采用相同的指令行)
- 咱们能够得到下面的地址: https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg861fddd8a92457efb9f016517db38eb7fe586a6f}
- 出于安全原因,删除了priv.txt
- 第四 咱们也能够修正nonce、初始难度、gas limit 等信息
- 咱们运用 script gengen.go 来创立开创区块,在gengen.go 中能够修正一个钱银系统的参数,包含币的总量,区块奖赏,区块时刻,区块难度信息,等等。- 依据私链开发的需求,咱们能够修正gengen.go 中的各种区块链的参数。
- 榜首 修正区块链alive的时刻戳
第80行,修正时刻unix时刻戳,用16进制。
(line 80): newGenesis.Timestamp="0x569CBF7F"
- 第二 咱们把premine的地址替换成咱们的地址
第90行(line 90): newGenesis.Coinbase="0x861fddd8a92457efb9f016517db38eb7fe586a6f"
- 第三 咱们修正premine的数量
第92行 (line 92): premine:=[]byte('https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg"0x861fddd8a92457efb9f016517db38eb7fe586a6f":https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg"balance": "10000000000000000000000000"}}')
(格式为:premine address 和premine amount +18个0)
因为neochain, 没有太多人参加,因为咱们把难度设置成cpu能够挖矿。
-第五 一切参数修正好后,咱们就能够保存,然后运转,得到开创区块的信息。 用以下指令来发生开创区块: command: go run gengen.go
-第六 咱们把运转结果仿制到: go-neochain\core\default_genesis.go line 30
const defaultGenesisBlock = "H4sIAAAJbogA/6yRTWrDMBCF76J1FpZl/Ti7xGnaRVsK7QVmpFEjkO1iK+ASfPeqNhQK7SKQWQgkzfvmPenCnvvOEtuyYip+lSjZhr2FlsYE7cfSIFXd7I/6mC9eYKAuPcB4+kN6fWXi3ZQGOECCBcg5IhmHFYlK59XYWmjLrRG6oAolOSHAoXCoaosONQhDnGSBHE3pIQPvYXwMbUgLT/GdyWeH4H2w55g+V9v8Z/xTmE43TNP0oUMY14c1invnnIG6rKQmj7UvuJJc5wCGUHuSRoHyWbeLsbdse7lGlbub3n2PyoDX1A/wnjfdOcYN20OE9X/5/3bnef4KAAD//0BefdIIAgAA"
第七 – 修正区块奖赏第八 – 保存一切修正后,能够编译客户端 (编译客户端的阐明详见:see ethereum docs)
- 在go-neochain\core\fees.go line 23replace:
var BlockReward *big.Int = big.NewInt(5e+18)
with:
var BlockReward *big.Int = big.NewInt(0.01e+18)
- 在neochain中,咱们把区块奖赏设置成0.01
第九- 把ethereum的hardnode和keys,替换成咱们自己的hardnode和keys
第十- 最终再从头编译客户端,并发布各种版别的客户端。 网络就能够alive,能够参阅ethereum的挖矿阐明,包含怎么树立矿池,让矿工参加挖矿。
go-neochain\vch\backend.go line 71replace:替换
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
//discover.MustParseNode("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303"), // IE
//discover.MustParseNode("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"), // BR
//discover.MustParseNode("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"), // SG
// VCH/DEV cpp-neochain (poc-9.vchdev.com)
//discover.MustParseNode("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"),
}
with:
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
discover.MustParseNode("enode://11936c3b31f940391025bba951777d4eafeffbd8aa24bf371b5166b2da6d69e9844b4778a35f68c106af8583be5c4500e69bb3639c10a30eabb311a044ac5202@62.210.105.88:17575"), // FR
discover.MustParseNode("enode://e1c30651e549149eb2bd68b77d5ca2a0ea662cd6364b846f456b5c12bd29978f738f55679b25538665d8797d3177c7160a41f079dbaf958b28e9aeb880647d75@139.196.109.133:17575"), // CN
}
阐明:本文仅适合做参阅资料,因为时刻匆忙,无法打开,能够在ethereum社区不断学习。
假如有任何疑问: patrickcrypto@gmail.com
本文链接:https://www.8btc.com/article/79922
转载请注明文章出处
怎么分叉以太坊并变成自己的私链?
帅初写于 2016年2月11日
The core value proposition of Ethereum can be summarized with a single word: Synergy.
跟着咱们对区块链技能的深化了解,越来越多的企业和个人开发者认识到ethereum区块链渠道的价值,因为ethereum渠道开发言语是图灵齐备的,也给区块链相关运用的开发带来了更多的可拓展性,特别是依据ethereum的智能合约渠道,能够让开发者十分快速的布置自己的智能合约。
类似于R3CEV运用ethereum的区块链技能树立一个银行间的区块链服务,未来定会有公司和个人期望站在ethereum的膀子上,快速布置自己的区块链服务,一起还能运用ethereum生态系统内,很多开发者奉献的开源代码。 大大下降自己的布置本钱。
本文会简略介绍怎么分叉以太坊,并把它变成自己的私链。期望对行业的从业人员有些协助。
榜首部分:重命名(本文示例私链为: neochain)
1-下载以太坊源码: download ethereum: https://github.com/ethereum/go-ethereum/tree/release/1.3.32- 重命名代码:rename folder to go-neochain
3- 重命名相关文件和文件夹 rename files and folders:
- replace ethereum with neochain in files and folders filenames4- replace occurences of ethereum in the code (using text replace software like grepWin): 重命名ethereum 代码中的一切ethereum字符,并替换成neochain,详细替换项目如下:- replace eth with vch in files and folders filenames
- repalce github.com/ethereum/go-ethereum with github.com/neochain/go-neochain5- replace back nch_ with eth_ to restore api default functions calls- repalce ethereum with neochain in all files
- repalce ETHEREUM with NEOCHAIN in all files
- repalce Ethereum with Neochain in all files
- repalce ether with neochain in all files
- repalce Ether with Neochain in all files
- repalce eth with vch in all files
- repalce ETH with VCH in all files
把eth_替换成nch_,用来存储调用的API
6- replace back mnchod with method
替换method
7- replace back Mnchod with Method
替换Method
8- replace back wvec with weth to restore the word wheter
替换weth
9- replace default rpc port (we'll use port 7575):
修正RPC 端口,neochain 运用7575 端口10- replace default p2p port (we'll use port 17575):- in file go-neochain\cmd\utils\flags.go line 71
把以太坊默认端口8545修正成7575
replace: 替换
RPCPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: 8545,
}
with:
RPCPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: 7575,
}
在neochain_js.go 第4108行 也进行替换
- in file go-neochain\jsre\neochain_js.go line 4108
replace: 替换
var HttpProvider = function (host) https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
this.host = host || 'http://localhost:8545';
};
with:
var HttpProvider = function (host) https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
this.host = host || 'http://localhost:7575';
};
在admin_args.go 第130行也需求进行替换
- in file go-neochain\rpc\api\admin_args.go line 130
replace:
args.ListenPort = 8545
with:
args.ListenPort = 7575
在comms.go 127行也进行替换
in file go-neochain\rpc\comms\comms.go line 127
replace:
if strings.HasPrefix(endpoint, "rpc:") https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
parts := strings.Split(endpoint, ":")
addr := "http://localhost"
port := uint(8545)
if len(parts) >= 3 https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
addr = parts[1] + ":" + parts[2]
}
with:
if strings.HasPrefix(endpoint, "rpc:") https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
parts := strings.Split(endpoint, ":")
addr := "http://localhost"
port := uint(7575)
if len(parts) >= 3 https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
addr = parts[1] + ":" + parts[2]
}
替换ethereum的p2p端口,在neochain 中,咱们运用17575端口
- in file go-neochain\cmd\utils\flags.go line 31511- replace default discovery port (we'll use port 27575):replace: 替换
ListenPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "port",
Usage: "Network listening port",
Value: 30303,
}
with:
ListenPortFlag = cli.IntFlaghttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
Name: "port",
Usage: "Network listening port",
Value: 17575,
}
替换ethereum的discovery port, 把30301端口替换成27575端口。neochain中咱们运用 27575端口。
- in go-neochain\cmd\bootnode\main.go line 37
replace:替换
listenAddr = flag.String("addr", ":30301", "listen address")
with:
listenAddr = flag.String("addr", ":27575", "listen address")
第二部分: 修正原始代码:
1- 停止ethereum的种子节点 disable default seed nodes:
替换成:
- in go-neochain\vch\backend.go line 71replace:
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
discover.MustParseNode("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303"), // IE
discover.MustParseNode("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"), // BR
discover.MustParseNode("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"), // SG
// VCH/DEV cpp-neochain (poc-9.vchdev.com)
discover.MustParseNode("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"),}
defaultTestNetBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
discover.MustParseNode("enode://e4533109cc9bd7604e4ff6c095f7a1d807e15b38e9bfeb05d3b7c423ba86af0a9e89abbf40bd9dde4250fef114cd09270fa4e224cbeef8b7bf05a51e8260d6b8@94.242.229.4:40404"),
discover.MustParseNode("enode://8c336ee6f03e99613ad21274f269479bf4413fb294d697ef15ab897598afb931f56beb8e97af530aee20ce2bcba5776f4a312bc168545de4d43736992c814592@94.242.229.203:30303"),}
2- 生成预挖的公钥和私钥对:create premine address keypair:
with:defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
}
defaultTestNetBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
}
3- 创立开创区块 create the genesis block string:
- 需求一个公钥地址,来发生neochain的开创区块,而且需求操控它的私钥来后面花费公钥上面的币。- 榜首步,经过一个随机数发生器,咱们来发生32位的私钥,最简略的做法便是经过下面指令发生:openssl rand -hex 32
- 第二步,咱们得到私钥为: eb1b1d5ffc51b07a64e622413479bb87xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (只展示出一部分)
- 第三步,咱们需求经过私钥来得到公钥,咱们树立一个新的文件 name: priv.txt , 然后仿制privatekey 到这个txt文件
- 第四步,咱们能够经过ethereum的客户端来发生公钥,运用一下指令: geth account import priv.txt (假如咱们没有ethereum客户端,咱们需求自己编译gvch而且采用相同的指令行)
- 咱们能够得到下面的地址: https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg861fddd8a92457efb9f016517db38eb7fe586a6f}
- 出于安全原因,删除了priv.txt
- 第四 咱们也能够修正nonce、初始难度、gas limit 等信息
- 咱们运用 script gengen.go 来创立开创区块,在gengen.go 中能够修正一个钱银系统的参数,包含币的总量,区块奖赏,区块时刻,区块难度信息,等等。- 依据私链开发的需求,咱们能够修正gengen.go 中的各种区块链的参数。
- 榜首 修正区块链alive的时刻戳
第80行,修正时刻unix时刻戳,用16进制。
(line 80): newGenesis.Timestamp="0x569CBF7F"
- 第二 咱们把premine的地址替换成咱们的地址
第90行(line 90): newGenesis.Coinbase="0x861fddd8a92457efb9f016517db38eb7fe586a6f"
- 第三 咱们修正premine的数量
第92行 (line 92): premine:=[]byte('https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg"0x861fddd8a92457efb9f016517db38eb7fe586a6f":https://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg"balance": "10000000000000000000000000"}}')
(格式为:premine address 和premine amount +18个0)
因为neochain, 没有太多人参加,因为咱们把难度设置成cpu能够挖矿。
-第五 一切参数修正好后,咱们就能够保存,然后运转,得到开创区块的信息。 用以下指令来发生开创区块: command: go run gengen.go
-第六 咱们把运转结果仿制到: go-neochain\core\default_genesis.go line 30
const defaultGenesisBlock = "H4sIAAAJbogA/6yRTWrDMBCF76J1FpZl/Ti7xGnaRVsK7QVmpFEjkO1iK+ASfPeqNhQK7SKQWQgkzfvmPenCnvvOEtuyYip+lSjZhr2FlsYE7cfSIFXd7I/6mC9eYKAuPcB4+kN6fWXi3ZQGOECCBcg5IhmHFYlK59XYWmjLrRG6oAolOSHAoXCoaosONQhDnGSBHE3pIQPvYXwMbUgLT/GdyWeH4H2w55g+V9v8Z/xTmE43TNP0oUMY14c1invnnIG6rKQmj7UvuJJc5wCGUHuSRoHyWbeLsbdse7lGlbub3n2PyoDX1A/wnjfdOcYN20OE9X/5/3bnef4KAAD//0BefdIIAgAA"
第七 – 修正区块奖赏第八 – 保存一切修正后,能够编译客户端 (编译客户端的阐明详见:see ethereum docs)
- 在go-neochain\core\fees.go line 23replace:
var BlockReward *big.Int = big.NewInt(5e+18)
with:
var BlockReward *big.Int = big.NewInt(0.01e+18)
- 在neochain中,咱们把区块奖赏设置成0.01
第九- 把ethereum的hardnode和keys,替换成咱们自己的hardnode和keys
第十- 最终再从头编译客户端,并发布各种版别的客户端。 网络就能够alive,能够参阅ethereum的挖矿阐明,包含怎么树立矿池,让矿工参加挖矿。
go-neochain\vch\backend.go line 71replace:替换
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
//discover.MustParseNode("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303"), // IE
//discover.MustParseNode("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"), // BR
//discover.MustParseNode("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"), // SG
// VCH/DEV cpp-neochain (poc-9.vchdev.com)
//discover.MustParseNode("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"),
}
with:
defaultBootNodes = []*discover.Nodehttps://bicoin8.com/wp-content/uploads/2023/04/202304211cHpE0.jpg
// VCH/DEV Go Bootnodes
discover.MustParseNode("enode://11936c3b31f940391025bba951777d4eafeffbd8aa24bf371b5166b2da6d69e9844b4778a35f68c106af8583be5c4500e69bb3639c10a30eabb311a044ac5202@62.210.105.88:17575"), // FR
discover.MustParseNode("enode://e1c30651e549149eb2bd68b77d5ca2a0ea662cd6364b846f456b5c12bd29978f738f55679b25538665d8797d3177c7160a41f079dbaf958b28e9aeb880647d75@139.196.109.133:17575"), // CN
}
阐明:本文仅适合做参阅资料,因为时刻匆忙,无法打开,能够在ethereum社区不断学习。
假如有任何疑问: patrickcrypto@gmail.com
本文链接:https://www.8btc.com/article/79922
转载请注明文章出处