chore: rename repo

This commit is contained in:
Richard Ramos 2021-10-03 09:44:44 -04:00
parent da00a45856
commit 292f29fd18
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
5 changed files with 11 additions and 11 deletions

View File

@ -7,7 +7,7 @@ import (
"math/rand"
"time"
pb "github.com/status-im/go-libp2p-rendezvous/pb"
pb "github.com/status-im/go-waku-rendezvous/pb"
ggio "github.com/gogo/protobuf/io"

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/status-im/go-libp2p-rendezvous
module github.com/status-im/go-waku-rendezvous
go 1.15

View File

@ -10,7 +10,7 @@ import (
"github.com/libp2p/go-libp2p-core/record"
record_pb "github.com/libp2p/go-libp2p-core/record/pb"
pb "github.com/status-im/go-libp2p-rendezvous/pb"
pb "github.com/status-im/go-waku-rendezvous/pb"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/peer"
@ -21,7 +21,7 @@ var log = logging.Logger("rendezvous")
const (
RendezvousID_v001 = protocol.ID("/vac/waku/rendezvous/0.0.1")
DefaultTTL = 2 * 3600 // 2hr
DefaultTTL = 20 // 20 seconds
)
type RendezvousError struct {
@ -45,13 +45,13 @@ func newRegisterMessage(privKey libp2pCrypto.PrivKey, ns string, pi peer.AddrInf
msg.Register.Ttl = ttl64
}
peerInfo := &peer.PeerRecord{
peerRecord := &peer.PeerRecord{
PeerID: pi.ID,
Addrs: pi.Addrs,
Seq: uint64(time.Now().Unix()),
}
envelope, err := record.Seal(peerInfo, privKey)
envelope, err := record.Seal(peerRecord, privKey)
if err != nil {
return nil, err
}
@ -104,12 +104,12 @@ func pbToPeerRecord(pbEnvelope *record_pb.Envelope) (peer.AddrInfo, error) {
return peer.AddrInfo{}, err
}
peerRec, ok := rec.(*peer.PeerRecord)
peerRecord, ok := rec.(*peer.PeerRecord)
if !ok {
return peer.AddrInfo{}, errors.New("invalid peer record")
}
return peer.AddrInfo{ID: peerRec.PeerID, Addrs: peerRec.Addrs}, nil
return peer.AddrInfo{ID: peerRecord.PeerID, Addrs: peerRecord.Addrs}, nil
}
func newRegisterResponse(ttl int) *pb.Message_RegisterResponse {

2
svc.go
View File

@ -4,7 +4,7 @@ import (
"sync"
"time"
pb "github.com/status-im/go-libp2p-rendezvous/pb"
pb "github.com/status-im/go-waku-rendezvous/pb"
ggio "github.com/gogo/protobuf/io"

View File

@ -8,8 +8,8 @@ import (
"testing"
"time"
db "github.com/status-im/go-libp2p-rendezvous/db/sqlite"
pb "github.com/status-im/go-libp2p-rendezvous/pb"
db "github.com/status-im/go-waku-rendezvous/db/sqlite"
pb "github.com/status-im/go-waku-rendezvous/pb"
ggio "github.com/gogo/protobuf/io"
bhost "github.com/libp2p/go-libp2p-blankhost"