Commit ff5be0e6 authored by Jeromy's avatar Jeromy
Browse files

seed rand for generation of peer IDs in echo example

parent 000cca04
...@@ -6,7 +6,9 @@ import ( ...@@ -6,7 +6,9 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"math/rand"
"strings" "strings"
"time"
golog "github.com/ipfs/go-log" golog "github.com/ipfs/go-log"
host "github.com/libp2p/go-libp2p-host" host "github.com/libp2p/go-libp2p-host"
...@@ -62,6 +64,7 @@ func makeBasicHost(listen string, secio bool) (host.Host, error) { ...@@ -62,6 +64,7 @@ func makeBasicHost(listen string, secio bool) (host.Host, error) {
} }
func main() { func main() {
rand.Seed(time.Now().UnixNano())
golog.SetAllLoggers(gologging.INFO) // Change to DEBUG for extra info golog.SetAllLoggers(gologging.INFO) // Change to DEBUG for extra info
listenF := flag.Int("l", 0, "wait for incoming connections") listenF := flag.Int("l", 0, "wait for incoming connections")
target := flag.String("d", "", "target peer to dial") target := flag.String("d", "", "target peer to dial")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment