Commit 6e3c94f9 authored by Steven Allen's avatar Steven Allen
Browse files

switch multipro example to a different UUID package

We already have this one imported into GX. Saves the effort of importing a
different one.
parent 65be183f
......@@ -8,11 +8,11 @@ import (
inet "github.com/libp2p/go-libp2p-net"
uuid "github.com/google/uuid"
assert "github.com/ipfs/go-ipfs/thirdparty/assert"
"github.com/libp2p/go-libp2p-host"
p2p "github.com/libp2p/go-libp2p/examples/multipro/pb"
protobufCodec "github.com/multiformats/go-multicodec/protobuf"
uuid "github.com/satori/go.uuid"
)
// pattern: /protocol-name/request-or-response-message/version
......@@ -125,7 +125,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool {
// create message data
req := &p2p.EchoRequest{
MessageData: e.node.NewMessageData(uuid.New().String(), false),
MessageData: e.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false),
Message: fmt.Sprintf("Echo from %s", e.node.ID())}
signature, err := e.node.signProtoMessage(req)
......
......@@ -6,11 +6,11 @@ import (
"fmt"
"log"
uuid "github.com/google/uuid"
"github.com/libp2p/go-libp2p-host"
inet "github.com/libp2p/go-libp2p-net"
p2p "github.com/libp2p/go-libp2p/examples/multipro/pb"
protobufCodec "github.com/multiformats/go-multicodec/protobuf"
uuid "github.com/satori/go.uuid"
)
// pattern: /protocol-name/request-or-response-message/version
......@@ -116,7 +116,7 @@ func (p *PingProtocol) Ping(host host.Host) bool {
log.Printf("%s: Sending ping to: %s....", p.node.ID(), host.ID())
// create message data
req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.New().String(), false),
req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false),
Message: fmt.Sprintf("Ping from %s", p.node.ID())}
// sign the data
......
......@@ -287,6 +287,12 @@
"hash": "QmRDePEiL4Yupq5EkcK3L3ko3iMgYaqUdLu7xc1kqs7dnV",
"name": "go-multicodec",
"version": "0.1.5"
},
{
"author": "satori",
"hash": "QmcBWojPoNh4qm7zvv4qiepvCnnc7ALS9qcp7TNwwxT1gT",
"name": "go.uuid",
"version": "1.1.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