mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Bootnode: Print private key at debug (#3372)
* print private key at debug * fix docker deps
This commit is contained in:
@@ -12,8 +12,8 @@ go_library(
|
||||
"//shared/version:go_default_library",
|
||||
"@com_github_btcsuite_btcd//btcec:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//p2p/discv5:go_default_library",
|
||||
"@com_github_ipfs_go_log//:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p_core//crypto:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@org_uber_go_automaxprocs//:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -33,8 +33,8 @@ go_image(
|
||||
"//shared/version:go_default_library",
|
||||
"@com_github_btcsuite_btcd//btcec:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//p2p/discv5:go_default_library",
|
||||
"@com_github_ipfs_go_log//:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p_core//crypto:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@org_uber_go_automaxprocs//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -18,11 +18,10 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/ethereum/go-ethereum/p2p/discv5"
|
||||
|
||||
logging "github.com/ipfs/go-log"
|
||||
"github.com/libp2p/go-libp2p-core/crypto"
|
||||
"github.com/prysmaticlabs/prysm/shared/version"
|
||||
_ "go.uber.org/automaxprocs"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -30,7 +29,7 @@ var (
|
||||
privateKey = flag.String("private", "", "Private key to use for peer ID")
|
||||
port = flag.Int("port", 4000, "Port to listen for connections")
|
||||
|
||||
log = logging.Logger("prysm-bootnode")
|
||||
log = logrus.WithField("prefix", "bootnode")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -39,7 +38,7 @@ func main() {
|
||||
fmt.Printf("Starting bootnode. Version: %s\n", version.GetVersion())
|
||||
|
||||
if *debug {
|
||||
logging.SetDebugLogging()
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
|
||||
defaultIP := "0.0.0.0"
|
||||
@@ -48,7 +47,7 @@ func main() {
|
||||
listener := createListener(defaultIP, *port, privKey)
|
||||
|
||||
node := listener.Self()
|
||||
fmt.Printf("Running bootnode, url: %s", node.String())
|
||||
log.Infof("Running bootnode, url: %s", node.String())
|
||||
|
||||
select {}
|
||||
}
|
||||
@@ -90,6 +89,13 @@ func extractPrivateKey() *ecdsa.PrivateKey {
|
||||
}
|
||||
privKey = (*ecdsa.PrivateKey)((*btcec.PrivateKey)(privInterfaceKey.(*crypto.Secp256k1PrivateKey)))
|
||||
log.Warning("No private key was provided. Using default/random private key")
|
||||
|
||||
b, err := privInterfaceKey.Bytes()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
log.Debugf("Private key %s", crypto.ConfigEncodeKey(b))
|
||||
}
|
||||
|
||||
return privKey
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user