mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Merge branch 'unstable' of https://github.com/sigp/lighthouse into merge-unstable-deneb-jul-14
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use clap::ArgMatches;
|
||||
use lighthouse_network::{
|
||||
discovery::{build_enr, CombinedKey, CombinedKeyExt, Keypair, ENR_FILENAME},
|
||||
discovery::{build_enr, CombinedKey, CombinedKeyExt, ENR_FILENAME},
|
||||
libp2p::identity::secp256k1,
|
||||
NetworkConfig, NETWORK_KEY_FILENAME,
|
||||
};
|
||||
use std::fs::File;
|
||||
@@ -29,8 +30,8 @@ pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
|
||||
config.enr_udp4_port = Some(udp_port);
|
||||
config.enr_tcp6_port = Some(tcp_port);
|
||||
|
||||
let local_keypair = Keypair::generate_secp256k1();
|
||||
let enr_key = CombinedKey::from_libp2p(&local_keypair)?;
|
||||
let secp256k1_keypair = secp256k1::Keypair::generate();
|
||||
let enr_key = CombinedKey::from_secp256k1(&secp256k1_keypair);
|
||||
let enr_fork_id = EnrForkId {
|
||||
fork_digest: ChainSpec::compute_fork_digest(genesis_fork_version, Hash256::zero()),
|
||||
next_fork_version: genesis_fork_version,
|
||||
@@ -47,13 +48,10 @@ pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
|
||||
.write_all(enr.to_base64().as_bytes())
|
||||
.map_err(|e| format!("Unable to write ENR to {}: {:?}", ENR_FILENAME, e))?;
|
||||
|
||||
let secret_bytes = match local_keypair {
|
||||
Keypair::Secp256k1(key) => key.secret().to_bytes(),
|
||||
_ => return Err("Key is not a secp256k1 key".into()),
|
||||
};
|
||||
|
||||
let mut key_file = File::create(output_dir.join(NETWORK_KEY_FILENAME))
|
||||
.map_err(|e| format!("Unable to create {}: {:?}", NETWORK_KEY_FILENAME, e))?;
|
||||
|
||||
let secret_bytes = secp256k1_keypair.secret().to_bytes();
|
||||
key_file
|
||||
.write_all(&secret_bytes)
|
||||
.map_err(|e| format!("Unable to write key to {}: {:?}", NETWORK_KEY_FILENAME, e))?;
|
||||
|
||||
@@ -40,7 +40,6 @@ fn main() {
|
||||
.long("spec")
|
||||
.value_name("STRING")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.possible_values(&["minimal", "mainnet", "gnosis"])
|
||||
.default_value("mainnet")
|
||||
.global(true),
|
||||
@@ -372,7 +371,6 @@ fn main() {
|
||||
.index(2)
|
||||
.value_name("BIP39_MNENMONIC")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.default_value(
|
||||
"replace nephew blur decorate waste convince soup column \
|
||||
orient excite play baby",
|
||||
@@ -393,7 +391,6 @@ fn main() {
|
||||
.help("The block hash used when generating an execution payload. This \
|
||||
value is used for `execution_payload_header.block_hash` as well as \
|
||||
`execution_payload_header.random`")
|
||||
.required(true)
|
||||
.default_value(
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
),
|
||||
@@ -411,7 +408,6 @@ fn main() {
|
||||
.value_name("INTEGER")
|
||||
.takes_value(true)
|
||||
.help("The base fee per gas field in the execution payload generated.")
|
||||
.required(true)
|
||||
.default_value("1000000000"),
|
||||
)
|
||||
.arg(
|
||||
@@ -420,7 +416,6 @@ fn main() {
|
||||
.value_name("INTEGER")
|
||||
.takes_value(true)
|
||||
.help("The gas limit field in the execution payload generated.")
|
||||
.required(true)
|
||||
.default_value("30000000"),
|
||||
)
|
||||
.arg(
|
||||
|
||||
Reference in New Issue
Block a user