Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-routing
Commits
f5e0203f
Commit
f5e0203f
authored
May 28, 2019
by
Raúl Kripalani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate to go-libp2p-core.
parent
b69591af
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
134 additions
and
149 deletions
+134
-149
go.mod
go.mod
+6
-9
go.sum
go.sum
+42
-58
mock/centralized_client.go
mock/centralized_client.go
+16
-16
mock/centralized_server.go
mock/centralized_server.go
+11
-11
mock/centralized_test.go
mock/centralized_test.go
+11
-10
mock/interface.go
mock/interface.go
+9
-8
none/none_client.go
none/none_client.go
+15
-15
offline/offline.go
offline/offline.go
+17
-17
offline/offline_test.go
offline/offline_test.go
+7
-5
No files found.
go.mod
View file @
f5e0203f
...
@@ -2,18 +2,15 @@ module github.com/ipfs/go-ipfs-routing
...
@@ -2,18 +2,15 @@ module github.com/ipfs/go-ipfs-routing
require (
require (
github.com/gogo/protobuf
v1.2.1
github.com/gogo/protobuf
v1.2.1
github.com/ipfs/go-cid
v0.0.
1
github.com/ipfs/go-cid
v0.0.
2
github.com/ipfs/go-datastore
v0.0.1
github.com/ipfs/go-datastore
v0.0.1
github.com/ipfs/go-ipfs-delay
v0.0.1
github.com/ipfs/go-ipfs-delay
v0.0.1
github.com/ipfs/go-ipfs-ds-help
v0.0.1
github.com/ipfs/go-ipfs-ds-help
v0.0.1
github.com/ipfs/go-ipfs-util
v0.0.1
github.com/ipfs/go-ipfs-util
v0.0.1
github.com/ipfs/go-log
v0.0.1
github.com/ipfs/go-log
v0.0.1
github.com/libp2p/go-libp2p-host
v0.0.1
github.com/libp2p/go-libp2p-core
v0.0.2
github.com/libp2p/go-libp2p-peer
v0.0.1
github.com/libp2p/go-libp2p-record
v0.1.0
github.com/libp2p/go-libp2p-peerstore
v0.0.1
github.com/libp2p/go-libp2p-testing
v0.0.3
github.com/libp2p/go-libp2p-record
v0.0.1
github.com/multiformats/go-multiaddr
v0.0.4
github.com/libp2p/go-libp2p-routing
v0.0.1
github.com/multiformats/go-multihash
v0.0.5
github.com/libp2p/go-testutil
v0.0.1
github.com/multiformats/go-multiaddr
v0.0.1
github.com/multiformats/go-multihash
v0.0.1
)
)
go.sum
View file @
f5e0203f
github.com/AndreasBriese/bbloom
v0.0.0-20180913140656-343706a395b7/go.mod h1:
bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Kubuxu/go-os-helper
v0.0.1/go.mod h1:
N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y=
github.com/aead/siphash
v1.0.1/go.mod h1:
Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/aead/siphash
v1.0.1/go.mod h1:
Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/btcsuite/btcd
v0.0.0-20190213025234-306aecffea32 h1:
qkOC5Gd33k54tobS36cXdAzJbeHaduLtnLQQwNoIi78=
github.com/btcsuite/btcd
v0.0.0-20190213025234-306aecffea32/go.mod h1:
DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
github.com/btcsuite/btcd
v0.0.0-20190213025234-306aecffea32/go.mod h1:
DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
github.com/btcsuite/btcd
v0.0.0-20190523000118-16327141da8c h1:
aEbSeNALREWXk0G7UdNhR3ayBV7tZ4M2PNmnrCAph6Q=
github.com/btcsuite/btcd
v0.0.0-20190523000118-16327141da8c/go.mod h1:
3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
github.com/btcsuite/btclog
v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:
TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btclog
v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:
TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil
v0.0.0-20190207003914-4c204d697803/go.mod h1:
+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil
v0.0.0-20190207003914-4c204d697803/go.mod h1:
+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil
v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:
+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/go-socks
v0.0.0-20170105172521-4720035b7bfd/go.mod h1:
HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/go-socks
v0.0.0-20170105172521-4720035b7bfd/go.mod h1:
HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb
v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:
F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/goleveldb
v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:
F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/snappy-go
v0.0.0-20151229074030-0bdef8d06723/go.mod h1:
8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/snappy-go
v0.0.0-20151229074030-0bdef8d06723/go.mod h1:
8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket
v0.0.0-20150119174127-31079b680792/go.mod h1:
ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/websocket
v0.0.0-20150119174127-31079b680792/go.mod h1:
ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc
v1.0.0/go.mod h1:
jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/btcsuite/winsvc
v1.0.0/go.mod h1:
jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/coreos/go-semver
v0.2.0 h1:
3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
github.com/coreos/go-semver
v0.3.0/go.mod h1:
nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver
v0.2.0/go.mod h1:
nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/davecgh/go-spew
v0.0.0-20171005155431-ecdeabc65495/go.mod h1:
J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew
v0.0.0-20171005155431-ecdeabc65495/go.mod h1:
J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew
v1.1.0 h1:
ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew
v1.1.0 h1:
ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew
v1.1.0/go.mod h1:
J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew
v1.1.0/go.mod h1:
J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgraph-io/badger
v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:
VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ=
github.com/dgryski/go-farm
v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:
SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize
v1.0.0/go.mod h1:
HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/fsnotify/fsnotify
v1.4.7/go.mod h1:
jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify
v1.4.7/go.mod h1:
jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-check/check
v0.0.0-20180628173108-788fd7840127 h1:
0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=
github.com/go-check/check
v0.0.0-20180628173108-788fd7840127 h1:
0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=
github.com/go-check/check
v0.0.0-20180628173108-788fd7840127/go.mod h1:
9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/go-check/check
v0.0.0-20180628173108-788fd7840127/go.mod h1:
9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/gogo/protobuf
v1.2.1 h1:
/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf
v1.2.1 h1:
/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf
v1.2.1/go.mod h1:
hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf
v1.2.1/go.mod h1:
hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/protobuf
v1.2.0/go.mod h1:
6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf
v1.2.0/go.mod h1:
6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf
v1.3.0/go.mod h1:
Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/golang/snappy
v0.0.0-20180518054509-2e65f85255db/go.mod h1:
/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/uuid
v1.1.1 h1:
Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid
v1.1.1 h1:
Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid
v1.1.1/go.mod h1:
TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid
v1.1.1/go.mod h1:
TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gxed/hashland/keccakpg
v0.0.1 h1:
wrk3uMNaMxbXiHibbPO4S0ymqJMm41WiudyFSs7UnsU=
github.com/gxed/hashland/keccakpg
v0.0.1/go.mod h1:
kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU=
github.com/gxed/hashland/keccakpg
v0.0.1/go.mod h1:
kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU=
github.com/gxed/hashland/murmur3
v0.0.1 h1:
SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJu4ZbSc=
github.com/gxed/hashland/murmur3
v0.0.1/go.mod h1:
KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48=
github.com/gxed/hashland/murmur3
v0.0.1/go.mod h1:
KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48=
github.com/hashicorp/golang-lru
v0.5.1/go.mod h1:
/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail
v1.0.0/go.mod h1:
ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hpcloud/tail
v1.0.0/go.mod h1:
ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ipfs/go-cid
v0.0.1 h1:
GBjWPktLnNyX0JiQCNFpUuUSoMw5KMyqrsejHYlILBE=
github.com/ipfs/go-cid
v0.0.1/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid
v0.0.1/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid
v0.0.2 h1:
tuuKaZPU1M6HcejsO3AcYWW8sZ8MTvyxfc4uqB4eFE8=
github.com/ipfs/go-cid
v0.0.2/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-datastore
v0.0.1 h1:
AW/KZCScnBWlSb5JbnEnLKFWXL224LBEh/9KXXOrUms=
github.com/ipfs/go-datastore
v0.0.1 h1:
AW/KZCScnBWlSb5JbnEnLKFWXL224LBEh/9KXXOrUms=
github.com/ipfs/go-datastore
v0.0.1/go.mod h1:
d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
github.com/ipfs/go-datastore
v0.0.1/go.mod h1:
d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
github.com/ipfs/go-ds-badger
v0.0.2/go.mod h1:
Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8=
github.com/ipfs/go-ds-leveldb
v0.0.1/go.mod h1:
feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=
github.com/ipfs/go-ipfs-delay
v0.0.0-20181109222059-70721b86a9a8/go.mod h1:
8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
github.com/ipfs/go-ipfs-delay
v0.0.0-20181109222059-70721b86a9a8/go.mod h1:
8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
github.com/ipfs/go-ipfs-delay
v0.0.1 h1:
r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=
github.com/ipfs/go-ipfs-delay
v0.0.1 h1:
r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=
github.com/ipfs/go-ipfs-delay
v0.0.1/go.mod h1:
8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
github.com/ipfs/go-ipfs-delay
v0.0.1/go.mod h1:
8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
...
@@ -49,8 +39,10 @@ github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv
...
@@ -49,8 +39,10 @@ github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv
github.com/ipfs/go-ipfs-util
v0.0.1/go.mod h1:
spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
github.com/ipfs/go-ipfs-util
v0.0.1/go.mod h1:
spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
github.com/ipfs/go-log
v0.0.1 h1:
9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc=
github.com/ipfs/go-log
v0.0.1 h1:
9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc=
github.com/ipfs/go-log
v0.0.1/go.mod h1:
kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM=
github.com/ipfs/go-log
v0.0.1/go.mod h1:
kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM=
github.com/jbenet/go
process
v0.0.0-20160826012719-b497e2f366b8 h1:
bspPhN+oKYFk5fcGNuQzp6IGzYQSenLEgH3s6jkXrWw
=
github.com/jbenet/go
-cienv
v0.1.0/go.mod h1:
TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA
=
github.com/jbenet/goprocess
v0.0.0-20160826012719-b497e2f366b8/go.mod h1:
Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY=
github.com/jbenet/goprocess
v0.0.0-20160826012719-b497e2f366b8/go.mod h1:
Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY=
github.com/jbenet/goprocess
v0.1.3 h1:
YKyIEECS/XvcfHtBzxtjBBbWK+MbvA6dG8ASiqwvr10=
github.com/jbenet/goprocess
v0.1.3/go.mod h1:
5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4=
github.com/jessevdk/go-flags
v0.0.0-20141203071132-1679536dcc89/go.mod h1:
4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags
v0.0.0-20141203071132-1679536dcc89/go.mod h1:
4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jrick/logrotate
v1.0.0/go.mod h1:
LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/jrick/logrotate
v1.0.0/go.mod h1:
LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/kisielk/errcheck
v1.1.0/go.mod h1:
EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck
v1.1.0/go.mod h1:
EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
...
@@ -61,86 +53,78 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
...
@@ -61,86 +53,78 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty
v1.1.1/go.mod h1:
pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty
v1.1.1/go.mod h1:
pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text
v0.1.0 h1:
45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text
v0.1.0 h1:
45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text
v0.1.0/go.mod h1:
4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text
v0.1.0/go.mod h1:
4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/libp2p/go-buffer-pool
v0.0.1/go.mod h1:
xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ=
github.com/libp2p/go-flow-metrics
v0.0.1/go.mod h1:
Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8=
github.com/libp2p/go-libp2p-crypto
v0.0.1 h1:
JNQd8CmoGTohO/akqrH16ewsqZpci2CbgYH/LmYl8gw=
github.com/libp2p/go-libp2p-core
v0.0.1/go.mod h1:
g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco=
github.com/libp2p/go-libp2p-crypto
v0.0.1/go.mod h1:
yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE=
github.com/libp2p/go-libp2p-core
v0.0.2 h1:
86uOwW+O6Uc7NbaK4diuLZo2/Ikvqw2rgyV03VcSbLE=
github.com/libp2p/go-libp2p-host
v0.0.1 h1:
dnqusU+DheGcdxrE718kG4XgHNuL2n9eEv8Rg5zy8hQ=
github.com/libp2p/go-libp2p-core
v0.0.2/go.mod h1:
9dAcntw/n46XycV4RnlBq3BpgrmyUi9LuoTNdPrbUco=
github.com/libp2p/go-libp2p-host
v0.0.1/go.mod h1:
qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go=
github.com/libp2p/go-libp2p-record
v0.1.0 h1:
wHwBGbFzymoIl69BpgwIu0O6ta3TXGcMPvHUAcodzRc=
github.com/libp2p/go-libp2p-interface-connmgr
v0.0.1 h1:
Q9EkNSLAOF+u90L88qmE9z/fTdjLh8OsJwGw74mkwk4=
github.com/libp2p/go-libp2p-record
v0.1.0/go.mod h1:
ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q=
github.com/libp2p/go-libp2p-interface-connmgr
v0.0.1/go.mod h1:
GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k=
github.com/libp2p/go-libp2p-testing
v0.0.3 h1:
bdij4bKaaND7tCsaXVjRfYkMpvoOeKj9AVQGJllA6jM=
github.com/libp2p/go-libp2p-net
v0.0.1 h1:
xJ4Vh4yKF/XKb8fd1Ev0ebAGzVjMxXzrxG2kjtU+F5Q=
github.com/libp2p/go-libp2p-testing
v0.0.3/go.mod h1:
gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
github.com/libp2p/go-libp2p-net
v0.0.1/go.mod h1:
Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c=
github.com/libp2p/go-libp2p-peer
v0.0.1 h1:
0qwAOljzYewINrU+Kndoc+1jAL7vzY/oY2Go4DCGfyY=
github.com/libp2p/go-libp2p-peer
v0.0.1/go.mod h1:
nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo=
github.com/libp2p/go-libp2p-peerstore
v0.0.1 h1:
twKovq8YK5trLrd3nB7PD2Zu9JcyAIdm7Bz9yBWjhq8=
github.com/libp2p/go-libp2p-peerstore
v0.0.1/go.mod h1:
RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20=
github.com/libp2p/go-libp2p-protocol
v0.0.1 h1:
+zkEmZ2yFDi5adpVE3t9dqh/N9TbpFWywowzeEzBbLM=
github.com/libp2p/go-libp2p-protocol
v0.0.1/go.mod h1:
Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s=
github.com/libp2p/go-libp2p-record
v0.0.1 h1:
zN7AS3X46qmwsw5JLxdDuI43cH5UYwovKxHPjKBYQxw=
github.com/libp2p/go-libp2p-record
v0.0.1/go.mod h1:
grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q=
github.com/libp2p/go-libp2p-routing
v0.0.1 h1:
hPMAWktf9rYi3ME4MG48qE7dq1ofJxiQbfdvpNntjhc=
github.com/libp2p/go-libp2p-routing
v0.0.1/go.mod h1:
N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys=
github.com/libp2p/go-stream-muxer
v0.0.1 h1:
Ce6e2Pyu+b5MC1k3eeFtAax0pW4gc6MosYSLV05UeLw=
github.com/libp2p/go-stream-muxer
v0.0.1/go.mod h1:
bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14=
github.com/libp2p/go-testutil
v0.0.1 h1:
Xg+O0G2HIMfHqBOBDcMS1iSZJ3GEcId4qOxCQvsGZHk=
github.com/libp2p/go-testutil
v0.0.1/go.mod h1:
iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I=
github.com/mattn/go-colorable
v0.1.1 h1:
G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
github.com/mattn/go-colorable
v0.1.1 h1:
G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
github.com/mattn/go-colorable
v0.1.1/go.mod h1:
FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable
v0.1.1/go.mod h1:
FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-isatty
v0.0.5 h1:
tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty
v0.0.5 h1:
tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty
v0.0.5/go.mod h1:
Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty
v0.0.5/go.mod h1:
Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/minio/blake2b-simd
v0.0.0-20160723061019-3f5f724cb5b1 h1:
lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=
github.com/minio/blake2b-simd
v0.0.0-20160723061019-3f5f724cb5b1 h1:
lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=
github.com/minio/blake2b-simd
v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:
pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
github.com/minio/blake2b-simd
v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:
pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
github.com/minio/sha256-simd
v0.0.0-20190131020904-2d45a736cd16 h1:
5W7KhL8HVF3XCFOweFD3BNESdnO8ewyYTFT2R+/b8FQ=
github.com/minio/sha256-simd
v0.0.0-20190131020904-2d45a736cd16/go.mod h1:
2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
github.com/minio/sha256-simd
v0.0.0-20190131020904-2d45a736cd16/go.mod h1:
2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
github.com/mr-tron/base58
v1.1.0 h1:
Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ=
github.com/minio/sha256-simd
v0.0.0-20190328051042-05b4dd3047e5 h1:
l16XLUUJ34wIz+RIvLhSwGvLvKyy+W598b135bJN6mg=
github.com/minio/sha256-simd
v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:
2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
github.com/mr-tron/base58
v1.1.0/go.mod h1:
xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58
v1.1.0/go.mod h1:
xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58
v1.1.1/go.mod h1:
xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58
v1.1.2 h1:
ZEw4I2EgPKDJ2iEw0cNmLB3ROrEmkOtXIkaG7wZg+78=
github.com/mr-tron/base58
v1.1.2/go.mod h1:
BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiformats/go-base32
v0.0.3 h1:
tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI=
github.com/multiformats/go-base32
v0.0.3 h1:
tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI=
github.com/multiformats/go-base32
v0.0.3/go.mod h1:
pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA=
github.com/multiformats/go-base32
v0.0.3/go.mod h1:
pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA=
github.com/multiformats/go-multiaddr
v0.0.1 h1:
/QUV3VBMDI6pi6xfiw7lr6xhDWWvQKn9udPn68kLSdY=
github.com/multiformats/go-multiaddr
v0.0.2/go.mod h1:
xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44=
github.com/multiformats/go-multiaddr
v0.0.1/go.mod h1:
xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44=
github.com/multiformats/go-multiaddr
v0.0.4 h1:
WgMSI84/eRLdbptXMkMWDXPjPq7SPLIgGUVm2eroyU4=
github.com/multiformats/go-multiaddr-dns
v0.0.1/go.mod h1:
9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
github.com/multiformats/go-multiaddr
v0.0.4/go.mod h1:
xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44=
github.com/multiformats/go-multiaddr-net
v0.0.1/go.mod h1:
nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU=
github.com/multiformats/go-multibase
v0.0.1 h1:
PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA=
github.com/multiformats/go-multibase
v0.0.1 h1:
PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA=
github.com/multiformats/go-multibase
v0.0.1/go.mod h1:
bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs=
github.com/multiformats/go-multibase
v0.0.1/go.mod h1:
bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs=
github.com/multiformats/go-multihash
v0.0.1 h1:
HHwN1K12I+XllBCrqKnhX949Orn4oawPkegHMu2vDqQ=
github.com/multiformats/go-multihash
v0.0.1/go.mod h1:
w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
github.com/multiformats/go-multihash
v0.0.1/go.mod h1:
w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
github.com/multiformats/go-multi
stream
v0.0.
1
h1:
JV4VfSdY9n7ECTtY59/TlSyFCzRILvYx4T4Ws8ZgihU
=
github.com/multiformats/go-multi
hash
v0.0.
5
h1:
1wxmCvTXAifAepIMyF39vZinRw5sbqjPs/UIi93+uik
=
github.com/multiformats/go-multi
stream
v0.0.
1
/go.mod h1:
fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg
=
github.com/multiformats/go-multi
hash
v0.0.
5
/go.mod h1:
lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po
=
github.com/onsi/ginkgo
v1.6.0/go.mod h1:
lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo
v1.6.0/go.mod h1:
lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo
v1.7.0/go.mod h1:
lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo
v1.7.0/go.mod h1:
lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega
v1.4.3/go.mod h1:
ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega
v1.4.3/go.mod h1:
ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go
v1.0.2 h1:
3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg=
github.com/opentracing/opentracing-go
v1.0.2 h1:
3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg=
github.com/opentracing/opentracing-go
v1.0.2/go.mod h1:
UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go
v1.0.2/go.mod h1:
UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pkg/errors
v0.8.1/go.mod h1:
bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib
v1.0.0 h1:
4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib
v1.0.0 h1:
4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib
v1.0.0/go.mod h1:
iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib
v1.0.0/go.mod h1:
iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spacemonkeygo/openssl
v0.0.0-20181017203307-c2dcc5cca94a h1:
/eS3yfGjQKG+9kayBkj0ip1BGhq6zJ3eaVksphxAaek=
github.com/spacemonkeygo/openssl
v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:
7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0=
github.com/spacemonkeygo/spacelog
v0.0.0-20180420211403-2296661a0572 h1:
RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU=
github.com/spacemonkeygo/spacelog
v0.0.0-20180420211403-2296661a0572/go.mod h1:
w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc=
github.com/spaolacci/murmur3
v1.1.0 h1:
7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3
v1.1.0/go.mod h1:
JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx
v0.1.0/go.mod h1:
HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx
v0.1.0/go.mod h1:
HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify
v1.3.0 h1:
TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify
v1.3.0 h1:
TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify
v1.3.0/go.mod h1:
M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify
v1.3.0/go.mod h1:
M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/syndtr/goleveldb
v1.0.0/go.mod h1:
ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/whyrusleeping/go-keyspace
v0.0.0-20160322163242-5b898ac5add1/go.mod h1:
8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc=
github.com/whyrusleeping/go-logging
v0.0.0-20170515211332-0457bb6b88fc h1:
9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
github.com/whyrusleeping/go-logging
v0.0.0-20170515211332-0457bb6b88fc h1:
9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
github.com/whyrusleeping/go-logging
v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:
bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM=
github.com/whyrusleeping/go-logging
v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:
bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM=
github.com/whyrusleeping/mafmt
v1.2.8/go.mod h1:
faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA=
golang.org/x/crypto
v0.0.0-20170930174604-9419663f5a44/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20170930174604-9419663f5a44/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20190211182817-74369b46fc67/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20190211182817-74369b46fc67/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20190225124518-7f87c0fbb88b h1:
+/WWzjwW6gidDJnMKWLKLX1gxn7irUTF1fLpQovfQ5M=
golang.org/x/crypto
v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:
6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto
v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:
djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto
v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:
yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto
v0.0.0-20190513172903-22d7a77e9e5f h1:
R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo=
golang.org/x/crypto
v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:
yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net
v0.0.0-20180906233101-161cd47e91fd/go.mod h1:
mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net
v0.0.0-20180906233101-161cd47e91fd/go.mod h1:
mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net
v0.0.0-20190227160552-c95aed5357e7 h1:
C2F/nMkR/9sfUTpvR3QrjBuTdvMUC/cFajkphs1YLQo=
golang.org/x/net
v0.0.0-20190227160552-c95aed5357e7/go.mod h1:
mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net
v0.0.0-20190227160552-c95aed5357e7/go.mod h1:
mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net
v0.0.0-20190404232315-eb5bcb51f2a3 h1:
0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net
v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:
t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync
v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:
RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync
v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:
RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys
v0.0.0-20180909124046-d0be0721c37e/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20180909124046-d0be0721c37e/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190219092855-153ac476189d/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190219092855-153ac476189d/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190222072716-a9d3bda3a223 h1:
DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys
v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20190412213103-97732733099d h1:
+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys
v0.0.0-20190412213103-97732733099d/go.mod h1:
h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text
v0.3.0/go.mod h1:
NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text
v0.3.0/go.mod h1:
NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools
v0.0.0-20180221164845-07fd8470d635/go.mod h1:
n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools
v0.0.0-20180221164845-07fd8470d635/go.mod h1:
n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/genproto
v0.0.0-20180831171423-11092d34479b/go.mod h1:
JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
gopkg.in/check.v1
v0.0.0-20161208181325-20d25e280405/go.mod h1:
Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1
v0.0.0-20161208181325-20d25e280405/go.mod h1:
Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1
v1.0.0-20180628173108-788fd7840127 h1:
qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1
v1.0.0-20180628173108-788fd7840127 h1:
qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1
v1.0.0-20180628173108-788fd7840127/go.mod h1:
Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1
v1.0.0-20180628173108-788fd7840127/go.mod h1:
Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1
v1.4.7/go.mod h1:
Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/fsnotify.v1
v1.4.7/go.mod h1:
Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1
v1.0.0-20141024135613-dd632973f1e7/go.mod h1:
dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/tomb.v1
v1.0.0-20141024135613-dd632973f1e7/go.mod h1:
dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2
v2.2.1 h1:
mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2
v2.2.1/go.mod h1:
hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2
v2.2.1/go.mod h1:
hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
mock/centralized_client.go
View file @
f5e0203f
...
@@ -6,11 +6,11 @@ import (
...
@@ -6,11 +6,11 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
peer
"github.com/libp2p/go-libp2p-peer"
pstore
"github.com/libp2p/go-libp2p-
peerstore
"
"github.com/libp2p/go-libp2p-
core/peer
"
routing
"github.com/libp2p/go-libp2p-routing"
"github.com/libp2p/go-libp2p-
core/
routing"
ropts
"github.com/libp2p/go-libp2p-
rou
ting/
options
"
"github.com/libp2p/go-libp2p-
tes
ting/
net
"
"github.com/libp2p/go-testutil"
ma
"github.com/multiformats/go-multiaddr"
ma
"github.com/multiformats/go-multiaddr"
)
)
...
@@ -19,37 +19,37 @@ var log = logging.Logger("mockrouter")
...
@@ -19,37 +19,37 @@ var log = logging.Logger("mockrouter")
type
client
struct
{
type
client
struct
{
vs
routing
.
ValueStore
vs
routing
.
ValueStore
server
server
server
server
peer
t
estutil
.
Identity
peer
t
net
.
Identity
}
}
// FIXME(brian): is this method meant to simulate putting a value into the network?
// FIXME(brian): is this method meant to simulate putting a value into the network?
func
(
c
*
client
)
PutValue
(
ctx
context
.
Context
,
key
string
,
val
[]
byte
,
opts
...
ro
pts
.
Option
)
error
{
func
(
c
*
client
)
PutValue
(
ctx
context
.
Context
,
key
string
,
val
[]
byte
,
opts
...
ro
uting
.
Option
)
error
{
log
.
Debugf
(
"PutValue: %s"
,
key
)
log
.
Debugf
(
"PutValue: %s"
,
key
)
return
c
.
vs
.
PutValue
(
ctx
,
key
,
val
,
opts
...
)
return
c
.
vs
.
PutValue
(
ctx
,
key
,
val
,
opts
...
)
}
}
// FIXME(brian): is this method meant to simulate getting a value from the network?
// FIXME(brian): is this method meant to simulate getting a value from the network?
func
(
c
*
client
)
GetValue
(
ctx
context
.
Context
,
key
string
,
opts
...
ro
pts
.
Option
)
([]
byte
,
error
)
{
func
(
c
*
client
)
GetValue
(
ctx
context
.
Context
,
key
string
,
opts
...
ro
uting
.
Option
)
([]
byte
,
error
)
{
log
.
Debugf
(
"GetValue: %s"
,
key
)
log
.
Debugf
(
"GetValue: %s"
,
key
)
return
c
.
vs
.
GetValue
(
ctx
,
key
,
opts
...
)
return
c
.
vs
.
GetValue
(
ctx
,
key
,
opts
...
)
}
}
func
(
c
*
client
)
SearchValue
(
ctx
context
.
Context
,
key
string
,
opts
...
ro
pts
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
func
(
c
*
client
)
SearchValue
(
ctx
context
.
Context
,
key
string
,
opts
...
ro
uting
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
log
.
Debugf
(
"SearchValue: %s"
,
key
)
log
.
Debugf
(
"SearchValue: %s"
,
key
)
return
c
.
vs
.
SearchValue
(
ctx
,
key
,
opts
...
)
return
c
.
vs
.
SearchValue
(
ctx
,
key
,
opts
...
)
}
}
func
(
c
*
client
)
FindProviders
(
ctx
context
.
Context
,
key
cid
.
Cid
)
([]
p
store
.
Pee
rInfo
,
error
)
{
func
(
c
*
client
)
FindProviders
(
ctx
context
.
Context
,
key
cid
.
Cid
)
([]
p
eer
.
Add
rInfo
,
error
)
{
return
c
.
server
.
Providers
(
key
),
nil
return
c
.
server
.
Providers
(
key
),
nil
}
}
func
(
c
*
client
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
p
store
.
Pee
rInfo
,
error
)
{
func
(
c
*
client
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
p
eer
.
Add
rInfo
,
error
)
{
log
.
Debugf
(
"FindPeer: %s"
,
pid
)
log
.
Debugf
(
"FindPeer: %s"
,
pid
)
return
p
store
.
Pee
rInfo
{},
nil
return
p
eer
.
Add
rInfo
{},
nil
}
}
func
(
c
*
client
)
FindProvidersAsync
(
ctx
context
.
Context
,
k
cid
.
Cid
,
max
int
)
<-
chan
p
store
.
Pee
rInfo
{
func
(
c
*
client
)
FindProvidersAsync
(
ctx
context
.
Context
,
k
cid
.
Cid
,
max
int
)
<-
chan
p
eer
.
Add
rInfo
{
out
:=
make
(
chan
p
store
.
Pee
rInfo
)
out
:=
make
(
chan
p
eer
.
Add
rInfo
)
go
func
()
{
go
func
()
{
defer
close
(
out
)
defer
close
(
out
)
for
i
,
p
:=
range
c
.
server
.
Providers
(
k
)
{
for
i
,
p
:=
range
c
.
server
.
Providers
(
k
)
{
...
@@ -72,7 +72,7 @@ func (c *client) Provide(_ context.Context, key cid.Cid, brd bool) error {
...
@@ -72,7 +72,7 @@ func (c *client) Provide(_ context.Context, key cid.Cid, brd bool) error {
if
!
brd
{
if
!
brd
{
return
nil
return
nil
}
}
info
:=
p
store
.
Pee
rInfo
{
info
:=
p
eer
.
Add
rInfo
{
ID
:
c
.
peer
.
ID
(),
ID
:
c
.
peer
.
ID
(),
Addrs
:
[]
ma
.
Multiaddr
{
c
.
peer
.
Address
()},
Addrs
:
[]
ma
.
Multiaddr
{
c
.
peer
.
Address
()},
}
}
...
@@ -87,4 +87,4 @@ func (c *client) Bootstrap(context.Context) error {
...
@@ -87,4 +87,4 @@ func (c *client) Bootstrap(context.Context) error {
return
nil
return
nil
}
}
var
_
routing
.
Ipfs
Routing
=
&
client
{}
var
_
routing
.
Routing
=
&
client
{}
mock/centralized_server.go
View file @
f5e0203f
...
@@ -9,17 +9,17 @@ import (
...
@@ -9,17 +9,17 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
dssync
"github.com/ipfs/go-datastore/sync"
dssync
"github.com/ipfs/go-datastore/sync"
peer
"github.com/libp2p/go-libp2p-peer"
pstore
"github.com/libp2p/go-libp2p-
peerstore
"
"github.com/libp2p/go-libp2p-
core/peer
"
"github.com/libp2p/go-
testutil
"
"github.com/libp2p/go-
libp2p-testing/net
"
offline
"github.com/ipfs/go-ipfs-routing/offline"
offline
"github.com/ipfs/go-ipfs-routing/offline"
)
)
// server is the mockrouting.Client's private interface to the routing server
// server is the mockrouting.Client's private interface to the routing server
type
server
interface
{
type
server
interface
{
Announce
(
p
store
.
Pee
rInfo
,
cid
.
Cid
)
error
Announce
(
p
eer
.
Add
rInfo
,
cid
.
Cid
)
error
Providers
(
cid
.
Cid
)
[]
p
store
.
Pee
rInfo
Providers
(
cid
.
Cid
)
[]
p
eer
.
Add
rInfo
Server
Server
}
}
...
@@ -33,11 +33,11 @@ type s struct {
...
@@ -33,11 +33,11 @@ type s struct {
}
}
type
providerRecord
struct
{
type
providerRecord
struct
{
Peer
p
store
.
Pee
rInfo
Peer
p
eer
.
Add
rInfo
Created
time
.
Time
Created
time
.
Time
}
}
func
(
rs
*
s
)
Announce
(
p
p
store
.
Pee
rInfo
,
c
cid
.
Cid
)
error
{
func
(
rs
*
s
)
Announce
(
p
p
eer
.
Add
rInfo
,
c
cid
.
Cid
)
error
{
rs
.
lock
.
Lock
()
rs
.
lock
.
Lock
()
defer
rs
.
lock
.
Unlock
()
defer
rs
.
lock
.
Unlock
()
...
@@ -54,14 +54,14 @@ func (rs *s) Announce(p pstore.PeerInfo, c cid.Cid) error {
...
@@ -54,14 +54,14 @@ func (rs *s) Announce(p pstore.PeerInfo, c cid.Cid) error {
return
nil
return
nil
}
}
func
(
rs
*
s
)
Providers
(
c
cid
.
Cid
)
[]
p
store
.
Pee
rInfo
{
func
(
rs
*
s
)
Providers
(
c
cid
.
Cid
)
[]
p
eer
.
Add
rInfo
{
rs
.
delayConf
.
Query
.
Wait
()
// before locking
rs
.
delayConf
.
Query
.
Wait
()
// before locking
rs
.
lock
.
RLock
()
rs
.
lock
.
RLock
()
defer
rs
.
lock
.
RUnlock
()
defer
rs
.
lock
.
RUnlock
()
k
:=
c
.
KeyString
()
k
:=
c
.
KeyString
()
var
ret
[]
p
store
.
Pee
rInfo
var
ret
[]
p
eer
.
Add
rInfo
records
,
ok
:=
rs
.
providers
[
k
]
records
,
ok
:=
rs
.
providers
[
k
]
if
!
ok
{
if
!
ok
{
return
ret
return
ret
...
@@ -80,11 +80,11 @@ func (rs *s) Providers(c cid.Cid) []pstore.PeerInfo {
...
@@ -80,11 +80,11 @@ func (rs *s) Providers(c cid.Cid) []pstore.PeerInfo {
return
ret
return
ret
}
}
func
(
rs
*
s
)
Client
(
p
t
estutil
.
Identity
)
Client
{
func
(
rs
*
s
)
Client
(
p
t
net
.
Identity
)
Client
{
return
rs
.
ClientWithDatastore
(
context
.
Background
(),
p
,
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
()))
return
rs
.
ClientWithDatastore
(
context
.
Background
(),
p
,
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
()))
}
}
func
(
rs
*
s
)
ClientWithDatastore
(
_
context
.
Context
,
p
t
estutil
.
Identity
,
datastore
ds
.
Datastore
)
Client
{
func
(
rs
*
s
)
ClientWithDatastore
(
_
context
.
Context
,
p
t
net
.
Identity
,
datastore
ds
.
Datastore
)
Client
{
return
&
client
{
return
&
client
{
peer
:
p
,
peer
:
p
,
vs
:
offline
.
NewOfflineRouter
(
datastore
,
MockValidator
{}),
vs
:
offline
.
NewOfflineRouter
(
datastore
,
MockValidator
{}),
...
...
mock/centralized_test.go
View file @
f5e0203f
...
@@ -8,13 +8,14 @@ import (
...
@@ -8,13 +8,14 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
delay
"github.com/ipfs/go-ipfs-delay"
delay
"github.com/ipfs/go-ipfs-delay"
u
"github.com/ipfs/go-ipfs-util"
u
"github.com/ipfs/go-ipfs-util"
pstore
"github.com/libp2p/go-libp2p-peerstore"
testutil
"github.com/libp2p/go-testutil"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-testing/net"
)
)
func
TestKeyNotFound
(
t
*
testing
.
T
)
{
func
TestKeyNotFound
(
t
*
testing
.
T
)
{
var
pi
=
t
estutil
.
RandIdentityOrFatal
(
t
)
var
pi
=
t
net
.
RandIdentityOrFatal
(
t
)
var
key
=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"mock key"
)))
var
key
=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"mock key"
)))
var
ctx
=
context
.
Background
()
var
ctx
=
context
.
Background
()
...
@@ -27,7 +28,7 @@ func TestKeyNotFound(t *testing.T) {
...
@@ -27,7 +28,7 @@ func TestKeyNotFound(t *testing.T) {
}
}
func
TestClientFindProviders
(
t
*
testing
.
T
)
{
func
TestClientFindProviders
(
t
*
testing
.
T
)
{
pi
:=
t
estutil
.
RandIdentityOrFatal
(
t
)
pi
:=
t
net
.
RandIdentityOrFatal
(
t
)
rs
:=
NewServer
()
rs
:=
NewServer
()
client
:=
rs
.
Client
(
pi
)
client
:=
rs
.
Client
(
pi
)
...
@@ -58,7 +59,7 @@ func TestClientOverMax(t *testing.T) {
...
@@ -58,7 +59,7 @@ func TestClientOverMax(t *testing.T) {
k
:=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"hello"
)))
k
:=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"hello"
)))
numProvidersForHelloKey
:=
100
numProvidersForHelloKey
:=
100
for
i
:=
0
;
i
<
numProvidersForHelloKey
;
i
++
{
for
i
:=
0
;
i
<
numProvidersForHelloKey
;
i
++
{
pi
:=
t
estutil
.
RandIdentityOrFatal
(
t
)
pi
:=
t
net
.
RandIdentityOrFatal
(
t
)
err
:=
rs
.
Client
(
pi
)
.
Provide
(
context
.
Background
(),
k
,
true
)
err
:=
rs
.
Client
(
pi
)
.
Provide
(
context
.
Background
(),
k
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
...
@@ -66,7 +67,7 @@ func TestClientOverMax(t *testing.T) {
...
@@ -66,7 +67,7 @@ func TestClientOverMax(t *testing.T) {
}
}
max
:=
10
max
:=
10
pi
:=
t
estutil
.
RandIdentityOrFatal
(
t
)
pi
:=
t
net
.
RandIdentityOrFatal
(
t
)
client
:=
rs
.
Client
(
pi
)
client
:=
rs
.
Client
(
pi
)
providersFromClient
:=
client
.
FindProvidersAsync
(
context
.
Background
(),
k
,
max
)
providersFromClient
:=
client
.
FindProvidersAsync
(
context
.
Background
(),
k
,
max
)
...
@@ -101,7 +102,7 @@ func TestCanceledContext(t *testing.T) {
...
@@ -101,7 +102,7 @@ func TestCanceledContext(t *testing.T) {
default
:
default
:
}
}
pi
,
err
:=
t
estutil
.
RandIdentity
()
pi
,
err
:=
t
net
.
RandIdentity
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
...
@@ -113,7 +114,7 @@ func TestCanceledContext(t *testing.T) {
...
@@ -113,7 +114,7 @@ func TestCanceledContext(t *testing.T) {
}
}
}()
}()
local
:=
t
estutil
.
RandIdentityOrFatal
(
t
)
local
:=
t
net
.
RandIdentityOrFatal
(
t
)
client
:=
rs
.
Client
(
local
)
client
:=
rs
.
Client
(
local
)
t
.
Log
(
"warning: max is finite so this test is non-deterministic"
)
t
.
Log
(
"warning: max is finite so this test is non-deterministic"
)
...
@@ -141,7 +142,7 @@ func TestValidAfter(t *testing.T) {
...
@@ -141,7 +142,7 @@ func TestValidAfter(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
pi
:=
t
estutil
.
RandIdentityOrFatal
(
t
)
pi
:=
t
net
.
RandIdentityOrFatal
(
t
)
key
:=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"mock key"
)))
key
:=
cid
.
NewCidV0
(
u
.
Hash
([]
byte
(
"mock key"
)))
conf
:=
DelayConfig
{
conf
:=
DelayConfig
{
ValueVisibility
:
delay
.
Fixed
(
1
*
time
.
Hour
),
ValueVisibility
:
delay
.
Fixed
(
1
*
time
.
Hour
),
...
@@ -152,7 +153,7 @@ func TestValidAfter(t *testing.T) {
...
@@ -152,7 +153,7 @@ func TestValidAfter(t *testing.T) {
rs
.
Client
(
pi
)
.
Provide
(
ctx
,
key
,
true
)
rs
.
Client
(
pi
)
.
Provide
(
ctx
,
key
,
true
)
var
providers
[]
p
store
.
Pee
rInfo
var
providers
[]
p
eer
.
Add
rInfo
max
:=
100
max
:=
100
providersChan
:=
rs
.
Client
(
pi
)
.
FindProvidersAsync
(
ctx
,
key
,
max
)
providersChan
:=
rs
.
Client
(
pi
)
.
FindProvidersAsync
(
ctx
,
key
,
max
)
for
p
:=
range
providersChan
{
for
p
:=
range
providersChan
{
...
...
mock/interface.go
View file @
f5e0203f
// Package mockrouting provides a virtual routing server. To use it,
// Package mockrouting provides a virtual routing server. To use it,
// create a virtual routing server and use the Client() method to get a
// create a virtual routing server and use the Client() method to get a
// routing client (
Ipfs
Routing). The server quacks like a DHT but is
// routing client (Routing). The server quacks like a DHT but is
// really a local in-memory hash table.
// really a local in-memory hash table.
package
mockrouting
package
mockrouting
...
@@ -9,9 +9,10 @@ import (
...
@@ -9,9 +9,10 @@ import (
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
delay
"github.com/ipfs/go-ipfs-delay"
delay
"github.com/ipfs/go-ipfs-delay"
peer
"github.com/libp2p/go-libp2p-peer"
routing
"github.com/libp2p/go-libp2p-routing"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-testutil"
"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p-testing/net"
)
)
// MockValidator is a record validator that always returns success.
// MockValidator is a record validator that always returns success.
...
@@ -22,13 +23,13 @@ func (MockValidator) Select(_ string, _ [][]byte) (int, error) { return 0, nil }
...
@@ -22,13 +23,13 @@ func (MockValidator) Select(_ string, _ [][]byte) (int, error) { return 0, nil }
// Server provides mockrouting Clients
// Server provides mockrouting Clients
type
Server
interface
{
type
Server
interface
{
Client
(
p
t
estutil
.
Identity
)
Client
Client
(
p
t
net
.
Identity
)
Client
ClientWithDatastore
(
context
.
Context
,
t
estutil
.
Identity
,
ds
.
Datastore
)
Client
ClientWithDatastore
(
context
.
Context
,
t
net
.
Identity
,
ds
.
Datastore
)
Client
}
}
// Client implements
Ipfs
Routing
// Client implements Routing
type
Client
interface
{
type
Client
interface
{
routing
.
Ipfs
Routing
routing
.
Routing
}
}
// NewServer returns a mockrouting Server
// NewServer returns a mockrouting Server
...
...
none/none_client.go
View file @
f5e0203f
...
@@ -7,35 +7,35 @@ import (
...
@@ -7,35 +7,35 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
p2phost
"github.com/libp2p/go-libp2p-host"
peer
"github.com/libp2p/go-libp2p-peer"
"github.com/libp2p/go-libp2p-core/host"
pstore
"github.com/libp2p/go-libp2p-peerstore"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"
record
"github.com/libp2p/go-libp2p-record"
record
"github.com/libp2p/go-libp2p-record"
routing
"github.com/libp2p/go-libp2p-routing"
ropts
"github.com/libp2p/go-libp2p-routing/options"
)
)
type
nilclient
struct
{
type
nilclient
struct
{
}
}
func
(
c
*
nilclient
)
PutValue
(
_
context
.
Context
,
_
string
,
_
[]
byte
,
_
...
ro
pts
.
Option
)
error
{
func
(
c
*
nilclient
)
PutValue
(
_
context
.
Context
,
_
string
,
_
[]
byte
,
_
...
ro
uting
.
Option
)
error
{
return
nil
return
nil
}
}
func
(
c
*
nilclient
)
GetValue
(
_
context
.
Context
,
_
string
,
_
...
ro
pts
.
Option
)
([]
byte
,
error
)
{
func
(
c
*
nilclient
)
GetValue
(
_
context
.
Context
,
_
string
,
_
...
ro
uting
.
Option
)
([]
byte
,
error
)
{
return
nil
,
errors
.
New
(
"tried GetValue from nil routing"
)
return
nil
,
errors
.
New
(
"tried GetValue from nil routing"
)
}
}
func
(
c
*
nilclient
)
SearchValue
(
_
context
.
Context
,
_
string
,
_
...
ro
pts
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
func
(
c
*
nilclient
)
SearchValue
(
_
context
.
Context
,
_
string
,
_
...
ro
uting
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
return
nil
,
errors
.
New
(
"tried SearchValue from nil routing"
)
return
nil
,
errors
.
New
(
"tried SearchValue from nil routing"
)
}
}
func
(
c
*
nilclient
)
FindPeer
(
_
context
.
Context
,
_
peer
.
ID
)
(
p
store
.
Pee
rInfo
,
error
)
{
func
(
c
*
nilclient
)
FindPeer
(
_
context
.
Context
,
_
peer
.
ID
)
(
p
eer
.
Add
rInfo
,
error
)
{
return
p
store
.
Pee
rInfo
{},
nil
return
p
eer
.
Add
rInfo
{},
nil
}
}
func
(
c
*
nilclient
)
FindProvidersAsync
(
_
context
.
Context
,
_
cid
.
Cid
,
_
int
)
<-
chan
p
store
.
Pee
rInfo
{
func
(
c
*
nilclient
)
FindProvidersAsync
(
_
context
.
Context
,
_
cid
.
Cid
,
_
int
)
<-
chan
p
eer
.
Add
rInfo
{
out
:=
make
(
chan
p
store
.
Pee
rInfo
)
out
:=
make
(
chan
p
eer
.
Add
rInfo
)
defer
close
(
out
)
defer
close
(
out
)
return
out
return
out
}
}
...
@@ -48,10 +48,10 @@ func (c *nilclient) Bootstrap(_ context.Context) error {
...
@@ -48,10 +48,10 @@ func (c *nilclient) Bootstrap(_ context.Context) error {
return
nil
return
nil
}
}
// ConstructNilRouting creates an
Ipfs
Routing client which does nothing.
// ConstructNilRouting creates an Routing client which does nothing.
func
ConstructNilRouting
(
_
context
.
Context
,
_
p2p
host
.
Host
,
_
ds
.
Batching
,
_
record
.
Validator
)
(
routing
.
Ipfs
Routing
,
error
)
{
func
ConstructNilRouting
(
_
context
.
Context
,
_
host
.
Host
,
_
ds
.
Batching
,
_
record
.
Validator
)
(
routing
.
Routing
,
error
)
{
return
&
nilclient
{},
nil
return
&
nilclient
{},
nil
}
}
// ensure nilclient satisfies interface
// ensure nilclient satisfies interface
var
_
routing
.
Ipfs
Routing
=
&
nilclient
{}
var
_
routing
.
Routing
=
&
nilclient
{}
offline/offline.go
View file @
f5e0203f
// Package offline implements
Ipfs
Routing with a client which
// Package offline implements Routing with a client which
// is only able to perform offline operations.
// is only able to perform offline operations.
package
offline
package
offline
...
@@ -12,29 +12,29 @@ import (
...
@@ -12,29 +12,29 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
dshelp
"github.com/ipfs/go-ipfs-ds-help"
dshelp
"github.com/ipfs/go-ipfs-ds-help"
"github.com/libp2p/go-libp2p-peer"
pstore
"github.com/libp2p/go-libp2p-peerstore"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"
record
"github.com/libp2p/go-libp2p-record"
record
"github.com/libp2p/go-libp2p-record"
pb
"github.com/libp2p/go-libp2p-record/pb"
pb
"github.com/libp2p/go-libp2p-record/pb"
routing
"github.com/libp2p/go-libp2p-routing"
ropts
"github.com/libp2p/go-libp2p-routing/options"
)
)
// ErrOffline is returned when trying to perform operations that
// ErrOffline is returned when trying to perform operations that
// require connectivity.
// require connectivity.
var
ErrOffline
=
errors
.
New
(
"routing system in offline mode"
)
var
ErrOffline
=
errors
.
New
(
"routing system in offline mode"
)
// NewOfflineRouter returns an
Ipfs
Routing implementation which only performs
// NewOfflineRouter returns an Routing implementation which only performs
// offline operations. It allows to Put and Get signed dht
// offline operations. It allows to Put and Get signed dht
// records to and from the local datastore.
// records to and from the local datastore.
func
NewOfflineRouter
(
dstore
ds
.
Datastore
,
validator
record
.
Validator
)
routing
.
Ipfs
Routing
{
func
NewOfflineRouter
(
dstore
ds
.
Datastore
,
validator
record
.
Validator
)
routing
.
Routing
{
return
&
offlineRouting
{
return
&
offlineRouting
{
datastore
:
dstore
,
datastore
:
dstore
,
validator
:
validator
,
validator
:
validator
,
}
}
}
}
// offlineRouting implements the
Ipfs
Routing interface,
// offlineRouting implements the Routing interface,
// but only provides the capability to Put and Get signed dht
// but only provides the capability to Put and Get signed dht
// records to and from the local datastore.
// records to and from the local datastore.
type
offlineRouting
struct
{
type
offlineRouting
struct
{
...
@@ -42,7 +42,7 @@ type offlineRouting struct {
...
@@ -42,7 +42,7 @@ type offlineRouting struct {
validator
record
.
Validator
validator
record
.
Validator
}
}
func
(
c
*
offlineRouting
)
PutValue
(
ctx
context
.
Context
,
key
string
,
val
[]
byte
,
_
...
ro
pts
.
Option
)
error
{
func
(
c
*
offlineRouting
)
PutValue
(
ctx
context
.
Context
,
key
string
,
val
[]
byte
,
_
...
ro
uting
.
Option
)
error
{
if
err
:=
c
.
validator
.
Validate
(
key
,
val
);
err
!=
nil
{
if
err
:=
c
.
validator
.
Validate
(
key
,
val
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -70,7 +70,7 @@ func (c *offlineRouting) PutValue(ctx context.Context, key string, val []byte, _
...
@@ -70,7 +70,7 @@ func (c *offlineRouting) PutValue(ctx context.Context, key string, val []byte, _
return
c
.
datastore
.
Put
(
dshelp
.
NewKeyFromBinary
([]
byte
(
key
)),
data
)
return
c
.
datastore
.
Put
(
dshelp
.
NewKeyFromBinary
([]
byte
(
key
)),
data
)
}
}
func
(
c
*
offlineRouting
)
GetValue
(
ctx
context
.
Context
,
key
string
,
_
...
ro
pts
.
Option
)
([]
byte
,
error
)
{
func
(
c
*
offlineRouting
)
GetValue
(
ctx
context
.
Context
,
key
string
,
_
...
ro
uting
.
Option
)
([]
byte
,
error
)
{
buf
,
err
:=
c
.
datastore
.
Get
(
dshelp
.
NewKeyFromBinary
([]
byte
(
key
)))
buf
,
err
:=
c
.
datastore
.
Get
(
dshelp
.
NewKeyFromBinary
([]
byte
(
key
)))
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -90,7 +90,7 @@ func (c *offlineRouting) GetValue(ctx context.Context, key string, _ ...ropts.Op
...
@@ -90,7 +90,7 @@ func (c *offlineRouting) GetValue(ctx context.Context, key string, _ ...ropts.Op
return
val
,
nil
return
val
,
nil
}
}
func
(
c
*
offlineRouting
)
SearchValue
(
ctx
context
.
Context
,
key
string
,
_
...
ro
pts
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
func
(
c
*
offlineRouting
)
SearchValue
(
ctx
context
.
Context
,
key
string
,
_
...
ro
uting
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
out
:=
make
(
chan
[]
byte
,
1
)
out
:=
make
(
chan
[]
byte
,
1
)
go
func
()
{
go
func
()
{
defer
close
(
out
)
defer
close
(
out
)
...
@@ -102,12 +102,12 @@ func (c *offlineRouting) SearchValue(ctx context.Context, key string, _ ...ropts
...
@@ -102,12 +102,12 @@ func (c *offlineRouting) SearchValue(ctx context.Context, key string, _ ...ropts
return
out
,
nil
return
out
,
nil
}
}
func
(
c
*
offlineRouting
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
p
store
.
Pee
rInfo
,
error
)
{
func
(
c
*
offlineRouting
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
p
eer
.
Add
rInfo
,
error
)
{
return
p
store
.
Pee
rInfo
{},
ErrOffline
return
p
eer
.
Add
rInfo
{},
ErrOffline
}
}
func
(
c
*
offlineRouting
)
FindProvidersAsync
(
ctx
context
.
Context
,
k
cid
.
Cid
,
max
int
)
<-
chan
p
store
.
Pee
rInfo
{
func
(
c
*
offlineRouting
)
FindProvidersAsync
(
ctx
context
.
Context
,
k
cid
.
Cid
,
max
int
)
<-
chan
p
eer
.
Add
rInfo
{
out
:=
make
(
chan
p
store
.
Pee
rInfo
)
out
:=
make
(
chan
p
eer
.
Add
rInfo
)
close
(
out
)
close
(
out
)
return
out
return
out
}
}
...
@@ -124,5 +124,5 @@ func (c *offlineRouting) Bootstrap(context.Context) error {
...
@@ -124,5 +124,5 @@ func (c *offlineRouting) Bootstrap(context.Context) error {
return
nil
return
nil
}
}
// ensure offlineRouting matches the
Ipfs
Routing interface
// ensure offlineRouting matches the Routing interface
var
_
routing
.
Ipfs
Routing
=
&
offlineRouting
{}
var
_
routing
.
Routing
=
&
offlineRouting
{}
offline/offline_test.go
View file @
f5e0203f
...
@@ -7,8 +7,10 @@ import (
...
@@ -7,8 +7,10 @@ import (
cid
"github.com/ipfs/go-cid"
cid
"github.com/ipfs/go-cid"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
ropt
"github.com/libp2p/go-libp2p-routing/options"
testutil
"github.com/libp2p/go-testutil"
"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p-core/test"
mh
"github.com/multiformats/go-multihash"
mh
"github.com/multiformats/go-multihash"
)
)
...
@@ -40,12 +42,12 @@ func TestOfflineRouterStorage(t *testing.T) {
...
@@ -40,12 +42,12 @@ func TestOfflineRouterStorage(t *testing.T) {
t
.
Fatal
(
"Router should throw errors for unfound records"
)
t
.
Fatal
(
"Router should throw errors for unfound records"
)
}
}
local
,
err
:=
offline
.
GetValue
(
ctx
,
"key"
,
ro
pt
.
Offline
)
local
,
err
:=
offline
.
GetValue
(
ctx
,
"key"
,
ro
uting
.
Offline
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
_
,
err
=
offline
.
GetValue
(
ctx
,
"notHere"
,
ro
pt
.
Offline
)
_
,
err
=
offline
.
GetValue
(
ctx
,
"notHere"
,
ro
uting
.
Offline
)
if
err
==
nil
{
if
err
==
nil
{
t
.
Fatal
(
"Router should throw errors for unfound records"
)
t
.
Fatal
(
"Router should throw errors for unfound records"
)
}
}
...
@@ -61,7 +63,7 @@ func TestOfflineRouterLocal(t *testing.T) {
...
@@ -61,7 +63,7 @@ func TestOfflineRouterLocal(t *testing.T) {
nds
:=
ds
.
NewMapDatastore
()
nds
:=
ds
.
NewMapDatastore
()
offline
:=
NewOfflineRouter
(
nds
,
blankValidator
{})
offline
:=
NewOfflineRouter
(
nds
,
blankValidator
{})
id
,
_
:=
test
util
.
RandPeerID
()
id
,
_
:=
test
.
RandPeerID
()
_
,
err
:=
offline
.
FindPeer
(
ctx
,
id
)
_
,
err
:=
offline
.
FindPeer
(
ctx
,
id
)
if
err
!=
ErrOffline
{
if
err
!=
ErrOffline
{
t
.
Fatal
(
"OfflineRouting should alert that its offline"
)
t
.
Fatal
(
"OfflineRouting should alert that its offline"
)
...
...
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