Add default values for libp2p config (#388)

This commit is contained in:
Giacomo Pasini 2023-09-11 15:26:01 +02:00 committed by GitHub
parent 8e0937beb7
commit efabf66994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -39,9 +39,10 @@ pub struct SwarmConfig {
// TCP listening port. Use 0 for random
pub port: u16,
// Secp256k1 private key in Hex format (`0x123...abc`). Default random
#[serde(with = "secret_key_serde")]
#[serde(with = "secret_key_serde", default = "secp256k1::SecretKey::generate")]
pub node_key: secp256k1::SecretKey,
// Initial peers to connect to
#[serde(default)]
pub initial_peers: Vec<Multiaddr>,
}