Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
e61035c5
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
e61035c5
编写于
4月 25, 2017
作者:
P
Péter Szilágyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cmd, eth, les, mobile: make networkid uint64 everywhere
上级
ba3bcd16
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
38 addition
and
38 deletion
+38
-38
cmd/faucet/faucet.go
cmd/faucet/faucet.go
+2
-2
cmd/puppeth/wizard_genesis.go
cmd/puppeth/wizard_genesis.go
+1
-1
cmd/utils/flags.go
cmd/utils/flags.go
+2
-2
eth/backend.go
eth/backend.go
+3
-3
eth/config.go
eth/config.go
+1
-1
eth/gen_config.go
eth/gen_config.go
+2
-2
eth/handler.go
eth/handler.go
+3
-3
eth/helper_test.go
eth/helper_test.go
+1
-1
eth/peer.go
eth/peer.go
+4
-4
eth/protocol.go
eth/protocol.go
+1
-1
eth/protocol_test.go
eth/protocol_test.go
+2
-2
ethstats/ethstats.go
ethstats/ethstats.go
+2
-2
internal/ethapi/api.go
internal/ethapi/api.go
+2
-2
les/backend.go
les/backend.go
+3
-3
les/handler.go
les/handler.go
+3
-3
les/peer.go
les/peer.go
+4
-4
mobile/geth.go
mobile/geth.go
+2
-2
未找到文件。
cmd/faucet/faucet.go
浏览文件 @
e61035c5
...
...
@@ -61,7 +61,7 @@ var (
apiPortFlag
=
flag
.
Int
(
"apiport"
,
8080
,
"Listener port for the HTTP API connection"
)
ethPortFlag
=
flag
.
Int
(
"ethport"
,
30303
,
"Listener port for the devp2p connection"
)
bootFlag
=
flag
.
String
(
"bootnodes"
,
""
,
"Comma separated bootnode enode URLs to seed with"
)
netFlag
=
flag
.
Int
(
"network"
,
0
,
"Network ID to use for the Ethereum protocol"
)
netFlag
=
flag
.
Uint64
(
"network"
,
0
,
"Network ID to use for the Ethereum protocol"
)
statsFlag
=
flag
.
String
(
"ethstats"
,
""
,
"Ethstats network monitoring auth string"
)
netnameFlag
=
flag
.
String
(
"faucet.name"
,
""
,
"Network name to assign to the faucet"
)
...
...
@@ -179,7 +179,7 @@ type faucet struct {
lock
sync
.
RWMutex
// Lock protecting the faucet's internals
}
func
newFaucet
(
genesis
*
core
.
Genesis
,
port
int
,
enodes
[]
*
discv5
.
Node
,
network
int
,
stats
string
,
ks
*
keystore
.
KeyStore
,
index
[]
byte
)
(
*
faucet
,
error
)
{
func
newFaucet
(
genesis
*
core
.
Genesis
,
port
int
,
enodes
[]
*
discv5
.
Node
,
network
uint64
,
stats
string
,
ks
*
keystore
.
KeyStore
,
index
[]
byte
)
(
*
faucet
,
error
)
{
// Assemble the raw devp2p protocol stack
stack
,
err
:=
node
.
New
(
&
node
.
Config
{
Name
:
"geth"
,
...
...
cmd/puppeth/wizard_genesis.go
浏览文件 @
e61035c5
...
...
@@ -120,7 +120,7 @@ func (w *wizard) makeGenesis() {
// Query the user for some custom extras
fmt
.
Println
()
fmt
.
Println
(
"Specify your chain/network ID if you want an explicit one (default = random)"
)
genesis
.
Config
.
ChainId
=
big
.
NewInt
(
int64
(
w
.
readDefaultInt
(
rand
.
Intn
(
65536
))))
genesis
.
Config
.
ChainId
=
new
(
big
.
Int
)
.
SetUint64
(
u
int64
(
w
.
readDefaultInt
(
rand
.
Intn
(
65536
))))
fmt
.
Println
()
fmt
.
Println
(
"Anything fun to embed into the genesis block? (max 32 bytes)"
)
...
...
cmd/utils/flags.go
浏览文件 @
e61035c5
...
...
@@ -148,7 +148,7 @@ var (
Usage
:
"Number of recent ethash mining DAGs to keep on disk (1+GB each)"
,
Value
:
eth
.
DefaultConfig
.
EthashDatasetsOnDisk
,
}
NetworkIdFlag
=
cli
.
Int
Flag
{
NetworkIdFlag
=
cli
.
Uint64
Flag
{
Name
:
"networkid"
,
Usage
:
"Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten)"
,
Value
:
eth
.
DefaultConfig
.
NetworkId
,
...
...
@@ -806,7 +806,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
cfg
.
LightPeers
=
ctx
.
GlobalInt
(
LightPeersFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
NetworkIdFlag
.
Name
)
{
cfg
.
NetworkId
=
ctx
.
Global
Int
(
NetworkIdFlag
.
Name
)
cfg
.
NetworkId
=
ctx
.
Global
Uint64
(
NetworkIdFlag
.
Name
)
}
// Ethereum needs to know maxPeers to calculate the light server peer ratio.
...
...
eth/backend.go
浏览文件 @
e61035c5
...
...
@@ -80,7 +80,7 @@ type Ethereum struct {
MinerThreads
int
etherbase
common
.
Address
net
VersionId
int
net
workId
uint64
netRPCService
*
ethapi
.
PublicNetAPI
}
...
...
@@ -118,7 +118,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
engine
:
CreateConsensusEngine
(
ctx
,
config
,
chainConfig
,
chainDb
),
shutdownChan
:
make
(
chan
bool
),
stopDbUpgrade
:
stopDbUpgrade
,
net
VersionId
:
config
.
NetworkId
,
net
workId
:
config
.
NetworkId
,
etherbase
:
config
.
Etherbase
,
MinerThreads
:
config
.
MinerThreads
,
}
...
...
@@ -347,7 +347,7 @@ func (s *Ethereum) Engine() consensus.Engine { return s.engine }
func
(
s
*
Ethereum
)
ChainDb
()
ethdb
.
Database
{
return
s
.
chainDb
}
func
(
s
*
Ethereum
)
IsListening
()
bool
{
return
true
}
// Always listening
func
(
s
*
Ethereum
)
EthVersion
()
int
{
return
int
(
s
.
protocolManager
.
SubProtocols
[
0
]
.
Version
)
}
func
(
s
*
Ethereum
)
NetVersion
()
int
{
return
s
.
netVersion
Id
}
func
(
s
*
Ethereum
)
NetVersion
()
uint64
{
return
s
.
network
Id
}
func
(
s
*
Ethereum
)
Downloader
()
*
downloader
.
Downloader
{
return
s
.
protocolManager
.
downloader
}
// Protocols implements node.Service, returning all the currently configured
...
...
eth/config.go
浏览文件 @
e61035c5
...
...
@@ -72,7 +72,7 @@ type Config struct {
Genesis
*
core
.
Genesis
`toml:",omitempty"`
// Protocol options
NetworkId
int
// Network ID to use for selecting peers to connect to
NetworkId
uint64
// Network ID to use for selecting peers to connect to
SyncMode
downloader
.
SyncMode
// Light client options
...
...
eth/gen_config.go
浏览文件 @
e61035c5
...
...
@@ -15,7 +15,7 @@ import (
func
(
c
Config
)
MarshalTOML
()
(
interface
{},
error
)
{
type
Config
struct
{
Genesis
*
core
.
Genesis
`toml:",omitempty"`
NetworkId
int
NetworkId
uint64
SyncMode
downloader
.
SyncMode
LightServ
int
`toml:",omitempty"`
LightPeers
int
`toml:",omitempty"`
...
...
@@ -72,7 +72,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
func
(
c
*
Config
)
UnmarshalTOML
(
unmarshal
func
(
interface
{})
error
)
error
{
type
Config
struct
{
Genesis
*
core
.
Genesis
`toml:",omitempty"`
NetworkId
*
int
NetworkId
*
uint64
SyncMode
*
downloader
.
SyncMode
LightServ
*
int
`toml:",omitempty"`
LightPeers
*
int
`toml:",omitempty"`
...
...
eth/handler.go
浏览文件 @
e61035c5
...
...
@@ -60,7 +60,7 @@ func errResp(code errCode, format string, v ...interface{}) error {
}
type
ProtocolManager
struct
{
networkId
int
networkId
uint64
fastSync
uint32
// Flag whether fast sync is enabled (gets disabled if we already have blocks)
acceptTxs
uint32
// Flag whether we're considered synchronised (enables transaction processing)
...
...
@@ -96,7 +96,7 @@ type ProtocolManager struct {
// NewProtocolManager returns a new ethereum sub protocol manager. The Ethereum sub protocol manages peers capable
// with the ethereum network.
func
NewProtocolManager
(
config
*
params
.
ChainConfig
,
mode
downloader
.
SyncMode
,
networkId
int
,
maxPeers
int
,
mux
*
event
.
TypeMux
,
txpool
txPool
,
engine
consensus
.
Engine
,
blockchain
*
core
.
BlockChain
,
chaindb
ethdb
.
Database
)
(
*
ProtocolManager
,
error
)
{
func
NewProtocolManager
(
config
*
params
.
ChainConfig
,
mode
downloader
.
SyncMode
,
networkId
uint64
,
maxPeers
int
,
mux
*
event
.
TypeMux
,
txpool
txPool
,
engine
consensus
.
Engine
,
blockchain
*
core
.
BlockChain
,
chaindb
ethdb
.
Database
)
(
*
ProtocolManager
,
error
)
{
// Create the protocol manager with the base fields
manager
:=
&
ProtocolManager
{
networkId
:
networkId
,
...
...
@@ -733,7 +733,7 @@ func (self *ProtocolManager) txBroadcastLoop() {
// EthNodeInfo represents a short summary of the Ethereum sub-protocol metadata known
// about the host peer.
type
EthNodeInfo
struct
{
Network
int
`json:"network"`
// Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3)
Network
uint64
`json:"network"`
// Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3)
Difficulty
*
big
.
Int
`json:"difficulty"`
// Total difficulty of the host's blockchain
Genesis
common
.
Hash
`json:"genesis"`
// SHA3 hash of the host's genesis block
Head
common
.
Hash
`json:"head"`
// SHA3 hash of the host's best owned block
...
...
eth/helper_test.go
浏览文件 @
e61035c5
...
...
@@ -173,7 +173,7 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te
func
(
p
*
testPeer
)
handshake
(
t
*
testing
.
T
,
td
*
big
.
Int
,
head
common
.
Hash
,
genesis
common
.
Hash
)
{
msg
:=
&
statusData
{
ProtocolVersion
:
uint32
(
p
.
version
),
NetworkId
:
uint32
(
DefaultConfig
.
NetworkId
)
,
NetworkId
:
DefaultConfig
.
NetworkId
,
TD
:
td
,
CurrentBlock
:
head
,
GenesisBlock
:
genesis
,
...
...
eth/peer.go
浏览文件 @
e61035c5
...
...
@@ -230,7 +230,7 @@ func (p *peer) RequestReceipts(hashes []common.Hash) error {
// Handshake executes the eth protocol handshake, negotiating version number,
// network IDs, difficulties, head and genesis blocks.
func
(
p
*
peer
)
Handshake
(
network
int
,
td
*
big
.
Int
,
head
common
.
Hash
,
genesis
common
.
Hash
)
error
{
func
(
p
*
peer
)
Handshake
(
network
uint64
,
td
*
big
.
Int
,
head
common
.
Hash
,
genesis
common
.
Hash
)
error
{
// Send out own handshake in a new thread
errc
:=
make
(
chan
error
,
2
)
var
status
statusData
// safe to read after two values have been received from errc
...
...
@@ -238,7 +238,7 @@ func (p *peer) Handshake(network int, td *big.Int, head common.Hash, genesis com
go
func
()
{
errc
<-
p2p
.
Send
(
p
.
rw
,
StatusMsg
,
&
statusData
{
ProtocolVersion
:
uint32
(
p
.
version
),
NetworkId
:
uint32
(
network
)
,
NetworkId
:
network
,
TD
:
td
,
CurrentBlock
:
head
,
GenesisBlock
:
genesis
,
...
...
@@ -263,7 +263,7 @@ func (p *peer) Handshake(network int, td *big.Int, head common.Hash, genesis com
return
nil
}
func
(
p
*
peer
)
readStatus
(
network
int
,
status
*
statusData
,
genesis
common
.
Hash
)
(
err
error
)
{
func
(
p
*
peer
)
readStatus
(
network
uint64
,
status
*
statusData
,
genesis
common
.
Hash
)
(
err
error
)
{
msg
,
err
:=
p
.
rw
.
ReadMsg
()
if
err
!=
nil
{
return
err
...
...
@@ -281,7 +281,7 @@ func (p *peer) readStatus(network int, status *statusData, genesis common.Hash)
if
status
.
GenesisBlock
!=
genesis
{
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
status
.
GenesisBlock
[
:
8
],
genesis
[
:
8
])
}
if
int
(
status
.
NetworkId
)
!=
network
{
if
status
.
NetworkId
!=
network
{
return
errResp
(
ErrNetworkIdMismatch
,
"%d (!= %d)"
,
status
.
NetworkId
,
network
)
}
if
int
(
status
.
ProtocolVersion
)
!=
p
.
version
{
...
...
eth/protocol.go
浏览文件 @
e61035c5
...
...
@@ -105,7 +105,7 @@ type txPool interface {
// statusData is the network packet for the status message.
type
statusData
struct
{
ProtocolVersion
uint32
NetworkId
uint
32
NetworkId
uint
64
TD
*
big
.
Int
CurrentBlock
common
.
Hash
GenesisBlock
common
.
Hash
...
...
eth/protocol_test.go
浏览文件 @
e61035c5
...
...
@@ -55,7 +55,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
wantError
:
errResp
(
ErrNoStatusMsg
,
"first msg has code 2 (!= 0)"
),
},
{
code
:
StatusMsg
,
data
:
statusData
{
10
,
uint32
(
DefaultConfig
.
NetworkId
)
,
td
,
currentBlock
,
genesis
},
code
:
StatusMsg
,
data
:
statusData
{
10
,
DefaultConfig
.
NetworkId
,
td
,
currentBlock
,
genesis
},
wantError
:
errResp
(
ErrProtocolVersionMismatch
,
"10 (!= %d)"
,
protocol
),
},
{
...
...
@@ -63,7 +63,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
wantError
:
errResp
(
ErrNetworkIdMismatch
,
"999 (!= 1)"
),
},
{
code
:
StatusMsg
,
data
:
statusData
{
uint32
(
protocol
),
uint32
(
DefaultConfig
.
NetworkId
)
,
td
,
currentBlock
,
common
.
Hash
{
3
}},
code
:
StatusMsg
,
data
:
statusData
{
uint32
(
protocol
),
DefaultConfig
.
NetworkId
,
td
,
currentBlock
,
common
.
Hash
{
3
}},
wantError
:
errResp
(
ErrGenesisBlockMismatch
,
"0300000000000000 (!= %x)"
,
genesis
[
:
8
]),
},
}
...
...
ethstats/ethstats.go
浏览文件 @
e61035c5
...
...
@@ -323,10 +323,10 @@ func (s *Service) login(conn *websocket.Conn) error {
var
network
,
protocol
string
if
info
:=
infos
.
Protocols
[
"eth"
];
info
!=
nil
{
network
=
strconv
.
Itoa
(
info
.
(
*
eth
.
EthNodeInfo
)
.
Network
)
network
=
fmt
.
Sprintf
(
"%d"
,
info
.
(
*
eth
.
EthNodeInfo
)
.
Network
)
protocol
=
fmt
.
Sprintf
(
"eth/%d"
,
eth
.
ProtocolVersions
[
0
])
}
else
{
network
=
strconv
.
Itoa
(
infos
.
Protocols
[
"les"
]
.
(
*
eth
.
EthNodeInfo
)
.
Network
)
network
=
fmt
.
Sprintf
(
"%d"
,
infos
.
Protocols
[
"les"
]
.
(
*
eth
.
EthNodeInfo
)
.
Network
)
protocol
=
fmt
.
Sprintf
(
"les/%d"
,
les
.
ProtocolVersions
[
0
])
}
auth
:=
&
authMsg
{
...
...
internal/ethapi/api.go
浏览文件 @
e61035c5
...
...
@@ -1435,11 +1435,11 @@ func (api *PrivateDebugAPI) SetHead(number hexutil.Uint64) {
// PublicNetAPI offers network related RPC methods
type
PublicNetAPI
struct
{
net
*
p2p
.
Server
networkVersion
int
networkVersion
uint64
}
// NewPublicNetAPI creates a new net API instance.
func
NewPublicNetAPI
(
net
*
p2p
.
Server
,
networkVersion
int
)
*
PublicNetAPI
{
func
NewPublicNetAPI
(
net
*
p2p
.
Server
,
networkVersion
uint64
)
*
PublicNetAPI
{
return
&
PublicNetAPI
{
net
,
networkVersion
}
}
...
...
les/backend.go
浏览文件 @
e61035c5
...
...
@@ -61,7 +61,7 @@ type LightEthereum struct {
engine
consensus
.
Engine
accountManager
*
accounts
.
Manager
net
VersionId
int
net
workId
uint64
netRPCService
*
ethapi
.
PublicNetAPI
}
...
...
@@ -87,7 +87,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
accountManager
:
ctx
.
AccountManager
,
engine
:
eth
.
CreateConsensusEngine
(
ctx
,
config
,
chainConfig
,
chainDb
),
shutdownChan
:
make
(
chan
bool
),
net
VersionId
:
config
.
NetworkId
,
net
workId
:
config
.
NetworkId
,
}
if
eth
.
blockchain
,
err
=
light
.
NewLightChain
(
odr
,
eth
.
chainConfig
,
eth
.
engine
,
eth
.
eventMux
);
err
!=
nil
{
return
nil
,
err
...
...
@@ -187,7 +187,7 @@ func (s *LightEthereum) Protocols() []p2p.Protocol {
// Ethereum protocol implementation.
func
(
s
*
LightEthereum
)
Start
(
srvr
*
p2p
.
Server
)
error
{
log
.
Warn
(
"Light client mode is an experimental feature"
)
s
.
netRPCService
=
ethapi
.
NewPublicNetAPI
(
srvr
,
s
.
net
Version
Id
)
s
.
netRPCService
=
ethapi
.
NewPublicNetAPI
(
srvr
,
s
.
net
work
Id
)
s
.
protocolManager
.
Start
(
srvr
)
return
nil
}
...
...
les/handler.go
浏览文件 @
e61035c5
...
...
@@ -95,7 +95,7 @@ type ProtocolManager struct {
lightSync
bool
txpool
txPool
txrelay
*
LesTxRelay
networkId
int
networkId
uint64
chainConfig
*
params
.
ChainConfig
blockchain
BlockChain
chainDb
ethdb
.
Database
...
...
@@ -128,7 +128,7 @@ type ProtocolManager struct {
// NewProtocolManager returns a new ethereum sub protocol manager. The Ethereum sub protocol manages peers capable
// with the ethereum network.
func
NewProtocolManager
(
chainConfig
*
params
.
ChainConfig
,
lightSync
bool
,
networkId
int
,
mux
*
event
.
TypeMux
,
engine
consensus
.
Engine
,
blockchain
BlockChain
,
txpool
txPool
,
chainDb
ethdb
.
Database
,
odr
*
LesOdr
,
txrelay
*
LesTxRelay
)
(
*
ProtocolManager
,
error
)
{
func
NewProtocolManager
(
chainConfig
*
params
.
ChainConfig
,
lightSync
bool
,
networkId
uint64
,
mux
*
event
.
TypeMux
,
engine
consensus
.
Engine
,
blockchain
BlockChain
,
txpool
txPool
,
chainDb
ethdb
.
Database
,
odr
*
LesOdr
,
txrelay
*
LesTxRelay
)
(
*
ProtocolManager
,
error
)
{
// Create the protocol manager with the base fields
manager
:=
&
ProtocolManager
{
lightSync
:
lightSync
,
...
...
@@ -310,7 +310,7 @@ func (pm *ProtocolManager) Stop() {
log
.
Info
(
"Light Ethereum protocol stopped"
)
}
func
(
pm
*
ProtocolManager
)
newPeer
(
pv
,
nv
int
,
p
*
p2p
.
Peer
,
rw
p2p
.
MsgReadWriter
)
*
peer
{
func
(
pm
*
ProtocolManager
)
newPeer
(
pv
int
,
nv
uint64
,
p
*
p2p
.
Peer
,
rw
p2p
.
MsgReadWriter
)
*
peer
{
return
newPeer
(
pv
,
nv
,
p
,
newMeteredMsgWriter
(
rw
))
}
...
...
les/peer.go
浏览文件 @
e61035c5
...
...
@@ -48,8 +48,8 @@ type peer struct {
rw
p2p
.
MsgReadWriter
version
int
// Protocol version negotiated
network
int
// Network ID being on
version
int
// Protocol version negotiated
network
uint64
// Network ID being on
id
string
...
...
@@ -69,7 +69,7 @@ type peer struct {
fcCosts
requestCostTable
}
func
newPeer
(
version
,
network
int
,
p
*
p2p
.
Peer
,
rw
p2p
.
MsgReadWriter
)
*
peer
{
func
newPeer
(
version
int
,
network
uint64
,
p
*
p2p
.
Peer
,
rw
p2p
.
MsgReadWriter
)
*
peer
{
id
:=
p
.
ID
()
return
&
peer
{
...
...
@@ -384,7 +384,7 @@ func (p *peer) Handshake(td *big.Int, head common.Hash, headNum uint64, genesis
if
rGenesis
!=
genesis
{
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
rGenesis
[
:
8
],
genesis
[
:
8
])
}
if
int
(
rNetwork
)
!=
p
.
network
{
if
rNetwork
!=
p
.
network
{
return
errResp
(
ErrNetworkIdMismatch
,
"%d (!= %d)"
,
rNetwork
,
p
.
network
)
}
if
int
(
rVersion
)
!=
p
.
version
{
...
...
mobile/geth.go
浏览文件 @
e61035c5
...
...
@@ -54,7 +54,7 @@ type NodeConfig struct {
// EthereumNetworkID is the network identifier used by the Ethereum protocol to
// decide if remote peers should be accepted or not.
EthereumNetworkID
int
EthereumNetworkID
int
64
// uint64 in truth, but Java can't handle that...
// EthereumGenesis is the genesis JSON to use to seed the blockchain with. An
// empty genesis state is equivalent to using the mainnet's state.
...
...
@@ -148,7 +148,7 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
ethConf
:=
eth
.
DefaultConfig
ethConf
.
Genesis
=
genesis
ethConf
.
SyncMode
=
downloader
.
LightSync
ethConf
.
NetworkId
=
config
.
EthereumNetworkID
ethConf
.
NetworkId
=
uint64
(
config
.
EthereumNetworkID
)
ethConf
.
DatabaseCache
=
config
.
EthereumDatabaseCache
if
err
:=
rawStack
.
Register
(
func
(
ctx
*
node
.
ServiceContext
)
(
node
.
Service
,
error
)
{
return
les
.
New
(
ctx
,
&
ethConf
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录