Commit 67fb60d9 authored by Steven Allen's avatar Steven Allen
Browse files

switch to google's uuid library

parent 934606d0
...@@ -8,10 +8,10 @@ import ( ...@@ -8,10 +8,10 @@ import (
inet "github.com/libp2p/go-libp2p-net" inet "github.com/libp2p/go-libp2p-net"
uuid "github.com/google/uuid"
"github.com/libp2p/go-libp2p-host" "github.com/libp2p/go-libp2p-host"
pb "github.com/libp2p/go-libp2p/examples/multipro/pb" pb "github.com/libp2p/go-libp2p/examples/multipro/pb"
protobufCodec "github.com/multiformats/go-multicodec/protobuf" protobufCodec "github.com/multiformats/go-multicodec/protobuf"
uuid "github.com/satori/go.uuid"
) )
// pattern: /protocol-name/request-or-response-message/version // pattern: /protocol-name/request-or-response-message/version
...@@ -126,7 +126,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool { ...@@ -126,7 +126,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool {
// create message data // create message data
req := &pb.EchoRequest{ req := &pb.EchoRequest{
MessageData: e.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false), MessageData: e.node.NewMessageData(uuid.New().String(), false),
Message: fmt.Sprintf("Echo from %s", e.node.ID())} Message: fmt.Sprintf("Echo from %s", e.node.ID())}
signature, err := e.node.signProtoMessage(req) signature, err := e.node.signProtoMessage(req)
......
...@@ -6,11 +6,11 @@ import ( ...@@ -6,11 +6,11 @@ import (
"fmt" "fmt"
"log" "log"
uuid "github.com/google/uuid"
"github.com/libp2p/go-libp2p-host" "github.com/libp2p/go-libp2p-host"
inet "github.com/libp2p/go-libp2p-net" inet "github.com/libp2p/go-libp2p-net"
p2p "github.com/libp2p/go-libp2p/examples/multipro/pb" p2p "github.com/libp2p/go-libp2p/examples/multipro/pb"
protobufCodec "github.com/multiformats/go-multicodec/protobuf" protobufCodec "github.com/multiformats/go-multicodec/protobuf"
uuid "github.com/satori/go.uuid"
) )
// pattern: /protocol-name/request-or-response-message/version // pattern: /protocol-name/request-or-response-message/version
...@@ -116,7 +116,7 @@ func (p *PingProtocol) Ping(host host.Host) bool { ...@@ -116,7 +116,7 @@ func (p *PingProtocol) Ping(host host.Host) bool {
log.Printf("%s: Sending ping to: %s....", p.node.ID(), host.ID()) log.Printf("%s: Sending ping to: %s....", p.node.ID(), host.ID())
// create message data // create message data
req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false), req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.New().String(), false),
Message: fmt.Sprintf("Ping from %s", p.node.ID())} Message: fmt.Sprintf("Ping from %s", p.node.ID())}
// sign the data // sign the data
......
...@@ -208,12 +208,6 @@ ...@@ -208,12 +208,6 @@
"name": "go-multicodec", "name": "go-multicodec",
"version": "0.1.5" "version": "0.1.5"
}, },
{
"author": "satori",
"hash": "QmcBWojPoNh4qm7zvv4qiepvCnnc7ALS9qcp7TNwwxT1gT",
"name": "go.uuid",
"version": "1.1.0"
},
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmUTQ9rzQf52c4MU4ESFbTF8RaUKtQztcAp6ww8wF3ahxC", "hash": "QmUTQ9rzQf52c4MU4ESFbTF8RaUKtQztcAp6ww8wF3ahxC",
...@@ -249,6 +243,12 @@ ...@@ -249,6 +243,12 @@
"hash": "QmbzWHWFpwCm7GDgrGyKnqUzh48PnRp86VD2Bb8wq6ZfDP", "hash": "QmbzWHWFpwCm7GDgrGyKnqUzh48PnRp86VD2Bb8wq6ZfDP",
"name": "go-libp2p-transport-upgrader", "name": "go-libp2p-transport-upgrader",
"version": "0.1.4" "version": "0.1.4"
},
{
"author": "google",
"hash": "QmSSeQqc5QeuefkaM6JFV5tSF9knLUkXKVhW1eYRiqe72W",
"name": "uuid",
"version": "0.1.0"
} }
], ],
"gxVersion": "0.4.0", "gxVersion": "0.4.0",
......
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