Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
ff5be0e6
Commit
ff5be0e6
authored
Mar 06, 2017
by
Jeromy
Browse files
seed rand for generation of peer IDs in echo example
parent
000cca04
Changes
1
Show whitespace changes
Inline
Side-by-side
examples/echo/main.go
View file @
ff5be0e6
...
...
@@ -6,7 +6,9 @@ import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"strings"
"time"
golog
"github.com/ipfs/go-log"
host
"github.com/libp2p/go-libp2p-host"
...
...
@@ -62,6 +64,7 @@ func makeBasicHost(listen string, secio bool) (host.Host, error) {
}
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
golog
.
SetAllLoggers
(
gologging
.
INFO
)
// Change to DEBUG for extra info
listenF
:=
flag
.
Int
(
"l"
,
0
,
"wait for incoming connections"
)
target
:=
flag
.
String
(
"d"
,
""
,
"target peer to dial"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment