@@ -42,7 +42,7 @@ ADD genesis.json /genesis.json
42
42
RUN \
43
43
echo 'geth --cache 512 init /genesis.json' > geth.sh && \{{if .Unlock}}
44
44
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> geth.sh && \{{end}}
45
- echo $'exec geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --nat extip:{{.IP}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--miner.etherbase {{.Etherbase}} --mine --miner.threads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --miner.gastarget {{.GasTarget}} --miner.gaslimit {{.GasLimit}} --miner.gasprice {{.GasPrice}}' >> geth.sh
45
+ echo $'exec geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --nat extip:{{.IP}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--miner.etherbase {{.Etherbase}} --mine --miner.threads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --miner.gastarget {{.GasTarget}} --miner.gaslimit {{.GasLimit}} --miner.gasprice {{.GasPrice}} {{if .NodeKeyHex}} --nodekeyhex {{.NodeKeyHex}} {{end}}{{if .Testnet}} --testnet{{end}} ' >> geth.sh
46
46
47
47
ENTRYPOINT ["/bin/sh", "geth.sh"]
48
48
`
@@ -98,18 +98,20 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
98
98
}
99
99
dockerfile := new (bytes.Buffer )
100
100
template .Must (template .New ("" ).Parse (nodeDockerfile )).Execute (dockerfile , map [string ]interface {}{
101
- "NetworkID" : config .network ,
102
- "Port" : config .port ,
103
- "IP" : client .address ,
104
- "Peers" : config .peersTotal ,
105
- "LightFlag" : lightFlag ,
106
- "Bootnodes" : strings .Join (bootnodes , "," ),
107
- "Ethstats" : config .ethstats ,
108
- "Etherbase" : config .etherbase ,
109
- "GasTarget" : uint64 (1000000 * config .gasTarget ),
110
- "GasLimit" : uint64 (1000000 * config .gasLimit ),
111
- "GasPrice" : uint64 (1000000000 * config .gasPrice ),
112
- "Unlock" : config .keyJSON != "" ,
101
+ "NetworkID" : config .network ,
102
+ "Port" : config .port ,
103
+ "IP" : client .address ,
104
+ "Peers" : config .peersTotal ,
105
+ "LightFlag" : lightFlag ,
106
+ "Bootnodes" : strings .Join (bootnodes , "," ),
107
+ "Ethstats" : config .ethstats ,
108
+ "Etherbase" : config .etherbase ,
109
+ "GasTarget" : uint64 (1000000 * config .gasTarget ),
110
+ "GasLimit" : uint64 (1000000 * config .gasLimit ),
111
+ "GasPrice" : uint64 (1000000000 * config .gasPrice ),
112
+ "Unlock" : config .keyJSON != "" ,
113
+ "NodeKeyHex" : config .nodeKeyHex ,
114
+ "Testnet" : config .testNet ,
113
115
})
114
116
files [filepath .Join (workdir , "Dockerfile" )] = dockerfile .Bytes ()
115
117
@@ -167,6 +169,8 @@ type nodeInfos struct {
167
169
gasTarget float64
168
170
gasLimit float64
169
171
gasPrice float64
172
+ nodeKeyHex string
173
+ testNet bool
170
174
}
171
175
172
176
// Report converts the typed struct into a plain string->string map, containing
0 commit comments