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 ( ...@@ -8,11 +8,11 @@ import (
inet "github.com/libp2p/go-libp2p-net" inet "github.com/libp2p/go-libp2p-net"
uuid "github.com/google/uuid"
assert "github.com/ipfs/go-ipfs/thirdparty/assert" assert "github.com/ipfs/go-ipfs/thirdparty/assert"
"github.com/libp2p/go-libp2p-host" "github.com/libp2p/go-libp2p-host"
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
...@@ -125,7 +125,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool { ...@@ -125,7 +125,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool {
// create message data // create message data
req := &p2p.EchoRequest{ 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())} 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.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())} Message: fmt.Sprintf("Ping from %s", p.node.ID())}
// sign the data // sign the data
......
...@@ -287,6 +287,12 @@ ...@@ -287,6 +287,12 @@
"hash": "QmRDePEiL4Yupq5EkcK3L3ko3iMgYaqUdLu7xc1kqs7dnV", "hash": "QmRDePEiL4Yupq5EkcK3L3ko3iMgYaqUdLu7xc1kqs7dnV",
"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"
} }
], ],
"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