mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
add outfile support (#3421)
This commit is contained in:
committed by
Nishant Das
parent
adc27a0bc2
commit
d94522510f
@@ -5,6 +5,7 @@ package main
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
@@ -19,6 +20,7 @@ var (
|
||||
privateKey = flag.String("private", "", "Base-64 encoded Private key to use for calculation of ENR")
|
||||
port = flag.Int("port", 0, "Port to use for calculation of ENR")
|
||||
ipAddr = flag.String("ipAddress", "", "IP to use in calculation of ENR")
|
||||
outfile = flag.String("out", "", "Filepath to write ENR")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -61,4 +63,12 @@ func main() {
|
||||
localNode.Set(ipEntry)
|
||||
localNode.Set(udpEntry)
|
||||
log.Info(localNode.Node().String())
|
||||
|
||||
if *outfile != "" {
|
||||
err := ioutil.WriteFile(*outfile, []byte(localNode.Node().String()), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
log.Infof("Wrote to %s", *outfile)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user