From fe8846fcd75bb576f2302973cb4110f73450b937 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 24 Jan 2018 15:55:28 -0800 Subject: [PATCH 01/25] gx: mass update License: MIT Signed-off-by: Steven Allen --- assets/assets.go | 2 +- blocks/blockstore/arc_cache.go | 6 +- blocks/blockstore/arc_cache_test.go | 8 +- blocks/blockstore/blockstore.go | 10 +- blocks/blockstore/blockstore_test.go | 12 +- blocks/blockstore/bloom_cache.go | 4 +- blocks/blockstore/bloom_cache_test.go | 8 +- blocks/blockstore/util/remove.go | 4 +- blocks/blocksutil/block_generator.go | 2 +- blockservice/blockservice.go | 4 +- blockservice/blockservice_test.go | 6 +- blockservice/test/blocks_test.go | 10 +- cmd/ipfs/daemon.go | 8 +- cmd/ipfs/ipfs.go | 2 +- cmd/ipfs/main.go | 14 +- cmd/seccat/seccat.go | 6 +- commands/command.go | 2 +- commands/command_test.go | 2 +- commands/legacy/command.go | 2 +- commands/legacy/legacy.go | 2 +- commands/legacy/legacy_test.go | 2 +- commands/legacy/request.go | 2 +- commands/legacy/response.go | 2 +- commands/request.go | 4 +- commands/response.go | 2 +- commands/response_test.go | 2 +- core/bootstrap.go | 10 +- core/bootstrap_test.go | 4 +- core/builder.go | 10 +- core/commands/add.go | 4 +- core/commands/bitswap.go | 6 +- core/commands/block.go | 8 +- core/commands/cat.go | 2 +- core/commands/commands.go | 2 +- core/commands/commands_test.go | 2 +- core/commands/dag/dag.go | 4 +- core/commands/dht.go | 12 +- core/commands/dht_test.go | 2 +- core/commands/files/files.go | 6 +- core/commands/filestore.go | 4 +- core/commands/get.go | 2 +- core/commands/get_test.go | 2 +- core/commands/helptext_test.go | 2 +- core/commands/id.go | 8 +- core/commands/keystore.go | 2 +- core/commands/ls.go | 2 +- core/commands/object/object.go | 4 +- core/commands/p2p.go | 2 +- core/commands/pin.go | 4 +- core/commands/ping.go | 8 +- core/commands/publish.go | 2 +- core/commands/pubsub.go | 10 +- core/commands/refs.go | 4 +- core/commands/repo.go | 4 +- core/commands/root.go | 2 +- core/commands/stat.go | 6 +- core/commands/swarm.go | 8 +- core/commands/sysdiag.go | 2 +- core/core.go | 48 ++--- core/coreapi/coreapi.go | 2 +- core/coreapi/dag.go | 2 +- core/coreapi/dag_test.go | 2 +- core/coreapi/interface/interface.go | 4 +- core/coreapi/interface/options/dag.go | 2 +- core/coreapi/key.go | 2 +- core/coreapi/name.go | 2 +- core/coreapi/unixfs.go | 4 +- core/coreapi/unixfs_test.go | 4 +- core/coredag/cbor.go | 4 +- core/coredag/dagpb.go | 6 +- core/coredag/dagtransl.go | 2 +- core/coredag/raw.go | 8 +- core/corehttp/commands.go | 4 +- core/corehttp/corehttp.go | 4 +- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_handler.go | 8 +- core/corehttp/gateway_test.go | 2 +- core/corehttp/metrics_test.go | 6 +- core/corerepo/gc.go | 2 +- core/corerepo/pinning.go | 2 +- core/coreunix/add.go | 8 +- core/coreunix/add_test.go | 4 +- core/coreunix/metadata.go | 2 +- core/coreunix/metadata_test.go | 8 +- core/mock/mock.go | 14 +- core/pathresolver.go | 4 +- exchange/bitswap/bitswap.go | 6 +- exchange/bitswap/bitswap_test.go | 10 +- exchange/bitswap/decision/bench_test.go | 8 +- exchange/bitswap/decision/engine.go | 4 +- exchange/bitswap/decision/engine_test.go | 10 +- exchange/bitswap/decision/ledger.go | 4 +- .../bitswap/decision/peer_request_queue.go | 4 +- .../decision/peer_request_queue_test.go | 6 +- exchange/bitswap/get.go | 4 +- exchange/bitswap/message/message.go | 6 +- exchange/bitswap/message/message_test.go | 6 +- exchange/bitswap/network/interface.go | 6 +- exchange/bitswap/network/ipfs_impl.go | 16 +- .../bitswap/notifications/notifications.go | 4 +- .../notifications/notifications_test.go | 4 +- exchange/bitswap/session.go | 8 +- exchange/bitswap/session_test.go | 4 +- exchange/bitswap/stat.go | 2 +- exchange/bitswap/testnet/interface.go | 4 +- exchange/bitswap/testnet/network_test.go | 6 +- exchange/bitswap/testnet/peernet.go | 8 +- exchange/bitswap/testnet/virtual.go | 10 +- exchange/bitswap/testutils.go | 10 +- exchange/bitswap/wantlist/wantlist.go | 2 +- exchange/bitswap/wantlist/wantlist_test.go | 2 +- exchange/bitswap/wantmanager.go | 4 +- exchange/bitswap/workers.go | 4 +- exchange/interface.go | 4 +- exchange/offline/offline.go | 4 +- exchange/offline/offline_test.go | 10 +- exchange/reprovide/providers.go | 2 +- exchange/reprovide/reprovide.go | 4 +- exchange/reprovide/reprovide_test.go | 10 +- filestore/filestore.go | 6 +- filestore/filestore_test.go | 4 +- filestore/fsrefstore.go | 10 +- filestore/util.go | 6 +- fuse/ipns/ipns_test.go | 4 +- fuse/ipns/ipns_unix.go | 4 +- fuse/node/mount_test.go | 2 +- fuse/readonly/ipfs_test.go | 6 +- fuse/readonly/readonly_unix.go | 4 +- importer/balanced/balanced_test.go | 2 +- importer/balanced/builder.go | 2 +- importer/chunk/rabin_test.go | 4 +- importer/chunk/splitting_test.go | 2 +- importer/helpers/dagbuilder.go | 4 +- importer/helpers/helpers.go | 4 +- importer/importer.go | 2 +- importer/importer_test.go | 4 +- importer/trickle/trickle_test.go | 2 +- importer/trickle/trickledag.go | 4 +- merkledag/batch.go | 6 +- merkledag/coding.go | 6 +- merkledag/merkledag.go | 6 +- merkledag/merkledag_test.go | 8 +- merkledag/node.go | 6 +- merkledag/node_test.go | 2 +- merkledag/raw.go | 8 +- merkledag/test/utils.go | 4 +- merkledag/traverse/traverse.go | 2 +- merkledag/traverse/traverse_test.go | 2 +- merkledag/utils/diff.go | 4 +- merkledag/utils/diffenum.go | 4 +- merkledag/utils/diffenum_test.go | 4 +- merkledag/utils/utils.go | 6 +- merkledag/utils/utils_test.go | 2 +- mfs/dir.go | 4 +- mfs/file.go | 2 +- mfs/mfs_test.go | 10 +- mfs/ops.go | 4 +- mfs/repub_test.go | 4 +- mfs/system.go | 4 +- namesys/ipns_select_test.go | 2 +- namesys/namesys.go | 12 +- namesys/namesys_test.go | 4 +- namesys/publisher.go | 12 +- namesys/publisher_test.go | 10 +- namesys/pubsub.go | 24 +-- namesys/pubsub_test.go | 18 +- namesys/republisher/repub.go | 8 +- namesys/republisher/repub_test.go | 4 +- namesys/resolve_test.go | 8 +- namesys/routing.go | 8 +- p2p/p2p.go | 12 +- p2p/registry.go | 8 +- package.json | 188 +++++++++--------- path/path.go | 2 +- path/resolver.go | 4 +- path/resolver_test.go | 4 +- pin/gc/gc.go | 4 +- pin/pin.go | 6 +- pin/pin_test.go | 8 +- pin/set.go | 4 +- pin/set_test.go | 6 +- plugin/ipld.go | 2 +- plugin/loader/initializer.go | 2 +- plugin/plugins/git/git.go | 8 +- repo/config/bootstrap_peers.go | 2 +- repo/config/init.go | 2 +- repo/fsrepo/datastores.go | 12 +- repo/fsrepo/fsrepo.go | 6 +- repo/fsrepo/fsrepo_test.go | 2 +- repo/fsrepo/lock/lock.go | 2 +- repo/fsrepo/serialize/serialize.go | 2 +- repo/mock.go | 2 +- repo/repo.go | 4 +- routing/mock/centralized_client.go | 18 +- routing/mock/centralized_server.go | 12 +- routing/mock/centralized_test.go | 8 +- routing/mock/interface.go | 8 +- routing/none/none_client.go | 10 +- routing/offline/offline.go | 14 +- routing/offline/offline_test.go | 4 +- tar/format.go | 2 +- test/dependencies/ma-pipe-unidir/main.go | 4 +- test/integration/addcat_test.go | 6 +- test/integration/bench_cat_test.go | 6 +- test/integration/bench_test.go | 2 +- test/integration/bitswap_wo_routing_test.go | 6 +- test/integration/three_legged_cat_test.go | 6 +- thirdparty/datastore2/datastore_closer.go | 4 +- thirdparty/datastore2/delayed.go | 4 +- thirdparty/datastore2/threadsafe.go | 2 +- thirdparty/ds-help/key.go | 4 +- thirdparty/pollEndpoint/main.go | 4 +- thirdparty/posinfo/posinfo.go | 2 +- unixfs/archive/archive.go | 2 +- unixfs/archive/tar/writer.go | 2 +- unixfs/hamt/hamt.go | 4 +- unixfs/io/dagreader.go | 2 +- unixfs/io/dirbuilder.go | 4 +- unixfs/io/pbdagreader.go | 4 +- unixfs/io/resolve.go | 2 +- unixfs/mod/dagmodifier.go | 4 +- unixfs/mod/dagmodifier_test.go | 2 +- unixfs/test/utils.go | 8 +- 223 files changed, 686 insertions(+), 686 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index 818e8fa436c..0515ec8ff67 100644 --- a/assets/assets.go +++ b/assets/assets.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/coreunix" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmdZ4PvPHFQVLLEve7DgoKDcSY19wwpGBB1GKjjKi2rEL1/dir-index-html" diff --git a/blocks/blockstore/arc_cache.go b/blocks/blockstore/arc_cache.go index da3b6d7a2f0..e403bb96c24 100644 --- a/blocks/blockstore/arc_cache.go +++ b/blocks/blockstore/arc_cache.go @@ -3,12 +3,12 @@ package blockstore import ( "context" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // arccache wraps a BlockStore with an Adaptive Replacement Cache (ARC) for diff --git a/blocks/blockstore/arc_cache_test.go b/blocks/blockstore/arc_cache_test.go index 734f1e73dde..5a160d72b03 100644 --- a/blocks/blockstore/arc_cache_test.go +++ b/blocks/blockstore/arc_cache_test.go @@ -4,11 +4,11 @@ import ( "context" "testing" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - syncds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var exampleBlock = blocks.NewBlock([]byte("foo")) diff --git a/blocks/blockstore/blockstore.go b/blocks/blockstore/blockstore.go index 946b1d69cf3..5a37560c5d1 100644 --- a/blocks/blockstore/blockstore.go +++ b/blocks/blockstore/blockstore.go @@ -9,13 +9,13 @@ import ( "sync/atomic" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsns "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/namespace" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsns "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/namespace" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var log = logging.Logger("blockstore") diff --git a/blocks/blockstore/blockstore_test.go b/blocks/blockstore/blockstore_test.go index 31e75acf65f..2b0366096c6 100644 --- a/blocks/blockstore/blockstore_test.go +++ b/blocks/blockstore/blockstore_test.go @@ -7,13 +7,13 @@ import ( "testing" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - ds_sync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" + ds_sync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func TestGetWhenKeyNotPresent(t *testing.T) { diff --git a/blocks/blockstore/bloom_cache.go b/blocks/blockstore/bloom_cache.go index b06f56c1153..5c2366207b2 100644 --- a/blocks/blockstore/bloom_cache.go +++ b/blocks/blockstore/bloom_cache.go @@ -5,11 +5,11 @@ import ( "sync/atomic" "time" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" bloom "gx/ipfs/QmXqKGu7QzfRzFC4yd5aL9sThYx22vY163VGwmxfp5qGHk/bbloom" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // bloomCached returns a Blockstore that caches Has requests using a Bloom diff --git a/blocks/blockstore/bloom_cache_test.go b/blocks/blockstore/bloom_cache_test.go index f2f1666fee5..a0385a99c43 100644 --- a/blocks/blockstore/bloom_cache_test.go +++ b/blocks/blockstore/bloom_cache_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" context "context" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - syncds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" + syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" ) func testBloomCached(ctx context.Context, bs Blockstore) (*bloomcache, error) { diff --git a/blocks/blockstore/util/remove.go b/blocks/blockstore/util/remove.go index 94b52254eaa..0ce2b3feabb 100644 --- a/blocks/blockstore/util/remove.go +++ b/blocks/blockstore/util/remove.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" bs "github.com/ipfs/go-ipfs/blocks/blockstore" "github.com/ipfs/go-ipfs/pin" diff --git a/blocks/blocksutil/block_generator.go b/blocks/blocksutil/block_generator.go index 9510c2dc80f..1161fa82000 100644 --- a/blocks/blocksutil/block_generator.go +++ b/blocks/blocksutil/block_generator.go @@ -2,7 +2,7 @@ // with Blocks. package blocksutil -import "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" +import "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" // NewBlockGenerator returns an object capable of // producing blocks. diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 65d98c8d9dc..73882260541 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -13,8 +13,8 @@ import ( bitswap "github.com/ipfs/go-ipfs/exchange/bitswap" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) var log = logging.Logger("blockservice") diff --git a/blockservice/blockservice_test.go b/blockservice/blockservice_test.go index 00d9ccabff9..c7ed02dc011 100644 --- a/blockservice/blockservice_test.go +++ b/blockservice/blockservice_test.go @@ -6,10 +6,10 @@ import ( "github.com/ipfs/go-ipfs/blocks/blockstore" butil "github.com/ipfs/go-ipfs/blocks/blocksutil" offline "github.com/ipfs/go-ipfs/exchange/offline" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" ) func TestWriteThroughWorks(t *testing.T) { diff --git a/blockservice/test/blocks_test.go b/blockservice/test/blocks_test.go index da54461d6df..965327dae32 100644 --- a/blockservice/test/blocks_test.go +++ b/blockservice/test/blocks_test.go @@ -10,12 +10,12 @@ import ( blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" . "github.com/ipfs/go-ipfs/blockservice" offline "github.com/ipfs/go-ipfs/exchange/offline" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func newObject(data []byte) blocks.Block { diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 97007b1f418..77c92145717 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -21,13 +21,13 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" - "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" + "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" mprome "gx/ipfs/QmSk46nSD78YiuNojYMS8NW6hSCjH95JajqqzzoychZgef/go-metrics-prometheus" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" "gx/ipfs/QmX3QZ5jHEPidwUrymXV1iSCSUhdGxj15sm2gP4jKMef7B/client_golang/prometheus" + iconn "gx/ipfs/Qmamsg8biD9P9CkvWGPUkWtJZNfyeHcWu2uztXkknd3frd/go-libp2p-interface-conn" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - iconn "gx/ipfs/Qmf82zCaYV8bkztRRoGwwSHVkaYtP2UKBnhpjJz1uFGJjQ/go-libp2p-interface-conn" ) const ( diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index be692f2f149..05112f8a619 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -6,7 +6,7 @@ import ( commands "github.com/ipfs/go-ipfs/core/commands" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" ) // This is the CLI root, used for executing commands accessible to CLI clients. diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 7b8b68b6ccd..d9eff8921ca 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -27,15 +27,15 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - loggables "gx/ipfs/QmSvcDkiRwB8LuMhUtnvhum2C851Mproo75ZDD19jx43tD/go-libp2p-loggables" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds/cli" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds/http" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper" + loggables "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/cli" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/http" ) // log is the command logger diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index 174cc0a0279..c73cdca948e 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -20,10 +20,10 @@ import ( "syscall" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + secio "gx/ipfs/QmZse3zsaZiyaAXaZ9RHgMGAgJqUDKN919gSC4kmNBcVne/go-libp2p-secio" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - secio "gx/ipfs/QmcfPte5kiCnjKVYELbDdHpuzh4avabCbg2WBjzXcHGTHN/go-libp2p-secio" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) var verbose = false diff --git a/commands/command.go b/commands/command.go index 383e6aedfb5..49d9a4e490b 100644 --- a/commands/command.go +++ b/commands/command.go @@ -17,7 +17,7 @@ import ( "github.com/ipfs/go-ipfs/path" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/command_test.go b/commands/command_test.go index f74f0e0beb4..52165c10507 100644 --- a/commands/command_test.go +++ b/commands/command_test.go @@ -3,7 +3,7 @@ package commands import ( "testing" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/legacy/command.go b/commands/legacy/command.go index 2196cb6f08c..0485472a50d 100644 --- a/commands/legacy/command.go +++ b/commands/legacy/command.go @@ -3,7 +3,7 @@ package legacy import ( "io" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" diff --git a/commands/legacy/legacy.go b/commands/legacy/legacy.go index 513c16496e6..8a5f290ab3d 100644 --- a/commands/legacy/legacy.go +++ b/commands/legacy/legacy.go @@ -4,7 +4,7 @@ import ( "io" "runtime/debug" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" ) diff --git a/commands/legacy/legacy_test.go b/commands/legacy/legacy_test.go index 8cfc51761a8..d7bd081852d 100644 --- a/commands/legacy/legacy_test.go +++ b/commands/legacy/legacy_test.go @@ -7,7 +7,7 @@ import ( "testing" oldcmds "github.com/ipfs/go-ipfs/commands" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/legacy/request.go b/commands/legacy/request.go index a887e4ae221..9deb42115a2 100644 --- a/commands/legacy/request.go +++ b/commands/legacy/request.go @@ -7,7 +7,7 @@ import ( "os" "reflect" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" diff --git a/commands/legacy/response.go b/commands/legacy/response.go index 481e1ff2c7b..cd45267eda2 100644 --- a/commands/legacy/response.go +++ b/commands/legacy/response.go @@ -7,7 +7,7 @@ import ( "reflect" "sync" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" oldcmds "github.com/ipfs/go-ipfs/commands" diff --git a/commands/request.go b/commands/request.go index 018e8469f32..ae580bbd655 100644 --- a/commands/request.go +++ b/commands/request.go @@ -14,9 +14,9 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/repo/config" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" ) diff --git a/commands/response.go b/commands/response.go index f01cb0d75b6..bc4be90725d 100644 --- a/commands/response.go +++ b/commands/response.go @@ -9,7 +9,7 @@ import ( "os" "strings" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/response_test.go b/commands/response_test.go index c65bd3572f9..510e36f295d 100644 --- a/commands/response_test.go +++ b/commands/response_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/bootstrap.go b/core/bootstrap.go index 6994168a531..367b1900b03 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -11,15 +11,15 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" math2 "github.com/ipfs/go-ipfs/thirdparty/math2" - lgbl "gx/ipfs/QmSvcDkiRwB8LuMhUtnvhum2C851Mproo75ZDD19jx43tD/go-libp2p-loggables" + lgbl "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" - host "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" + inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" periodicproc "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/periodic" - inet "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + host "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) // ErrNotEnoughBootstrapPeers signals that we do not have enough bootstrap diff --git a/core/bootstrap_test.go b/core/bootstrap_test.go index 1b9083dd343..1a684d5685e 100644 --- a/core/bootstrap_test.go +++ b/core/bootstrap_test.go @@ -5,8 +5,8 @@ import ( "testing" config "github.com/ipfs/go-ipfs/repo/config" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { diff --git a/core/builder.go b/core/builder.go index fd64349d197..80b6b3b5730 100644 --- a/core/builder.go +++ b/core/builder.go @@ -20,14 +20,14 @@ import ( cfg "github.com/ipfs/go-ipfs/repo/config" uio "github.com/ipfs/go-ipfs/unixfs/io" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" - retry "gx/ipfs/QmTLGdJpFxjNTGqBkwTyhN3WeJteSjQPACmyxDjJ49V5NM/retry-datastore" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + retry "gx/ipfs/Qmc74pRHvndTDAB5nXztWAV7vs5j1obvCb9ejfQzXp9USX/retry-datastore" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) type BuildCfg struct { diff --git a/core/commands/add.go b/core/commands/add.go index 3b9933a004f..236d13c2d42 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -17,8 +17,8 @@ import ( mfs "github.com/ipfs/go-ipfs/mfs" ft "github.com/ipfs/go-ipfs/unixfs" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index c511a1e9c27..954cfc7cbfe 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -12,10 +12,10 @@ import ( decision "github.com/ipfs/go-ipfs/exchange/bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" ) var BitswapCmd = &cmds.Command{ diff --git a/core/commands/block.go b/core/commands/block.go index c1b20a1bebf..1dba3050c8c 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -11,11 +11,11 @@ import ( util "github.com/ipfs/go-ipfs/blocks/blockstore/util" e "github.com/ipfs/go-ipfs/core/commands/e" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) type BlockStat struct { diff --git a/core/commands/cat.go b/core/commands/cat.go index e65d27eae3b..ad16eb508d3 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands.go b/core/commands/commands.go index fbce892d60e..5f227cc7998 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -13,7 +13,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index 50176a7cee5..b74ce30ba7a 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" ) func collectPaths(prefix string, cmd *cmds.Command, out map[string]struct{}) { diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index fc78724174b..ae152166dd2 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -14,10 +14,10 @@ import ( pin "github.com/ipfs/go-ipfs/pin" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" ) var log = logging.Logger("cmds/files") diff --git a/core/commands/dht.go b/core/commands/dht.go index e84ff4b4195..ecc8200e580 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -13,14 +13,14 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - notif "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing/notifications" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + notif "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing/notifications" b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" - ipdht "gx/ipfs/QmfUvYQhL2GinafMbPDYz7VFoZv4iiuLuR33aRsPurXGag/go-libp2p-kad-dht" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + ipdht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" ) var ErrNotDHT = errors.New("routing service is not a DHT") diff --git a/core/commands/dht_test.go b/core/commands/dht_test.go index 6b1dab39384..07a635ca1f2 100644 --- a/core/commands/dht_test.go +++ b/core/commands/dht_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/ipfs/go-ipfs/namesys" - tu "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + tu "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestKeyTranslation(t *testing.T) { diff --git a/core/commands/files/files.go b/core/commands/files/files.go index db53a5b2658..31b126d9e7f 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -19,11 +19,11 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("cmds/files") diff --git a/core/commands/filestore.go b/core/commands/filestore.go index a4347a45243..13d7092a599 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -12,9 +12,9 @@ import ( "github.com/ipfs/go-ipfs/filestore" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" ) var FileStoreCmd = &cmds.Command{ diff --git a/core/commands/get.go b/core/commands/get.go index 13b9bf44557..a6c9561f674 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -16,7 +16,7 @@ import ( tar "github.com/ipfs/go-ipfs/thirdparty/tar" uarchive "github.com/ipfs/go-ipfs/unixfs/archive" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" ) diff --git a/core/commands/get_test.go b/core/commands/get_test.go index 8f5acb57951..e1444ae2c78 100644 --- a/core/commands/get_test.go +++ b/core/commands/get_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/helptext_test.go b/core/commands/helptext_test.go index 87f1e2a0e79..3ab0b46bd09 100644 --- a/core/commands/helptext_test.go +++ b/core/commands/helptext_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" ) func checkHelptextRecursive(t *testing.T, name []string, c *cmds.Command) { diff --git a/core/commands/id.go b/core/commands/id.go index f75cab121f1..69126e43a59 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -12,13 +12,13 @@ import ( core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" - kb "gx/ipfs/QmQEo84PQQPJpx9Bf2YxerGVgmgWvQ9iwuZBAJaNJKWREr/go-libp2p-kbucket" + identify "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" - "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - identify "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/protocol/identify" + kb "gx/ipfs/QmYe9YR9fibxCaExayDXUAN7eX7Q4N7jsMcPs8KgpGdiEV/go-libp2p-kbucket" + "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) const offlineIdErrorMessage = `'ipfs id' currently cannot query information on remote diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 24516d76c90..e86bcf9056f 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -12,7 +12,7 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" e "github.com/ipfs/go-ipfs/core/commands/e" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/ls.go b/core/commands/ls.go index 094c9186f71..312cc1c3c84 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -17,8 +17,8 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" unixfspb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type LsLink struct { diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 032b8ada08c..1b6790da9e6 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -20,9 +20,9 @@ import ( pin "github.com/ipfs/go-ipfs/pin" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ErrObjectTooLarge is returned when too much data was read from stdin. current limit 2m diff --git a/core/commands/p2p.go b/core/commands/p2p.go index 5f229ffbf09..3551c315e05 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -11,7 +11,7 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/pin.go b/core/commands/pin.go index 646f0f54b6b..32e813514cf 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -16,9 +16,9 @@ import ( pin "github.com/ipfs/go-ipfs/pin" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/ping.go b/core/commands/ping.go index c3af1e6b22b..99bbcec23f4 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -12,11 +12,11 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) const kPingTimeout = 10 * time.Second diff --git a/core/commands/publish.go b/core/commands/publish.go index fc6230663b2..b16a9c425db 100644 --- a/core/commands/publish.go +++ b/core/commands/publish.go @@ -14,7 +14,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" path "github.com/ipfs/go-ipfs/path" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" crypto "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 9b716a01ee1..6da8fbce5d8 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -11,12 +11,12 @@ import ( core "github.com/ipfs/go-ipfs/core" - floodsub "gx/ipfs/QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG/go-libp2p-floodsub" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) var PubsubCmd = &cmds.Command{ diff --git a/core/commands/refs.go b/core/commands/refs.go index e1c687795f7..4b50afaec87 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -13,9 +13,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // KeyList is a general type for outputting lists of keys diff --git a/core/commands/repo.go b/core/commands/repo.go index 1397aa82af1..57c21238c7b 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -18,9 +18,9 @@ import ( lockfile "github.com/ipfs/go-ipfs/repo/fsrepo/lock" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" ) type RepoVersion struct { diff --git a/core/commands/root.go b/core/commands/root.go index 0d66464cbe1..bbc03e7e56c 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -13,7 +13,7 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" + "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/stat.go b/core/commands/stat.go index 1cf5f4a0c0f..0e991836b63 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -8,10 +8,10 @@ import ( "time" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" - metrics "gx/ipfs/QmaL2WYJGbWKqHoLujoi9GQ5jj4JVFrBqHUBWmEYzJPVWT/go-libp2p-metrics" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index ec86d2b6378..f31bfd547a8 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -15,12 +15,12 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/repo/fsrepo" + swarm "gx/ipfs/QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d/go-libp2p-swarm" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" - swarm "gx/ipfs/QmUhvp4VoQ9cKDVLqAxciEKdm8ymBx2Syx4C1Tv6SmSTPa/go-libp2p-swarm" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + iaddr "gx/ipfs/QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp/go-ipfs-addr" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - iaddr "gx/ipfs/QmdMeXVB1V1SAZcFzoCuM3zR9K8PeuzCYg4zXNHcHh6dHU/go-ipfs-addr" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) type stringList struct { diff --git a/core/commands/sysdiag.go b/core/commands/sysdiag.go index 2206288f7fc..50bf5517b09 100644 --- a/core/commands/sysdiag.go +++ b/core/commands/sysdiag.go @@ -8,7 +8,7 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" config "github.com/ipfs/go-ipfs/repo/config" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" sysi "gx/ipfs/QmZRjKbHa6DenStpQJFiaPcEwkZqrx7TH6xTf342LDU3qM/go-sysinfo" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/core.go b/core/core.go index 62ed73636fe..9311a80a7f7 100644 --- a/core/core.go +++ b/core/core.go @@ -42,39 +42,39 @@ import ( offroute "github.com/ipfs/go-ipfs/routing/offline" ft "github.com/ipfs/go-ipfs/unixfs" + discovery "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/discovery" + p2pbhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/routed" + identify "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" + ping "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/ping" yamux "gx/ipfs/QmNWCEvi7bPRcvqAV8AKLGVNoQdArWi7NJayka2SM4XtRe/go-smux-yamux" - floodsub "gx/ipfs/QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG/go-libp2p-floodsub" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + connmgr "gx/ipfs/QmQqCKzSsjnsvoLxFeNJUCkeicXU4hY47GTCeTwEUnsvyx/go-libp2p-connmgr" mplex "gx/ipfs/QmREBy6TSjLQMtYFhjf97cypsUTzBagcwamWocKHFCTb1e/go-smux-multiplex" - ifconnmgr "gx/ipfs/QmSAJm4QdTJ3EGF2cvgNcQyXTEbxqWSW1x4kCVV1aJQUQr/go-libp2p-interface-connmgr" + ipnet "gx/ipfs/QmRFDGFgeKQjEjZdVcDUBiGYLkRDHbH151dLwa5K7dgGZy/go-libp2p-interface-pnet" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + circuit "gx/ipfs/QmS1Cmc1ZP4vwvwSuJ92pWdrdmd51YPqpxYu8byYKwPnKv/go-libp2p-circuit" + swarm "gx/ipfs/QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d/go-libp2p-swarm" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" - swarm "gx/ipfs/QmUhvp4VoQ9cKDVLqAxciEKdm8ymBx2Syx4C1Tv6SmSTPa/go-libp2p-swarm" + addrutil "gx/ipfs/QmUBVwiWc4Xv1U8qky2eZab7UqfJ1WFmCKVGjFfdDkxr8W/go-addr-util" + pnet "gx/ipfs/QmUvHSZFyrZSRDUKzfE2ASstVUKtSbUCK24TTkWK73iZfc/go-libp2p-pnet" mssmux "gx/ipfs/QmVniQJkdzLZaZwzwMdd3dJTvWiJ1DQEkreVy6hs6h7Vk5/go-smux-multistream" - circuit "gx/ipfs/QmVqNgx6RByRcnLVsr9spbo5ScomJyDZrb9Gz4XMWkYB7Z/go-libp2p-circuit" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - ipnet "gx/ipfs/QmXcN1kXchSvodd2MGypWXXirXk7GigQ7WVyWGYpukag6J/go-libp2p-interface-pnet" - pnet "gx/ipfs/QmXduVyMCsR4bUbRxvc9oi8PJJFm4hyoisYHhUzCcTnfUS/go-libp2p-pnet" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - discovery "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/discovery" - p2pbhost "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/host/routed" - identify "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/protocol/identify" - ping "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/protocol/ping" - metrics "gx/ipfs/QmaL2WYJGbWKqHoLujoi9GQ5jj4JVFrBqHUBWmEYzJPVWT/go-libp2p-metrics" + ifconnmgr "gx/ipfs/QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o/go-libp2p-interface-connmgr" + floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - connmgr "gx/ipfs/QmainUZ19HogMBjMocvHmgWEqofbpzLGNAir4AEY1KcJey/go-libp2p-connmgr" - mafilter "gx/ipfs/QmcrNvQBZkpbT7zLcGyjdPCiCHLVtaYeg4UVUH7XLfWJWy/go-maddr-filter" - addrutil "gx/ipfs/Qmcxa9y1KVC51TVicSKomsnunJGSA9UJSuBvJc28JCip4H/go-addr-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" - dht "gx/ipfs/QmfUvYQhL2GinafMbPDYz7VFoZv4iiuLuR33aRsPurXGag/go-libp2p-kad-dht" + metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + mafilter "gx/ipfs/Qmf2UAmRwDG4TvnkQpHZWPAzw7rpCYVhxmRXmYxXr5LD1g/go-maddr-filter" + dht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) const IpnsValidatorTag = "ipns" diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 6c1d61dcdea..d834dc0d177 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -8,7 +8,7 @@ import ( ipfspath "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type CoreAPI struct { diff --git a/core/coreapi/dag.go b/core/coreapi/dag.go index 3a45fd0a4b3..ea22c46c527 100644 --- a/core/coreapi/dag.go +++ b/core/coreapi/dag.go @@ -11,7 +11,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" coredag "github.com/ipfs/go-ipfs/core/coredag" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type DagAPI struct { diff --git a/core/coreapi/dag_test.go b/core/coreapi/dag_test.go index 745337e5672..712509b6d21 100644 --- a/core/coreapi/dag_test.go +++ b/core/coreapi/dag_test.go @@ -8,7 +8,7 @@ import ( coreapi "github.com/ipfs/go-ipfs/core/coreapi" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" ) var ( diff --git a/core/coreapi/interface/interface.go b/core/coreapi/interface/interface.go index 720f935e28e..6e00d51ab43 100644 --- a/core/coreapi/interface/interface.go +++ b/core/coreapi/interface/interface.go @@ -10,8 +10,8 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - ipld "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Path is a generic wrapper for paths used in the API. A path can be resolved diff --git a/core/coreapi/interface/options/dag.go b/core/coreapi/interface/options/dag.go index 7850c4bc3a8..b56fcd81a6e 100644 --- a/core/coreapi/interface/options/dag.go +++ b/core/coreapi/interface/options/dag.go @@ -3,7 +3,7 @@ package options import ( "math" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type DagPutSettings struct { diff --git a/core/coreapi/key.go b/core/coreapi/key.go index cb67d9c2d86..162f8c03402 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -10,7 +10,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" ipfspath "github.com/ipfs/go-ipfs/path" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" crypto "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/core/coreapi/name.go b/core/coreapi/name.go index c007bba13bc..9b0d1885ea0 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -15,7 +15,7 @@ import ( ipath "github.com/ipfs/go-ipfs/path" offline "github.com/ipfs/go-ipfs/routing/offline" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" crypto "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index e3b458a0d97..dbfdca3cc1c 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -8,8 +8,8 @@ import ( coreunix "github.com/ipfs/go-ipfs/core/coreunix" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type UnixfsAPI CoreAPI diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index c4b00e4b650..7eff906b90f 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -20,9 +20,9 @@ import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" unixfs "github.com/ipfs/go-ipfs/unixfs" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + cbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - cbor "gx/ipfs/QmeZv9VXw2SfVbX55LV6kGTWASKBc9ZxAVqGBeJcDGdoXy/go-ipld-cbor" ) // `echo -n 'hello, world!' | ipfs add` diff --git a/core/coredag/cbor.go b/core/coredag/cbor.go index 3d4a0b42aae..0355c6b4bf6 100644 --- a/core/coredag/cbor.go +++ b/core/coredag/cbor.go @@ -4,8 +4,8 @@ import ( "io" "io/ioutil" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - ipldcbor "gx/ipfs/QmeZv9VXw2SfVbX55LV6kGTWASKBc9ZxAVqGBeJcDGdoXy/go-ipld-cbor" + ipldcbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func cborJSONParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index 1c31d4be3ad..581a1692d0a 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func dagpbJSONParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { diff --git a/core/coredag/dagtransl.go b/core/coredag/dagtransl.go index 10a76c05211..ca877b2b56e 100644 --- a/core/coredag/dagtransl.go +++ b/core/coredag/dagtransl.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DagParser is function used for parsing stream into Node diff --git a/core/coredag/raw.go b/core/coredag/raw.go index 7123fef47be..a109e4668c1 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -7,10 +7,10 @@ import ( "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - block "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + block "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func rawRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 9dfdfe70aba..108792cc77c 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -15,8 +15,8 @@ import ( path "github.com/ipfs/go-ipfs/path" config "github.com/ipfs/go-ipfs/repo/config" - cmds "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds" - cmdsHttp "gx/ipfs/QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9/go-ipfs-cmds/http" + cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmdsHttp "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/http" ) var ( diff --git a/core/corehttp/corehttp.go b/core/corehttp/corehttp.go index 2686ca675ff..dd5ea2a7b1d 100644 --- a/core/corehttp/corehttp.go +++ b/core/corehttp/corehttp.go @@ -11,10 +11,10 @@ import ( "time" core "github.com/ipfs/go-ipfs/core" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) var log = logging.Logger("core/server") diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index 54fcd3e9be9..14d3be7ffe1 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -9,7 +9,7 @@ import ( coreapi "github.com/ipfs/go-ipfs/core/coreapi" config "github.com/ipfs/go-ipfs/repo/config" - id "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" ) type GatewayConfig struct { diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index bf164f9cb8d..f4f99cfeb98 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -23,11 +23,11 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - multibase "gx/ipfs/QmafgXF3u3QSWErQoZ2URmQp5PFG384htoE7J338nS2H7T/go-multibase" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + multibase "gx/ipfs/QmexBtiTTEwwn42Yi6ouKt6VqzpA6wjJgiW1oh9VfaRrup/go-multibase" ) const ( diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 97a2bbe6495..32c03a88604 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -19,7 +19,7 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" - id "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 3c452d5fa95..4401b460c6c 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -7,9 +7,9 @@ import ( core "github.com/ipfs/go-ipfs/core" - inet "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" - testutil "gx/ipfs/QmZTcPxK6VqrwY94JpKZPvEqAZ6tEr1rLrpcqJbbRZbg2V/go-libp2p-netutil" - bhost "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/host/basic" + bhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/basic" + inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" + testutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" ) // This test is based on go-libp2p/p2p/net/swarm.TestConnectednessCorrect diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 2ea8db3d5e4..77e0dea9abc 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -13,7 +13,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var log = logging.Logger("corerepo") diff --git a/core/corerepo/pinning.go b/core/corerepo/pinning.go index 92ac963d916..9a6522cdd39 100644 --- a/core/corerepo/pinning.go +++ b/core/corerepo/pinning.go @@ -21,7 +21,7 @@ import ( path "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func Pin(n *core.IpfsNode, ctx context.Context, paths []string, recursive bool) ([]*cid.Cid, error) { diff --git a/core/coreunix/add.go b/core/coreunix/add.go index c1e8157145e..19cddacb9a2 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -24,12 +24,12 @@ import ( posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" unixfs "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - syncds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("coreunix") diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index 5ee2ef58ca8..000b06b8c2e 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -20,9 +20,9 @@ import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" pi "github.com/ipfs/go-ipfs/thirdparty/posinfo" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func TestAddRecursive(t *testing.T) { diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index 2052fd5ee2c..b3d119b4e82 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -4,7 +4,7 @@ import ( core "github.com/ipfs/go-ipfs/core" dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error) { diff --git a/core/coreunix/metadata_test.go b/core/coreunix/metadata_test.go index e13ddece2c8..37cbf25b647 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -16,10 +16,10 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func getDagserv(t *testing.T) merkledag.DAGService { diff --git a/core/mock/mock.go b/core/mock/mock.go index 0d4f2fe5fa0..aa1098685e2 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -9,15 +9,15 @@ import ( "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - host "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - ipnet "gx/ipfs/QmXcN1kXchSvodd2MGypWXXirXk7GigQ7WVyWGYpukag6J/go-libp2p-interface-pnet" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + ipnet "gx/ipfs/QmRFDGFgeKQjEjZdVcDUBiGYLkRDHbH151dLwa5K7dgGZy/go-libp2p-interface-pnet" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - metrics "gx/ipfs/QmaL2WYJGbWKqHoLujoi9GQ5jj4JVFrBqHUBWmEYzJPVWT/go-libp2p-metrics" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + host "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) // NewMockNode constructs an IpfsNode for use in tests. diff --git a/core/pathresolver.go b/core/pathresolver.go index 0d06860df53..5ed8842f703 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -8,9 +8,9 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ErrNoNamesys is an explicit error for when an IPFS node doesn't diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index ec12e7be3a1..e74438c4464 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -23,9 +23,9 @@ import ( process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) var log = logging.Logger("bitswap") diff --git a/exchange/bitswap/bitswap_test.go b/exchange/bitswap/bitswap_test.go index c0b13cabe4e..23cce9303f3 100644 --- a/exchange/bitswap/bitswap_test.go +++ b/exchange/bitswap/bitswap_test.go @@ -17,11 +17,11 @@ import ( detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - p2ptestutil "gx/ipfs/QmZTcPxK6VqrwY94JpKZPvEqAZ6tEr1rLrpcqJbbRZbg2V/go-libp2p-netutil" - tu "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" - travis "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil/ci/travis" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + p2ptestutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + tu "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" + travis "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil/ci/travis" ) // FIXME the tests are really sensitive to the network delay. fix them to work diff --git a/exchange/bitswap/decision/bench_test.go b/exchange/bitswap/decision/bench_test.go index 288bb7e7da1..5f06bcfec72 100644 --- a/exchange/bitswap/decision/bench_test.go +++ b/exchange/bitswap/decision/bench_test.go @@ -6,10 +6,10 @@ import ( "testing" "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) // FWIW: At the time of this commit, including a timestamp in task increases diff --git a/exchange/bitswap/decision/engine.go b/exchange/bitswap/decision/engine.go index bad932b7e75..d81db4cb2e3 100644 --- a/exchange/bitswap/decision/engine.go +++ b/exchange/bitswap/decision/engine.go @@ -10,8 +10,8 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) // TODO consider taking responsibility for other types of requests. For diff --git a/exchange/bitswap/decision/engine_test.go b/exchange/bitswap/decision/engine_test.go index 1a12d019bbe..eea38a6f476 100644 --- a/exchange/bitswap/decision/engine_test.go +++ b/exchange/bitswap/decision/engine_test.go @@ -11,11 +11,11 @@ import ( blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" message "github.com/ipfs/go-ipfs/exchange/bitswap/message" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) type peerAndEngine struct { diff --git a/exchange/bitswap/decision/ledger.go b/exchange/bitswap/decision/ledger.go index e3ce24df658..210a9ffe358 100644 --- a/exchange/bitswap/decision/ledger.go +++ b/exchange/bitswap/decision/ledger.go @@ -6,8 +6,8 @@ import ( wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func newLedger(p peer.ID) *ledger { diff --git a/exchange/bitswap/decision/peer_request_queue.go b/exchange/bitswap/decision/peer_request_queue.go index 00123ac8a40..46606eabf84 100644 --- a/exchange/bitswap/decision/peer_request_queue.go +++ b/exchange/bitswap/decision/peer_request_queue.go @@ -7,8 +7,8 @@ import ( wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" pq "github.com/ipfs/go-ipfs/thirdparty/pq" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type peerRequestQueue interface { diff --git a/exchange/bitswap/decision/peer_request_queue_test.go b/exchange/bitswap/decision/peer_request_queue_test.go index 3416a5ca1cb..fdd8eb66648 100644 --- a/exchange/bitswap/decision/peer_request_queue_test.go +++ b/exchange/bitswap/decision/peer_request_queue_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestPushPop(t *testing.T) { diff --git a/exchange/bitswap/get.go b/exchange/bitswap/get.go index aa26de4ef86..f10a62d688d 100644 --- a/exchange/bitswap/get.go +++ b/exchange/bitswap/get.go @@ -6,9 +6,9 @@ import ( blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" notifications "github.com/ipfs/go-ipfs/exchange/bitswap/notifications" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type getBlocksFunc func(context.Context, []*cid.Cid) (<-chan blocks.Block, error) diff --git a/exchange/bitswap/message/message.go b/exchange/bitswap/message/message.go index de5c9269618..cb1fb562c50 100644 --- a/exchange/bitswap/message/message.go +++ b/exchange/bitswap/message/message.go @@ -6,12 +6,12 @@ import ( pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - inet "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" + inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // TODO move message.go into the bitswap package diff --git a/exchange/bitswap/message/message_test.go b/exchange/bitswap/message/message_test.go index 7e0eb48b7ab..1ab0a9c40ea 100644 --- a/exchange/bitswap/message/message_test.go +++ b/exchange/bitswap/message/message_test.go @@ -6,10 +6,10 @@ import ( pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func mkFakeCid(s string) *cid.Cid { diff --git a/exchange/bitswap/network/interface.go b/exchange/bitswap/network/interface.go index d2cd1fd6c20..d111f499c12 100644 --- a/exchange/bitswap/network/interface.go +++ b/exchange/bitswap/network/interface.go @@ -5,10 +5,10 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" - ifconnmgr "gx/ipfs/QmSAJm4QdTJ3EGF2cvgNcQyXTEbxqWSW1x4kCVV1aJQUQr/go-libp2p-interface-connmgr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ifconnmgr "gx/ipfs/QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o/go-libp2p-interface-connmgr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var ( diff --git a/exchange/bitswap/network/ipfs_impl.go b/exchange/bitswap/network/ipfs_impl.go index 241da4e6e02..e0e6649d568 100644 --- a/exchange/bitswap/network/ipfs_impl.go +++ b/exchange/bitswap/network/ipfs_impl.go @@ -8,16 +8,16 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" - host "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - ifconnmgr "gx/ipfs/QmSAJm4QdTJ3EGF2cvgNcQyXTEbxqWSW1x4kCVV1aJQUQr/go-libp2p-interface-connmgr" + inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - inet "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ifconnmgr "gx/ipfs/QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o/go-libp2p-interface-connmgr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + host "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) var log = logging.Logger("bitswap_network") diff --git a/exchange/bitswap/notifications/notifications.go b/exchange/bitswap/notifications/notifications.go index f5ed529629e..ba5b379ec8b 100644 --- a/exchange/bitswap/notifications/notifications.go +++ b/exchange/bitswap/notifications/notifications.go @@ -3,10 +3,10 @@ package notifications import ( "context" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" pubsub "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/briantigerchow/pubsub" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) const bufferSize = 16 diff --git a/exchange/bitswap/notifications/notifications_test.go b/exchange/bitswap/notifications/notifications_test.go index 9373d709764..0377c307d6a 100644 --- a/exchange/bitswap/notifications/notifications_test.go +++ b/exchange/bitswap/notifications/notifications_test.go @@ -7,8 +7,8 @@ import ( "time" blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func TestDuplicates(t *testing.T) { diff --git a/exchange/bitswap/session.go b/exchange/bitswap/session.go index 73d9fd1f47f..33875f069c4 100644 --- a/exchange/bitswap/session.go +++ b/exchange/bitswap/session.go @@ -8,11 +8,11 @@ import ( notifications "github.com/ipfs/go-ipfs/exchange/bitswap/notifications" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - loggables "gx/ipfs/QmSvcDkiRwB8LuMhUtnvhum2C851Mproo75ZDD19jx43tD/go-libp2p-loggables" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + loggables "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) const activeWantsLimit = 16 diff --git a/exchange/bitswap/session_test.go b/exchange/bitswap/session_test.go index 2536ff0e79d..6458904548a 100644 --- a/exchange/bitswap/session_test.go +++ b/exchange/bitswap/session_test.go @@ -8,8 +8,8 @@ import ( blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func TestBasicSessions(t *testing.T) { diff --git a/exchange/bitswap/stat.go b/exchange/bitswap/stat.go index 2c82c7caeef..825888abcb9 100644 --- a/exchange/bitswap/stat.go +++ b/exchange/bitswap/stat.go @@ -3,7 +3,7 @@ package bitswap import ( "sort" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type Stat struct { diff --git a/exchange/bitswap/testnet/interface.go b/exchange/bitswap/testnet/interface.go index 6bc3bf1889b..53eb6ea6273 100644 --- a/exchange/bitswap/testnet/interface.go +++ b/exchange/bitswap/testnet/interface.go @@ -2,8 +2,8 @@ package bitswap import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) type Network interface { diff --git a/exchange/bitswap/testnet/network_test.go b/exchange/bitswap/testnet/network_test.go index ee10af3ce42..4e54e4eb845 100644 --- a/exchange/bitswap/testnet/network_test.go +++ b/exchange/bitswap/testnet/network_test.go @@ -9,9 +9,9 @@ import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestSendMessageAsyncButWaitForResponse(t *testing.T) { diff --git a/exchange/bitswap/testnet/peernet.go b/exchange/bitswap/testnet/peernet.go index 6d1ea8ad99d..af7b05940e4 100644 --- a/exchange/bitswap/testnet/peernet.go +++ b/exchange/bitswap/testnet/peernet.go @@ -5,10 +5,10 @@ import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" mockrouting "github.com/ipfs/go-ipfs/routing/mock" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - mockpeernet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + mockpeernet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) type peernet struct { diff --git a/exchange/bitswap/testnet/virtual.go b/exchange/bitswap/testnet/virtual.go index 97d25199230..643eebad62a 100644 --- a/exchange/bitswap/testnet/virtual.go +++ b/exchange/bitswap/testnet/virtual.go @@ -10,12 +10,12 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - ifconnmgr "gx/ipfs/QmSAJm4QdTJ3EGF2cvgNcQyXTEbxqWSW1x4kCVV1aJQUQr/go-libp2p-interface-connmgr" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ifconnmgr "gx/ipfs/QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o/go-libp2p-interface-connmgr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) var log = logging.Logger("bstestnet") diff --git a/exchange/bitswap/testutils.go b/exchange/bitswap/testutils.go index 0ad9ef77379..b361e53f3f8 100644 --- a/exchange/bitswap/testutils.go +++ b/exchange/bitswap/testutils.go @@ -8,12 +8,12 @@ import ( tn "github.com/ipfs/go-ipfs/exchange/bitswap/testnet" datastore2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - p2ptestutil "gx/ipfs/QmZTcPxK6VqrwY94JpKZPvEqAZ6tEr1rLrpcqJbbRZbg2V/go-libp2p-netutil" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - ds_sync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + ds_sync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + p2ptestutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ) // WARNING: this uses RandTestBogusIdentity DO NOT USE for NON TESTS! diff --git a/exchange/bitswap/wantlist/wantlist.go b/exchange/bitswap/wantlist/wantlist.go index 9a1412785fa..c2225b88d3a 100644 --- a/exchange/bitswap/wantlist/wantlist.go +++ b/exchange/bitswap/wantlist/wantlist.go @@ -6,7 +6,7 @@ import ( "sort" "sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type ThreadSafe struct { diff --git a/exchange/bitswap/wantlist/wantlist_test.go b/exchange/bitswap/wantlist/wantlist_test.go index 3c400f9bfd1..37c5c91c609 100644 --- a/exchange/bitswap/wantlist/wantlist_test.go +++ b/exchange/bitswap/wantlist/wantlist_test.go @@ -3,7 +3,7 @@ package wantlist import ( "testing" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var testcids []*cid.Cid diff --git a/exchange/bitswap/wantmanager.go b/exchange/bitswap/wantmanager.go index e89d7ef6604..c4cc7ea3597 100644 --- a/exchange/bitswap/wantmanager.go +++ b/exchange/bitswap/wantmanager.go @@ -11,8 +11,8 @@ import ( wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) type WantManager struct { diff --git a/exchange/bitswap/workers.go b/exchange/bitswap/workers.go index 8a1f420bd0f..11b9b2d8296 100644 --- a/exchange/bitswap/workers.go +++ b/exchange/bitswap/workers.go @@ -11,8 +11,8 @@ import ( process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var TaskWorkerCount = 8 diff --git a/exchange/interface.go b/exchange/interface.go index 443672d897d..c1dd1162448 100644 --- a/exchange/interface.go +++ b/exchange/interface.go @@ -5,9 +5,9 @@ import ( "context" "io" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // Any type that implements exchange.Interface may be used as an IPFS block diff --git a/exchange/offline/offline.go b/exchange/offline/offline.go index f104d20b137..35c38887f38 100644 --- a/exchange/offline/offline.go +++ b/exchange/offline/offline.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/blocks/blockstore" exchange "github.com/ipfs/go-ipfs/exchange" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func Exchange(bs blockstore.Blockstore) exchange.Interface { diff --git a/exchange/offline/offline_test.go b/exchange/offline/offline_test.go index 681ea232852..5bc2926c100 100644 --- a/exchange/offline/offline_test.go +++ b/exchange/offline/offline_test.go @@ -6,12 +6,12 @@ import ( "github.com/ipfs/go-ipfs/blocks/blockstore" "github.com/ipfs/go-ipfs/blocks/blocksutil" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - ds_sync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + ds_sync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func TestBlockReturnsErr(t *testing.T) { diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index a7cac3092a9..adcd5c62bae 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -7,7 +7,7 @@ import ( merkledag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // NewBlockstoreProvider returns key provider using bstore.AllKeysChan diff --git a/exchange/reprovide/reprovide.go b/exchange/reprovide/reprovide.go index bbc46b83048..56394d72e4c 100644 --- a/exchange/reprovide/reprovide.go +++ b/exchange/reprovide/reprovide.go @@ -5,10 +5,10 @@ import ( "fmt" "time" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" backoff "gx/ipfs/QmPJUtEJsm5YLUWhF6imvyCH8KZXRJa9Wup7FDMwTy5Ufz/backoff" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var log = logging.Logger("reprovider") diff --git a/exchange/reprovide/reprovide_test.go b/exchange/reprovide/reprovide_test.go index ac739d2fc9e..3b10788a19d 100644 --- a/exchange/reprovide/reprovide_test.go +++ b/exchange/reprovide/reprovide_test.go @@ -6,11 +6,11 @@ import ( blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" mock "github.com/ipfs/go-ipfs/routing/mock" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" . "github.com/ipfs/go-ipfs/exchange/reprovide" ) diff --git a/filestore/filestore.go b/filestore/filestore.go index 502b11fed7e..873ef12c3a7 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -12,11 +12,11 @@ import ( "github.com/ipfs/go-ipfs/blocks/blockstore" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var log = logging.Logger("filestore") diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 13a95ee5f81..8021114244a 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -11,8 +11,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func newTestFilestore(t *testing.T) (string, *Filestore) { diff --git a/filestore/fsrefstore.go b/filestore/fsrefstore.go index b77990073e6..603a513805f 100644 --- a/filestore/fsrefstore.go +++ b/filestore/fsrefstore.go @@ -11,13 +11,13 @@ import ( pb "github.com/ipfs/go-ipfs/filestore/pb" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsns "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/namespace" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" proto "gx/ipfs/QmT6n4mspWYEya864BhCUJEgyxiRfmiSY9ruQwTUNpRKaM/protobuf/proto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsns "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/namespace" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // FilestorePrefix identifies the key prefix for FileManager blocks. diff --git a/filestore/util.go b/filestore/util.go index 932061be3af..35a640b68f9 100644 --- a/filestore/util.go +++ b/filestore/util.go @@ -8,9 +8,9 @@ import ( pb "github.com/ipfs/go-ipfs/filestore/pb" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // Status is used to identify the state of the block data referenced diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 83717b2e925..7b8b2114efe 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -15,11 +15,11 @@ import ( core "github.com/ipfs/go-ipfs/core" namesys "github.com/ipfs/go-ipfs/namesys" offroute "github.com/ipfs/go-ipfs/routing/offline" - ci "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil/ci" + ci "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil/ci" racedet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" fstest "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs/fstestutil" ) diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 475d51de791..b4a4fbdc0fa 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -19,11 +19,11 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func init() { diff --git a/fuse/node/mount_test.go b/fuse/node/mount_test.go index 395a6f5d726..4e1d72f5997 100644 --- a/fuse/node/mount_test.go +++ b/fuse/node/mount_test.go @@ -16,7 +16,7 @@ import ( mount "github.com/ipfs/go-ipfs/fuse/mount" namesys "github.com/ipfs/go-ipfs/namesys" offroute "github.com/ipfs/go-ipfs/routing/offline" - ci "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil/ci" + ci "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil/ci" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index b3085db1cd3..9e92456f6cb 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -20,11 +20,11 @@ import ( chunk "github.com/ipfs/go-ipfs/importer/chunk" dag "github.com/ipfs/go-ipfs/merkledag" uio "github.com/ipfs/go-ipfs/unixfs/io" - ci "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil/ci" + ci "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil/ci" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" fstest "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs/fstestutil" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 4fb93b96d61..678ac054fb7 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -16,12 +16,12 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" - format "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - lgbl "gx/ipfs/QmSvcDkiRwB8LuMhUtnvhum2C851Mproo75ZDD19jx43tD/go-libp2p-loggables" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + lgbl "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" + format "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("fuse/ipfs") diff --git a/importer/balanced/balanced_test.go b/importer/balanced/balanced_test.go index c97583b41ef..0278c2d0793 100644 --- a/importer/balanced/balanced_test.go +++ b/importer/balanced/balanced_test.go @@ -15,7 +15,7 @@ import ( mdtest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" ) // TODO: extract these tests and more as a generic layout test suite diff --git a/importer/balanced/builder.go b/importer/balanced/builder.go index 334bf8eb08b..a2e58a4a107 100644 --- a/importer/balanced/builder.go +++ b/importer/balanced/builder.go @@ -5,7 +5,7 @@ import ( h "github.com/ipfs/go-ipfs/importer/helpers" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func BalancedLayout(db *h.DagBuilderHelper) (node.Node, error) { diff --git a/importer/chunk/rabin_test.go b/importer/chunk/rabin_test.go index 888b9ac2edd..1d5702e3834 100644 --- a/importer/chunk/rabin_test.go +++ b/importer/chunk/rabin_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - util "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) func TestRabinChunking(t *testing.T) { diff --git a/importer/chunk/splitting_test.go b/importer/chunk/splitting_test.go index 68df428030d..c5ef621e040 100644 --- a/importer/chunk/splitting_test.go +++ b/importer/chunk/splitting_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" ) func randBuf(t *testing.T, size int) []byte { diff --git a/importer/helpers/dagbuilder.go b/importer/helpers/dagbuilder.go index 0c6e9c5e07c..8d4cff8b70b 100644 --- a/importer/helpers/dagbuilder.go +++ b/importer/helpers/dagbuilder.go @@ -8,9 +8,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DagBuilderHelper wraps together a bunch of objects needed to diff --git a/importer/helpers/helpers.go b/importer/helpers/helpers.go index 28c1e5c2478..1a607ed861d 100644 --- a/importer/helpers/helpers.go +++ b/importer/helpers/helpers.go @@ -9,8 +9,8 @@ import ( pi "github.com/ipfs/go-ipfs/thirdparty/posinfo" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // BlockSizeLimit specifies the maximum size an imported block can have. diff --git a/importer/importer.go b/importer/importer.go index 32b8de18bb2..db71b6a4267 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -13,7 +13,7 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Builds a DAG from the given file, writing created blocks to disk as they are diff --git a/importer/importer_test.go b/importer/importer_test.go index 36a49ec0dfa..c3896e0ce23 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -12,8 +12,8 @@ import ( mdtest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, dag.DAGService) { diff --git a/importer/trickle/trickle_test.go b/importer/trickle/trickle_test.go index 71c242ecdf7..1653b5f3199 100644 --- a/importer/trickle/trickle_test.go +++ b/importer/trickle/trickle_test.go @@ -16,7 +16,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" ) type UseRawLeaves bool diff --git a/importer/trickle/trickledag.go b/importer/trickle/trickledag.go index 894d40a118c..2d9789a5fd6 100644 --- a/importer/trickle/trickledag.go +++ b/importer/trickle/trickledag.go @@ -9,8 +9,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // layerRepeat specifies how many times to append a child tree of a diff --git a/merkledag/batch.go b/merkledag/batch.go index 79c86aa9a5e..a6ee02f06f1 100644 --- a/merkledag/batch.go +++ b/merkledag/batch.go @@ -3,9 +3,9 @@ package merkledag import ( "runtime" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) // ParallelBatchCommits is the number of batch commits that can be in-flight before blocking. diff --git a/merkledag/coding.go b/merkledag/coding.go index dec46f1683c..6600527964b 100644 --- a/merkledag/coding.go +++ b/merkledag/coding.go @@ -5,12 +5,12 @@ import ( "sort" "strings" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" pb "github.com/ipfs/go-ipfs/merkledag/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // for now, we use a PBNode intermediate thing. diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 311bcef27da..8f89b137e28 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -9,9 +9,9 @@ import ( bserv "github.com/ipfs/go-ipfs/blockservice" offline "github.com/ipfs/go-ipfs/exchange/offline" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" - ipldcbor "gx/ipfs/QmeZv9VXw2SfVbX55LV6kGTWASKBc9ZxAVqGBeJcDGdoXy/go-ipld-cbor" + ipldcbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // TODO: We should move these registrations elsewhere. Really, most of the IPLD diff --git a/merkledag/merkledag_test.go b/merkledag/merkledag_test.go index a1fd02d81e3..8b1ad141443 100644 --- a/merkledag/merkledag_test.go +++ b/merkledag/merkledag_test.go @@ -22,11 +22,11 @@ import ( mdpb "github.com/ipfs/go-ipfs/merkledag/pb" dstest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" - blocks "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestNode(t *testing.T) { diff --git a/merkledag/node.go b/merkledag/node.go index 8dd7fed3d9c..44d44617da0 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -5,9 +5,9 @@ import ( "encoding/json" "fmt" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotProtobuf = fmt.Errorf("expected protobuf dag node") diff --git a/merkledag/node_test.go b/merkledag/node_test.go index 72b65c28939..27726c4543e 100644 --- a/merkledag/node_test.go +++ b/merkledag/node_test.go @@ -8,7 +8,7 @@ import ( . "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestRemoveLink(t *testing.T) { diff --git a/merkledag/raw.go b/merkledag/raw.go index 9ef9e4da853..2d195dd5a95 100644 --- a/merkledag/raw.go +++ b/merkledag/raw.go @@ -2,11 +2,11 @@ package merkledag import ( "fmt" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type RawNode struct { diff --git a/merkledag/test/utils.go b/merkledag/test/utils.go index 89d44b7ee8c..c0ab995e262 100644 --- a/merkledag/test/utils.go +++ b/merkledag/test/utils.go @@ -5,8 +5,8 @@ import ( bsrv "github.com/ipfs/go-ipfs/blockservice" "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" ) func Mock() dag.DAGService { diff --git a/merkledag/traverse/traverse.go b/merkledag/traverse/traverse.go index 2759d0269c6..d12c9f3014c 100644 --- a/merkledag/traverse/traverse.go +++ b/merkledag/traverse/traverse.go @@ -5,7 +5,7 @@ import ( "context" "errors" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Order is an identifier for traversal algorithm orders diff --git a/merkledag/traverse/traverse_test.go b/merkledag/traverse/traverse_test.go index 30f9c524d57..23d42c6c0a0 100644 --- a/merkledag/traverse/traverse_test.go +++ b/merkledag/traverse/traverse_test.go @@ -8,7 +8,7 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" mdagtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestDFSPreNoSkip(t *testing.T) { diff --git a/merkledag/utils/diff.go b/merkledag/utils/diff.go index 1114d18d5e9..db5e22936ab 100644 --- a/merkledag/utils/diff.go +++ b/merkledag/utils/diff.go @@ -7,8 +7,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const ( diff --git a/merkledag/utils/diffenum.go b/merkledag/utils/diffenum.go index e63ce985e8e..1dc8e4ecd88 100644 --- a/merkledag/utils/diffenum.go +++ b/merkledag/utils/diffenum.go @@ -6,8 +6,8 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DiffEnumerate fetches every object in the graph pointed to by 'to' that is diff --git a/merkledag/utils/diffenum_test.go b/merkledag/utils/diffenum_test.go index 72f6ea23f7b..66875160995 100644 --- a/merkledag/utils/diffenum_test.go +++ b/merkledag/utils/diffenum_test.go @@ -8,8 +8,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func buildNode(name string, desc map[string]ndesc, out map[string]node.Node) node.Node { diff --git a/merkledag/utils/utils.go b/merkledag/utils/utils.go index de782536d43..6c16967ca69 100644 --- a/merkledag/utils/utils.go +++ b/merkledag/utils/utils.go @@ -10,9 +10,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - syncds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type Editor struct { diff --git a/merkledag/utils/utils_test.go b/merkledag/utils/utils_test.go index 185aadf041e..2c3e953d302 100644 --- a/merkledag/utils/utils_test.go +++ b/merkledag/utils/utils_test.go @@ -8,7 +8,7 @@ import ( mdtest "github.com/ipfs/go-ipfs/merkledag/test" path "github.com/ipfs/go-ipfs/path" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func TestAddLink(t *testing.T) { diff --git a/mfs/dir.go b/mfs/dir.go index 57e4554f080..250219d758b 100644 --- a/mfs/dir.go +++ b/mfs/dir.go @@ -15,8 +15,8 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" ufspb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotYetImplemented = errors.New("not yet implemented") diff --git a/mfs/file.go b/mfs/file.go index 36302688689..aa870551a5e 100644 --- a/mfs/file.go +++ b/mfs/file.go @@ -10,7 +10,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" mod "github.com/ipfs/go-ipfs/unixfs/mod" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type File struct { diff --git a/mfs/mfs_test.go b/mfs/mfs_test.go index 6498a76158a..b9ec1b4e426 100644 --- a/mfs/mfs_test.go +++ b/mfs/mfs_test.go @@ -24,11 +24,11 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func emptyDirNode() *dag.ProtoNode { diff --git a/mfs/ops.go b/mfs/ops.go index 214a66fca84..9d7182124dd 100644 --- a/mfs/ops.go +++ b/mfs/ops.go @@ -9,8 +9,8 @@ import ( path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Mv moves the file or directory at 'src' to 'dst' diff --git a/mfs/repub_test.go b/mfs/repub_test.go index 60045fec563..499650d131d 100644 --- a/mfs/repub_test.go +++ b/mfs/repub_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - ci "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil/ci" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + ci "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil/ci" ) func TestRepublisher(t *testing.T) { diff --git a/mfs/system.go b/mfs/system.go index 319ba3020c9..28dbe8aecb3 100644 --- a/mfs/system.go +++ b/mfs/system.go @@ -19,9 +19,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotExist = errors.New("no such rootfs") diff --git a/namesys/ipns_select_test.go b/namesys/ipns_select_test.go index e36eade006e..7489f139b16 100644 --- a/namesys/ipns_select_test.go +++ b/namesys/ipns_select_test.go @@ -9,7 +9,7 @@ import ( pb "github.com/ipfs/go-ipfs/namesys/pb" path "github.com/ipfs/go-ipfs/path" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/namesys/namesys.go b/namesys/namesys.go index 7f7adec1ffd..e38d58455fb 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -9,14 +9,14 @@ import ( path "github.com/ipfs/go-ipfs/path" - floodsub "gx/ipfs/QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG/go-libp2p-floodsub" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) // mpns (a multi-protocol NameSystem) implements generic IPFS naming. diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index 66062156d59..2cd91c79f8b 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -10,9 +10,9 @@ import ( offroute "github.com/ipfs/go-ipfs/routing/offline" "github.com/ipfs/go-ipfs/unixfs" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" ) type mockResolver struct { diff --git a/namesys/publisher.go b/namesys/publisher.go index bdfbe5e3be7..6d033d50233 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -13,14 +13,14 @@ import ( dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" ft "github.com/ipfs/go-ipfs/unixfs" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - record "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record" - dhtpb "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record/pb" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" + dhtpb "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record/pb" ) // ErrExpiredRecord should be returned when an ipns record is diff --git a/namesys/publisher_test.go b/namesys/publisher_test.go index 37e3aeeae65..de6a5c694cd 100644 --- a/namesys/publisher_test.go +++ b/namesys/publisher_test.go @@ -10,12 +10,12 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) type identity struct { diff --git a/namesys/pubsub.go b/namesys/pubsub.go index 67605685281..c71d82a7d89 100644 --- a/namesys/pubsub.go +++ b/namesys/pubsub.go @@ -12,20 +12,20 @@ import ( path "github.com/ipfs/go-ipfs/path" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - floodsub "gx/ipfs/QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG/go-libp2p-floodsub" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - record "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record" - dhtpb "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record/pb" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" + dhtpb "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record/pb" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) // PubsubPublisher is a publisher that distributes IPNS records through pubsub diff --git a/namesys/pubsub_test.go b/namesys/pubsub_test.go index c82a425db98..abafa732b6e 100644 --- a/namesys/pubsub_test.go +++ b/namesys/pubsub_test.go @@ -9,16 +9,16 @@ import ( path "github.com/ipfs/go-ipfs/path" mockrouting "github.com/ipfs/go-ipfs/routing/mock" - floodsub "gx/ipfs/QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG/go-libp2p-floodsub" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - bhost "gx/ipfs/QmYmhgAcvmDGXct1qBvc1kz9BxQSit1XBrTeiGZp2FvRyn/go-libp2p-blankhost" - netutil "gx/ipfs/QmZTcPxK6VqrwY94JpKZPvEqAZ6tEr1rLrpcqJbbRZbg2V/go-libp2p-netutil" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + netutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + bhost "gx/ipfs/QmZ15dDSCo4DKn4o4GnqqLExKATBeeo3oNyQ5FBKtNjEQT/go-libp2p-blankhost" + floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) func newNetHost(ctx context.Context, t *testing.T) p2phost.Host { diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index d871aaca3c8..dc158fea628 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -11,15 +11,15 @@ import ( path "github.com/ipfs/go-ipfs/path" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" gpctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - recpb "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record/pb" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + recpb "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record/pb" ) var errNoEntry = errors.New("no previous entry") diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 441b7cce2e1..08bb700a398 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -12,9 +12,9 @@ import ( . "github.com/ipfs/go-ipfs/namesys/republisher" path "github.com/ipfs/go-ipfs/path" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) func TestRepublish(t *testing.T) { diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 9c1f8381644..2e0159860b2 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -8,11 +8,11 @@ import ( path "github.com/ipfs/go-ipfs/path" mockrouting "github.com/ipfs/go-ipfs/routing/mock" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ) func TestRoutingResolve(t *testing.T) { diff --git a/namesys/routing.go b/namesys/routing.go index cd6ee7c4b30..7a1abbecf06 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -9,14 +9,14 @@ import ( pb "github.com/ipfs/go-ipfs/namesys/pb" path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) var log = logging.Logger("namesys") diff --git a/p2p/p2p.go b/p2p/p2p.go index abd7f1785ef..db4090b2740 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -5,13 +5,13 @@ import ( "errors" "time" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" - net "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + net "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" pro "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) // P2P structure holds information on currently running streams/listeners diff --git a/p2p/registry.go b/p2p/registry.go index fe1ae26fba2..74d29481bc6 100644 --- a/p2p/registry.go +++ b/p2p/registry.go @@ -4,10 +4,10 @@ import ( "fmt" "io" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" - net "gx/ipfs/QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko/go-libp2p-net" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + net "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ) // ListenerInfo holds information on a p2p listener. diff --git a/package.json b/package.json index 307d5151575..644dee158e6 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ }, { "author": "whyrusleeping", - "hash": "QmcfPte5kiCnjKVYELbDdHpuzh4avabCbg2WBjzXcHGTHN", + "hash": "QmZse3zsaZiyaAXaZ9RHgMGAgJqUDKN919gSC4kmNBcVne", "name": "go-libp2p-secio", - "version": "1.2.3" + "version": "1.2.5" }, { "author": "whyrusleeping", @@ -26,9 +26,9 @@ }, { "author": "whyrusleeping", - "hash": "QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG", + "hash": "Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU", "name": "go-libp2p-peer", - "version": "2.2.1" + "version": "2.2.2" }, { "author": "whyrusleeping", @@ -47,20 +47,20 @@ "version": "0.1.1" }, { - "hash": "QmYp98qwJs6kAtpVGij9vj2oFq5jt11ev25oGY8VDU8j2f", + "hash": "QmQtAm9iMWkV98JWotgfUQ3RRx7ZhxVDMZFnzEzmFwnKnU", "name": "iptb", - "version": "1.2.3" + "version": "1.2.4" }, { - "hash": "QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd", + "hash": "QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua", "name": "go-multihash", - "version": "1.0.6" + "version": "1.0.7" }, { "author": "satori", - "hash": "QmcyaFHbyiZfoX5GTpcqqCPYmbjYNAhRDekXSJPFHdYNSV", + "hash": "QmcBWojPoNh4qm7zvv4qiepvCnnc7ALS9qcp7TNwwxT1gT", "name": "go.uuid", - "version": "1.0.0" + "version": "1.1.0" }, { "author": "steakknife", @@ -130,9 +130,9 @@ }, { "author": "jbenet", - "hash": "QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5", + "hash": "QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg", "name": "go-datastore", - "version": "1.4.0" + "version": "1.4.1" }, { "author": "codahale", @@ -154,9 +154,9 @@ }, { "author": "whyrusleeping", - "hash": "QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR", + "hash": "QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7", "name": "go-libp2p-peerstore", - "version": "1.4.10" + "version": "1.4.14" }, { "author": "whyrusleeping", @@ -178,51 +178,51 @@ }, { "author": "whyrusleeping", - "hash": "QmTLGdJpFxjNTGqBkwTyhN3WeJteSjQPACmyxDjJ49V5NM", + "hash": "Qmc74pRHvndTDAB5nXztWAV7vs5j1obvCb9ejfQzXp9USX", "name": "retry-datastore", - "version": "1.1.5" + "version": "1.1.6" }, { "author": "whyrusleeping", - "hash": "QmWpcmY1DgPxKwMq3MWxxYx7QH61pfeQHQZSPqHjhwqT6t", + "hash": "QmPa81w9aTcax5JnkdMqN7bLPCSMSeBQEuUDX1UF1Sv6k1", "name": "failstore", - "version": "1.0.5" + "version": "1.0.6" }, { "author": "whyrusleeping", - "hash": "Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5", + "hash": "QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio", "name": "go-libp2p", - "version": "5.0.8" + "version": "5.0.11" }, { "author": "whyrusleeping", - "hash": "QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg", + "hash": "QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY", "name": "go-cid", - "version": "0.7.19" + "version": "0.7.20" }, { "author": "whyrusleeping", - "hash": "Qmak5iFUErGmKhYUC5StZtCGFp5bdhvye8PdKgTMk9B9Fw", + "hash": "QmZrg75SRPcecedozjmtQTPv8iVqx3b5ExHNVdKW3EU7w5", "name": "go-ds-flatfs", - "version": "1.1.5" + "version": "1.1.6" }, { "author": "whyrusleeping", - "hash": "QmU7tt6mHJ5Wocjy2omBxpDfN8g9pkRimzJae7EXdrs96k", + "hash": "QmRhjB5Mnha4k6VH6qRFNabAVkxpbqC7bVw2daMKLHPXXN", "name": "go-ds-measure", - "version": "1.2.3" + "version": "1.3.0" }, { "author": "whyrusleeping", - "hash": "QmYnCBXxoyoS38vtNQjjpRwZTiUnpuuKpapxMNaDfyQRLf", + "hash": "Qmbkc8BMfEixGCeKRuGGbf34mAjTb9xPmJ8Pm5gHU7ohZ4", "name": "go-ds-leveldb", - "version": "1.0.4" + "version": "1.0.5" }, { "author": "whyrusleeping", - "hash": "QmSvcDkiRwB8LuMhUtnvhum2C851Mproo75ZDD19jx43tD", + "hash": "QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT", "name": "go-libp2p-loggables", - "version": "1.1.9" + "version": "1.1.11" }, { "author": "ipfs", @@ -237,33 +237,33 @@ "version": "0.1.2" }, { - "hash": "QmfUvYQhL2GinafMbPDYz7VFoZv4iiuLuR33aRsPurXGag", + "hash": "QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL", "name": "go-libp2p-kad-dht", - "version": "3.0.11" + "version": "3.0.14" }, { "author": "whyrusleeping", - "hash": "QmUdSmn7urGVGYio3VpDUUvfC3zyP2WMNm4KMNxJmpbF2Y", + "hash": "QmdBE7cR24tR3VSUVHfDDpXD2bAmWier6LC2QZvQX9eQjb", "name": "hang-fds", - "version": "0.0.8" + "version": "0.0.9" }, { "author": "whyrusleeping", - "hash": "QmP1T1SGU6276R2MHKP2owbck37Fnzd6ZkpyNJvnG2LoTG", + "hash": "Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm", "name": "go-libp2p-floodsub", - "version": "0.9.7" + "version": "0.9.8" }, { "author": "whyrusleeping", - "hash": "QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf", + "hash": "Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES", "name": "go-ipld-format", - "version": "0.5.2" + "version": "0.5.3" }, { "author": "whyrusleeping", - "hash": "QmeZv9VXw2SfVbX55LV6kGTWASKBc9ZxAVqGBeJcDGdoXy", + "hash": "QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1", "name": "go-ipld-cbor", - "version": "1.2.11" + "version": "1.2.12" }, { "author": "lgierth", @@ -290,9 +290,9 @@ }, { "author": "libp2p", - "hash": "QmXduVyMCsR4bUbRxvc9oi8PJJFm4hyoisYHhUzCcTnfUS", + "hash": "QmUvHSZFyrZSRDUKzfE2ASstVUKtSbUCK24TTkWK73iZfc", "name": "go-libp2p-pnet", - "version": "2.3.4" + "version": "2.3.5" }, { "author": "kubuxu", @@ -308,20 +308,20 @@ }, { "author": "whyrusleeping", - "hash": "QmZTcPxK6VqrwY94JpKZPvEqAZ6tEr1rLrpcqJbbRZbg2V", + "hash": "QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY", "name": "go-libp2p-netutil", - "version": "0.3.6" + "version": "0.3.7" }, { - "hash": "QmQEo84PQQPJpx9Bf2YxerGVgmgWvQ9iwuZBAJaNJKWREr", + "hash": "QmYe9YR9fibxCaExayDXUAN7eX7Q4N7jsMcPs8KgpGdiEV", "name": "go-libp2p-kbucket", - "version": "2.1.15" + "version": "2.1.16" }, { "author": "whyrusleeping", - "hash": "Qmcxa9y1KVC51TVicSKomsnunJGSA9UJSuBvJc28JCip4H", + "hash": "QmUBVwiWc4Xv1U8qky2eZab7UqfJ1WFmCKVGjFfdDkxr8W", "name": "go-addr-util", - "version": "1.2.4" + "version": "1.2.5" }, { "author": "whyrusleeping", @@ -331,27 +331,27 @@ }, { "author": "whyrusleeping", - "hash": "QmafgXF3u3QSWErQoZ2URmQp5PFG384htoE7J338nS2H7T", + "hash": "QmexBtiTTEwwn42Yi6ouKt6VqzpA6wjJgiW1oh9VfaRrup", "name": "go-multibase", - "version": "0.2.5" + "version": "0.2.6" }, { "author": "whyrusleeping", - "hash": "Qmf82zCaYV8bkztRRoGwwSHVkaYtP2UKBnhpjJz1uFGJjQ", + "hash": "Qmamsg8biD9P9CkvWGPUkWtJZNfyeHcWu2uztXkknd3frd", "name": "go-libp2p-interface-conn", - "version": "0.4.10" + "version": "0.4.11" }, { "author": "multiformats", - "hash": "QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG", + "hash": "QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb", "name": "go-multiaddr", - "version": "1.2.5" + "version": "1.2.6" }, { "author": "whyrusleeping", - "hash": "QmaL2WYJGbWKqHoLujoi9GQ5jj4JVFrBqHUBWmEYzJPVWT", + "hash": "Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux", "name": "go-libp2p-metrics", - "version": "2.0.2" + "version": "2.0.3" }, { "author": "whyrusleeping", @@ -361,21 +361,21 @@ }, { "author": "multiformats", - "hash": "QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr", + "hash": "QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB", "name": "go-multiaddr-net", - "version": "1.5.6" + "version": "1.5.7" }, { "author": "libp2p", - "hash": "QmXcN1kXchSvodd2MGypWXXirXk7GigQ7WVyWGYpukag6J", + "hash": "QmRFDGFgeKQjEjZdVcDUBiGYLkRDHbH151dLwa5K7dgGZy", "name": "go-libp2p-interface-pnet", - "version": "2.1.4" + "version": "2.1.5" }, { "author": "whyrusleeping", - "hash": "QmU4vCDZTPLDqSDKguWbHCiUe46mZUtmM2g2suBZ9NE8ko", + "hash": "QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2", "name": "go-libp2p-net", - "version": "2.0.3" + "version": "2.0.4" }, { "author": "whyrusleeping", @@ -403,20 +403,20 @@ }, { "author": "whyrusleeping", - "hash": "QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd", + "hash": "QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL", "name": "go-libp2p-host", - "version": "2.1.3" + "version": "2.1.4" }, { "author": "whyrusleeping", - "hash": "QmUhvp4VoQ9cKDVLqAxciEKdm8ymBx2Syx4C1Tv6SmSTPa", + "hash": "QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d", "name": "go-libp2p-swarm", - "version": "2.1.2" + "version": "2.1.3" }, { - "hash": "QmUEB5nT4LG3TkUd5mkHrfRESUSgaUD4r7jSAYvvPeuWT9", + "hash": "Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46", "name": "go-ipfs-cmds", - "version": "1.0.2" + "version": "1.0.3" }, { "hash": "QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM", @@ -425,14 +425,14 @@ }, { "author": "whyrusleeping", - "hash": "QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3", + "hash": "QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx", "name": "go-ipfs-util", - "version": "1.2.6" + "version": "1.2.7" }, { - "hash": "QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR", + "hash": "QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV", "name": "go-libp2p-record", - "version": "2.1.6" + "version": "3.0.1" }, { "author": "whyrusleeping", @@ -442,61 +442,61 @@ }, { "author": "stebalien", - "hash": "QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c", + "hash": "Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2", "name": "go-block-format", - "version": "0.1.5" + "version": "0.1.6" }, { - "hash": "QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA", + "hash": "QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon", "name": "go-libp2p-routing", - "version": "2.2.19" + "version": "2.2.20" }, { "author": "whyrusleeping", - "hash": "Qmajzb6i5uwyfzcBtdqHYx94qSAMKZHBFouGV1xVbAKES9", + "hash": "QmX5GwZzNJ2PhFDPW12MjQWtmE21i4UnHQ2uKtYkp4Ad7a", "name": "go-ipld-git", - "version": "0.1.5" + "version": "0.1.6" }, { - "hash": "QmcrNvQBZkpbT7zLcGyjdPCiCHLVtaYeg4UVUH7XLfWJWy", + "hash": "Qmf2UAmRwDG4TvnkQpHZWPAzw7rpCYVhxmRXmYxXr5LD1g", "name": "go-maddr-filter", - "version": "1.1.5" + "version": "1.1.6" }, { "author": "vyzo", - "hash": "QmVqNgx6RByRcnLVsr9spbo5ScomJyDZrb9Gz4XMWkYB7Z", + "hash": "QmS1Cmc1ZP4vwvwSuJ92pWdrdmd51YPqpxYu8byYKwPnKv", "name": "go-libp2p-circuit", - "version": "2.0.7" + "version": "2.0.8" }, { "author": "magik6k", - "hash": "Qmdin8YL17fL1BC5ej6o9b8es6MBoiQjKVdyxEwJh3HVmf", + "hash": "QmNy185DeGicV5kKsmPxEoffUYm1SeQFHXHTs8L8QnuHX8", "name": "go-ds-badger", - "version": "1.3.0" + "version": "1.4.2" }, { "author": "whyrusleeping", - "hash": "QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp", + "hash": "QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG", "name": "go-testutil", - "version": "1.1.13" + "version": "1.1.14" }, { "author": "whyrusleeping", - "hash": "QmainUZ19HogMBjMocvHmgWEqofbpzLGNAir4AEY1KcJey", + "hash": "QmQqCKzSsjnsvoLxFeNJUCkeicXU4hY47GTCeTwEUnsvyx", "name": "go-libp2p-connmgr", - "version": "0.3.6" + "version": "0.3.7" }, { "author": "why", - "hash": "QmSAJm4QdTJ3EGF2cvgNcQyXTEbxqWSW1x4kCVV1aJQUQr", + "hash": "QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o", "name": "go-libp2p-interface-connmgr", - "version": "0.0.4" + "version": "0.0.5" }, { "author": "why", - "hash": "QmdMeXVB1V1SAZcFzoCuM3zR9K8PeuzCYg4zXNHcHh6dHU", + "hash": "QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp", "name": "go-ipfs-addr", - "version": "0.1.4" + "version": "0.1.5" }, { "author": "The Go Authors", @@ -506,9 +506,9 @@ }, { "author": "whyrusleeping", - "hash": "QmYmhgAcvmDGXct1qBvc1kz9BxQSit1XBrTeiGZp2FvRyn", + "hash": "QmZ15dDSCo4DKn4o4GnqqLExKATBeeo3oNyQ5FBKtNjEQT", "name": "go-libp2p-blankhost", - "version": "0.2.3" + "version": "0.2.4" }, { "author": "jbenet", diff --git a/path/path.go b/path/path.go index 9c4d8f135e3..decf2890487 100644 --- a/path/path.go +++ b/path/path.go @@ -5,7 +5,7 @@ import ( "path" "strings" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) // ErrBadPath is returned when a given path is incorrectly formatted diff --git a/path/resolver.go b/path/resolver.go index c4aabe1b752..68639fbc0d9 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -9,9 +9,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("path") diff --git a/path/resolver_test.go b/path/resolver_test.go index 53393281441..8347fc6023d 100644 --- a/path/resolver_test.go +++ b/path/resolver_test.go @@ -9,8 +9,8 @@ import ( dagmock "github.com/ipfs/go-ipfs/merkledag/test" path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - util "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func randNode() *merkledag.ProtoNode { diff --git a/pin/gc/gc.go b/pin/gc/gc.go index f3b98597bcf..7a19b69698b 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -9,9 +9,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("gc") diff --git a/pin/pin.go b/pin/pin.go index 00198179258..f148053ff70 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -12,10 +12,10 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" dutils "github.com/ipfs/go-ipfs/merkledag/utils" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("pin") diff --git a/pin/pin_test.go b/pin/pin_test.go index f34283b79cc..7980c8dbc4d 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -10,10 +10,10 @@ import ( "github.com/ipfs/go-ipfs/exchange/offline" mdag "github.com/ipfs/go-ipfs/merkledag" - "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func randNode() (*mdag.ProtoNode, *cid.Cid) { diff --git a/pin/set.go b/pin/set.go index 116e6229710..6d4bff54b54 100644 --- a/pin/set.go +++ b/pin/set.go @@ -12,9 +12,9 @@ import ( "github.com/ipfs/go-ipfs/merkledag" "github.com/ipfs/go-ipfs/pin/internal/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const ( diff --git a/pin/set_test.go b/pin/set_test.go index 1ee16ed3849..0eab73b3541 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -10,9 +10,9 @@ import ( offline "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func ignoreCids(_ *cid.Cid) {} diff --git a/plugin/ipld.go b/plugin/ipld.go index 8815ce080af..71b7a8170dc 100644 --- a/plugin/ipld.go +++ b/plugin/ipld.go @@ -3,7 +3,7 @@ package plugin import ( "github.com/ipfs/go-ipfs/core/coredag" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // PluginIPLD is an interface that can be implemented to add handlers for diff --git a/plugin/loader/initializer.go b/plugin/loader/initializer.go index 9115634c9a9..b9e9d00f21f 100644 --- a/plugin/loader/initializer.go +++ b/plugin/loader/initializer.go @@ -4,7 +4,7 @@ import ( "github.com/ipfs/go-ipfs/core/coredag" "github.com/ipfs/go-ipfs/plugin" - format "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + format "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func initialize(plugins []plugin.Plugin) error { diff --git a/plugin/plugins/git/git.go b/plugin/plugins/git/git.go index dae188b8833..f50bc40267e 100644 --- a/plugin/plugins/git/git.go +++ b/plugin/plugins/git/git.go @@ -9,10 +9,10 @@ import ( "github.com/ipfs/go-ipfs/core/coredag" "github.com/ipfs/go-ipfs/plugin" - "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - git "gx/ipfs/Qmajzb6i5uwyfzcBtdqHYx94qSAMKZHBFouGV1xVbAKES9/go-ipld-git" - "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + git "gx/ipfs/QmX5GwZzNJ2PhFDPW12MjQWtmE21i4UnHQ2uKtYkp4Ad7a/go-ipld-git" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Plugins is exported list of plugins that will be loaded diff --git a/repo/config/bootstrap_peers.go b/repo/config/bootstrap_peers.go index d4f6469dc14..f59a3f65528 100644 --- a/repo/config/bootstrap_peers.go +++ b/repo/config/bootstrap_peers.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - iaddr "gx/ipfs/QmdMeXVB1V1SAZcFzoCuM3zR9K8PeuzCYg4zXNHcHh6dHU/go-ipfs-addr" + iaddr "gx/ipfs/QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp/go-ipfs-addr" ) // DefaultBootstrapAddresses are the hardcoded bootstrap addresses diff --git a/repo/config/init.go b/repo/config/init.go index a3ceee6d388..afcdbfec939 100644 --- a/repo/config/init.go +++ b/repo/config/init.go @@ -7,7 +7,7 @@ import ( "io" "time" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index d2ad79804a8..6b22b127513 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -10,15 +10,15 @@ import ( repo "github.com/ipfs/go-ipfs/repo" - measure "gx/ipfs/QmU7tt6mHJ5Wocjy2omBxpDfN8g9pkRimzJae7EXdrs96k/go-ds-measure" - flatfs "gx/ipfs/Qmak5iFUErGmKhYUC5StZtCGFp5bdhvye8PdKgTMk9B9Fw/go-ds-flatfs" + measure "gx/ipfs/QmRhjB5Mnha4k6VH6qRFNabAVkxpbqC7bVw2daMKLHPXXN/go-ds-measure" + flatfs "gx/ipfs/QmZrg75SRPcecedozjmtQTPv8iVqx3b5ExHNVdKW3EU7w5/go-ds-flatfs" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - mount "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/syncmount" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + mount "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/syncmount" - levelds "gx/ipfs/QmYnCBXxoyoS38vtNQjjpRwZTiUnpuuKpapxMNaDfyQRLf/go-ds-leveldb" + badgerds "gx/ipfs/QmNy185DeGicV5kKsmPxEoffUYm1SeQFHXHTs8L8QnuHX8/go-ds-badger" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" - badgerds "gx/ipfs/Qmdin8YL17fL1BC5ej6o9b8es6MBoiQjKVdyxEwJh3HVmf/go-ds-badger" + levelds "gx/ipfs/Qmbkc8BMfEixGCeKRuGGbf34mAjTb9xPmJ8Pm5gHU7ohZ4/go-ds-leveldb" ) // ConfigFromMap creates a new datastore config from a map diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 51823042a77..0f555d33bec 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -23,10 +23,10 @@ import ( "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir" - util "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + measure "gx/ipfs/QmRhjB5Mnha4k6VH6qRFNabAVkxpbqC7bVw2daMKLHPXXN/go-ds-measure" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - measure "gx/ipfs/QmU7tt6mHJ5Wocjy2omBxpDfN8g9pkRimzJae7EXdrs96k/go-ds-measure" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) var log = logging.Logger("fsrepo") diff --git a/repo/fsrepo/fsrepo_test.go b/repo/fsrepo/fsrepo_test.go index 14837540fd8..9cb6e86ee73 100644 --- a/repo/fsrepo/fsrepo_test.go +++ b/repo/fsrepo/fsrepo_test.go @@ -9,7 +9,7 @@ import ( "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/thirdparty/assert" - datastore "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + datastore "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" ) // swap arg order diff --git a/repo/fsrepo/lock/lock.go b/repo/fsrepo/lock/lock.go index 9e18e5b8629..2872aaf00ec 100644 --- a/repo/fsrepo/lock/lock.go +++ b/repo/fsrepo/lock/lock.go @@ -8,7 +8,7 @@ import ( "strings" "syscall" - "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" lock "gx/ipfs/QmWi28zbQG6B1xfaaWx5cYoLn3kBFU6pQ6GWQNRV5P6dNe/lock" ) diff --git a/repo/fsrepo/serialize/serialize.go b/repo/fsrepo/serialize/serialize.go index 2171f23da47..d98a5264011 100644 --- a/repo/fsrepo/serialize/serialize.go +++ b/repo/fsrepo/serialize/serialize.go @@ -9,7 +9,7 @@ import ( "path/filepath" "github.com/ipfs/go-ipfs/repo/config" - "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" "gx/ipfs/QmdYwCmx8pZRkzdcd8MhmLJqYVoVTC1aGsy5Q4reMGLNLg/atomicfile" ) diff --git a/repo/mock.go b/repo/mock.go index 46ae7560ebd..40e4b558671 100644 --- a/repo/mock.go +++ b/repo/mock.go @@ -7,7 +7,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/repo/config" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) var errTODO = errors.New("TODO: mock repo") diff --git a/repo/repo.go b/repo/repo.go index 8cd77659415..b7a58f2562b 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -8,8 +8,8 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" config "github.com/ipfs/go-ipfs/repo/config" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) var ( diff --git a/routing/mock/centralized_client.go b/routing/mock/centralized_client.go index 175a9d436dc..683a2a88485 100644 --- a/routing/mock/centralized_client.go +++ b/routing/mock/centralized_client.go @@ -6,18 +6,18 @@ import ( "time" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" - dhtpb "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record/pb" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + dhtpb "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record/pb" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) var log = logging.Logger("mockrouter") diff --git a/routing/mock/centralized_server.go b/routing/mock/centralized_server.go index 1a3d6ef3746..6a86a6c6b92 100644 --- a/routing/mock/centralized_server.go +++ b/routing/mock/centralized_server.go @@ -6,13 +6,13 @@ import ( "sync" "time" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dssync "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) // server is the mockrouting.Client's private interface to the routing server diff --git a/routing/mock/centralized_test.go b/routing/mock/centralized_test.go index 917b71afb7b..0fb7ce90fd6 100644 --- a/routing/mock/centralized_test.go +++ b/routing/mock/centralized_test.go @@ -6,11 +6,11 @@ import ( "time" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) func TestKeyNotFound(t *testing.T) { diff --git a/routing/mock/interface.go b/routing/mock/interface.go index 3aed934ce3a..31de6b0cc61 100644 --- a/routing/mock/interface.go +++ b/routing/mock/interface.go @@ -8,11 +8,11 @@ import ( "context" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ) // Server provides mockrouting Clients diff --git a/routing/none/none_client.go b/routing/none/none_client.go index 64f9893b031..7d29395930c 100644 --- a/routing/none/none_client.go +++ b/routing/none/none_client.go @@ -6,11 +6,11 @@ import ( repo "github.com/ipfs/go-ipfs/repo" - p2phost "gx/ipfs/QmP46LGWhzVZTMmt5akNNLfoV8qL4h5wTwmzQxLyDafggd/go-libp2p-host" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - peer "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) type nilclient struct { diff --git a/routing/offline/offline.go b/routing/offline/offline.go index a1d58f09204..46cb34adac6 100644 --- a/routing/offline/offline.go +++ b/routing/offline/offline.go @@ -7,15 +7,15 @@ import ( dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - routing "gx/ipfs/QmPCGUjMRuBcPybZFpjhzpifwPP9wPRoiy5geTQKU4vqWA/go-libp2p-routing" - record "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record" - pb "gx/ipfs/QmWGtsyPYEoiqTtWLpeUA2jpW4YSZgarKDD2zivYAFz7sR/go-libp2p-record/pb" - "gx/ipfs/QmWNY7dV54ZDYmTA1ykVdwNCqC11mpU4zSUp6XDpLTH9eG/go-libp2p-peer" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" + pb "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record/pb" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) var ErrOffline = errors.New("routing system in offline mode") diff --git a/routing/offline/offline_test.go b/routing/offline/offline_test.go index e0da0d2ef0b..42a80016237 100644 --- a/routing/offline/offline_test.go +++ b/routing/offline/offline_test.go @@ -5,8 +5,8 @@ import ( "context" "testing" - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestOfflineRouterStorage(t *testing.T) { diff --git a/tar/format.go b/tar/format.go index eb1db7e1baa..512ef046d39 100644 --- a/tar/format.go +++ b/tar/format.go @@ -15,8 +15,8 @@ import ( path "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("tarfmt") diff --git a/test/dependencies/ma-pipe-unidir/main.go b/test/dependencies/ma-pipe-unidir/main.go index 8cf0f11a19b..ec7f7272e2e 100644 --- a/test/dependencies/ma-pipe-unidir/main.go +++ b/test/dependencies/ma-pipe-unidir/main.go @@ -8,8 +8,8 @@ import ( "os" "strconv" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) const USAGE = "ma-pipe-unidir [-l|--listen] [--pidFile=path] [-h|--help] \n" diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 78f9d7a81f7..53cfadc41a6 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -18,10 +18,10 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) var log = logging.Logger("epictest") diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index 2be19f6e4c4..1667277a959 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -13,9 +13,9 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func BenchmarkCat1MB(b *testing.B) { benchmarkVarCat(b, unit.MB*1) } diff --git a/test/integration/bench_test.go b/test/integration/bench_test.go index c7c3e9919ab..c84d13f23d5 100644 --- a/test/integration/bench_test.go +++ b/test/integration/bench_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/ipfs/go-ipfs/thirdparty/unit" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func benchmarkAddCat(numBytes int64, conf testutil.LatencyConfig, b *testing.B) { diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index c7d3b8db130..4197a9512af 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -7,10 +7,10 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/mock" - "gx/ipfs/QmYsEQydGrsxNZfAiskvQ76N2xE9hDQtSAkRSynwMiUK3c/go-block-format" + "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) func TestBitswapWithoutRouting(t *testing.T) { diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index a4304dfcc52..df5b40b410e 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -14,9 +14,9 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - pstore "gx/ipfs/QmYijbtjCxFEjSXaudaQAUz3LN5VKLssm8WCUsRoqzXmQR/go-libp2p-peerstore" - mocknet "gx/ipfs/Qma23bpHwQrQyvKeBemaeJh7sAoRHggPkgnge1B9489ff5/go-libp2p/p2p/net/mock" - testutil "gx/ipfs/QmeDA8gNhvRTsbrjEieay5wezupJDiky8xvCzDABbsGzmp/go-testutil" + mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) func TestThreeLeggedCatTransfer(t *testing.T) { diff --git a/thirdparty/datastore2/datastore_closer.go b/thirdparty/datastore2/datastore_closer.go index 546a80e5b77..3cc9bfed550 100644 --- a/thirdparty/datastore2/datastore_closer.go +++ b/thirdparty/datastore2/datastore_closer.go @@ -3,8 +3,8 @@ package datastore2 import ( "io" - "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - syncds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/sync" + "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" ) type ThreadSafeDatastoreCloser interface { diff --git a/thirdparty/datastore2/delayed.go b/thirdparty/datastore2/delayed.go index 8e6e3887d29..1a33237c3e4 100644 --- a/thirdparty/datastore2/delayed.go +++ b/thirdparty/datastore2/delayed.go @@ -1,8 +1,8 @@ package datastore2 import ( - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - dsq "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore/query" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + dsq "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/query" delay "github.com/ipfs/go-ipfs/thirdparty/delay" ) diff --git a/thirdparty/datastore2/threadsafe.go b/thirdparty/datastore2/threadsafe.go index d4e9e55fd23..124c1e63e4e 100644 --- a/thirdparty/datastore2/threadsafe.go +++ b/thirdparty/datastore2/threadsafe.go @@ -3,7 +3,7 @@ package datastore2 import ( "io" - "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" + "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" ) // ClaimThreadSafe claims that a Datastore is threadsafe, even when diff --git a/thirdparty/ds-help/key.go b/thirdparty/ds-help/key.go index 072d4fa9a01..c1cf2c48479 100644 --- a/thirdparty/ds-help/key.go +++ b/thirdparty/ds-help/key.go @@ -1,8 +1,8 @@ package dshelp import ( - ds "gx/ipfs/QmdHG8MAuARdGHxx4rPQASLcvhz24fzjSQq7AJRAQEorq5/go-datastore" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" base32 "gx/ipfs/QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6/base32" ) diff --git a/thirdparty/pollEndpoint/main.go b/thirdparty/pollEndpoint/main.go index adebe265c8f..7b12fc80817 100644 --- a/thirdparty/pollEndpoint/main.go +++ b/thirdparty/pollEndpoint/main.go @@ -10,9 +10,9 @@ import ( "os" "time" - manet "gx/ipfs/QmSGL5Uoa6gKHgBBwQG8u1CWKUC8ZnwaZiLgFVTFBR2bxr/go-multiaddr-net" + manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - ma "gx/ipfs/QmW8s4zTsUoX1Q6CeYxVKPyqSKbF7H1YDUyTostBtZ8DaG/go-multiaddr" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" ) var ( diff --git a/thirdparty/posinfo/posinfo.go b/thirdparty/posinfo/posinfo.go index f24c260bd39..8ab873a9182 100644 --- a/thirdparty/posinfo/posinfo.go +++ b/thirdparty/posinfo/posinfo.go @@ -3,7 +3,7 @@ package posinfo import ( "os" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type PosInfo struct { diff --git a/unixfs/archive/archive.go b/unixfs/archive/archive.go index 8061f90ddd6..dc3afd0c27d 100644 --- a/unixfs/archive/archive.go +++ b/unixfs/archive/archive.go @@ -11,7 +11,7 @@ import ( tar "github.com/ipfs/go-ipfs/unixfs/archive/tar" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DefaultBufSize is the buffer size for gets. for now, 1MB, which is ~4 blocks. diff --git a/unixfs/archive/tar/writer.go b/unixfs/archive/tar/writer.go index 360334b79c2..27372e8f848 100644 --- a/unixfs/archive/tar/writer.go +++ b/unixfs/archive/tar/writer.go @@ -13,8 +13,8 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" upb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Writer is a utility structure that helps to write diff --git a/unixfs/hamt/hamt.go b/unixfs/hamt/hamt.go index fdf72238770..044017f974f 100644 --- a/unixfs/hamt/hamt.go +++ b/unixfs/hamt/hamt.go @@ -31,9 +31,9 @@ import ( format "github.com/ipfs/go-ipfs/unixfs" upb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" "gx/ipfs/QmfJHywXQu98UeZtGJBQrPAR6AtmDjjbe3qjTo9piXHPnx/murmur3" ) diff --git a/unixfs/io/dagreader.go b/unixfs/io/dagreader.go index 8ec527033ce..9d197876c09 100644 --- a/unixfs/io/dagreader.go +++ b/unixfs/io/dagreader.go @@ -10,8 +10,8 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrIsDir = errors.New("this dag node is a directory") diff --git a/unixfs/io/dirbuilder.go b/unixfs/io/dirbuilder.go index 1ab8cf7121e..822533435ef 100644 --- a/unixfs/io/dirbuilder.go +++ b/unixfs/io/dirbuilder.go @@ -8,9 +8,9 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" format "github.com/ipfs/go-ipfs/unixfs" hamt "github.com/ipfs/go-ipfs/unixfs/hamt" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ShardSplitThreshold specifies how large of an unsharded directory diff --git a/unixfs/io/pbdagreader.go b/unixfs/io/pbdagreader.go index 891865400b4..0bc8d61e87b 100644 --- a/unixfs/io/pbdagreader.go +++ b/unixfs/io/pbdagreader.go @@ -10,9 +10,9 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DagReader provides a way to easily read the data contained in a dag. diff --git a/unixfs/io/resolve.go b/unixfs/io/resolve.go index a66de7bdf46..a5b4f132ada 100644 --- a/unixfs/io/resolve.go +++ b/unixfs/io/resolve.go @@ -7,7 +7,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" hamt "github.com/ipfs/go-ipfs/unixfs/hamt" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ResolveUnixfsOnce resolves a single hop of a path through a graph in a diff --git a/unixfs/mod/dagmodifier.go b/unixfs/mod/dagmodifier.go index 92fd3f4ccc8..b6ae06fa10e 100644 --- a/unixfs/mod/dagmodifier.go +++ b/unixfs/mod/dagmodifier.go @@ -14,9 +14,9 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrSeekFail = errors.New("failed to seek properly") diff --git a/unixfs/mod/dagmodifier_test.go b/unixfs/mod/dagmodifier_test.go index d6ba1ddb809..41979c613be 100644 --- a/unixfs/mod/dagmodifier_test.go +++ b/unixfs/mod/dagmodifier_test.go @@ -13,7 +13,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" testu "github.com/ipfs/go-ipfs/unixfs/test" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" ) func testModWrite(t *testing.T, beg, size uint64, orig []byte, dm *DagModifier, opts testu.NodeOpts) []byte { diff --git a/unixfs/test/utils.go b/unixfs/test/utils.go index 8ea7de6e161..fe2a23508c0 100644 --- a/unixfs/test/utils.go +++ b/unixfs/test/utils.go @@ -15,10 +15,10 @@ import ( mdagmock "github.com/ipfs/go-ipfs/merkledag/test" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/QmNwUEK7QbwSqyKBu3mMtToo8SUc6wQJ7gdZq4gGGJqfnf/go-ipld-format" - u "gx/ipfs/QmPsAfmDBnZN3kZGSuNwvCNDZiHneERSKmRcFyG3UkvcT3/go-ipfs-util" - mh "gx/ipfs/QmYeKnKpubCMRiq3PGZcTREErthbb5Q9cXsCoSkD9bjEBd/go-multihash" - cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func SizeSplitterGen(size int64) chunk.SplitterGen { From d82b5272b93e052eaf847d87453648ba8816be73 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 24 Jan 2018 16:05:10 -0800 Subject: [PATCH 02/25] switch to fast base58 library License: MIT Signed-off-by: Steven Allen --- core/commands/dht.go | 21 ++++++++++++++++----- core/commands/id.go | 6 +++--- core/core.go | 8 ++++++-- package.json | 12 ++++++------ 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/core/commands/dht.go b/core/commands/dht.go index ecc8200e580..ed2e2818a63 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -15,7 +15,7 @@ import ( routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" notif "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing/notifications" - b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" + b58 "gx/ipfs/QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY/go-base58-fast/base58" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" @@ -69,9 +69,13 @@ var queryDhtCmd = &cmds.Command{ events := make(chan *notif.QueryEvent) ctx := notif.RegisterForQueryEvents(req.Context(), events) - k := string(b58.Decode(req.Arguments()[0])) + id, err := peer.IDB58Decode(req.Arguments()[0]) + if err != nil { + res.SetError(cmds.ClientError("invalid peer ID"), cmdkit.ErrClient) + return + } - closestPeers, err := dht.GetClosestPeers(ctx, k) + closestPeers, err := dht.GetClosestPeers(ctx, string(id)) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -773,9 +777,16 @@ func escapeDhtKey(s string) (string, error) { parts := path.SplitList(s) switch len(parts) { case 1: - return string(b58.Decode(s)), nil + k, err := b58.Decode(s) + if err != nil { + return "", err + } + return string(k), nil case 3: - k := b58.Decode(parts[2]) + k, err := b58.Decode(parts[2]) + if err != nil { + return "", err + } return path.Join(append(parts[:2], string(k))), nil default: return "", errors.New("invalid key") diff --git a/core/commands/id.go b/core/commands/id.go index 69126e43a59..0d4b6c5e0d4 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -13,7 +13,6 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" identify "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" - b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" kb "gx/ipfs/QmYe9YR9fibxCaExayDXUAN7eX7Q4N7jsMcPs8KgpGdiEV/go-libp2p-kbucket" "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" @@ -72,8 +71,9 @@ EXAMPLE: var id peer.ID if len(req.Arguments()) > 0 { - id = peer.ID(b58.Decode(req.Arguments()[0])) - if len(id) == 0 { + var err error + id, err = peer.IDB58Decode(req.Arguments()[0]) + if err != nil { res.SetError(cmds.ClientError("Invalid peer id"), cmdkit.ErrClient) return } diff --git a/core/core.go b/core/core.go index 9311a80a7f7..80aeb1dd2ea 100644 --- a/core/core.go +++ b/core/core.go @@ -59,7 +59,6 @@ import ( goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" addrutil "gx/ipfs/QmUBVwiWc4Xv1U8qky2eZab7UqfJ1WFmCKVGjFfdDkxr8W/go-addr-util" pnet "gx/ipfs/QmUvHSZFyrZSRDUKzfE2ASstVUKtSbUCK24TTkWK73iZfc/go-libp2p-pnet" mssmux "gx/ipfs/QmVniQJkdzLZaZwzwMdd3dJTvWiJ1DQEkreVy6hs6h7Vk5/go-smux-multistream" @@ -672,7 +671,12 @@ func (n *IpfsNode) loadID() error { return errors.New("no peer ID in config! (was 'ipfs init' run?)") } - n.Identity = peer.ID(b58.Decode(cid)) + id, err := peer.IDB58Decode(cid) + if err != nil { + return fmt.Errorf("peer ID invalid: %s", err) + } + + n.Identity = id return nil } diff --git a/package.json b/package.json index 644dee158e6..c3045a5ae5d 100644 --- a/package.json +++ b/package.json @@ -395,12 +395,6 @@ "name": "protobuf", "version": "0.0.0" }, - { - "author": "whyrusleeping", - "hash": "QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf", - "name": "go-base58", - "version": "0.0.0" - }, { "author": "whyrusleeping", "hash": "QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL", @@ -515,6 +509,12 @@ "hash": "QmWBug6eBS7AxRdCDVuSY5CnSit7cS2XnPFYJWqWDumhCG", "name": "go-msgio", "version": "0.0.3" + }, + { + "author": "mr-tron", + "hash": "QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY", + "name": "go-base58-fast", + "version": "0.1.1" } ], "gxVersion": "0.10.0", From 8899e986703ad4f597c637564e2d59d3c2bb8645 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 14:32:40 -0800 Subject: [PATCH 03/25] fix tests that use invalid peer IDs Our code now better validates peer IDs. License: MIT Signed-off-by: Steven Allen --- core/coreapi/key_test.go | 2 +- core/coreapi/unixfs_test.go | 4 +++- core/corehttp/gateway_test.go | 2 +- core/coreunix/add_test.go | 8 +++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/coreapi/key_test.go b/core/coreapi/key_test.go index 7e1b23ac9d0..6ec279e4b1b 100644 --- a/core/coreapi/key_test.go +++ b/core/coreapi/key_test.go @@ -31,7 +31,7 @@ func TestListSelf(t *testing.T) { t.Errorf("expected the key to be called 'self', got '%s'", keys[0].Name()) } - if keys[0].Path().String() != "/ipns/Qmfoo" { + if keys[0].Path().String() != "/ipns/"+testPeerID { t.Errorf("expected the key to have path '/ipns/Qmfoo', got '%s'", keys[0].Path().String()) } } diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 7eff906b90f..e4423dd90eb 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -25,6 +25,8 @@ import ( ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) +const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" + // `echo -n 'hello, world!' | ipfs add` var hello = coreapi.ResolvedPath("/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk", nil, nil) var helloStr = "hello, world!" @@ -59,7 +61,7 @@ func makeAPIIdent(ctx context.Context, fullIdentity bool) (*core.IpfsNode, corei } } else { ident = config.Identity{ - PeerID: "Qmfoo", + PeerID: testPeerID, } } diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 32c03a88604..6b396812e29 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -55,7 +55,7 @@ func (m mockNamesys) GetResolver(subs string) (namesys.Resolver, bool) { func newNodeWithMockNamesys(ns mockNamesys) (*core.IpfsNode, error) { c := config.Config{ Identity: config.Identity{ - PeerID: "Qmfoo", // required by offline node + PeerID: "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe", // required by offline node }, } r := &repo.Mock{ diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index 000b06b8c2e..c7e647ee987 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -25,11 +25,13 @@ import ( "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) +const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" + func TestAddRecursive(t *testing.T) { r := &repo.Mock{ C: config.Config{ Identity: config.Identity{ - PeerID: "Qmfoo", // required by offline node + PeerID: testPeerID, // required by offline node }, }, D: ds2.ThreadSafeCloserMapDatastore(), @@ -49,7 +51,7 @@ func TestAddGCLive(t *testing.T) { r := &repo.Mock{ C: config.Config{ Identity: config.Identity{ - PeerID: "Qmfoo", // required by offline node + PeerID: testPeerID, // required by offline node }, }, D: ds2.ThreadSafeCloserMapDatastore(), @@ -158,7 +160,7 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) { r := &repo.Mock{ C: config.Config{ Identity: config.Identity{ - PeerID: "Qmfoo", // required by offline node + PeerID: testPeerID, // required by offline node }, }, D: ds2.ThreadSafeCloserMapDatastore(), From 281d5eafb4ed763047c70b8097881ab2a5654e4b Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Sat, 20 Jan 2018 17:25:55 -0500 Subject: [PATCH 04/25] Update ipns validator License: MIT Signed-off-by: Dirk McCormick --- namesys/ipns_validate_test.go | 93 +++++++++++++++++++++++++++++++++++ namesys/publisher.go | 32 +++++++++++- 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 namesys/ipns_validate_test.go diff --git a/namesys/ipns_validate_test.go b/namesys/ipns_validate_test.go new file mode 100644 index 00000000000..d75fa6cb701 --- /dev/null +++ b/namesys/ipns_validate_test.go @@ -0,0 +1,93 @@ +package namesys + +import ( + "testing" + "time" + + path "github.com/ipfs/go-ipfs/path" + u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" + record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" +) + +func TestValidation(t *testing.T) { + // Create a record validator + validator := make(record.Validator) + validator["ipns"] = &record.ValidChecker{ValidateIpnsRecord, true} + + // Generate a key for signing the records + r := u.NewSeededRand(15) // generate deterministic keypair + priv, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) + if err != nil { + t.Fatal(err) + } + + // Create entry with expiry in one hour + ts := time.Now() + entry, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(time.Hour)) + if err != nil { + t.Fatal(err) + } + + // Get IPNS record path + pubkb, err := pubk.Bytes() + if err != nil { + t.Fatal(err) + } + pubkh := u.Hash(pubkb).B58String() + ipnsPath := "/ipns/" + pubkh + + val, err := proto.Marshal(entry) + if err != nil { + t.Fatal(err) + } + + // Create the record + r1, err := record.MakePutRecord(priv, ipnsPath, val, true) + + // Validate the record + err = validator.VerifyRecord(r1) + if err != nil { + t.Fatal(err) + } + + // Create IPNS record path with a different key + _, pubk2, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) + if err != nil { + t.Fatal(err) + } + pubkb2, err := pubk2.Bytes() + if err != nil { + t.Fatal(err) + } + pubkh2 := u.Hash(pubkb2).B58String() + ipnsWrongPath := "/ipns/" + pubkh2 + + r2, err := record.MakePutRecord(priv, ipnsWrongPath, val, true) + + // Record should fail validation because path doesn't match author + err = validator.VerifyRecord(r2) + if err != ErrInvalidAuthor { + t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") + } + + // Create expired entry + expired, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(-1*time.Hour)) + if err != nil { + t.Fatal(err) + } + valExp, err := proto.Marshal(expired) + if err != nil { + t.Fatal(err) + } + + // Create record with the expired entry + r3, err := record.MakePutRecord(priv, ipnsPath, valExp, true) + + // Record should fail validation because entry is expired + err = validator.VerifyRecord(r3) + if err != ErrExpiredRecord { + t.Fatal("ValidateIpnsRecord should have returned ErrExpiredRecord") + } +} diff --git a/namesys/publisher.go b/namesys/publisher.go index 6d033d50233..4861a1eaee2 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -5,6 +5,7 @@ import ( "context" "errors" "fmt" + "strings" "time" pb "github.com/ipfs/go-ipfs/namesys/pb" @@ -31,6 +32,14 @@ var ErrExpiredRecord = errors.New("expired record") // unknown validity type. var ErrUnrecognizedValidity = errors.New("unrecognized validity type") +// ErrInvalidAuthor is returned when an IpnsRecord has an +// author that does not match the IPNS path +var ErrInvalidAuthor = errors.New("author does not match path") + +// ErrInvalidPath should be returned when an ipns record path +// is not in a valid format +var ErrInvalidPath = errors.New("record path invalid") + const PublishPutValTimeout = time.Minute const DefaultRecordTTL = 24 * time.Hour @@ -295,12 +304,31 @@ func selectRecord(recs []*pb.IpnsEntry, vals [][]byte) (int, error) { // ValidateIpnsRecord implements ValidatorFunc and verifies that the // given 'val' is an IpnsEntry and that that entry is valid. -func ValidateIpnsRecord(k string, val []byte) error { +func ValidateIpnsRecord(r *record.ValidationRecord) error { + if r.Namespace != "ipns" { + return ErrInvalidPath + } + entry := new(pb.IpnsEntry) - err := proto.Unmarshal(val, entry) + err := proto.Unmarshal(r.Value, entry) if err != nil { return err } + + // Note: The DHT will actually check the signature so we don't + // need to do that here + + // Author in key must match author in record + parts := strings.Split(r.Key, "/") + pid, err := peer.IDB58Decode(parts[0]) + if err != nil { + return ErrInvalidAuthor + } + if string(pid) != string(r.Author) { + return ErrInvalidAuthor + } + + // Check that record has not expired switch entry.GetValidityType() { case pb.IpnsEntry_EOL: t, err := u.ParseRFC3339(string(entry.GetValidity())) From b90d7bd7b06f7a91accdfcd212803819ba318223 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Sun, 21 Jan 2018 09:51:29 -0500 Subject: [PATCH 05/25] Remove unneccesary split in IpnsValidator License: MIT Signed-off-by: Dirk McCormick --- namesys/ipns_validate_test.go | 91 ++++++++++++++++++++++++++--------- namesys/publisher.go | 4 +- 2 files changed, 68 insertions(+), 27 deletions(-) diff --git a/namesys/ipns_validate_test.go b/namesys/ipns_validate_test.go index d75fa6cb701..8e9adc781c9 100644 --- a/namesys/ipns_validate_test.go +++ b/namesys/ipns_validate_test.go @@ -1,6 +1,7 @@ package namesys import ( + "io" "testing" "time" @@ -18,10 +19,7 @@ func TestValidation(t *testing.T) { // Generate a key for signing the records r := u.NewSeededRand(15) // generate deterministic keypair - priv, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) - if err != nil { - t.Fatal(err) - } + priv, ipnsPath := genKeys(t, r) // Create entry with expiry in one hour ts := time.Now() @@ -30,64 +28,109 @@ func TestValidation(t *testing.T) { t.Fatal(err) } - // Get IPNS record path - pubkb, err := pubk.Bytes() + val, err := proto.Marshal(entry) if err != nil { t.Fatal(err) } - pubkh := u.Hash(pubkb).B58String() - ipnsPath := "/ipns/" + pubkh - val, err := proto.Marshal(entry) + // Create the record + rec, err := record.MakePutRecord(priv, ipnsPath, val, true) if err != nil { t.Fatal(err) } - // Create the record - r1, err := record.MakePutRecord(priv, ipnsPath, val, true) - // Validate the record - err = validator.VerifyRecord(r1) + err = validator.VerifyRecord(rec) if err != nil { t.Fatal(err) } + // Create IPNS record path with a different key - _, pubk2, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) + _, ipnsWrongAuthor := genKeys(t, r) + wrongAuthorRec, err := record.MakePutRecord(priv, ipnsWrongAuthor, val, true) if err != nil { t.Fatal(err) } - pubkb2, err := pubk2.Bytes() + + // Record should fail validation because path doesn't match author + err = validator.VerifyRecord(wrongAuthorRec) + if err != ErrInvalidAuthor { + t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") + } + + + // Create IPNS record path with extra path components after author + extraPath := ipnsPath + "/some/path" + extraPathRec, err := record.MakePutRecord(priv, extraPath, val, true) if err != nil { t.Fatal(err) } - pubkh2 := u.Hash(pubkb2).B58String() - ipnsWrongPath := "/ipns/" + pubkh2 - r2, err := record.MakePutRecord(priv, ipnsWrongPath, val, true) + // Record should fail validation because path has extra components after author + err = validator.VerifyRecord(extraPathRec) + if err != ErrInvalidAuthor { + t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") + } - // Record should fail validation because path doesn't match author - err = validator.VerifyRecord(r2) + + // Create unsigned IPNS record + unsignedRec, err := record.MakePutRecord(priv, ipnsPath, val, false) + if err != nil { + t.Fatal(err) + } + + // Record should fail validation because IPNS records require signature + err = validator.VerifyRecord(unsignedRec) + if err != ErrInvalidAuthor { + t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") + } + + + // Create unsigned IPNS record with no author + unsignedRecNoAuthor, err := record.MakePutRecord(priv, ipnsPath, val, false) + if err != nil { + t.Fatal(err) + } + noAuth := "" + unsignedRecNoAuthor.Author = &noAuth + + // Record should fail validation because IPNS records require author + err = validator.VerifyRecord(unsignedRecNoAuthor) if err != ErrInvalidAuthor { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } + // Create expired entry - expired, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(-1*time.Hour)) + expiredEntry, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(-1*time.Hour)) if err != nil { t.Fatal(err) } - valExp, err := proto.Marshal(expired) + valExp, err := proto.Marshal(expiredEntry) if err != nil { t.Fatal(err) } // Create record with the expired entry - r3, err := record.MakePutRecord(priv, ipnsPath, valExp, true) + expiredRec, err := record.MakePutRecord(priv, ipnsPath, valExp, true) // Record should fail validation because entry is expired - err = validator.VerifyRecord(r3) + err = validator.VerifyRecord(expiredRec) if err != ErrExpiredRecord { t.Fatal("ValidateIpnsRecord should have returned ErrExpiredRecord") } } + +func genKeys(t *testing.T, r io.Reader) (ci.PrivKey, string) { + priv, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) + if err != nil { + t.Fatal(err) + } + pubkb, err := pubk.Bytes() + if err != nil { + t.Fatal(err) + } + p := "/ipns/" + u.Hash(pubkb).B58String() + return priv, p +} diff --git a/namesys/publisher.go b/namesys/publisher.go index 4861a1eaee2..48d32bcc182 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -5,7 +5,6 @@ import ( "context" "errors" "fmt" - "strings" "time" pb "github.com/ipfs/go-ipfs/namesys/pb" @@ -319,8 +318,7 @@ func ValidateIpnsRecord(r *record.ValidationRecord) error { // need to do that here // Author in key must match author in record - parts := strings.Split(r.Key, "/") - pid, err := peer.IDB58Decode(parts[0]) + pid, err := peer.IDB58Decode(r.Key) if err != nil { return ErrInvalidAuthor } From f6d507b203e25093c892cb306144730cec032bf8 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Sun, 21 Jan 2018 17:48:57 -0500 Subject: [PATCH 06/25] go fmt License: MIT Signed-off-by: Dirk McCormick --- namesys/ipns_validate_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/namesys/ipns_validate_test.go b/namesys/ipns_validate_test.go index 8e9adc781c9..2d46c7a82d5 100644 --- a/namesys/ipns_validate_test.go +++ b/namesys/ipns_validate_test.go @@ -45,7 +45,6 @@ func TestValidation(t *testing.T) { t.Fatal(err) } - // Create IPNS record path with a different key _, ipnsWrongAuthor := genKeys(t, r) wrongAuthorRec, err := record.MakePutRecord(priv, ipnsWrongAuthor, val, true) @@ -59,7 +58,6 @@ func TestValidation(t *testing.T) { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } - // Create IPNS record path with extra path components after author extraPath := ipnsPath + "/some/path" extraPathRec, err := record.MakePutRecord(priv, extraPath, val, true) @@ -73,7 +71,6 @@ func TestValidation(t *testing.T) { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } - // Create unsigned IPNS record unsignedRec, err := record.MakePutRecord(priv, ipnsPath, val, false) if err != nil { @@ -86,7 +83,6 @@ func TestValidation(t *testing.T) { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } - // Create unsigned IPNS record with no author unsignedRecNoAuthor, err := record.MakePutRecord(priv, ipnsPath, val, false) if err != nil { @@ -101,7 +97,6 @@ func TestValidation(t *testing.T) { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } - // Create expired entry expiredEntry, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(-1*time.Hour)) if err != nil { From fdb0046a1712e20ad107980b9667d65048b4660f Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Tue, 23 Jan 2018 08:25:40 -0500 Subject: [PATCH 07/25] Fix ipns validator key parsing License: MIT Signed-off-by: Dirk McCormick --- namesys/ipns_validate_test.go | 11 ++++++----- namesys/publisher.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/namesys/ipns_validate_test.go b/namesys/ipns_validate_test.go index 2d46c7a82d5..fa788810342 100644 --- a/namesys/ipns_validate_test.go +++ b/namesys/ipns_validate_test.go @@ -8,6 +8,7 @@ import ( path "github.com/ipfs/go-ipfs/path" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" ) @@ -45,7 +46,7 @@ func TestValidation(t *testing.T) { t.Fatal(err) } - // Create IPNS record path with a different key + // Create IPNS record path with a different private key _, ipnsWrongAuthor := genKeys(t, r) wrongAuthorRec, err := record.MakePutRecord(priv, ipnsWrongAuthor, val, true) if err != nil { @@ -118,14 +119,14 @@ func TestValidation(t *testing.T) { } func genKeys(t *testing.T, r io.Reader) (ci.PrivKey, string) { - priv, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) + priv, _, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) if err != nil { t.Fatal(err) } - pubkb, err := pubk.Bytes() + id, err := peer.IDFromPrivateKey(priv) if err != nil { t.Fatal(err) } - p := "/ipns/" + u.Hash(pubkb).B58String() - return priv, p + _, ipnsKey := IpnsKeysForID(id) + return priv, ipnsKey } diff --git a/namesys/publisher.go b/namesys/publisher.go index 48d32bcc182..3dc38c4d161 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -318,7 +318,7 @@ func ValidateIpnsRecord(r *record.ValidationRecord) error { // need to do that here // Author in key must match author in record - pid, err := peer.IDB58Decode(r.Key) + pid, err := peer.IDFromString(r.Key) if err != nil { return ErrInvalidAuthor } From 49569a61425cef5fe3f026947fe4abbea2b3a534 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 11:25:47 -0800 Subject: [PATCH 08/25] gx update badger ds (fix internal deps issue) License: MIT Signed-off-by: Steven Allen --- package.json | 4 ++-- repo/fsrepo/datastores.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c3045a5ae5d..735fa3a13c3 100644 --- a/package.json +++ b/package.json @@ -464,9 +464,9 @@ }, { "author": "magik6k", - "hash": "QmNy185DeGicV5kKsmPxEoffUYm1SeQFHXHTs8L8QnuHX8", + "hash": "QmeJHZio8XaK919S4pN9uJLRdt2qP2WipU7beXrejANvaB", "name": "go-ds-badger", - "version": "1.4.2" + "version": "1.4.3" }, { "author": "whyrusleeping", diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index 6b22b127513..2a6d98571ec 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -16,9 +16,9 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" mount "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/syncmount" - badgerds "gx/ipfs/QmNy185DeGicV5kKsmPxEoffUYm1SeQFHXHTs8L8QnuHX8/go-ds-badger" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" levelds "gx/ipfs/Qmbkc8BMfEixGCeKRuGGbf34mAjTb9xPmJ8Pm5gHU7ohZ4/go-ds-leveldb" + badgerds "gx/ipfs/QmeJHZio8XaK919S4pN9uJLRdt2qP2WipU7beXrejANvaB/go-ds-badger" ) // ConfigFromMap creates a new datastore config from a map From 730754d9d20cdc7575c054fb099ef8527776db4d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 12:21:08 -0800 Subject: [PATCH 09/25] dagmodifier: remove useless offset update License: MIT Signed-off-by: Steven Allen --- unixfs/mod/dagmodifier.go | 1 - 1 file changed, 1 deletion(-) diff --git a/unixfs/mod/dagmodifier.go b/unixfs/mod/dagmodifier.go index b6ae06fa10e..3ac7d77c0fc 100644 --- a/unixfs/mod/dagmodifier.go +++ b/unixfs/mod/dagmodifier.go @@ -330,7 +330,6 @@ func (dm *DagModifier) modifyDag(n node.Node, offset uint64, data io.Reader) (*c return nil, false, err } - offset += bs node.Links()[i].Cid = k // Recache serialized node From d154b4a990d14126227b68d21274191046a186b5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 12:21:51 -0800 Subject: [PATCH 10/25] merkledag: switch to new dag interface Also: * Update the blockstore/blockservice methods to match. * Construct a new temporary offline dag instead of having a GetOfflineLinkService method. License: MIT Signed-off-by: Steven Allen --- blockservice/blockservice.go | 72 +++---- blockservice/test/blocks_test.go | 6 +- core/commands/block.go | 4 +- core/commands/dag/dag.go | 5 +- core/commands/dht.go | 3 +- core/commands/files/files.go | 2 +- core/commands/ls.go | 2 +- core/commands/object/object.go | 11 +- core/commands/object/patch.go | 12 +- core/commands/pin.go | 9 +- core/commands/pubsub.go | 4 +- core/commands/refs.go | 5 +- core/commands/tar.go | 2 +- core/core.go | 5 +- core/coreapi/dag.go | 2 +- core/coreapi/unixfs_test.go | 17 +- core/corehttp/gateway_handler.go | 12 +- core/corehttp/gateway_test.go | 16 +- core/corerepo/gc.go | 4 +- core/coreunix/add.go | 12 +- core/coreunix/add_test.go | 4 +- core/coreunix/metadata.go | 4 +- core/coreunix/metadata_test.go | 3 +- exchange/reprovide/providers.go | 7 +- fuse/readonly/ipfs_test.go | 6 +- fuse/readonly/readonly_unix.go | 8 +- importer/balanced/balanced_test.go | 5 +- importer/helpers/dagbuilder.go | 13 +- importer/helpers/helpers.go | 10 +- importer/importer.go | 7 +- importer/importer_test.go | 7 +- importer/trickle/trickle_test.go | 3 +- merkledag/batch.go | 99 ---------- merkledag/merkledag.go | 287 +++++++--------------------- merkledag/merkledag_test.go | 56 +++--- merkledag/node.go | 6 +- merkledag/node_test.go | 19 +- merkledag/test/utils.go | 4 +- merkledag/traverse/traverse_test.go | 15 +- merkledag/utils/diff.go | 6 +- merkledag/utils/diffenum_test.go | 24 ++- merkledag/utils/utils.go | 47 ++--- merkledag/utils/utils_test.go | 18 +- mfs/dir.go | 12 +- mfs/fd.go | 2 +- mfs/file.go | 4 +- mfs/mfs_test.go | 16 +- mfs/system.go | 8 +- path/resolver.go | 8 +- path/resolver_test.go | 2 +- pin/gc/gc.go | 17 +- pin/pin.go | 26 +-- pin/pin_test.go | 36 ++-- pin/set.go | 15 +- tar/format.go | 10 +- unixfs/archive/archive.go | 3 +- unixfs/archive/tar/writer.go | 6 +- unixfs/hamt/hamt.go | 14 +- unixfs/hamt/hamt_stress_test.go | 9 +- unixfs/hamt/hamt_test.go | 27 ++- unixfs/io/dagreader.go | 2 +- unixfs/io/dagreader_test.go | 8 +- unixfs/io/dirbuilder.go | 6 +- unixfs/io/dirbuilder_test.go | 4 +- unixfs/io/pbdagreader.go | 12 +- unixfs/io/resolve.go | 2 +- unixfs/mod/dagmodifier.go | 26 +-- unixfs/test/utils.go | 10 +- 68 files changed, 493 insertions(+), 655 deletions(-) delete mode 100644 merkledag/batch.go diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 73882260541..d4f6fffadec 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "io" "github.com/ipfs/go-ipfs/blocks/blockstore" exchange "github.com/ipfs/go-ipfs/exchange" @@ -21,10 +22,27 @@ var log = logging.Logger("blockservice") var ErrNotFound = errors.New("blockservice: key not found") +type BlockGetter interface { + // GetBlock gets the requested block. + GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error) + + // GetBlocks does a batch request for the given cids, returning blocks as + // they are found, in no particular order. + // + // It may not be able to find all requested blocks (or the context may + // be canceled). In that case, it will close the channel early. It is up + // to the consumer to detect this situation and keep track which blocks + // it has received and which it hasn't. + GetBlocks(ctx context.Context, ks []*cid.Cid) <-chan blocks.Block +} + // BlockService is a hybrid block datastore. It stores data in a local // datastore and may retrieve data from a remote Exchange. // It uses an internal `datastore.Datastore` instance to store values. type BlockService interface { + io.Closer + BlockGetter + // Blockstore returns a reference to the underlying blockstore Blockstore() blockstore.Blockstore @@ -32,20 +50,14 @@ type BlockService interface { Exchange() exchange.Interface // AddBlock puts a given block to the underlying datastore - AddBlock(o blocks.Block) (*cid.Cid, error) + AddBlock(o blocks.Block) error // AddBlocks adds a slice of blocks at the same time using batching // capabilities of the underlying datastore whenever possible. - AddBlocks(bs []blocks.Block) ([]*cid.Cid, error) - - GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error) - DeleteBlock(o blocks.Block) error + AddBlocks(bs []blocks.Block) error - // GetBlocks does a batch request for the given cids, returning blocks as - // they are found, in no particular order. - GetBlocks(ctx context.Context, ks []*cid.Cid) <-chan blocks.Block - - Close() error + // DeleteBlock deletes the given block from the blockservice. + DeleteBlock(o *cid.Cid) error } type blockService struct { @@ -110,38 +122,34 @@ func NewSession(ctx context.Context, bs BlockService) *Session { // AddBlock adds a particular block to the service, Putting it into the datastore. // TODO pass a context into this if the remote.HasBlock is going to remain here. -func (s *blockService) AddBlock(o blocks.Block) (*cid.Cid, error) { +func (s *blockService) AddBlock(o blocks.Block) error { c := o.Cid() if s.checkFirst { - has, err := s.blockstore.Has(c) - if err != nil { - return nil, err - } - - if has { - return c, nil + if has, err := s.blockstore.Has(c); has || err != nil { + return err } } - err := s.blockstore.Put(o) - if err != nil { - return nil, err + if err := s.blockstore.Put(o); err != nil { + return err } if err := s.exchange.HasBlock(o); err != nil { - return nil, errors.New("blockservice is closed") + // TODO(stebalien): really an error? + return errors.New("blockservice is closed") } - return c, nil + return nil } -func (s *blockService) AddBlocks(bs []blocks.Block) ([]*cid.Cid, error) { +func (s *blockService) AddBlocks(bs []blocks.Block) error { var toput []blocks.Block if s.checkFirst { + toput = make([]blocks.Block, 0, len(bs)) for _, b := range bs { has, err := s.blockstore.Has(b.Cid()) if err != nil { - return nil, err + return err } if !has { toput = append(toput, b) @@ -153,18 +161,16 @@ func (s *blockService) AddBlocks(bs []blocks.Block) ([]*cid.Cid, error) { err := s.blockstore.PutMany(toput) if err != nil { - return nil, err + return err } - var ks []*cid.Cid for _, o := range toput { if err := s.exchange.HasBlock(o); err != nil { - return nil, fmt.Errorf("blockservice is closed (%s)", err) + // TODO(stebalien): Should this really *return*? + return fmt.Errorf("blockservice is closed (%s)", err) } - - ks = append(ks, o.Cid()) } - return ks, nil + return nil } // GetBlock retrieves a particular block from the service, @@ -256,8 +262,8 @@ func getBlocks(ctx context.Context, ks []*cid.Cid, bs blockstore.Blockstore, f e } // DeleteBlock deletes a block in the blockservice from the datastore -func (s *blockService) DeleteBlock(o blocks.Block) error { - return s.blockstore.DeleteBlock(o.Cid()) +func (s *blockService) DeleteBlock(c *cid.Cid) error { + return s.blockstore.DeleteBlock(c) } func (s *blockService) Close() error { diff --git a/blockservice/test/blocks_test.go b/blockservice/test/blocks_test.go index 965327dae32..3ff25366cb1 100644 --- a/blockservice/test/blocks_test.go +++ b/blockservice/test/blocks_test.go @@ -33,16 +33,12 @@ func TestBlocks(t *testing.T) { t.Error("Block key and data multihash key not equal") } - k, err := bs.AddBlock(o) + err := bs.AddBlock(o) if err != nil { t.Error("failed to add block to BlockService", err) return } - if !k.Equals(o.Cid()) { - t.Error("returned key is not equal to block key", err) - } - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() b2, err := bs.GetBlock(ctx, o.Cid()) diff --git a/core/commands/block.go b/core/commands/block.go index 1dba3050c8c..cf88f3283f7 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -199,14 +199,14 @@ It reads from stdin, and is a base58 encoded multihash. return } - k, err := n.Blocks.AddBlock(b) + err = n.Blocks.AddBlock(b) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } err = cmds.EmitOnce(res, &BlockStat{ - Key: k.String(), + Key: b.Cid().String(), Size: len(data), }) if err != nil { diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index ae152166dd2..a029022a14a 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -18,6 +18,7 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("cmds/files") @@ -102,7 +103,7 @@ into an object of the specified format. addAllAndPin := func(f files.File) error { cids := cid.NewSet() - b := n.DAG.Batch() + b := node.NewBatch(req.Context(), n.DAG) for { file, err := f.NextFile() @@ -122,7 +123,7 @@ into an object of the specified format. } for _, nd := range nds { - _, err := b.Add(nd) + err := b.Add(nd) if err != nil { return err } diff --git a/core/commands/dht.go b/core/commands/dht.go index ed2e2818a63..27f0cee207e 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -19,6 +19,7 @@ import ( peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ipdht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" ) @@ -377,7 +378,7 @@ func provideKeys(ctx context.Context, r routing.IpfsRouting, cids []*cid.Cid) er return nil } -func provideKeysRec(ctx context.Context, r routing.IpfsRouting, dserv dag.DAGService, cids []*cid.Cid) error { +func provideKeysRec(ctx context.Context, r routing.IpfsRouting, dserv node.DAGService, cids []*cid.Cid) error { provided := cid.NewSet() for _, c := range cids { kset := cid.NewSet() diff --git a/core/commands/files/files.go b/core/commands/files/files.go index 31b126d9e7f..90f2cd6d256 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -170,7 +170,7 @@ func statGetFormatOptions(req cmds.Request) (string, error) { } } -func statNode(ds dag.DAGService, fsn mfs.FSNode) (*Object, error) { +func statNode(ds node.DAGService, fsn mfs.FSNode) (*Object, error) { nd, err := fsn.GetNode() if err != nil { return nil, err diff --git a/core/commands/ls.go b/core/commands/ls.go index 312cc1c3c84..8c7ac404746 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -134,7 +134,7 @@ The JSON output contains type information. t := unixfspb.Data_DataType(-1) linkNode, err := link.GetNode(req.Context(), dserv) - if err == merkledag.ErrNotFound && !resolve { + if err == node.ErrNotFound && !resolve { // not an error linkNode = nil } else if err != nil { diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 1b6790da9e6..6eae3034ea3 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -2,6 +2,7 @@ package objectcmd import ( "bytes" + "context" "encoding/base64" "encoding/json" "encoding/xml" @@ -422,7 +423,7 @@ And then run: defer n.Blockstore.PinLock().Unlock() } - objectCid, err := objectPut(n, input, inputenc, datafieldenc) + objectCid, err := objectPut(req.Context(), n, input, inputenc, datafieldenc) if err != nil { errType := cmdkit.ErrNormal if err == ErrUnknownObjectEnc { @@ -504,12 +505,12 @@ Available templates: } } - k, err := n.DAG.Add(node) + err = n.DAG.Add(req.Context(), node) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - res.SetOutput(&Object{Hash: k.String()}) + res.SetOutput(&Object{Hash: node.Cid().String()}) }, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { @@ -542,7 +543,7 @@ func nodeFromTemplate(template string) (*dag.ProtoNode, error) { var ErrEmptyNode = errors.New("no data or links in this node") // objectPut takes a format option, serializes bytes from stdin and updates the dag with that data -func objectPut(n *core.IpfsNode, input io.Reader, encoding string, dataFieldEncoding string) (*cid.Cid, error) { +func objectPut(ctx context.Context, n *core.IpfsNode, input io.Reader, encoding string, dataFieldEncoding string) (*cid.Cid, error) { data, err := ioutil.ReadAll(io.LimitReader(input, inputLimit+10)) if err != nil { @@ -602,7 +603,7 @@ func objectPut(n *core.IpfsNode, input io.Reader, encoding string, dataFieldEnco return nil, err } - _, err = n.DAG.Add(dagnode) + err = n.DAG.Add(ctx, dagnode) if err != nil { return nil, err } diff --git a/core/commands/object/patch.go b/core/commands/object/patch.go index e41d355fe12..a1caad7b39a 100644 --- a/core/commands/object/patch.go +++ b/core/commands/object/patch.go @@ -109,13 +109,13 @@ the limit will not be respected by the network. rtpb.SetData(append(rtpb.Data(), data...)) - newkey, err := nd.DAG.Add(rtpb) + err = nd.DAG.Add(req.Context(), rtpb) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - res.SetOutput(&Object{Hash: newkey.String()}) + res.SetOutput(&Object{Hash: rtpb.Cid().String()}) }, Type: Object{}, Marshalers: cmds.MarshalerMap{ @@ -177,13 +177,13 @@ Example: rtpb.SetData(data) - newkey, err := nd.DAG.Add(rtpb) + err = nd.DAG.Add(req.Context(), rtpb) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - res.SetOutput(&Object{Hash: newkey.String()}) + res.SetOutput(&Object{Hash: rtpb.Cid().String()}) }, Type: Object{}, Marshalers: cmds.MarshalerMap{ @@ -237,7 +237,7 @@ Removes a link by the given name from root. return } - nnode, err := e.Finalize(nd.DAG) + nnode, err := e.Finalize(req.Context(), nd.DAG) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -334,7 +334,7 @@ to a file containing 'bar', and returns the hash of the new object. return } - nnode, err := e.Finalize(nd.DAG) + nnode, err := e.Finalize(req.Context(), nd.DAG) if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/pin.go b/core/commands/pin.go index 32e813514cf..d6ef739796e 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -7,10 +7,12 @@ import ( "io" "time" + bserv "github.com/ipfs/go-ipfs/blockservice" cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" corerepo "github.com/ipfs/go-ipfs/core/corerepo" + offline "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" pin "github.com/ipfs/go-ipfs/pin" @@ -555,7 +557,7 @@ func pinLsAll(typeStr string, ctx context.Context, n *core.IpfsNode) (map[string if typeStr == "indirect" || typeStr == "all" { set := cid.NewSet() for _, k := range n.Pinning.RecursiveKeys() { - err := dag.EnumerateChildren(n.Context(), n.DAG.GetLinks, k, set.Visit) + err := dag.EnumerateChildren(n.Context(), dag.GetLinksWithDAG(n.DAG), k, set.Visit) if err != nil { return nil, err } @@ -594,7 +596,10 @@ type pinVerifyOpts struct { func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts) <-chan interface{} { visited := make(map[string]PinStatus) - getLinks := n.DAG.GetOfflineLinkService().GetLinks + + bs := n.Blocks.Blockstore() + DAG := dag.NewDAGService(bserv.New(bs, offline.Exchange(bs))) + getLinks := dag.GetLinksWithDAG(DAG) recPins := n.Pinning.RecursiveKeys() var checkPin func(root *cid.Cid) PinStatus diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 6da8fbce5d8..a9ff2d06ce0 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -100,13 +100,13 @@ This command outputs data in the following encodings: if discover { go func() { blk := blocks.NewBlock([]byte("floodsub:" + topic)) - cid, err := n.Blocks.AddBlock(blk) + err := n.Blocks.AddBlock(blk) if err != nil { log.Error("pubsub discovery: ", err) return } - connectToPubSubPeers(req.Context, n, cid) + connectToPubSubPeers(req.Context, n, blk.Cid()) }() } diff --git a/core/commands/refs.go b/core/commands/refs.go index 4b50afaec87..75e845989c0 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -10,7 +10,6 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" - dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" @@ -222,7 +221,7 @@ type RefWrapper struct { type RefWriter struct { out chan interface{} - DAG dag.DAGService + DAG node.DAGService Ctx context.Context Unique bool @@ -244,7 +243,7 @@ func (rw *RefWriter) writeRefsRecursive(n node.Node) (int, error) { nc := n.Cid() var count int - for i, ng := range dag.GetDAG(rw.Ctx, rw.DAG, n) { + for i, ng := range node.GetDAG(rw.Ctx, rw.DAG, n) { lc := n.Links()[i].Cid if rw.skip(lc) { continue diff --git a/core/commands/tar.go b/core/commands/tar.go index 98cf89750f1..d95974d448c 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -51,7 +51,7 @@ represent it. return } - node, err := tar.ImportTar(fi, nd.DAG) + node, err := tar.ImportTar(req.Context(), fi, nd.DAG) if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/core.go b/core/core.go index 80aeb1dd2ea..d0ab326df44 100644 --- a/core/core.go +++ b/core/core.go @@ -70,6 +70,7 @@ import ( ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" mafilter "gx/ipfs/Qmf2UAmRwDG4TvnkQpHZWPAzw7rpCYVhxmRXmYxXr5LD1g/go-maddr-filter" dht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" @@ -117,7 +118,7 @@ type IpfsNode struct { BaseBlocks bstore.Blockstore // the raw blockstore, no filestore wrapping GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc Blocks bserv.BlockService // the block service, get/add blocks. - DAG merkledag.DAGService // the merkle dag service, get/add objects. + DAG node.DAGService // the merkle dag service, get/add objects. Resolver *path.Resolver // the path resolution system Reporter metrics.Reporter Discovery discovery.Service @@ -739,7 +740,7 @@ func (n *IpfsNode) loadFilesRoot() error { switch { case err == ds.ErrNotFound || val == nil: nd = ft.EmptyDirNode() - _, err := n.DAG.Add(nd) + err := n.DAG.Add(n.Context(), nd) if err != nil { return fmt.Errorf("failure writing to dagstore: %s", err) } diff --git a/core/coreapi/dag.go b/core/coreapi/dag.go index ea22c46c527..51ccb8faad7 100644 --- a/core/coreapi/dag.go +++ b/core/coreapi/dag.go @@ -41,7 +41,7 @@ func (api *DagAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.DagPut return nil, fmt.Errorf("no node returned from ParseInputs") } - _, err = api.node.DAG.Add(nds[0]) + err = api.node.DAG.Add(ctx, nds[0]) if err != nil { return nil, err } diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index e4423dd90eb..8c3bf59fb11 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -200,12 +200,12 @@ func TestCatDir(t *testing.T) { if err != nil { t.Error(err) } - - c, err := node.DAG.Add(unixfs.EmptyDirNode()) + edir := unixfs.EmptyDirNode() + err = node.DAG.Add(ctx, edir) if err != nil { t.Error(err) } - p := coreapi.ParseCid(c) + p := coreapi.ParseCid(edir.Cid()) if p.String() != emptyDir.String() { t.Fatalf("expected path %s, got: %s", emptyDir, p) @@ -224,12 +224,13 @@ func TestCatNonUnixfs(t *testing.T) { t.Error(err) } - c, err := node.DAG.Add(new(mdag.ProtoNode)) + nd := new(mdag.ProtoNode) + err = node.DAG.Add(ctx, nd) if err != nil { t.Error(err) } - _, err = api.Unixfs().Cat(ctx, coreapi.ParseCid(c)) + _, err = api.Unixfs().Cat(ctx, coreapi.ParseCid(nd.Cid())) if !strings.Contains(err.Error(), "proto: required field") { t.Fatalf("expected protobuf error, got: %s", err) } @@ -292,7 +293,7 @@ func TestLsEmptyDir(t *testing.T) { t.Error(err) } - _, err = node.DAG.Add(unixfs.EmptyDirNode()) + err = node.DAG.Add(ctx, unixfs.EmptyDirNode()) if err != nil { t.Error(err) } @@ -320,12 +321,12 @@ func TestLsNonUnixfs(t *testing.T) { t.Fatal(err) } - c, err := node.DAG.Add(nd) + err = node.DAG.Add(ctx, nd) if err != nil { t.Error(err) } - links, err := api.Unixfs().Ls(ctx, coreapi.ParseCid(c)) + links, err := api.Unixfs().Ls(ctx, coreapi.ParseCid(nd.Cid())) if err != nil { t.Error(err) } diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index f4f99cfeb98..1dbc8f4f2e5 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -474,7 +474,7 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) { return } - nnode, err := e.Finalize(i.node.DAG) + nnode, err := e.Finalize(ctx, i.node.DAG) if err != nil { webError(w, "putHandler: could not get node", err, http.StatusInternalServerError) return @@ -498,11 +498,11 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) { // object set-data case pbnd.SetData(pbnewnode.Data()) - newcid, err = i.node.DAG.Add(pbnd) + newcid = pbnd.Cid() + err = i.node.DAG.Add(ctx, pbnd) if err != nil { nnk := newnode.Cid() - rk := pbnd.Cid() - webError(w, fmt.Sprintf("putHandler: Could not add newnode(%q) to root(%q)", nnk.String(), rk.String()), err, http.StatusInternalServerError) + webError(w, fmt.Sprintf("putHandler: Could not add newnode(%q) to root(%q)", nnk.String(), newcid.String()), err, http.StatusInternalServerError) return } default: @@ -561,7 +561,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) { var newnode *dag.ProtoNode = pbnd for j := len(pathNodes) - 2; j >= 0; j-- { - if _, err := i.node.DAG.Add(newnode); err != nil { + if err := i.node.DAG.Add(ctx, newnode); err != nil { webError(w, "Could not add node", err, http.StatusInternalServerError) return } @@ -579,7 +579,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) { } } - if _, err := i.node.DAG.Add(newnode); err != nil { + if err := i.node.DAG.Add(ctx, newnode); err != nil { webError(w, "Could not add root node", err, http.StatusInternalServerError) return } diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 6b396812e29..ca03dcca52b 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -178,6 +178,9 @@ func TestGatewayGet(t *testing.T) { } func TestIPNSHostnameRedirect(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + ns := mockNamesys{} ts, n := newTestServerAndNode(t, ns) t.Logf("test server url: %s", ts.URL) @@ -199,12 +202,12 @@ func TestIPNSHostnameRedirect(t *testing.T) { t.Fatal(err) } - _, err = n.DAG.Add(dagn2) + err = n.DAG.Add(ctx, dagn2) if err != nil { t.Fatal(err) } - _, err = n.DAG.Add(dagn1) + err = n.DAG.Add(ctx, dagn1) if err != nil { t.Fatal(err) } @@ -262,6 +265,9 @@ func TestIPNSHostnameRedirect(t *testing.T) { } func TestIPNSHostnameBacklinks(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + ns := mockNamesys{} ts, n := newTestServerAndNode(t, ns) t.Logf("test server url: %s", ts.URL) @@ -286,15 +292,15 @@ func TestIPNSHostnameBacklinks(t *testing.T) { t.Fatal(err) } - _, err = n.DAG.Add(dagn3) + err = n.DAG.Add(ctx, dagn3) if err != nil { t.Fatal(err) } - _, err = n.DAG.Add(dagn2) + err = n.DAG.Add(ctx, dagn2) if err != nil { t.Fatal(err) } - _, err = n.DAG.Add(dagn1) + err = n.DAG.Add(ctx, dagn1) if err != nil { t.Fatal(err) } diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 77e0dea9abc..e90f3ce9467 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -86,7 +86,7 @@ func GarbageCollect(n *core.IpfsNode, ctx context.Context) error { if err != nil { return err } - rmed := gc.GC(ctx, n.Blockstore, n.DAG, n.Pinning, roots) + rmed := gc.GC(ctx, n.Blockstore, n.Pinning, roots) return CollectResult(ctx, rmed, nil) } @@ -154,7 +154,7 @@ func GarbageCollectAsync(n *core.IpfsNode, ctx context.Context) <-chan gc.Result return out } - return gc.GC(ctx, n.Blockstore, n.DAG, n.Pinning, roots) + return gc.GC(ctx, n.Blockstore, n.Pinning, roots) } func PeriodicGC(ctx context.Context, node *core.IpfsNode) error { diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 19cddacb9a2..6540bc576f6 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -74,7 +74,7 @@ type AddedObject struct { } // NewAdder Returns a new Adder used for a file add operation. -func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds dag.DAGService) (*Adder, error) { +func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds node.DAGService) (*Adder, error) { return &Adder{ ctx: ctx, pinning: p, @@ -94,7 +94,7 @@ type Adder struct { ctx context.Context pinning pin.Pinner blockstore bstore.GCBlockstore - dagService dag.DAGService + dagService node.DAGService Out chan interface{} Progress bool Hidden bool @@ -195,7 +195,9 @@ func (adder *Adder) PinRoot() error { return nil } - rnk, err := adder.dagService.Add(root) + rnk := root.Cid() + + err = adder.dagService.Add(adder.ctx, root) if err != nil { return err } @@ -470,7 +472,7 @@ func (adder *Adder) addFile(file files.File) error { dagnode := dag.NodeWithData(sdata) dagnode.SetPrefix(adder.Prefix) - _, err = adder.dagService.Add(dagnode) + err = adder.dagService.Add(adder.ctx, dagnode) if err != nil { return err } @@ -573,7 +575,7 @@ func outputDagnode(out chan interface{}, name string, dn node.Node) error { } // NewMemoryDagService builds and returns a new mem-datastore. -func NewMemoryDagService() dag.DAGService { +func NewMemoryDagService() node.DAGService { // build mem-datastore for editor's intermediary nodes bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) bsrv := bserv.New(bs, offline.Exchange(bs)) diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index c7e647ee987..b41dee22d96 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -104,7 +104,7 @@ func TestAddGCLive(t *testing.T) { gcstarted := make(chan struct{}) go func() { defer close(gcstarted) - gcout = gc.GC(context.Background(), node.Blockstore, node.DAG, node.Pinning, nil) + gcout = gc.GC(context.Background(), node.Blockstore, node.Pinning, nil) }() // gc shouldnt start until we let the add finish its current file. @@ -150,7 +150,7 @@ func TestAddGCLive(t *testing.T) { defer cancel() set := cid.NewSet() - err = dag.EnumerateChildren(ctx, node.DAG.GetLinks, last, set.Visit) + err = dag.EnumerateChildren(ctx, dag.GetLinksWithDAG(node.DAG), last, set.Visit) if err != nil { t.Fatal(err) } diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index b3d119b4e82..fbea51c217a 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -29,12 +29,12 @@ func AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error return "", err } - nk, err := n.DAG.Add(mdnode) + err = n.DAG.Add(n.Context(), mdnode) if err != nil { return "", err } - return nk.String(), nil + return mdnode.Cid().String(), nil } func Metadata(n *core.IpfsNode, skey string) (*ft.Metadata, error) { diff --git a/core/coreunix/metadata_test.go b/core/coreunix/metadata_test.go index 37cbf25b647..eef92b86586 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -20,9 +20,10 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func getDagserv(t *testing.T) merkledag.DAGService { +func getDagserv(t *testing.T) node.DAGService { db := dssync.MutexWrap(ds.NewMapDatastore()) bs := bstore.NewBlockstore(db) blockserv := bserv.New(bs, offline.Exchange(bs)) diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index adcd5c62bae..5c592903b1f 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -6,6 +6,7 @@ import ( blocks "github.com/ipfs/go-ipfs/blocks/blockstore" merkledag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) @@ -18,7 +19,7 @@ func NewBlockstoreProvider(bstore blocks.Blockstore) KeyChanFunc { } // NewPinnedProvider returns provider supplying pinned keys -func NewPinnedProvider(pinning pin.Pinner, dag merkledag.DAGService, onlyRoots bool) KeyChanFunc { +func NewPinnedProvider(pinning pin.Pinner, dag node.DAGService, onlyRoots bool) KeyChanFunc { return func(ctx context.Context) (<-chan *cid.Cid, error) { set, err := pinSet(ctx, pinning, dag, onlyRoots) if err != nil { @@ -42,7 +43,7 @@ func NewPinnedProvider(pinning pin.Pinner, dag merkledag.DAGService, onlyRoots b } } -func pinSet(ctx context.Context, pinning pin.Pinner, dag merkledag.DAGService, onlyRoots bool) (*streamingSet, error) { +func pinSet(ctx context.Context, pinning pin.Pinner, dag node.DAGService, onlyRoots bool) (*streamingSet, error) { set := newStreamingSet() go func() { @@ -56,7 +57,7 @@ func pinSet(ctx context.Context, pinning pin.Pinner, dag merkledag.DAGService, o set.add(key) if !onlyRoots { - err := merkledag.EnumerateChildren(ctx, dag.GetLinks, key, set.add) + err := merkledag.EnumerateChildren(ctx, merkledag.GetLinksWithDAG(dag), key, set.add) if err != nil { log.Errorf("reprovide indirect pins: %s", err) return diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 9e92456f6cb..554a3e132e1 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -145,7 +145,7 @@ func TestIpfsStressRead(t *testing.T) { t.Fatal(err) } - _, err = nd.DAG.Add(newdir) + err = nd.DAG.Add(nd.Context(), newdir) if err != nil { t.Fatal(err) } @@ -224,12 +224,12 @@ func TestIpfsBasicDirRead(t *testing.T) { t.Fatal(err) } - d1ndk, err := nd.DAG.Add(d1nd) + err = nd.DAG.Add(nd.Context(), d1nd) if err != nil { t.Fatal(err) } - dirname := path.Join(mnt.Dir, d1ndk.String()) + dirname := path.Join(mnt.Dir, d1nd.Cid().String()) fname := path.Join(dirname, "actual") rbuf, err := ioutil.ReadFile(fname) if err != nil { diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 678ac054fb7..17f43b08612 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -21,7 +21,7 @@ import ( lgbl "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" - format "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("fuse/ipfs") @@ -92,7 +92,7 @@ func (*Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { // Node is the core object representing a filesystem tree node. type Node struct { Ipfs *core.IpfsNode - Nd format.Node + Nd node.Node cached *ftpb.Data } @@ -157,7 +157,7 @@ func (s *Node) Lookup(ctx context.Context, name string) (fs.Node, error) { nd, err := s.Ipfs.DAG.Get(ctx, link.Cid) switch err { - case mdag.ErrNotFound: + case node.ErrNotFound: default: log.Errorf("fuse lookup %q: %s", name, err) return nil, err @@ -177,7 +177,7 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { } var entries []fuse.Dirent - err = dir.ForEachLink(ctx, func(lnk *format.Link) error { + err = dir.ForEachLink(ctx, func(lnk *node.Link) error { n := lnk.Name if len(n) == 0 { n = lnk.Cid.String() diff --git a/importer/balanced/balanced_test.go b/importer/balanced/balanced_test.go index 0278c2d0793..26cb058de3e 100644 --- a/importer/balanced/balanced_test.go +++ b/importer/balanced/balanced_test.go @@ -16,11 +16,12 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // TODO: extract these tests and more as a generic layout test suite -func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) { +func buildTestDag(ds node.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, @@ -34,7 +35,7 @@ func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) return nd.(*dag.ProtoNode), nil } -func getTestDag(t *testing.T, ds dag.DAGService, size int64, blksize int64) (*dag.ProtoNode, []byte) { +func getTestDag(t *testing.T, ds node.DAGService, size int64, blksize int64) (*dag.ProtoNode, []byte) { data := make([]byte, size) u.NewTimeSeededRand().Read(data) r := bytes.NewReader(data) diff --git a/importer/helpers/dagbuilder.go b/importer/helpers/dagbuilder.go index 8d4cff8b70b..34c19ea0520 100644 --- a/importer/helpers/dagbuilder.go +++ b/importer/helpers/dagbuilder.go @@ -1,6 +1,7 @@ package helpers import ( + "context" "io" "os" @@ -16,13 +17,13 @@ import ( // DagBuilderHelper wraps together a bunch of objects needed to // efficiently create unixfs dag trees type DagBuilderHelper struct { - dserv dag.DAGService + dserv node.DAGService spl chunk.Splitter recvdErr error rawLeaves bool nextData []byte // the next item to return. maxlinks int - batch *dag.Batch + batch *node.Batch fullPath string stat os.FileInfo prefix *cid.Prefix @@ -40,7 +41,7 @@ type DagBuilderParams struct { Prefix *cid.Prefix // DAGService to write blocks to (required) - Dagserv dag.DAGService + Dagserv node.DAGService // NoCopy signals to the chunker that it should track fileinfo for // filestore adds @@ -56,7 +57,7 @@ func (dbp *DagBuilderParams) New(spl chunk.Splitter) *DagBuilderHelper { rawLeaves: dbp.RawLeaves, prefix: dbp.Prefix, maxlinks: dbp.Maxlinks, - batch: dbp.Dagserv.Batch(), + batch: node.NewBatch(context.TODO(), dbp.Dagserv), } if fi, ok := spl.Reader().(files.FileInfo); dbp.NoCopy && ok { db.fullPath = fi.AbsPath() @@ -106,7 +107,7 @@ func (db *DagBuilderHelper) Next() ([]byte, error) { } // GetDagServ returns the dagservice object this Helper is using -func (db *DagBuilderHelper) GetDagServ() dag.DAGService { +func (db *DagBuilderHelper) GetDagServ() node.DAGService { return db.dserv } @@ -199,7 +200,7 @@ func (db *DagBuilderHelper) Add(node *UnixfsNode) (node.Node, error) { return nil, err } - _, err = db.dserv.Add(dn) + err = db.dserv.Add(context.TODO(), dn) if err != nil { return nil, err } diff --git a/importer/helpers/helpers.go b/importer/helpers/helpers.go index 1a607ed861d..dbd994c2c68 100644 --- a/importer/helpers/helpers.go +++ b/importer/helpers/helpers.go @@ -78,7 +78,7 @@ func (n *UnixfsNode) Set(other *UnixfsNode) { } } -func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds dag.DAGService) (*UnixfsNode, error) { +func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds node.DAGService) (*UnixfsNode, error) { nd, err := n.node.Links()[i].GetNode(ctx, ds) if err != nil { return nil, err @@ -110,7 +110,7 @@ func (n *UnixfsNode) AddChild(child *UnixfsNode, db *DagBuilderHelper) error { return err } - _, err = db.batch.Add(childnode) + err = db.batch.Add(childnode) return err } @@ -133,7 +133,11 @@ func (n *UnixfsNode) FileSize() uint64 { } func (n *UnixfsNode) SetPosInfo(offset uint64, fullPath string, stat os.FileInfo) { - n.posInfo = &pi.PosInfo{offset, fullPath, stat} + n.posInfo = &pi.PosInfo{ + Offset: offset, + FullPath: fullPath, + Stat: stat, + } } // getDagNode fills out the proper formatting for the unixfs node diff --git a/importer/importer.go b/importer/importer.go index db71b6a4267..8a07df3df12 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -10,7 +10,6 @@ import ( "github.com/ipfs/go-ipfs/importer/chunk" h "github.com/ipfs/go-ipfs/importer/helpers" trickle "github.com/ipfs/go-ipfs/importer/trickle" - dag "github.com/ipfs/go-ipfs/merkledag" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" @@ -18,7 +17,7 @@ import ( // Builds a DAG from the given file, writing created blocks to disk as they are // created -func BuildDagFromFile(fpath string, ds dag.DAGService) (node.Node, error) { +func BuildDagFromFile(fpath string, ds node.DAGService) (node.Node, error) { stat, err := os.Lstat(fpath) if err != nil { return nil, err @@ -37,7 +36,7 @@ func BuildDagFromFile(fpath string, ds dag.DAGService) (node.Node, error) { return BuildDagFromReader(ds, chunk.DefaultSplitter(f)) } -func BuildDagFromReader(ds dag.DAGService, spl chunk.Splitter) (node.Node, error) { +func BuildDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, @@ -46,7 +45,7 @@ func BuildDagFromReader(ds dag.DAGService, spl chunk.Splitter) (node.Node, error return bal.BalancedLayout(dbp.New(spl)) } -func BuildTrickleDagFromReader(ds dag.DAGService, spl chunk.Splitter) (node.Node, error) { +func BuildTrickleDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, diff --git a/importer/importer_test.go b/importer/importer_test.go index c3896e0ce23..85504443a37 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -8,7 +8,6 @@ import ( "testing" chunk "github.com/ipfs/go-ipfs/importer/chunk" - dag "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" @@ -16,7 +15,7 @@ import ( node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, dag.DAGService) { +func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, node.DAGService) { ds := mdtest.Mock() r := io.LimitReader(u.NewTimeSeededRand(), size) nd, err := BuildDagFromReader(ds, chunk.NewSizeSplitter(r, blksize)) @@ -26,7 +25,7 @@ func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, dag.DAG return nd, ds } -func getTrickleDag(t testing.TB, size int64, blksize int64) (node.Node, dag.DAGService) { +func getTrickleDag(t testing.TB, size int64, blksize int64) (node.Node, node.DAGService) { ds := mdtest.Mock() r := io.LimitReader(u.NewTimeSeededRand(), size) nd, err := BuildTrickleDagFromReader(ds, chunk.NewSizeSplitter(r, blksize)) @@ -102,7 +101,7 @@ func BenchmarkTrickleReadFull(b *testing.B) { runReadBench(b, nd, ds) } -func runReadBench(b *testing.B, nd node.Node, ds dag.DAGService) { +func runReadBench(b *testing.B, nd node.Node, ds node.DAGService) { for i := 0; i < b.N; i++ { ctx, cancel := context.WithCancel(context.Background()) read, err := uio.NewDagReader(ctx, nd, ds) diff --git a/importer/trickle/trickle_test.go b/importer/trickle/trickle_test.go index 1653b5f3199..5a95cc4c6c5 100644 --- a/importer/trickle/trickle_test.go +++ b/importer/trickle/trickle_test.go @@ -17,6 +17,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type UseRawLeaves bool @@ -31,7 +32,7 @@ func runBothSubtests(t *testing.T, tfunc func(*testing.T, UseRawLeaves)) { t.Run("leaves=Raw", func(t *testing.T) { tfunc(t, RawLeaves) }) } -func buildTestDag(ds merkledag.DAGService, spl chunk.Splitter, rawLeaves UseRawLeaves) (*merkledag.ProtoNode, error) { +func buildTestDag(ds node.DAGService, spl chunk.Splitter, rawLeaves UseRawLeaves) (*merkledag.ProtoNode, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, diff --git a/merkledag/batch.go b/merkledag/batch.go deleted file mode 100644 index a6ee02f06f1..00000000000 --- a/merkledag/batch.go +++ /dev/null @@ -1,99 +0,0 @@ -package merkledag - -import ( - "runtime" - - cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" - blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" -) - -// ParallelBatchCommits is the number of batch commits that can be in-flight before blocking. -// TODO(#4299): Experiment with multiple datastores, storage devices, and CPUs to find -// the right value/formula. -var ParallelBatchCommits = runtime.NumCPU() * 2 - -// Batch is a buffer for batching adds to a dag. -type Batch struct { - ds *dagService - - activeCommits int - commitError error - commitResults chan error - - blocks []blocks.Block - size int - - MaxSize int - MaxBlocks int -} - -func (t *Batch) processResults() { - for t.activeCommits > 0 && t.commitError == nil { - select { - case err := <-t.commitResults: - t.activeCommits-- - if err != nil { - t.commitError = err - } - default: - return - } - } -} - -func (t *Batch) asyncCommit() { - numBlocks := len(t.blocks) - if numBlocks == 0 || t.commitError != nil { - return - } - if t.activeCommits >= ParallelBatchCommits { - err := <-t.commitResults - t.activeCommits-- - - if err != nil { - t.commitError = err - return - } - } - go func(b []blocks.Block) { - _, err := t.ds.Blocks.AddBlocks(b) - t.commitResults <- err - }(t.blocks) - - t.activeCommits++ - t.blocks = make([]blocks.Block, 0, numBlocks) - t.size = 0 - - return -} - -// Add adds a node to the batch and commits the batch if necessary. -func (t *Batch) Add(nd node.Node) (*cid.Cid, error) { - // Not strictly necessary but allows us to catch errors early. - t.processResults() - if t.commitError != nil { - return nil, t.commitError - } - - t.blocks = append(t.blocks, nd) - t.size += len(nd.RawData()) - if t.size > t.MaxSize || len(t.blocks) > t.MaxBlocks { - t.asyncCommit() - } - return nd.Cid(), t.commitError -} - -// Commit commits batched nodes. -func (t *Batch) Commit() error { - t.asyncCommit() - for t.activeCommits > 0 && t.commitError == nil { - err := <-t.commitResults - t.activeCommits-- - if err != nil { - t.commitError = err - } - } - - return t.commitError -} diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 8f89b137e28..33b097510b7 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -7,11 +7,11 @@ import ( "sync" bserv "github.com/ipfs/go-ipfs/blockservice" - offline "github.com/ipfs/go-ipfs/exchange/offline" ipldcbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) // TODO: We should move these registrations elsewhere. Really, most of the IPLD @@ -23,37 +23,7 @@ func init() { node.Register(cid.DagCBOR, ipldcbor.DecodeBlock) } -var ErrNotFound = fmt.Errorf("merkledag: not found") - -// DAGService is an IPFS Merkle DAG service. -type DAGService interface { - // Add adds the node to the DAGService - Add(node.Node) (*cid.Cid, error) - // Get gets the node the from the DAGService - Get(context.Context, *cid.Cid) (node.Node, error) - // Remove removes the node from the DAGService - Remove(node.Node) error - - // GetMany returns a channel of NodeOption given - // a set of CIDs. - GetMany(context.Context, []*cid.Cid) <-chan *NodeOption - - // Batch is a buffer for batching adds to a dag. - Batch() *Batch - - LinkService -} - -type LinkService interface { - // GetLinks return all links for a node. The complete node does not - // necessarily have to exist locally, or at all. For example, raw - // leaves cannot possibly have links so there is no need to look - // at the node. - GetLinks(context.Context, *cid.Cid) ([]*node.Link, error) - - GetOfflineLinkService() LinkService -} - +// NewDAGService constructs a new DAGService (using the default implementation). func NewDAGService(bs bserv.BlockService) *dagService { return &dagService{Blocks: bs} } @@ -68,25 +38,20 @@ type dagService struct { } // Add adds a node to the dagService, storing the block in the BlockService -func (n *dagService) Add(nd node.Node) (*cid.Cid, error) { +func (n *dagService) Add(ctx context.Context, nd node.Node) error { if n == nil { // FIXME remove this assertion. protect with constructor invariant - return nil, fmt.Errorf("dagService is nil") + return fmt.Errorf("dagService is nil") } return n.Blocks.AddBlock(nd) } -func (n *dagService) Batch() *Batch { - return &Batch{ - ds: n, - commitResults: make(chan error, ParallelBatchCommits), - MaxSize: 8 << 20, - - // By default, only batch up to 128 nodes at a time. - // The current implementation of flatfs opens this many file - // descriptors at the same time for the optimized batch write. - MaxBlocks: 128, +func (n *dagService) AddMany(ctx context.Context, nds []node.Node) error { + blks := make([]blocks.Block, len(nds)) + for i, nd := range nds { + blks[i] = nd } + return n.Blocks.AddBlocks(blks) } // Get retrieves a node from the dagService, fetching the block in the BlockService @@ -101,7 +66,7 @@ func (n *dagService) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { b, err := n.Blocks.GetBlock(ctx, c) if err != nil { if err == bserv.ErrNotFound { - return nil, ErrNotFound + return nil, node.ErrNotFound } return nil, fmt.Errorf("Failed to get block for %s: %v", c, err) } @@ -122,17 +87,23 @@ func (n *dagService) GetLinks(ctx context.Context, c *cid.Cid) ([]*node.Link, er return node.Links(), nil } -func (n *dagService) GetOfflineLinkService() LinkService { - if n.Blocks.Exchange().IsOnline() { - bsrv := bserv.New(n.Blocks.Blockstore(), offline.Exchange(n.Blocks.Blockstore())) - return NewDAGService(bsrv) - } else { - return n - } +func (n *dagService) Remove(ctx context.Context, c *cid.Cid) error { + return n.Blocks.DeleteBlock(c) } -func (n *dagService) Remove(nd node.Node) error { - return n.Blocks.DeleteBlock(nd) +// RemoveMany removes multiple nodes from the DAG. It will likely be faster than +// removing them individually. +// +// This operation is not atomic. If it returns an error, some nodes may or may +// not have been removed. +func (n *dagService) RemoveMany(ctx context.Context, cids []*cid.Cid) error { + // TODO(#4608): make this batch all the way down. + for _, c := range cids { + if err := n.Blocks.DeleteBlock(c); err != nil { + return err + } + } + return nil } // GetLinksDirect creates a function to get the links for a node, from @@ -140,14 +111,14 @@ func (n *dagService) Remove(nd node.Node) error { // locally (and can not be retrieved) an error will be returned. func GetLinksDirect(serv node.NodeGetter) GetLinks { return func(ctx context.Context, c *cid.Cid) ([]*node.Link, error) { - node, err := serv.Get(ctx, c) + nd, err := serv.Get(ctx, c) if err != nil { if err == bserv.ErrNotFound { - err = ErrNotFound + err = node.ErrNotFound } return nil, err } - return node.Links(), nil + return nd.Links(), nil } } @@ -155,11 +126,12 @@ type sesGetter struct { bs *bserv.Session } +// Get gets a single node from the DAG. func (sg *sesGetter) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { blk, err := sg.bs.GetBlock(ctx, c) switch err { case bserv.ErrNotFound: - return nil, ErrNotFound + return nil, node.ErrNotFound default: return nil, err case nil: @@ -169,8 +141,13 @@ func (sg *sesGetter) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { return node.Decode(blk) } +// GetMany gets many nodes at once, batching the request if possible. +func (sg *sesGetter) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *node.NodeOption { + return getNodesFromBG(ctx, sg.bs, keys) +} + // FetchGraph fetches all nodes that are children of the given node -func FetchGraph(ctx context.Context, root *cid.Cid, serv DAGService) error { +func FetchGraph(ctx context.Context, root *cid.Cid, serv node.DAGService) error { var ng node.NodeGetter = serv ds, ok := serv.(*dagService) if ok { @@ -205,14 +182,18 @@ func FindLinks(links []*cid.Cid, c *cid.Cid, start int) []int { return out } -type NodeOption struct { - Node node.Node - Err error +// GetMany gets many nodes from the DAG at once. +// +// This method may not return all requested nodes (and may or may not return an +// error indicating that it failed to do so. It is up to the caller to verify +// that it received all nodes. +func (n *dagService) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *node.NodeOption { + return getNodesFromBG(ctx, n.Blocks, keys) } -func (ds *dagService) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *NodeOption { - out := make(chan *NodeOption, len(keys)) - blocks := ds.Blocks.GetBlocks(ctx, keys) +func getNodesFromBG(ctx context.Context, bs bserv.BlockGetter, keys []*cid.Cid) <-chan *node.NodeOption { + out := make(chan *node.NodeOption, len(keys)) + blocks := bs.GetBlocks(ctx, keys) var count int go func() { @@ -222,182 +203,43 @@ func (ds *dagService) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *Node case b, ok := <-blocks: if !ok { if count != len(keys) { - out <- &NodeOption{Err: fmt.Errorf("failed to fetch all nodes")} + out <- &node.NodeOption{Err: fmt.Errorf("failed to fetch all nodes")} } return } nd, err := node.Decode(b) if err != nil { - out <- &NodeOption{Err: err} + out <- &node.NodeOption{Err: err} return } - out <- &NodeOption{Node: nd} + out <- &node.NodeOption{Node: nd} count++ case <-ctx.Done(): - out <- &NodeOption{Err: ctx.Err()} - return - } - } - }() - return out -} - -// GetDAG will fill out all of the links of the given Node. -// It returns a channel of nodes, which the caller can receive -// all the child nodes of 'root' on, in proper order. -func GetDAG(ctx context.Context, ds DAGService, root node.Node) []NodeGetter { - var cids []*cid.Cid - for _, lnk := range root.Links() { - cids = append(cids, lnk.Cid) - } - - return GetNodes(ctx, ds, cids) -} - -// GetNodes returns an array of 'NodeGetter' promises, with each corresponding -// to the key with the same index as the passed in keys -func GetNodes(ctx context.Context, ds DAGService, keys []*cid.Cid) []NodeGetter { - - // Early out if no work to do - if len(keys) == 0 { - return nil - } - - promises := make([]NodeGetter, len(keys)) - for i := range keys { - promises[i] = newNodePromise(ctx) - } - - dedupedKeys := dedupeKeys(keys) - go func() { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - nodechan := ds.GetMany(ctx, dedupedKeys) - - for count := 0; count < len(keys); { - select { - case opt, ok := <-nodechan: - if !ok { - for _, p := range promises { - p.Fail(ErrNotFound) - } - return - } - - if opt.Err != nil { - for _, p := range promises { - p.Fail(opt.Err) - } - return - } - - nd := opt.Node - is := FindLinks(keys, nd.Cid(), 0) - for _, i := range is { - count++ - promises[i].Send(nd) - } - case <-ctx.Done(): + out <- &node.NodeOption{Err: ctx.Err()} return } } }() - return promises -} - -// Remove duplicates from a list of keys -func dedupeKeys(cids []*cid.Cid) []*cid.Cid { - out := make([]*cid.Cid, 0, len(cids)) - set := cid.NewSet() - for _, c := range cids { - if set.Visit(c) { - out = append(out, c) - } - } return out } -func newNodePromise(ctx context.Context) NodeGetter { - return &nodePromise{ - recv: make(chan node.Node, 1), - ctx: ctx, - err: make(chan error, 1), - } -} - -type nodePromise struct { - cache node.Node - clk sync.Mutex - recv chan node.Node - ctx context.Context - err chan error -} - -// NodeGetter provides a promise like interface for a dag Node -// the first call to Get will block until the Node is received -// from its internal channels, subsequent calls will return the -// cached node. -type NodeGetter interface { - Get(context.Context) (node.Node, error) - Fail(err error) - Send(node.Node) -} - -func (np *nodePromise) Fail(err error) { - np.clk.Lock() - v := np.cache - np.clk.Unlock() - - // if promise has a value, don't fail it - if v != nil { - return - } - - np.err <- err -} - -func (np *nodePromise) Send(nd node.Node) { - var already bool - np.clk.Lock() - if np.cache != nil { - already = true - } - np.cache = nd - np.clk.Unlock() - - if already { - panic("sending twice to the same promise is an error!") - } - - np.recv <- nd -} - -func (np *nodePromise) Get(ctx context.Context) (node.Node, error) { - np.clk.Lock() - c := np.cache - np.clk.Unlock() - if c != nil { - return c, nil - } +// GetLinks is the type of function passed to the EnumerateChildren function(s) +// for getting the children of an IPLD node. +type GetLinks func(context.Context, *cid.Cid) ([]*node.Link, error) - select { - case nd := <-np.recv: - return nd, nil - case <-np.ctx.Done(): - return nil, np.ctx.Err() - case <-ctx.Done(): - return nil, ctx.Err() - case err := <-np.err: - return nil, err +// GetLinksWithDAG returns a GetLinks function that tries to use the given +// NodeGetter as a LinkGetter to get the children of a given IPLD node. This may +// allow us to traverse the DAG without actually loading and parsing the node in +// question (if we already have the links cached). +func GetLinksWithDAG(ng node.NodeGetter) GetLinks { + return func(ctx context.Context, c *cid.Cid) ([]*node.Link, error) { + return node.GetLinks(ctx, ng, c) } } -type GetLinks func(context.Context, *cid.Cid) ([]*node.Link, error) - // EnumerateChildren will walk the dag below the given root node and add all // unseen children to the passed in set. // TODO: parallelize to avoid disk latency perf hits? @@ -443,6 +285,10 @@ func (p *ProgressTracker) Value() int { // 'fetchNodes' will start at a time var FetchGraphConcurrency = 8 +// EnumerateChildrenAsync is equivalent to EnumerateChildren *except* that it +// fetches children in parallel. +// +// NOTE: It *does not* make multiple concurrent calls to the passed `visit` function. func EnumerateChildrenAsync(ctx context.Context, getLinks GetLinks, c *cid.Cid, visit func(*cid.Cid) bool) error { feed := make(chan *cid.Cid) out := make(chan []*node.Link) @@ -523,3 +369,8 @@ func EnumerateChildrenAsync(ctx context.Context, getLinks GetLinks, c *cid.Cid, } } + +var _ node.LinkGetter = &dagService{} +var _ node.NodeGetter = &dagService{} +var _ node.NodeGetter = &sesGetter{} +var _ node.DAGService = &dagService{} diff --git a/merkledag/merkledag_test.go b/merkledag/merkledag_test.go index 8b1ad141443..b23cc4feb19 100644 --- a/merkledag/merkledag_test.go +++ b/merkledag/merkledag_test.go @@ -131,7 +131,7 @@ func TestBatchFetchDupBlock(t *testing.T) { func runBatchFetchTest(t *testing.T, read io.Reader) { ctx := context.Background() - var dagservs []DAGService + var dagservs []node.DAGService for _, bsi := range bstest.Mocks(5) { dagservs = append(dagservs, NewDAGService(bsi)) } @@ -155,7 +155,7 @@ func runBatchFetchTest(t *testing.T, read io.Reader) { t.Fatal(err) } - _, err = dagservs[0].Add(root) + err = dagservs[0].Add(ctx, root) if err != nil { t.Fatal(err) } @@ -221,7 +221,7 @@ func TestCantGet(t *testing.T) { } func TestFetchGraph(t *testing.T) { - var dservs []DAGService + var dservs []node.DAGService bsis := bstest.Mocks(2) for _, bsi := range bsis { dservs = append(dservs, NewDAGService(bsi)) @@ -285,13 +285,15 @@ func TestEnumerateChildren(t *testing.T) { } func TestFetchFailure(t *testing.T) { + ctx := context.Background() + ds := dstest.Mock() ds_bad := dstest.Mock() top := new(ProtoNode) for i := 0; i < 10; i++ { nd := NodeWithData([]byte{byte('a' + i)}) - _, err := ds.Add(nd) + err := ds.Add(ctx, nd) if err != nil { t.Fatal(err) } @@ -304,7 +306,7 @@ func TestFetchFailure(t *testing.T) { for i := 0; i < 10; i++ { nd := NodeWithData([]byte{'f', 'a' + byte(i)}) - _, err := ds_bad.Add(nd) + err := ds_bad.Add(ctx, nd) if err != nil { t.Fatal(err) } @@ -315,9 +317,9 @@ func TestFetchFailure(t *testing.T) { } } - getters := GetDAG(context.Background(), ds, top) + getters := node.GetDAG(ctx, ds, top) for i, getter := range getters { - _, err := getter.Get(context.Background()) + _, err := getter.Get(ctx) if err != nil && i < 10 { t.Fatal(err) } @@ -352,15 +354,17 @@ func TestUnmarshalFailure(t *testing.T) { } func TestBasicAddGet(t *testing.T) { + ctx := context.Background() + ds := dstest.Mock() nd := new(ProtoNode) - c, err := ds.Add(nd) + err := ds.Add(ctx, nd) if err != nil { t.Fatal(err) } - out, err := ds.Get(context.Background(), c) + out, err := ds.Get(ctx, nd.Cid()) if err != nil { t.Fatal(err) } @@ -371,20 +375,22 @@ func TestBasicAddGet(t *testing.T) { } func TestGetRawNodes(t *testing.T) { + ctx := context.Background() + rn := NewRawNode([]byte("test")) ds := dstest.Mock() - c, err := ds.Add(rn) + err := ds.Add(ctx, rn) if err != nil { t.Fatal(err) } - if !c.Equals(rn.Cid()) { + if !rn.Cid().Equals(rn.Cid()) { t.Fatal("output cids didnt match") } - out, err := ds.Get(context.TODO(), c) + out, err := ds.Get(ctx, rn.Cid()) if err != nil { t.Fatal(err) } @@ -449,6 +455,8 @@ func TestProtoNodeResolve(t *testing.T) { } func TestCidRetention(t *testing.T) { + ctx := context.Background() + nd := new(ProtoNode) nd.SetData([]byte("fooooo")) @@ -466,13 +474,13 @@ func TestCidRetention(t *testing.T) { } bs := dstest.Bserv() - _, err = bs.AddBlock(blk) + err = bs.AddBlock(blk) if err != nil { t.Fatal(err) } ds := NewDAGService(bs) - out, err := ds.Get(context.Background(), c2) + out, err := ds.Get(ctx, c2) if err != nil { t.Fatal(err) } @@ -501,6 +509,8 @@ func TestCidRawDoesnNeedData(t *testing.T) { } func TestEnumerateAsyncFailsNotFound(t *testing.T) { + ctx := context.Background() + a := NodeWithData([]byte("foo1")) b := NodeWithData([]byte("foo2")) c := NodeWithData([]byte("foo3")) @@ -508,7 +518,7 @@ func TestEnumerateAsyncFailsNotFound(t *testing.T) { ds := dstest.Mock() for _, n := range []node.Node{a, b, c} { - _, err := ds.Add(n) + err := ds.Add(ctx, n) if err != nil { t.Fatal(err) } @@ -531,13 +541,13 @@ func TestEnumerateAsyncFailsNotFound(t *testing.T) { t.Fatal(err) } - pcid, err := ds.Add(parent) + err := ds.Add(ctx, parent) if err != nil { t.Fatal(err) } cset := cid.NewSet() - err = EnumerateChildrenAsync(context.Background(), GetLinksDirect(ds), pcid, cset.Visit) + err = EnumerateChildrenAsync(ctx, GetLinksDirect(ds), parent.Cid(), cset.Visit) if err == nil { t.Fatal("this should have failed") } @@ -570,7 +580,9 @@ func testProgressIndicator(t *testing.T, depth int) { } } -func mkDag(ds DAGService, depth int) (*cid.Cid, int) { +func mkDag(ds node.DAGService, depth int) (*cid.Cid, int) { + ctx := context.Background() + totalChildren := 0 f := func() *ProtoNode { p := new(ProtoNode) @@ -578,7 +590,7 @@ func mkDag(ds DAGService, depth int) (*cid.Cid, int) { rand.Read(buf) p.SetData(buf) - _, err := ds.Add(p) + err := ds.Add(ctx, p) if err != nil { panic(err) } @@ -589,7 +601,7 @@ func mkDag(ds DAGService, depth int) (*cid.Cid, int) { thisf := f f = func() *ProtoNode { pn := mkNodeWithChildren(thisf, 10) - _, err := ds.Add(pn) + err := ds.Add(ctx, pn) if err != nil { panic(err) } @@ -599,12 +611,12 @@ func mkDag(ds DAGService, depth int) (*cid.Cid, int) { } nd := f() - c, err := ds.Add(nd) + err := ds.Add(ctx, nd) if err != nil { panic(err) } - return c, totalChildren + return nd.Cid(), totalChildren } func mkNodeWithChildren(getChild func() *ProtoNode, width int) *ProtoNode { diff --git a/merkledag/node.go b/merkledag/node.go index 44d44617da0..143e7e07525 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -140,7 +140,7 @@ func (n *ProtoNode) RemoveNodeLink(name string) error { n.links = good if !found { - return ErrNotFound + return node.ErrNotFound } return nil @@ -160,7 +160,7 @@ func (n *ProtoNode) GetNodeLink(name string) (*node.Link, error) { return nil, ErrLinkNotFound } -func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds DAGService, name string) (*ProtoNode, error) { +func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds node.DAGService, name string) (*ProtoNode, error) { nd, err := n.GetLinkedNode(ctx, ds, name) if err != nil { return nil, err @@ -174,7 +174,7 @@ func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds DAGService, name return pbnd, nil } -func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds DAGService, name string) (node.Node, error) { +func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds node.DAGService, name string) (node.Node, error) { lnk, err := n.GetNodeLink(name) if err != nil { return nil, err diff --git a/merkledag/node_test.go b/merkledag/node_test.go index 27726c4543e..4b6a412d222 100644 --- a/merkledag/node_test.go +++ b/merkledag/node_test.go @@ -41,7 +41,7 @@ func TestRemoveLink(t *testing.T) { // should fail err = nd.RemoveNodeLink("a") - if err != ErrNotFound { + if err != node.ErrNotFound { t.Fatal("should have failed to remove link") } @@ -60,20 +60,25 @@ func TestRemoveLink(t *testing.T) { } func TestFindLink(t *testing.T) { + ctx := context.Background() + ds := mdtest.Mock() - k, err := ds.Add(new(ProtoNode)) + ndEmpty := new(ProtoNode) + err := ds.Add(ctx, ndEmpty) if err != nil { t.Fatal(err) } + kEmpty := ndEmpty.Cid() + nd := &ProtoNode{} nd.SetLinks([]*node.Link{ - {Name: "a", Cid: k}, - {Name: "c", Cid: k}, - {Name: "b", Cid: k}, + {Name: "a", Cid: kEmpty}, + {Name: "c", Cid: kEmpty}, + {Name: "b", Cid: kEmpty}, }) - _, err = ds.Add(nd) + err = ds.Add(ctx, nd) if err != nil { t.Fatal(err) } @@ -107,7 +112,7 @@ func TestFindLink(t *testing.T) { t.Fatal(err) } - if olnk.Cid.String() == k.String() { + if olnk.Cid.String() == kEmpty.String() { t.Fatal("new link should have different hash") } } diff --git a/merkledag/test/utils.go b/merkledag/test/utils.go index c0ab995e262..87bfe23c8e7 100644 --- a/merkledag/test/utils.go +++ b/merkledag/test/utils.go @@ -5,11 +5,13 @@ import ( bsrv "github.com/ipfs/go-ipfs/blockservice" "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" + ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func Mock() dag.DAGService { +func Mock() node.DAGService { return dag.NewDAGService(Bserv()) } diff --git a/merkledag/traverse/traverse_test.go b/merkledag/traverse/traverse_test.go index 23d42c6c0a0..8c32a69345d 100644 --- a/merkledag/traverse/traverse_test.go +++ b/merkledag/traverse/traverse_test.go @@ -2,6 +2,7 @@ package traverse import ( "bytes" + "context" "fmt" "testing" @@ -350,7 +351,7 @@ func testWalkOutputs(t *testing.T, root node.Node, opts Options, expect []byte) } } -func newFan(t *testing.T, ds mdag.DAGService) node.Node { +func newFan(t *testing.T, ds node.DAGService) node.Node { a := mdag.NodeWithData([]byte("/a")) addLink(t, ds, a, child(t, ds, a, "aa")) addLink(t, ds, a, child(t, ds, a, "ab")) @@ -359,7 +360,7 @@ func newFan(t *testing.T, ds mdag.DAGService) node.Node { return a } -func newLinkedList(t *testing.T, ds mdag.DAGService) node.Node { +func newLinkedList(t *testing.T, ds node.DAGService) node.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") aaa := child(t, ds, aa, "aaa") @@ -372,7 +373,7 @@ func newLinkedList(t *testing.T, ds mdag.DAGService) node.Node { return a } -func newBinaryTree(t *testing.T, ds mdag.DAGService) node.Node { +func newBinaryTree(t *testing.T, ds node.DAGService) node.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") ab := child(t, ds, a, "ab") @@ -385,7 +386,7 @@ func newBinaryTree(t *testing.T, ds mdag.DAGService) node.Node { return a } -func newBinaryDAG(t *testing.T, ds mdag.DAGService) node.Node { +func newBinaryDAG(t *testing.T, ds node.DAGService) node.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") aaa := child(t, ds, aa, "aaa") @@ -402,9 +403,9 @@ func newBinaryDAG(t *testing.T, ds mdag.DAGService) node.Node { return a } -func addLink(t *testing.T, ds mdag.DAGService, a, b node.Node) { +func addLink(t *testing.T, ds node.DAGService, a, b node.Node) { to := string(a.(*mdag.ProtoNode).Data()) + "2" + string(b.(*mdag.ProtoNode).Data()) - if _, err := ds.Add(b); err != nil { + if err := ds.Add(context.Background(), b); err != nil { t.Error(err) } if err := a.(*mdag.ProtoNode).AddNodeLink(to, b.(*mdag.ProtoNode)); err != nil { @@ -412,6 +413,6 @@ func addLink(t *testing.T, ds mdag.DAGService, a, b node.Node) { } } -func child(t *testing.T, ds mdag.DAGService, a node.Node, name string) node.Node { +func child(t *testing.T, ds node.DAGService, a node.Node, name string) node.Node { return mdag.NodeWithData([]byte(string(a.(*mdag.ProtoNode).Data()) + "/" + name)) } diff --git a/merkledag/utils/diff.go b/merkledag/utils/diff.go index db5e22936ab..2ead4bdf761 100644 --- a/merkledag/utils/diff.go +++ b/merkledag/utils/diff.go @@ -37,7 +37,7 @@ func (c *Change) String() string { } } -func ApplyChange(ctx context.Context, ds dag.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error) { +func ApplyChange(ctx context.Context, ds node.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error) { e := NewDagEditor(nd, ds) for _, c := range cs { switch c.Type { @@ -85,11 +85,11 @@ func ApplyChange(ctx context.Context, ds dag.DAGService, nd *dag.ProtoNode, cs [ } } - return e.Finalize(ds) + return e.Finalize(ctx, ds) } // Diff returns a set of changes that transform node 'a' into node 'b' -func Diff(ctx context.Context, ds dag.DAGService, a, b node.Node) ([]*Change, error) { +func Diff(ctx context.Context, ds node.DAGService, a, b node.Node) ([]*Change, error) { if len(a.Links()) == 0 && len(b.Links()) == 0 { return []*Change{ &Change{ diff --git a/merkledag/utils/diffenum_test.go b/merkledag/utils/diffenum_test.go index 66875160995..5fd463aec82 100644 --- a/merkledag/utils/diffenum_test.go +++ b/merkledag/utils/diffenum_test.go @@ -136,7 +136,7 @@ func TestDiffEnumBasic(t *testing.T) { lgds := &getLogger{ds: ds} for _, nd := range nds { - _, err := ds.Add(nd) + err := ds.Add(ctx, nd) if err != nil { t.Fatal(err) } @@ -167,6 +167,22 @@ func (gl *getLogger) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { return nd, nil } +func (gl *getLogger) GetMany(ctx context.Context, cids []*cid.Cid) <-chan *node.NodeOption { + outCh := make(chan *node.NodeOption, len(cids)) + nds := gl.ds.GetMany(ctx, cids) + for no := range nds { + if no.Err == nil { + gl.log = append(gl.log, no.Node.Cid()) + } + select { + case outCh <- no: + default: + panic("too many responses") + } + } + return nds +} + func assertCidList(a, b []*cid.Cid) error { if len(a) != len(b) { return fmt.Errorf("got different number of cids than expected") @@ -188,14 +204,14 @@ func TestDiffEnumFail(t *testing.T) { lgds := &getLogger{ds: ds} for _, s := range []string{"a1", "a2", "b", "c"} { - _, err := ds.Add(nds[s]) + err := ds.Add(ctx, nds[s]) if err != nil { t.Fatal(err) } } err := DiffEnumerate(ctx, lgds, nds["a1"].Cid(), nds["a2"].Cid()) - if err != dag.ErrNotFound { + if err != node.ErrNotFound { t.Fatal("expected err not found") } @@ -215,7 +231,7 @@ func TestDiffEnumRecurse(t *testing.T) { lgds := &getLogger{ds: ds} for _, s := range []string{"a1", "a2", "b", "c", "d"} { - _, err := ds.Add(nds[s]) + err := ds.Add(ctx, nds[s]) if err != nil { t.Fatal(err) } diff --git a/merkledag/utils/utils.go b/merkledag/utils/utils.go index 6c16967ca69..dd119834da1 100644 --- a/merkledag/utils/utils.go +++ b/merkledag/utils/utils.go @@ -20,14 +20,14 @@ type Editor struct { // tmp is a temporary in memory (for now) dagstore for all of the // intermediary nodes to be stored in - tmp dag.DAGService + tmp node.DAGService // src is the dagstore with *all* of the data on it, it is used to pull // nodes from for modification (nil is a valid value) - src dag.DAGService + src node.DAGService } -func NewMemoryDagService() dag.DAGService { +func NewMemoryDagService() node.DAGService { // build mem-datastore for editor's intermediary nodes bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) bsrv := bserv.New(bs, offline.Exchange(bs)) @@ -35,7 +35,7 @@ func NewMemoryDagService() dag.DAGService { } // root is the node to be modified, source is the dagstore to pull nodes from (optional) -func NewDagEditor(root *dag.ProtoNode, source dag.DAGService) *Editor { +func NewDagEditor(root *dag.ProtoNode, source node.DAGService) *Editor { return &Editor{ root: root, tmp: NewMemoryDagService(), @@ -47,22 +47,22 @@ func (e *Editor) GetNode() *dag.ProtoNode { return e.root.Copy().(*dag.ProtoNode) } -func (e *Editor) GetDagService() dag.DAGService { +func (e *Editor) GetDagService() node.DAGService { return e.tmp } -func addLink(ctx context.Context, ds dag.DAGService, root *dag.ProtoNode, childname string, childnd node.Node) (*dag.ProtoNode, error) { +func addLink(ctx context.Context, ds node.DAGService, root *dag.ProtoNode, childname string, childnd node.Node) (*dag.ProtoNode, error) { if childname == "" { return nil, errors.New("cannot create link with no name!") } // ensure that the node we are adding is in the dagservice - _, err := ds.Add(childnd) + err := ds.Add(ctx, childnd) if err != nil { return nil, err } - _ = ds.Remove(root) + _ = ds.Remove(ctx, root.Cid()) // ensure no link with that name already exists _ = root.RemoveNodeLink(childname) // ignore error, only option is ErrNotFound @@ -71,7 +71,7 @@ func addLink(ctx context.Context, ds dag.DAGService, root *dag.ProtoNode, childn return nil, err } - if _, err := ds.Add(root); err != nil { + if err := ds.Add(ctx, root); err != nil { return nil, err } return root, nil @@ -98,7 +98,7 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path if err == dag.ErrLinkNotFound && create != nil { nd = create() err = nil // no longer an error case - } else if err == dag.ErrNotFound { + } else if err == node.ErrNotFound { // try finding it in our source dagstore nd, err = root.GetLinkedProtoNode(ctx, e.src, path[0]) } @@ -115,7 +115,7 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path return nil, err } - _ = e.tmp.Remove(root) + _ = e.tmp.Remove(ctx, root.Cid()) _ = root.RemoveNodeLink(path[0]) err = root.AddNodeLinkClean(path[0], ndprime) @@ -123,7 +123,7 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path return nil, err } - _, err = e.tmp.Add(root) + err = e.tmp.Add(ctx, root) if err != nil { return nil, err } @@ -149,7 +149,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) return nil, err } - _, err = e.tmp.Add(root) + err = e.tmp.Add(ctx, root) if err != nil { return nil, err } @@ -159,7 +159,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) // search for node in both tmp dagstore and source dagstore nd, err := root.GetLinkedProtoNode(ctx, e.tmp, path[0]) - if err == dag.ErrNotFound { + if err == node.ErrNotFound { nd, err = root.GetLinkedProtoNode(ctx, e.src, path[0]) } @@ -172,7 +172,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) return nil, err } - _ = e.tmp.Remove(root) + e.tmp.Remove(ctx, root.Cid()) _ = root.RemoveNodeLink(path[0]) err = root.AddNodeLinkClean(path[0], nnode) @@ -180,7 +180,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) return nil, err } - _, err = e.tmp.Add(root) + err = e.tmp.Add(ctx, root) if err != nil { return nil, err } @@ -188,22 +188,23 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) return root, nil } -func (e *Editor) Finalize(ds dag.DAGService) (*dag.ProtoNode, error) { +func (e *Editor) Finalize(ctx context.Context, ds node.DAGService) (*dag.ProtoNode, error) { nd := e.GetNode() - err := copyDag(nd, e.tmp, ds) + err := copyDag(ctx, nd, e.tmp, ds) return nd, err } -func copyDag(nd node.Node, from, to dag.DAGService) error { - _, err := to.Add(nd) +func copyDag(ctx context.Context, nd node.Node, from, to node.DAGService) error { + // TODO(#4609): make this batch. + err := to.Add(ctx, nd) if err != nil { return err } for _, lnk := range nd.Links() { - child, err := lnk.GetNode(context.Background(), from) + child, err := lnk.GetNode(ctx, from) if err != nil { - if err == dag.ErrNotFound { + if err == node.ErrNotFound { // not found means we didnt modify it, and it should // already be in the target datastore continue @@ -211,7 +212,7 @@ func copyDag(nd node.Node, from, to dag.DAGService) error { return err } - err = copyDag(child, from, to) + err = copyDag(ctx, child, from, to) if err != nil { return err } diff --git a/merkledag/utils/utils_test.go b/merkledag/utils/utils_test.go index 2c3e953d302..c404ffed418 100644 --- a/merkledag/utils/utils_test.go +++ b/merkledag/utils/utils_test.go @@ -9,35 +9,39 @@ import ( path "github.com/ipfs/go-ipfs/path" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestAddLink(t *testing.T) { + ctx, context := context.WithCancel(context.Background()) + defer context() + ds := mdtest.Mock() fishnode := dag.NodeWithData([]byte("fishcakes!")) - fk, err := ds.Add(fishnode) + err := ds.Add(ctx, fishnode) if err != nil { t.Fatal(err) } nd := new(dag.ProtoNode) - nnode, err := addLink(context.Background(), ds, nd, "fish", fishnode) + nnode, err := addLink(ctx, ds, nd, "fish", fishnode) if err != nil { t.Fatal(err) } - fnprime, err := nnode.GetLinkedNode(context.Background(), ds, "fish") + fnprime, err := nnode.GetLinkedNode(ctx, ds, "fish") if err != nil { t.Fatal(err) } fnpkey := fnprime.Cid() - if !fnpkey.Equals(fk) { + if !fnpkey.Equals(fishnode.Cid()) { t.Fatal("wrong child node found!") } } -func assertNodeAtPath(t *testing.T, ds dag.DAGService, root *dag.ProtoNode, pth string, exp *cid.Cid) { +func assertNodeAtPath(t *testing.T, ds node.DAGService, root *dag.ProtoNode, pth string, exp *cid.Cid) { parts := path.SplitList(pth) cur := root for _, e := range parts { @@ -78,7 +82,7 @@ func TestInsertNode(t *testing.T) { func testInsert(t *testing.T, e *Editor, path, data string, create bool, experr string) { child := dag.NodeWithData([]byte(data)) - ck, err := e.tmp.Add(child) + err := e.tmp.Add(context.Background(), child) if err != nil { t.Fatal(err) } @@ -106,5 +110,5 @@ func testInsert(t *testing.T, e *Editor, path, data string, create bool, experr t.Fatal(err, path, data, create, experr) } - assertNodeAtPath(t, e.tmp, e.root, path, ck) + assertNodeAtPath(t, e.tmp, e.root, path, child.Cid()) } diff --git a/mfs/dir.go b/mfs/dir.go index 250219d758b..5ad39d20503 100644 --- a/mfs/dir.go +++ b/mfs/dir.go @@ -24,7 +24,7 @@ var ErrInvalidChild = errors.New("invalid child node") var ErrDirExists = errors.New("directory already has entry by that name") type Directory struct { - dserv dag.DAGService + dserv node.DAGService parent childCloser childDirs map[string]*Directory @@ -40,7 +40,7 @@ type Directory struct { name string } -func NewDirectory(ctx context.Context, name string, node node.Node, parent childCloser, dserv dag.DAGService) (*Directory, error) { +func NewDirectory(ctx context.Context, name string, node node.Node, parent childCloser, dserv node.DAGService) (*Directory, error) { db, err := uio.NewDirectoryFromNode(dserv, node) if err != nil { return nil, err @@ -104,7 +104,7 @@ func (d *Directory) flushCurrentNode() (*dag.ProtoNode, error) { return nil, err } - _, err = d.dserv.Add(nd) + err = d.dserv.Add(d.ctx, nd) if err != nil { return nil, err } @@ -306,7 +306,7 @@ func (d *Directory) Mkdir(name string) (*Directory, error) { ndir := ft.EmptyDirNode() ndir.SetPrefix(d.GetPrefix()) - _, err = d.dserv.Add(ndir) + err = d.dserv.Add(d.ctx, ndir) if err != nil { return nil, err } @@ -354,7 +354,7 @@ func (d *Directory) AddChild(name string, nd node.Node) error { return ErrDirExists } - _, err = d.dserv.Add(nd) + err = d.dserv.Add(d.ctx, nd) if err != nil { return err } @@ -420,7 +420,7 @@ func (d *Directory) GetNode() (node.Node, error) { return nil, err } - _, err = d.dserv.Add(nd) + err = d.dserv.Add(d.ctx, nd) if err != nil { return nil, err } diff --git a/mfs/fd.go b/mfs/fd.go index 9eb36931644..a93a9bb4281 100644 --- a/mfs/fd.go +++ b/mfs/fd.go @@ -122,7 +122,7 @@ func (fi *fileDescriptor) flushUp(fullsync bool) error { return err } - _, err = fi.inode.dserv.Add(nd) + err = fi.inode.dserv.Add(context.TODO(), nd) if err != nil { return err } diff --git a/mfs/file.go b/mfs/file.go index aa870551a5e..033965fa204 100644 --- a/mfs/file.go +++ b/mfs/file.go @@ -20,7 +20,7 @@ type File struct { desclock sync.RWMutex - dserv dag.DAGService + dserv node.DAGService node node.Node nodelk sync.Mutex @@ -29,7 +29,7 @@ type File struct { // NewFile returns a NewFile object with the given parameters. If the // Cid version is non-zero RawLeaves will be enabled. -func NewFile(name string, node node.Node, parent childCloser, dserv dag.DAGService) (*File, error) { +func NewFile(name string, node node.Node, parent childCloser, dserv node.DAGService) (*File, error) { fi := &File{ dserv: dserv, parent: parent, diff --git a/mfs/mfs_test.go b/mfs/mfs_test.go index b9ec1b4e426..3745d88871b 100644 --- a/mfs/mfs_test.go +++ b/mfs/mfs_test.go @@ -35,19 +35,19 @@ func emptyDirNode() *dag.ProtoNode { return dag.NodeWithData(ft.FolderPBData()) } -func getDagserv(t *testing.T) dag.DAGService { +func getDagserv(t *testing.T) node.DAGService { db := dssync.MutexWrap(ds.NewMapDatastore()) bs := bstore.NewBlockstore(db) blockserv := bserv.New(bs, offline.Exchange(bs)) return dag.NewDAGService(blockserv) } -func getRandFile(t *testing.T, ds dag.DAGService, size int64) node.Node { +func getRandFile(t *testing.T, ds node.DAGService, size int64) node.Node { r := io.LimitReader(u.NewTimeSeededRand(), size) return fileNodeFromReader(t, ds, r) } -func fileNodeFromReader(t *testing.T, ds dag.DAGService, r io.Reader) node.Node { +func fileNodeFromReader(t *testing.T, ds node.DAGService, r io.Reader) node.Node { nd, err := importer.BuildDagFromReader(ds, chunk.DefaultSplitter(r)) if err != nil { t.Fatal(err) @@ -128,7 +128,7 @@ func compStrArrs(a, b []string) bool { return true } -func assertFileAtPath(ds dag.DAGService, root *Directory, expn node.Node, pth string) error { +func assertFileAtPath(ds node.DAGService, root *Directory, expn node.Node, pth string) error { exp, ok := expn.(*dag.ProtoNode) if !ok { return dag.ErrNotProtobuf @@ -182,7 +182,7 @@ func assertFileAtPath(ds dag.DAGService, root *Directory, expn node.Node, pth st return nil } -func catNode(ds dag.DAGService, nd *dag.ProtoNode) ([]byte, error) { +func catNode(ds node.DAGService, nd *dag.ProtoNode) ([]byte, error) { r, err := uio.NewDagReader(context.TODO(), nd, ds) if err != nil { return nil, err @@ -192,7 +192,7 @@ func catNode(ds dag.DAGService, nd *dag.ProtoNode) ([]byte, error) { return ioutil.ReadAll(r) } -func setupRoot(ctx context.Context, t *testing.T) (dag.DAGService, *Root) { +func setupRoot(ctx context.Context, t *testing.T) (node.DAGService, *Root) { ds := getDagserv(t) root := emptyDirNode() @@ -284,7 +284,7 @@ func TestDirectoryLoadFromDag(t *testing.T) { rootdir := rt.GetValue().(*Directory) nd := getRandFile(t, ds, 1000) - _, err := ds.Add(nd) + err := ds.Add(ctx, nd) if err != nil { t.Fatal(err) } @@ -292,7 +292,7 @@ func TestDirectoryLoadFromDag(t *testing.T) { fihash := nd.Cid() dir := emptyDirNode() - _, err = ds.Add(dir) + err = ds.Add(ctx, dir) if err != nil { t.Fatal(err) } diff --git a/mfs/system.go b/mfs/system.go index 28dbe8aecb3..5c30db57c18 100644 --- a/mfs/system.go +++ b/mfs/system.go @@ -58,7 +58,7 @@ type Root struct { repub *Republisher - dserv dag.DAGService + dserv node.DAGService Type string } @@ -67,7 +67,7 @@ type Root struct { type PubFunc func(context.Context, *cid.Cid) error // NewRoot creates a new Root and starts up a republisher routine for it. -func NewRoot(parent context.Context, ds dag.DAGService, node *dag.ProtoNode, pf PubFunc) (*Root, error) { +func NewRoot(parent context.Context, ds node.DAGService, node *dag.ProtoNode, pf PubFunc) (*Root, error) { var repub *Republisher if pf != nil { @@ -160,13 +160,13 @@ func (kr *Root) FlushMemFree(ctx context.Context) error { // closeChild implements the childCloser interface, and signals to the publisher that // there are changes ready to be published. func (kr *Root) closeChild(name string, nd node.Node, sync bool) error { - c, err := kr.dserv.Add(nd) + err := kr.dserv.Add(context.TODO(), nd) if err != nil { return err } if kr.repub != nil { - kr.repub.Update(c) + kr.repub.Update(nd.Cid()) } return nil } diff --git a/path/resolver.go b/path/resolver.go index 68639fbc0d9..71ac52ba0f3 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -35,12 +35,12 @@ func (e ErrNoLink) Error() string { // TODO: now that this is more modular, try to unify this code with the // the resolvers in namesys type Resolver struct { - DAG dag.DAGService + DAG node.DAGService - ResolveOnce func(ctx context.Context, ds dag.DAGService, nd node.Node, names []string) (*node.Link, []string, error) + ResolveOnce func(ctx context.Context, ds node.DAGService, nd node.Node, names []string) (*node.Link, []string, error) } -func NewBasicResolver(ds dag.DAGService) *Resolver { +func NewBasicResolver(ds node.DAGService) *Resolver { return &Resolver{ DAG: ds, ResolveOnce: ResolveSingle, @@ -123,7 +123,7 @@ func (s *Resolver) ResolvePath(ctx context.Context, fpath Path) (node.Node, erro // ResolveSingle simply resolves one hop of a path through a graph with no // extra context (does not opaquely resolve through sharded nodes) -func ResolveSingle(ctx context.Context, ds dag.DAGService, nd node.Node, names []string) (*node.Link, []string, error) { +func ResolveSingle(ctx context.Context, ds node.DAGService, nd node.Node, names []string) (*node.Link, []string, error) { return nd.ResolveLink(names) } diff --git a/path/resolver_test.go b/path/resolver_test.go index 8347fc6023d..5f5a9ee50ab 100644 --- a/path/resolver_test.go +++ b/path/resolver_test.go @@ -39,7 +39,7 @@ func TestRecurivePathResolution(t *testing.T) { } for _, n := range []node.Node{a, b, c} { - _, err = dagService.Add(n) + err = dagService.Add(ctx, n) if err != nil { t.Fatal(err) } diff --git a/pin/gc/gc.go b/pin/gc/gc.go index 7a19b69698b..c3ab3db9006 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -6,6 +6,8 @@ import ( "fmt" bstore "github.com/ipfs/go-ipfs/blocks/blockstore" + bserv "github.com/ipfs/go-ipfs/blockservice" + offline "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" @@ -33,7 +35,7 @@ type Result struct { // The routine then iterates over every block in the blockstore and // deletes any block that is not found in the marked set. // -func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.Pinner, bestEffortRoots []*cid.Cid) <-chan Result { +func GC(ctx context.Context, bs bstore.GCBlockstore, pn pin.Pinner, bestEffortRoots []*cid.Cid) <-chan Result { elock := log.EventBegin(ctx, "GC.lockWait") unlocker := bs.GCLock() @@ -41,7 +43,8 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin. elock = log.EventBegin(ctx, "GC.locked") emark := log.EventBegin(ctx, "GC.mark") - ls = ls.GetOfflineLinkService() + bsrv := bserv.New(bs, offline.Exchange(bs)) + ds := dag.NewDAGService(bsrv) output := make(chan Result, 128) @@ -50,7 +53,7 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin. defer unlocker.Unlock() defer elock.Done() - gcs, err := ColoredSet(ctx, pn, ls, bestEffortRoots, output) + gcs, err := ColoredSet(ctx, pn, ds, bestEffortRoots, output) if err != nil { output <- Result{Error: err} return @@ -125,13 +128,13 @@ func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots // ColoredSet computes the set of nodes in the graph that are pinned by the // pins in the given pinner. -func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffortRoots []*cid.Cid, output chan<- Result) (*cid.Set, error) { +func ColoredSet(ctx context.Context, pn pin.Pinner, ng node.NodeGetter, bestEffortRoots []*cid.Cid, output chan<- Result) (*cid.Set, error) { // KeySet currently implemented in memory, in the future, may be bloom filter or // disk backed to conserve memory. errors := false gcs := cid.NewSet() getLinks := func(ctx context.Context, cid *cid.Cid) ([]*node.Link, error) { - links, err := ls.GetLinks(ctx, cid) + links, err := node.GetLinks(ctx, ng, cid) if err != nil { errors = true output <- Result{Error: &CannotFetchLinksError{cid, err}} @@ -145,8 +148,8 @@ func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffo } bestEffortGetLinks := func(ctx context.Context, cid *cid.Cid) ([]*node.Link, error) { - links, err := ls.GetLinks(ctx, cid) - if err != nil && err != dag.ErrNotFound { + links, err := node.GetLinks(ctx, ng, cid) + if err != nil && err != node.ErrNotFound { errors = true output <- Result{Error: &CannotFetchLinksError{cid, err}} } diff --git a/pin/pin.go b/pin/pin.go index f148053ff70..9387439fb5c 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -178,13 +178,13 @@ type pinner struct { // Track the keys used for storing the pinning state, so gc does // not delete them. internalPin *cid.Set - dserv mdag.DAGService - internal mdag.DAGService // dagservice used to store internal objects + dserv node.DAGService + internal node.DAGService // dagservice used to store internal objects dstore ds.Datastore } // NewPinner creates a new pinner using the given datastore as a backend -func NewPinner(dstore ds.Datastore, serv, internal mdag.DAGService) Pinner { +func NewPinner(dstore ds.Datastore, serv, internal node.DAGService) Pinner { rcset := cid.NewSet() dirset := cid.NewSet() @@ -203,11 +203,13 @@ func NewPinner(dstore ds.Datastore, serv, internal mdag.DAGService) Pinner { func (p *pinner) Pin(ctx context.Context, node node.Node, recurse bool) error { p.lock.Lock() defer p.lock.Unlock() - c, err := p.dserv.Add(node) + err := p.dserv.Add(ctx, node) if err != nil { return err } + c := node.Cid() + if recurse { if p.recursePin.Has(c) { return nil @@ -356,7 +358,7 @@ func (p *pinner) CheckIfPinned(cids ...*cid.Cid) ([]Pinned, error) { // Now walk all recursive pins to check for indirect pins var checkChildren func(*cid.Cid, *cid.Cid) error checkChildren = func(rk, parentKey *cid.Cid) error { - links, err := p.dserv.GetLinks(context.Background(), parentKey) + links, err := node.GetLinks(context.TODO(), p.dserv, parentKey) if err != nil { return err } @@ -425,7 +427,7 @@ func cidSetWithValues(cids []*cid.Cid) *cid.Set { } // LoadPinner loads a pinner and its keysets from the given datastore -func LoadPinner(d ds.Datastore, dserv, internal mdag.DAGService) (Pinner, error) { +func LoadPinner(d ds.Datastore, dserv, internal node.DAGService) (Pinner, error) { p := new(pinner) rootKeyI, err := d.Get(pinDatastoreKey) @@ -550,16 +552,18 @@ func (p *pinner) Flush() error { } // add the empty node, its referenced by the pin sets but never created - _, err := p.internal.Add(new(mdag.ProtoNode)) + err := p.internal.Add(ctx, new(mdag.ProtoNode)) if err != nil { return err } - k, err := p.internal.Add(root) + err = p.internal.Add(ctx, root) if err != nil { return err } + k := root.Cid() + internalset.Add(k) if err := p.dstore.Put(pinDatastoreKey, k.Bytes()); err != nil { return fmt.Errorf("cannot store pin state: %v", err) @@ -593,8 +597,8 @@ func (p *pinner) PinWithMode(c *cid.Cid, mode PinMode) { // hasChild recursively looks for a Cid among the children of a root Cid. // The visit function can be used to shortcut already-visited branches. -func hasChild(ds mdag.LinkService, root *cid.Cid, child *cid.Cid, visit func(*cid.Cid) bool) (bool, error) { - links, err := ds.GetLinks(context.Background(), root) +func hasChild(ng node.NodeGetter, root *cid.Cid, child *cid.Cid, visit func(*cid.Cid) bool) (bool, error) { + links, err := node.GetLinks(context.TODO(), ng, root) if err != nil { return false, err } @@ -604,7 +608,7 @@ func hasChild(ds mdag.LinkService, root *cid.Cid, child *cid.Cid, visit func(*ci return true, nil } if visit(c) { - has, err := hasChild(ds, c, child, visit) + has, err := hasChild(ng, c, child, visit) if err != nil { return false, err } diff --git a/pin/pin_test.go b/pin/pin_test.go index 7980c8dbc4d..3652ef8e722 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -59,7 +59,7 @@ func TestPinnerBasic(t *testing.T) { p := NewPinner(dstore, dserv, dserv) a, ak := randNode() - _, err := dserv.Add(a) + err := dserv.Add(ctx, a) if err != nil { t.Fatal(err) } @@ -74,10 +74,11 @@ func TestPinnerBasic(t *testing.T) { // create new node c, to be indirectly pinned through b c, _ := randNode() - ck, err := dserv.Add(c) + err = dserv.Add(ctx, c) if err != nil { t.Fatal(err) } + ck := c.Cid() // Create new node b, to be parent to a and c b, _ := randNode() @@ -91,10 +92,11 @@ func TestPinnerBasic(t *testing.T) { t.Fatal(err) } - _, err = dserv.Add(b) + err = dserv.Add(ctx, b) if err != nil { t.Fatal(err) } + bk := b.Cid() // recursively pin B{A,C} err = p.Pin(ctx, b, true) @@ -104,7 +106,6 @@ func TestPinnerBasic(t *testing.T) { assertPinned(t, p, ck, "child of recursively pinned node not found") - bk := b.Cid() assertPinned(t, p, bk, "Recursively pinned node not found..") d, _ := randNode() @@ -115,11 +116,11 @@ func TestPinnerBasic(t *testing.T) { d.AddNodeLink("e", e) // Must be in dagserv for unpin to work - _, err = dserv.Add(e) + err = dserv.Add(ctx, e) if err != nil { t.Fatal(err) } - _, err = dserv.Add(d) + err = dserv.Add(ctx, d) if err != nil { t.Fatal(err) } @@ -194,13 +195,13 @@ func TestIsPinnedLookup(t *testing.T) { } } - ak, err := dserv.Add(a) + err := dserv.Add(ctx, a) if err != nil { t.Fatal(err) } //t.Logf("a[%d] is %s", i, ak) aNodes[i] = a - aKeys[i] = ak + aKeys[i] = a.Cid() } // Pin A5 recursively @@ -222,20 +223,22 @@ func TestIsPinnedLookup(t *testing.T) { } // Add C - ck, err := dserv.Add(c) + err := dserv.Add(ctx, c) if err != nil { t.Fatal(err) } + ck := c.Cid() //t.Logf("C is %s", ck) // Add C to B and Add B if err := b.AddNodeLink("myotherchild", c); err != nil { t.Fatal(err) } - bk, err := dserv.Add(b) + err = dserv.Add(ctx, b) if err != nil { t.Fatal(err) } + bk := b.Cid() //t.Logf("B is %s", bk) // Pin C recursively @@ -284,7 +287,7 @@ func TestDuplicateSemantics(t *testing.T) { p := NewPinner(dstore, dserv, dserv) a, _ := randNode() - _, err := dserv.Add(a) + err := dserv.Add(ctx, a) if err != nil { t.Fatal(err) } @@ -349,12 +352,12 @@ func TestPinRecursiveFail(t *testing.T) { t.Fatal("should have failed to pin here") } - _, err = dserv.Add(b) + err = dserv.Add(ctx, b) if err != nil { t.Fatal(err) } - _, err = dserv.Add(a) + err = dserv.Add(ctx, a) if err != nil { t.Fatal(err) } @@ -369,6 +372,8 @@ func TestPinRecursiveFail(t *testing.T) { } func TestPinUpdate(t *testing.T) { + ctx := context.Background() + dstore := dssync.MutexWrap(ds.NewMapDatastore()) bstore := blockstore.NewBlockstore(dstore) bserv := bs.New(bstore, offline.Exchange(bstore)) @@ -378,10 +383,9 @@ func TestPinUpdate(t *testing.T) { n1, c1 := randNode() n2, c2 := randNode() - dserv.Add(n1) - dserv.Add(n2) + dserv.Add(ctx, n1) + dserv.Add(ctx, n2) - ctx := context.Background() if err := p.Pin(ctx, n1, true); err != nil { t.Fatal(err) } diff --git a/pin/set.go b/pin/set.go index 6d4bff54b54..8778df9603f 100644 --- a/pin/set.go +++ b/pin/set.go @@ -54,7 +54,7 @@ func (s sortByHash) Swap(a, b int) { s.links[a], s.links[b] = s.links[b], s.links[a] } -func storeItems(ctx context.Context, dag merkledag.DAGService, estimatedLen uint64, depth uint32, iter itemIterator, internalKeys keyObserver) (*merkledag.ProtoNode, error) { +func storeItems(ctx context.Context, dag node.DAGService, estimatedLen uint64, depth uint32, iter itemIterator, internalKeys keyObserver) (*merkledag.ProtoNode, error) { links := make([]*node.Link, 0, defaultFanout+maxItems) for i := 0; i < defaultFanout; i++ { links = append(links, &node.Link{Cid: emptyKey}) @@ -139,10 +139,11 @@ func storeItems(ctx context.Context, dag merkledag.DAGService, estimatedLen uint return nil, err } - childKey, err := dag.Add(child) + err = dag.Add(ctx, child) if err != nil { return nil, err } + childKey := child.Cid() internalKeys(childKey) @@ -202,7 +203,7 @@ func writeHdr(n *merkledag.ProtoNode, hdr *pb.Set) error { type walkerFunc func(idx int, link *node.Link) error -func walkItems(ctx context.Context, dag merkledag.DAGService, n *merkledag.ProtoNode, fn walkerFunc, children keyObserver) error { +func walkItems(ctx context.Context, dag node.DAGService, n *merkledag.ProtoNode, fn walkerFunc, children keyObserver) error { hdr, err := readHdr(n) if err != nil { return err @@ -237,7 +238,7 @@ func walkItems(ctx context.Context, dag merkledag.DAGService, n *merkledag.Proto return nil } -func loadSet(ctx context.Context, dag merkledag.DAGService, root *merkledag.ProtoNode, name string, internalKeys keyObserver) ([]*cid.Cid, error) { +func loadSet(ctx context.Context, dag node.DAGService, root *merkledag.ProtoNode, name string, internalKeys keyObserver) ([]*cid.Cid, error) { l, err := root.GetNodeLink(name) if err != nil { return nil, err @@ -280,17 +281,17 @@ func getCidListIterator(cids []*cid.Cid) itemIterator { } } -func storeSet(ctx context.Context, dag merkledag.DAGService, cids []*cid.Cid, internalKeys keyObserver) (*merkledag.ProtoNode, error) { +func storeSet(ctx context.Context, dag node.DAGService, cids []*cid.Cid, internalKeys keyObserver) (*merkledag.ProtoNode, error) { iter := getCidListIterator(cids) n, err := storeItems(ctx, dag, uint64(len(cids)), 0, iter, internalKeys) if err != nil { return nil, err } - c, err := dag.Add(n) + err = dag.Add(ctx, n) if err != nil { return nil, err } - internalKeys(c) + internalKeys(n.Cid()) return n, nil } diff --git a/tar/format.go b/tar/format.go index 512ef046d39..327d1fd2cba 100644 --- a/tar/format.go +++ b/tar/format.go @@ -34,7 +34,7 @@ func marshalHeader(h *tar.Header) ([]byte, error) { return buf.Bytes(), nil } -func ImportTar(r io.Reader, ds dag.DAGService) (*dag.ProtoNode, error) { +func ImportTar(ctx context.Context, r io.Reader, ds node.DAGService) (*dag.ProtoNode, error) { tr := tar.NewReader(r) root := new(dag.ProtoNode) @@ -73,7 +73,7 @@ func ImportTar(r io.Reader, ds dag.DAGService) (*dag.ProtoNode, error) { } } - _, err = ds.Add(header) + err = ds.Add(ctx, header) if err != nil { return nil, err } @@ -85,7 +85,7 @@ func ImportTar(r io.Reader, ds dag.DAGService) (*dag.ProtoNode, error) { } } - return e.Finalize(ds) + return e.Finalize(ctx, ds) } // adds a '-' to the beginning of each path element so we can use 'data' as a @@ -100,7 +100,7 @@ func escapePath(pth string) string { type tarReader struct { links []*node.Link - ds dag.DAGService + ds node.DAGService childRead *tarReader hdrBuf *bytes.Reader @@ -194,7 +194,7 @@ func (tr *tarReader) Read(b []byte) (int, error) { return tr.Read(b) } -func ExportTar(ctx context.Context, root *dag.ProtoNode, ds dag.DAGService) (io.Reader, error) { +func ExportTar(ctx context.Context, root *dag.ProtoNode, ds node.DAGService) (io.Reader, error) { if string(root.Data()) != "ipfs/tar" { return nil, errors.New("not an IPFS tarchive") } diff --git a/unixfs/archive/archive.go b/unixfs/archive/archive.go index dc3afd0c27d..2f6dc718319 100644 --- a/unixfs/archive/archive.go +++ b/unixfs/archive/archive.go @@ -7,7 +7,6 @@ import ( "io" "path" - mdag "github.com/ipfs/go-ipfs/merkledag" tar "github.com/ipfs/go-ipfs/unixfs/archive/tar" uio "github.com/ipfs/go-ipfs/unixfs/io" @@ -31,7 +30,7 @@ func (i *identityWriteCloser) Close() error { } // DagArchive is equivalent to `ipfs getdag $hash | maybe_tar | maybe_gzip` -func DagArchive(ctx context.Context, nd node.Node, name string, dag mdag.DAGService, archive bool, compression int) (io.Reader, error) { +func DagArchive(ctx context.Context, nd node.Node, name string, dag node.DAGService, archive bool, compression int) (io.Reader, error) { _, filename := path.Split(name) diff --git a/unixfs/archive/tar/writer.go b/unixfs/archive/tar/writer.go index 27372e8f848..9cd69666023 100644 --- a/unixfs/archive/tar/writer.go +++ b/unixfs/archive/tar/writer.go @@ -21,14 +21,14 @@ import ( // unixfs merkledag nodes as a tar archive format. // It wraps any io.Writer. type Writer struct { - Dag mdag.DAGService + Dag node.DAGService TarW *tar.Writer ctx context.Context } // NewWriter wraps given io.Writer. -func NewWriter(ctx context.Context, dag mdag.DAGService, archive bool, compression int, w io.Writer) (*Writer, error) { +func NewWriter(ctx context.Context, dag node.DAGService, archive bool, compression int, w io.Writer) (*Writer, error) { return &Writer{ Dag: dag, TarW: tar.NewWriter(w), @@ -41,7 +41,7 @@ func (w *Writer) writeDir(nd *mdag.ProtoNode, fpath string) error { return err } - for i, ng := range mdag.GetDAG(w.ctx, w.Dag, nd) { + for i, ng := range node.GetDAG(w.ctx, w.Dag, nd) { child, err := ng.Get(w.ctx) if err != nil { return err diff --git a/unixfs/hamt/hamt.go b/unixfs/hamt/hamt.go index 044017f974f..2974d492805 100644 --- a/unixfs/hamt/hamt.go +++ b/unixfs/hamt/hamt.go @@ -57,7 +57,7 @@ type HamtShard struct { prefixPadStr string maxpadlen int - dserv dag.DAGService + dserv node.DAGService } // child can either be another shard, or a leaf node value @@ -66,7 +66,7 @@ type child interface { Label() string } -func NewHamtShard(dserv dag.DAGService, size int) (*HamtShard, error) { +func NewHamtShard(dserv node.DAGService, size int) (*HamtShard, error) { ds, err := makeHamtShard(dserv, size) if err != nil { return nil, err @@ -78,7 +78,7 @@ func NewHamtShard(dserv dag.DAGService, size int) (*HamtShard, error) { return ds, nil } -func makeHamtShard(ds dag.DAGService, size int) (*HamtShard, error) { +func makeHamtShard(ds node.DAGService, size int) (*HamtShard, error) { lg2s := int(math.Log2(float64(size))) if 1< Date: Thu, 25 Jan 2018 14:33:42 -0800 Subject: [PATCH 11/25] namesys: remove unecessary peerID cast License: MIT Signed-off-by: Steven Allen --- namesys/publisher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namesys/publisher.go b/namesys/publisher.go index 3dc38c4d161..3bdca3771d3 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -322,7 +322,7 @@ func ValidateIpnsRecord(r *record.ValidationRecord) error { if err != nil { return ErrInvalidAuthor } - if string(pid) != string(r.Author) { + if pid != r.Author { return ErrInvalidAuthor } From 699b2c4bb876b6f12a8dc87de3ff268d60bc05f7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 15:10:07 -0800 Subject: [PATCH 12/25] make code-climate happier License: MIT Signed-off-by: Steven Allen --- blockservice/blockservice.go | 14 ++++++++++---- importer/helpers/helpers.go | 11 +++++++---- importer/importer.go | 11 +++++++---- merkledag/node.go | 6 ++++-- merkledag/test/utils.go | 2 ++ merkledag/utils/diff.go | 1 + merkledag/utils/utils.go | 12 ++++++++++-- merkledag/utils/utils_test.go | 4 ++-- mfs/dir.go | 4 ++++ path/resolver.go | 1 + tar/format.go | 4 ++++ unixfs/hamt/hamt.go | 2 ++ unixfs/io/dirbuilder.go | 2 ++ unixfs/io/pbdagreader.go | 1 + unixfs/test/utils.go | 5 +++++ 15 files changed, 62 insertions(+), 18 deletions(-) diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index d4f6fffadec..3969dad69b1 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -22,6 +22,8 @@ var log = logging.Logger("blockservice") var ErrNotFound = errors.New("blockservice: key not found") +// BlockGetter is the common interface shared between blockservice sessions and +// the blockservice. type BlockGetter interface { // GetBlock gets the requested block. GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error) @@ -95,12 +97,14 @@ func NewWriteThrough(bs blockstore.Blockstore, rem exchange.Interface) BlockServ } } -func (bs *blockService) Blockstore() blockstore.Blockstore { - return bs.blockstore +// Blockstore returns the blockstore behind this blockservice. +func (s *blockService) Blockstore() blockstore.Blockstore { + return s.blockstore } -func (bs *blockService) Exchange() exchange.Interface { - return bs.exchange +// Exchange returns the exchange behind this blockservice. +func (s *blockService) Exchange() exchange.Interface { + return s.exchange } // NewSession creates a bitswap session that allows for controlled exchange of @@ -286,3 +290,5 @@ func (s *Session) GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error func (s *Session) GetBlocks(ctx context.Context, ks []*cid.Cid) <-chan blocks.Block { return getBlocks(ctx, ks, s.bs, s.ses) } + +var _ BlockGetter = (*Session)(nil) diff --git a/importer/helpers/helpers.go b/importer/helpers/helpers.go index dbd994c2c68..64b91d38ba4 100644 --- a/importer/helpers/helpers.go +++ b/importer/helpers/helpers.go @@ -65,10 +65,12 @@ func (n *UnixfsNode) SetPrefix(prefix *cid.Prefix) { n.node.SetPrefix(prefix) } +// NumChildren returns the number of children referenced by this UnixfsNode. func (n *UnixfsNode) NumChildren() int { return n.ufmt.NumChildren() } +// Set replaces this UnixfsNode with another UnixfsNode func (n *UnixfsNode) Set(other *UnixfsNode) { n.node = other.node n.raw = other.raw @@ -78,6 +80,7 @@ func (n *UnixfsNode) Set(other *UnixfsNode) { } } +// GetChild gets the ith child of this node from the given DAGService. func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds node.DAGService) (*UnixfsNode, error) { nd, err := n.node.Links()[i].GetNode(ctx, ds) if err != nil { @@ -92,8 +95,8 @@ func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds node.DAGService) (* return NewUnixfsNodeFromDag(pbn) } -// addChild will add the given UnixfsNode as a child of the receiver. -// the passed in DagBuilderHelper is used to store the child node an +// AddChild adds the given UnixfsNode as a child of the receiver. +// The passed in DagBuilderHelper is used to store the child node an // pin it locally so it doesnt get lost func (n *UnixfsNode) AddChild(child *UnixfsNode, db *DagBuilderHelper) error { n.ufmt.AddBlockSize(child.FileSize()) @@ -115,7 +118,7 @@ func (n *UnixfsNode) AddChild(child *UnixfsNode, db *DagBuilderHelper) error { return err } -// Removes the child node at the given index +// RemoveChild removes the child node at the given index func (n *UnixfsNode) RemoveChild(index int, dbh *DagBuilderHelper) { n.ufmt.RemoveBlockSize(index) n.node.SetLinks(append(n.node.Links()[:index], n.node.Links()[index+1:]...)) @@ -140,7 +143,7 @@ func (n *UnixfsNode) SetPosInfo(offset uint64, fullPath string, stat os.FileInfo } } -// getDagNode fills out the proper formatting for the unixfs node +// GetDagNode fills out the proper formatting for the unixfs node // inside of a DAG node and returns the dag node func (n *UnixfsNode) GetDagNode() (node.Node, error) { nd, err := n.getBaseDagNode() diff --git a/importer/importer.go b/importer/importer.go index 8a07df3df12..f209f3cc573 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -1,5 +1,5 @@ -// package importer implements utilities used to create IPFS DAGs from files -// and readers +// Package importer implements utilities used to create IPFS DAGs from files +// and readers. package importer import ( @@ -15,8 +15,8 @@ import ( node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -// Builds a DAG from the given file, writing created blocks to disk as they are -// created +// BuildDagFromFile builds a DAG from the given file, writing created blocks to +// disk as they are created func BuildDagFromFile(fpath string, ds node.DAGService) (node.Node, error) { stat, err := os.Lstat(fpath) if err != nil { @@ -36,6 +36,8 @@ func BuildDagFromFile(fpath string, ds node.DAGService) (node.Node, error) { return BuildDagFromReader(ds, chunk.DefaultSplitter(f)) } +// BuildDagFromReader builds a DAG from the chunks returned by the given chunk +// splitter. func BuildDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, @@ -45,6 +47,7 @@ func BuildDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, erro return bal.BalancedLayout(dbp.New(spl)) } +// BuildTrickleDagFromReader is similar to BuildDagFromReader but uses the trickle layout. func BuildTrickleDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, diff --git a/merkledag/node.go b/merkledag/node.go index 143e7e07525..4cb79ca9c33 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -124,7 +124,7 @@ func (n *ProtoNode) AddRawLink(name string, l *node.Link) error { return nil } -// Remove a link on this node by the given name +// RemoveNodeLink removes a link on this node by the given name. func (n *ProtoNode) RemoveNodeLink(name string) error { n.encoded = nil good := make([]*node.Link, 0, len(n.links)) @@ -146,7 +146,7 @@ func (n *ProtoNode) RemoveNodeLink(name string) error { return nil } -// Return a copy of the link with given name +// GetNodeLink returns a copy of the link with the given name. func (n *ProtoNode) GetNodeLink(name string) (*node.Link, error) { for _, l := range n.links { if l.Name == name { @@ -160,6 +160,7 @@ func (n *ProtoNode) GetNodeLink(name string) (*node.Link, error) { return nil, ErrLinkNotFound } +// GetLinkedProtoNode returns a copy of the ProtoNode with the given name. func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds node.DAGService, name string) (*ProtoNode, error) { nd, err := n.GetLinkedNode(ctx, ds, name) if err != nil { @@ -174,6 +175,7 @@ func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds node.DAGService, return pbnd, nil } +// GetLinkedNode returns a copy of the IPLD Node with the given name. func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds node.DAGService, name string) (node.Node, error) { lnk, err := n.GetNodeLink(name) if err != nil { diff --git a/merkledag/test/utils.go b/merkledag/test/utils.go index 87bfe23c8e7..b4a180ac6e4 100644 --- a/merkledag/test/utils.go +++ b/merkledag/test/utils.go @@ -11,10 +11,12 @@ import ( node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) +// Mock returns a new thread-safe, mock DAGService. func Mock() node.DAGService { return dag.NewDAGService(Bserv()) } +// Bserv returns a new, thread-safe, mock BlockService. func Bserv() bsrv.BlockService { bstore := blockstore.NewBlockstore(dssync.MutexWrap(ds.NewMapDatastore())) return bsrv.New(bstore, offline.Exchange(bstore)) diff --git a/merkledag/utils/diff.go b/merkledag/utils/diff.go index 2ead4bdf761..5dfd37fb75b 100644 --- a/merkledag/utils/diff.go +++ b/merkledag/utils/diff.go @@ -37,6 +37,7 @@ func (c *Change) String() string { } } +// ApplyChange applies the requested changes to the given node in the given dag. func ApplyChange(ctx context.Context, ds node.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error) { e := NewDagEditor(nd, ds) for _, c := range cs { diff --git a/merkledag/utils/utils.go b/merkledag/utils/utils.go index dd119834da1..eb4413f155b 100644 --- a/merkledag/utils/utils.go +++ b/merkledag/utils/utils.go @@ -27,6 +27,7 @@ type Editor struct { src node.DAGService } +// NewMemoryDagService returns a new, thread-safe in-memory DAGService. func NewMemoryDagService() node.DAGService { // build mem-datastore for editor's intermediary nodes bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) @@ -34,7 +35,10 @@ func NewMemoryDagService() node.DAGService { return dag.NewDAGService(bsrv) } -// root is the node to be modified, source is the dagstore to pull nodes from (optional) +// NewDagEditor returns an ProtoNode editor. +// +// * root is the node to be modified +// * source is the dagstore to pull nodes from (optional) func NewDagEditor(root *dag.ProtoNode, source node.DAGService) *Editor { return &Editor{ root: root, @@ -43,17 +47,19 @@ func NewDagEditor(root *dag.ProtoNode, source node.DAGService) *Editor { } } +// GetNode returns the a copy of the root node being edited. func (e *Editor) GetNode() *dag.ProtoNode { return e.root.Copy().(*dag.ProtoNode) } +// GetDagService returns the DAGService used by this editor. func (e *Editor) GetDagService() node.DAGService { return e.tmp } func addLink(ctx context.Context, ds node.DAGService, root *dag.ProtoNode, childname string, childnd node.Node) (*dag.ProtoNode, error) { if childname == "" { - return nil, errors.New("cannot create link with no name!") + return nil, errors.New("cannot create link with no name") } // ensure that the node we are adding is in the dagservice @@ -188,6 +194,8 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) return root, nil } +// Finalize writes the new DAG to the given DAGService and returns the modified +// root node. func (e *Editor) Finalize(ctx context.Context, ds node.DAGService) (*dag.ProtoNode, error) { nd := e.GetNode() err := copyDag(ctx, nd, e.tmp, ds) diff --git a/merkledag/utils/utils_test.go b/merkledag/utils/utils_test.go index c404ffed418..345bd2928b2 100644 --- a/merkledag/utils/utils_test.go +++ b/merkledag/utils/utils_test.go @@ -70,8 +70,8 @@ func TestInsertNode(t *testing.T) { testInsert(t, e, "a/b/c/d/f", "baz", true, "") testInsert(t, e, "a/b/c/d/f", "bar", true, "") - testInsert(t, e, "", "bar", true, "cannot create link with no name!") - testInsert(t, e, "////", "slashes", true, "cannot create link with no name!") + testInsert(t, e, "", "bar", true, "cannot create link with no name") + testInsert(t, e, "////", "slashes", true, "cannot create link with no name") c := e.GetNode().Cid() diff --git a/mfs/dir.go b/mfs/dir.go index 5ad39d20503..901f69952f1 100644 --- a/mfs/dir.go +++ b/mfs/dir.go @@ -40,6 +40,10 @@ type Directory struct { name string } +// NewDirectory constructs a new MFS directory. +// +// You probably don't want to call this directly. Instead, construct a new root +// using NewRoot. func NewDirectory(ctx context.Context, name string, node node.Node, parent childCloser, dserv node.DAGService) (*Directory, error) { db, err := uio.NewDirectoryFromNode(dserv, node) if err != nil { diff --git a/path/resolver.go b/path/resolver.go index 71ac52ba0f3..68865283add 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -40,6 +40,7 @@ type Resolver struct { ResolveOnce func(ctx context.Context, ds node.DAGService, nd node.Node, names []string) (*node.Link, []string, error) } +// NewBasicResolver constructs a new basic resolver. func NewBasicResolver(ds node.DAGService) *Resolver { return &Resolver{ DAG: ds, diff --git a/tar/format.go b/tar/format.go index 327d1fd2cba..ee03fea3d9a 100644 --- a/tar/format.go +++ b/tar/format.go @@ -34,6 +34,8 @@ func marshalHeader(h *tar.Header) ([]byte, error) { return buf.Bytes(), nil } +// ImportTar imports a tar file into the given DAGService and returns the root +// node. func ImportTar(ctx context.Context, r io.Reader, ds node.DAGService) (*dag.ProtoNode, error) { tr := tar.NewReader(r) @@ -194,6 +196,8 @@ func (tr *tarReader) Read(b []byte) (int, error) { return tr.Read(b) } +// ExportTar exports the passed DAG as a tar file. This function is the inverse +// of ImportTar. func ExportTar(ctx context.Context, root *dag.ProtoNode, ds node.DAGService) (io.Reader, error) { if string(root.Data()) != "ipfs/tar" { return nil, errors.New("not an IPFS tarchive") diff --git a/unixfs/hamt/hamt.go b/unixfs/hamt/hamt.go index 2974d492805..e0b063e4f7b 100644 --- a/unixfs/hamt/hamt.go +++ b/unixfs/hamt/hamt.go @@ -66,6 +66,7 @@ type child interface { Label() string } +// NewHamtShard creates a new, empty HAMT shard with the given size. func NewHamtShard(dserv node.DAGService, size int) (*HamtShard, error) { ds, err := makeHamtShard(dserv, size) if err != nil { @@ -93,6 +94,7 @@ func makeHamtShard(ds node.DAGService, size int) (*HamtShard, error) { }, nil } +// NewHamtFromDag creates new a HAMT shard from the given DAG. func NewHamtFromDag(dserv node.DAGService, nd node.Node) (*HamtShard, error) { pbnd, ok := nd.(*dag.ProtoNode) if !ok { diff --git a/unixfs/io/dirbuilder.go b/unixfs/io/dirbuilder.go index bc9eb6c8e46..cc3a3905ceb 100644 --- a/unixfs/io/dirbuilder.go +++ b/unixfs/io/dirbuilder.go @@ -51,6 +51,8 @@ func NewDirectory(dserv node.DAGService) *Directory { // ErrNotADir implies that the given node was not a unixfs directory var ErrNotADir = fmt.Errorf("merkledag node was not a directory or shard") +// NewDirectoryFromNode loads a unixfs directory from the given IPLD node and +// DAGService. func NewDirectoryFromNode(dserv node.DAGService, nd node.Node) (*Directory, error) { pbnd, ok := nd.(*mdag.ProtoNode) if !ok { diff --git a/unixfs/io/pbdagreader.go b/unixfs/io/pbdagreader.go index 8f0f22d3b09..85cbc19688c 100644 --- a/unixfs/io/pbdagreader.go +++ b/unixfs/io/pbdagreader.go @@ -50,6 +50,7 @@ type pbDagReader struct { var _ DagReader = (*pbDagReader)(nil) +// NewPBFileReader constructs a new PBFileReader. func NewPBFileReader(ctx context.Context, n *mdag.ProtoNode, pb *ftpb.Data, serv node.DAGService) *pbDagReader { fctx, cancel := context.WithCancel(ctx) curLinks := getLinkCids(n) diff --git a/unixfs/test/utils.go b/unixfs/test/utils.go index 8b234c9ad4f..1e44b1e9c78 100644 --- a/unixfs/test/utils.go +++ b/unixfs/test/utils.go @@ -27,6 +27,7 @@ func SizeSplitterGen(size int64) chunk.SplitterGen { } } +// GetDAGServ returns a mock DAGService. func GetDAGServ() node.DAGService { return mdagmock.Mock() } @@ -51,6 +52,7 @@ func init() { UseBlake2b256.Prefix.MhLength = -1 } +// GetNode returns a unixfs file node with the specified data. func GetNode(t testing.TB, dserv node.DAGService, data []byte, opts NodeOpts) node.Node { in := bytes.NewReader(data) @@ -69,10 +71,12 @@ func GetNode(t testing.TB, dserv node.DAGService, data []byte, opts NodeOpts) no return node } +// GetEmptyNode returns an empty unixfs file node. func GetEmptyNode(t testing.TB, dserv node.DAGService, opts NodeOpts) node.Node { return GetNode(t, dserv, []byte{}, opts) } +// GetRandomNode returns a random unixfs file node. func GetRandomNode(t testing.TB, dserv node.DAGService, size int64, opts NodeOpts) ([]byte, node.Node) { in := io.LimitReader(u.NewTimeSeededRand(), size) buf, err := ioutil.ReadAll(in) @@ -96,6 +100,7 @@ func ArrComp(a, b []byte) error { return nil } +// PrintDag pretty-prints the given dag to stdout. func PrintDag(nd *mdag.ProtoNode, ds node.DAGService, indent int) { pbd, err := ft.FromBytes(nd.Data()) if err != nil { From 1159abd83e60a38037f2b68ea7fea56771a31d5e Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 18:02:59 -0800 Subject: [PATCH 13/25] cmds: can't call SetError after SetOutput License: MIT Signed-off-by: Steven Allen --- core/commands/dht.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/commands/dht.go b/core/commands/dht.go index 27f0cee207e..89e3bffb70b 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -174,9 +174,6 @@ var findProvidersDhtCmd = &cmds.Command{ return } - outChan := make(chan interface{}) - res.SetOutput((<-chan interface{})(outChan)) - events := make(chan *notif.QueryEvent) ctx := notif.RegisterForQueryEvents(req.Context(), events) @@ -186,6 +183,9 @@ var findProvidersDhtCmd = &cmds.Command{ return } + outChan := make(chan interface{}) + res.SetOutput((<-chan interface{})(outChan)) + pchan := dht.FindProvidersAsync(ctx, c, numProviders) go func() { defer close(outChan) @@ -535,18 +535,18 @@ Different key types can specify other 'best' rules. return } - outChan := make(chan interface{}) - res.SetOutput((<-chan interface{})(outChan)) - - events := make(chan *notif.QueryEvent) - ctx := notif.RegisterForQueryEvents(req.Context(), events) - dhtkey, err := escapeDhtKey(req.Arguments()[0]) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } + outChan := make(chan interface{}) + res.SetOutput((<-chan interface{})(outChan)) + + events := make(chan *notif.QueryEvent) + ctx := notif.RegisterForQueryEvents(req.Context(), events) + go func() { defer close(outChan) for e := range events { @@ -650,9 +650,6 @@ NOTE: A value may not exceed 2048 bytes. return } - outChan := make(chan interface{}) - res.SetOutput((<-chan interface{})(outChan)) - events := make(chan *notif.QueryEvent) ctx := notif.RegisterForQueryEvents(req.Context(), events) @@ -662,6 +659,9 @@ NOTE: A value may not exceed 2048 bytes. return } + outChan := make(chan interface{}) + res.SetOutput((<-chan interface{})(outChan)) + data := req.Arguments()[1] go func() { From 97cb6a0fbe0bdd197f9caa1eb6587fdc3c3d7037 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 21:06:08 -0800 Subject: [PATCH 14/25] fix dht tests we no longer allow putting values with arbitrary keys. License: MIT Signed-off-by: Steven Allen --- test/sharness/t0170-dht.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/test/sharness/t0170-dht.sh b/test/sharness/t0170-dht.sh index 597481d56df..bb1d54b1282 100755 --- a/test/sharness/t0170-dht.sh +++ b/test/sharness/t0170-dht.sh @@ -4,6 +4,9 @@ test_description="Test dht command" . lib/test-lib.sh +TEST_DHT_VALUE="CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8hSwYY1FXqjT5M36O/Q5fBeDhXE5ePvGAeN3MIibfChqQpgqBbXQi1gAp4TQypSTKl/AMy7hfzsKauieim7jHMgIYAB4pLoBQD1qGVn/n7CqzAR3gDg9umIGuAy15oT0uaqMDqSepfnyxEyPDqfDklgvmS/MAwfBHjH2IPcMIaFgZ6d6gVlhmwuH8WVQ/geumDqyKuU9Jy+SUozmxEu2Baylg4fuqxaxoqOiPFZeWKSCFAngFj3NPmLApE0Fy48/eEZ+t7iP6s/raupP4+Jk/AFNDJNos4VxUnLJpZ1g6W5vYkkt1kXbMTaqxFVryCdCW2UEOwEzjGPGkcIE4RJrHAgMBAAE=" +TEST_DHT_PATH="/pk/QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a" + # start iptb + wait for peering NUM_NODES=5 test_expect_success 'init iptb' ' @@ -25,12 +28,30 @@ test_expect_success 'findpeer' ' ' # ipfs dht put -test_expect_success 'put' ' - ipfsi 1 dht put planet pluto | sort >putted && +test_expect_success 'put with good keys' ' + echo "$TEST_DHT_VALUE" | base64 -d | ipfsi 0 dht put "$TEST_DHT_PATH" | sort >putted && [ -s putted ] || test_fsh cat putted ' +# ipfs dht get +test_expect_success 'get with good keys' ' + HASH="$(echo "hello world" | ipfsi 2 add -q)" && + ipfsi 2 name publish "/ipfs/$HASH" && + ipfsi 1 dht get "/ipns/$PEERID_2" | grep -aq "/ipfs/$HASH" +' + +test_expect_failure 'put with bad keys' ' + ! ipfsi 0 dht put "foo" "bar" && + ! ipfsi 0 dht put "/pk/foo" "bar" && + ! ipfsi 0 dht put "/ipns/foo" "bar" +' + +test_expect_failure 'get with bad keys' ' + ! ipfsi 0 dht get "foo" && + ! ipfsi 0 dht get "/pk/foo" +' + test_expect_success "add a ref so we can find providers for it" ' echo "some stuff" > afile && HASH=$(ipfsi 3 add -q afile) @@ -43,13 +64,6 @@ test_expect_success 'findprovs' ' test_cmp provs expected ' -# ipfs dht get -test_expect_success 'get' ' - ipfsi 0 dht put bar foo >actual && - ipfsi 4 dht get -v bar >actual && - egrep "error: record key does not have selectorfunc" actual > /dev//null || - test_fsh cat actual -' # ipfs dht query ## We query 3 different keys, to statisically lower the chance that the queryer From d73bf86cf7a7b7a52ccacd85b4de0a430bc39fcc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 21:19:44 -0800 Subject: [PATCH 15/25] note issue for failing dht test cases License: MIT Signed-off-by: Steven Allen --- test/sharness/t0170-dht.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0170-dht.sh b/test/sharness/t0170-dht.sh index bb1d54b1282..29a709d701e 100755 --- a/test/sharness/t0170-dht.sh +++ b/test/sharness/t0170-dht.sh @@ -41,13 +41,13 @@ test_expect_success 'get with good keys' ' ipfsi 1 dht get "/ipns/$PEERID_2" | grep -aq "/ipfs/$HASH" ' -test_expect_failure 'put with bad keys' ' +test_expect_failure 'put with bad keys (issue #4611)' ' ! ipfsi 0 dht put "foo" "bar" && ! ipfsi 0 dht put "/pk/foo" "bar" && ! ipfsi 0 dht put "/ipns/foo" "bar" ' -test_expect_failure 'get with bad keys' ' +test_expect_failure 'get with bad keys (issue #4611)' ' ! ipfsi 0 dht get "foo" && ! ipfsi 0 dht get "/pk/foo" ' From e049228e17193bfb41cf497827f6ba6827c88ca0 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Jan 2018 21:23:51 -0800 Subject: [PATCH 16/25] fix namesys pubsub sharness tests We *expect* name resolution to fail as nothing has been published. License: MIT Signed-off-by: Steven Allen --- test/sharness/t0183-namesys-pubsub.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0183-namesys-pubsub.sh b/test/sharness/t0183-namesys-pubsub.sh index f4684af4c70..91bddea4d19 100755 --- a/test/sharness/t0183-namesys-pubsub.sh +++ b/test/sharness/t0183-namesys-pubsub.sh @@ -26,9 +26,11 @@ test_expect_success 'check namesys pubsub state' ' test_cmp expected state2 ' +# These commands are *expected* to fail. We haven't published anything yet. test_expect_success 'subscribe nodes to the publisher topic' ' - ipfsi 1 name resolve /ipns/$PEERID_0 && - ipfsi 2 name resolve /ipns/$PEERID_0 + ipfsi 1 name resolve /ipns/$PEERID_0; + ipfsi 2 name resolve /ipns/$PEERID_0; + true ' test_expect_success 'check subscriptions' ' From 118ecb22cda4b9957cec77ec9bf805fc56b45768 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 26 Jan 2018 00:33:36 -0800 Subject: [PATCH 17/25] remove new DHT record author check We're going to just fix this a future commit. *This* change breaks publishing IPNS records using alternative IPNS keys (because the author signature (peer ID) differs from the record signature). We're going to fix it by validating the IPNS signature and ditching the author/signature fields. License: MIT Signed-off-by: Steven Allen --- namesys/ipns_validate_test.go | 4 +++- namesys/publisher.go | 33 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/namesys/ipns_validate_test.go b/namesys/ipns_validate_test.go index fa788810342..82a6be2c0fa 100644 --- a/namesys/ipns_validate_test.go +++ b/namesys/ipns_validate_test.go @@ -16,7 +16,7 @@ import ( func TestValidation(t *testing.T) { // Create a record validator validator := make(record.Validator) - validator["ipns"] = &record.ValidChecker{ValidateIpnsRecord, true} + validator["ipns"] = &record.ValidChecker{Func: ValidateIpnsRecord, Sign: true} // Generate a key for signing the records r := u.NewSeededRand(15) // generate deterministic keypair @@ -46,6 +46,7 @@ func TestValidation(t *testing.T) { t.Fatal(err) } + /* TODO(#4613) // Create IPNS record path with a different private key _, ipnsWrongAuthor := genKeys(t, r) wrongAuthorRec, err := record.MakePutRecord(priv, ipnsWrongAuthor, val, true) @@ -97,6 +98,7 @@ func TestValidation(t *testing.T) { if err != ErrInvalidAuthor { t.Fatal("ValidateIpnsRecord should have returned ErrInvalidAuthor") } + */ // Create expired entry expiredEntry, err := CreateRoutingEntryData(priv, path.Path("foo"), 1, ts.Add(-1*time.Hour)) diff --git a/namesys/publisher.go b/namesys/publisher.go index 3bdca3771d3..473e9042bba 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -31,10 +31,6 @@ var ErrExpiredRecord = errors.New("expired record") // unknown validity type. var ErrUnrecognizedValidity = errors.New("unrecognized validity type") -// ErrInvalidAuthor is returned when an IpnsRecord has an -// author that does not match the IPNS path -var ErrInvalidAuthor = errors.New("author does not match path") - // ErrInvalidPath should be returned when an ipns record path // is not in a valid format var ErrInvalidPath = errors.New("record path invalid") @@ -314,17 +310,24 @@ func ValidateIpnsRecord(r *record.ValidationRecord) error { return err } - // Note: The DHT will actually check the signature so we don't - // need to do that here - - // Author in key must match author in record - pid, err := peer.IDFromString(r.Key) - if err != nil { - return ErrInvalidAuthor - } - if pid != r.Author { - return ErrInvalidAuthor - } + // NOTE/FIXME(#4613): We're not checking the DHT signature/author here. + // We're going to remove them in a followup commit and then check the + // *IPNS* signature. However, to do that, we need to ensure we *have* + // the public key and: + // + // 1. Don't want to fetch it from the network when handling PUTs. + // 2. Do want to fetch it from the network when handling GETs. + // + // Therefore, we'll need to either: + // + // 1. Pass some for of offline hint to the validator (e.g., using a context). + // 2. Ensure we pre-fetch the key when performing gets. + // + // This PR is already *way* too large so we're punting that fix to a new + // PR. + // + // This is not a regression, it just restores the current (bad) + // behavior. // Check that record has not expired switch entry.GetValidityType() { From d0998a926d9832ee76da30516de914b1d6e378fd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 27 Jan 2018 13:28:34 -0800 Subject: [PATCH 18/25] make base64 decoding cross-platform support both the -D and the -d flag. License: MIT Signed-off-by: Steven Allen --- test/ipfs-test-lib.sh | 10 ++++++++++ test/sharness/t0170-dht.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/ipfs-test-lib.sh b/test/ipfs-test-lib.sh index fc856df47df..6c31c8380b5 100644 --- a/test/ipfs-test-lib.sh +++ b/test/ipfs-test-lib.sh @@ -109,3 +109,13 @@ test_seq() { i=$(expr "$i" + 1) done } + +b64decode() { + for flag in "-D" "-d"; do + if base64 "$flag" 2>/dev/null; then + return + fi + done + echo "no compatible base64 command found" >&2 + return 1 +} diff --git a/test/sharness/t0170-dht.sh b/test/sharness/t0170-dht.sh index 29a709d701e..44a28f556e9 100755 --- a/test/sharness/t0170-dht.sh +++ b/test/sharness/t0170-dht.sh @@ -29,7 +29,7 @@ test_expect_success 'findpeer' ' # ipfs dht put test_expect_success 'put with good keys' ' - echo "$TEST_DHT_VALUE" | base64 -d | ipfsi 0 dht put "$TEST_DHT_PATH" | sort >putted && + echo "$TEST_DHT_VALUE" | b64decode | ipfsi 0 dht put "$TEST_DHT_PATH" | sort >putted && [ -s putted ] || test_fsh cat putted ' From 5acbecc26b53cddbe74484b2fdf4f55212fa9687 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 27 Jan 2018 18:03:59 -0800 Subject: [PATCH 19/25] update go-lib2p-loggables fixes a UUID bug I introduced (UUIDs were always an error value) License: MIT Signed-off-by: Steven Allen --- cmd/ipfs/daemon.go | 2 +- cmd/ipfs/ipfs.go | 2 +- cmd/ipfs/main.go | 8 ++--- commands/command.go | 2 +- commands/command_test.go | 2 +- commands/legacy/command.go | 2 +- commands/legacy/legacy.go | 2 +- commands/legacy/legacy_test.go | 2 +- commands/legacy/request.go | 2 +- commands/legacy/response.go | 2 +- commands/request.go | 2 +- commands/response.go | 2 +- commands/response_test.go | 2 +- core/bootstrap.go | 2 +- core/commands/add.go | 2 +- core/commands/bitswap.go | 2 +- core/commands/block.go | 2 +- core/commands/cat.go | 2 +- core/commands/commands.go | 2 +- core/commands/commands_test.go | 2 +- core/commands/dht.go | 2 +- core/commands/filestore.go | 2 +- core/commands/get.go | 2 +- core/commands/get_test.go | 2 +- core/commands/helptext_test.go | 2 +- core/commands/id.go | 2 +- core/commands/pubsub.go | 4 +-- core/commands/repo.go | 2 +- core/commands/root.go | 2 +- core/commands/stat.go | 2 +- core/commands/swarm.go | 4 +-- core/core.go | 18 +++++------ core/corehttp/commands.go | 4 +-- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_test.go | 2 +- core/corehttp/metrics_test.go | 4 +-- core/mock/mock.go | 2 +- exchange/bitswap/bitswap_test.go | 2 +- exchange/bitswap/session.go | 2 +- exchange/bitswap/testnet/peernet.go | 2 +- exchange/bitswap/testutils.go | 2 +- fuse/readonly/readonly_unix.go | 2 +- namesys/namesys.go | 2 +- namesys/pubsub.go | 2 +- namesys/pubsub_test.go | 4 +-- namesys/republisher/repub_test.go | 2 +- package.json | 36 ++++++++++----------- repo/config/bootstrap_peers.go | 2 +- test/integration/addcat_test.go | 2 +- test/integration/bench_cat_test.go | 2 +- test/integration/bitswap_wo_routing_test.go | 2 +- test/integration/three_legged_cat_test.go | 2 +- 52 files changed, 85 insertions(+), 85 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 77c92145717..2168cd84024 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -21,12 +21,12 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" mprome "gx/ipfs/QmSk46nSD78YiuNojYMS8NW6hSCjH95JajqqzzoychZgef/go-metrics-prometheus" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" "gx/ipfs/QmX3QZ5jHEPidwUrymXV1iSCSUhdGxj15sm2gP4jKMef7B/client_golang/prometheus" iconn "gx/ipfs/Qmamsg8biD9P9CkvWGPUkWtJZNfyeHcWu2uztXkknd3frd/go-libp2p-interface-conn" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index 05112f8a619..9b2c9978cf5 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -6,7 +6,7 @@ import ( commands "github.com/ipfs/go-ipfs/core/commands" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" ) // This is the CLI root, used for executing commands accessible to CLI clients. diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index d9eff8921ca..8310a4f8d5c 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -28,14 +28,14 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds/cli" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds/http" + loggables "gx/ipfs/QmQ3c5AP6yjqD3E4get5atkvfaUU4rubWquoL2e8ycjUSu/go-libp2p-loggables" manet "gx/ipfs/QmRK2LxanhK2gZq6k6R7vk5ZoYZk8ULSSTB7FzDsMUX6CB/go-multiaddr-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper" - loggables "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/cli" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/http" ) // log is the command logger diff --git a/commands/command.go b/commands/command.go index 49d9a4e490b..04d34588754 100644 --- a/commands/command.go +++ b/commands/command.go @@ -16,8 +16,8 @@ import ( "github.com/ipfs/go-ipfs/path" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/command_test.go b/commands/command_test.go index 52165c10507..73d0a700d52 100644 --- a/commands/command_test.go +++ b/commands/command_test.go @@ -3,7 +3,7 @@ package commands import ( "testing" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/legacy/command.go b/commands/legacy/command.go index 0485472a50d..41a840234ec 100644 --- a/commands/legacy/command.go +++ b/commands/legacy/command.go @@ -3,7 +3,7 @@ package legacy import ( "io" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" diff --git a/commands/legacy/legacy.go b/commands/legacy/legacy.go index 8a5f290ab3d..add88717b23 100644 --- a/commands/legacy/legacy.go +++ b/commands/legacy/legacy.go @@ -4,7 +4,7 @@ import ( "io" "runtime/debug" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" ) diff --git a/commands/legacy/legacy_test.go b/commands/legacy/legacy_test.go index d7bd081852d..a05fd33bf61 100644 --- a/commands/legacy/legacy_test.go +++ b/commands/legacy/legacy_test.go @@ -7,7 +7,7 @@ import ( "testing" oldcmds "github.com/ipfs/go-ipfs/commands" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/legacy/request.go b/commands/legacy/request.go index 9deb42115a2..3b2cdf48917 100644 --- a/commands/legacy/request.go +++ b/commands/legacy/request.go @@ -7,7 +7,7 @@ import ( "os" "reflect" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" diff --git a/commands/legacy/response.go b/commands/legacy/response.go index cd45267eda2..67f6dba1c3f 100644 --- a/commands/legacy/response.go +++ b/commands/legacy/response.go @@ -7,7 +7,7 @@ import ( "reflect" "sync" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" oldcmds "github.com/ipfs/go-ipfs/commands" diff --git a/commands/request.go b/commands/request.go index ae580bbd655..10b8f562a59 100644 --- a/commands/request.go +++ b/commands/request.go @@ -16,7 +16,7 @@ import ( "github.com/ipfs/go-ipfs/repo/config" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" ) diff --git a/commands/response.go b/commands/response.go index bc4be90725d..7ac7d3caee4 100644 --- a/commands/response.go +++ b/commands/response.go @@ -9,7 +9,7 @@ import ( "os" "strings" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/response_test.go b/commands/response_test.go index 510e36f295d..74c06f1df5e 100644 --- a/commands/response_test.go +++ b/commands/response_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/bootstrap.go b/core/bootstrap.go index 367b1900b03..a1c97c8e682 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -11,7 +11,7 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" math2 "github.com/ipfs/go-ipfs/thirdparty/math2" - lgbl "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" + lgbl "gx/ipfs/QmQ3c5AP6yjqD3E4get5atkvfaUU4rubWquoL2e8ycjUSu/go-libp2p-loggables" inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" diff --git a/core/commands/add.go b/core/commands/add.go index 236d13c2d42..d7a7129937f 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -17,8 +17,8 @@ import ( mfs "github.com/ipfs/go-ipfs/mfs" ft "github.com/ipfs/go-ipfs/unixfs" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 954cfc7cbfe..f66f1afa677 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -12,8 +12,8 @@ import ( decision "github.com/ipfs/go-ipfs/exchange/bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/block.go b/core/commands/block.go index cf88f3283f7..2d9356ada13 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -11,8 +11,8 @@ import ( util "github.com/ipfs/go-ipfs/blocks/blockstore/util" e "github.com/ipfs/go-ipfs/core/commands/e" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" diff --git a/core/commands/cat.go b/core/commands/cat.go index ad16eb508d3..950fcb23634 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands.go b/core/commands/commands.go index 5f227cc7998..c64d0ea6e7d 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -13,7 +13,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index b74ce30ba7a..60cf6f50fd3 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" ) func collectPaths(prefix string, cmd *cmds.Command, out map[string]struct{}) { diff --git a/core/commands/dht.go b/core/commands/dht.go index 89e3bffb70b..e2f4f5b368a 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -19,9 +19,9 @@ import ( peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" + ipdht "gx/ipfs/Qmdm5sm2xHCXNaWdxpjhFeStvSNMRhKQkqpBX7aDcqXtfT/go-libp2p-kad-dht" node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" - ipdht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" ) var ErrNotDHT = errors.New("routing service is not a DHT") diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 13d7092a599..ffa28c3dca5 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/filestore" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/get.go b/core/commands/get.go index a6c9561f674..05af9aec2de 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -16,7 +16,7 @@ import ( tar "github.com/ipfs/go-ipfs/thirdparty/tar" uarchive "github.com/ipfs/go-ipfs/unixfs/archive" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" ) diff --git a/core/commands/get_test.go b/core/commands/get_test.go index e1444ae2c78..5b1aadf0e76 100644 --- a/core/commands/get_test.go +++ b/core/commands/get_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/helptext_test.go b/core/commands/helptext_test.go index 3ab0b46bd09..dcdee02441e 100644 --- a/core/commands/helptext_test.go +++ b/core/commands/helptext_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" ) func checkHelptextRecursive(t *testing.T, name []string, c *cmds.Command) { diff --git a/core/commands/id.go b/core/commands/id.go index 0d4b6c5e0d4..853d1aa3dac 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -12,7 +12,7 @@ import ( core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" - identify "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" + identify "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/protocol/identify" kb "gx/ipfs/QmYe9YR9fibxCaExayDXUAN7eX7Q4N7jsMcPs8KgpGdiEV/go-libp2p-kbucket" "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index a9ff2d06ce0..1cd9cc0d5ce 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -11,8 +11,8 @@ import ( core "github.com/ipfs/go-ipfs/core" - floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" + floodsub "gx/ipfs/QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4/go-libp2p-floodsub" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" diff --git a/core/commands/repo.go b/core/commands/repo.go index 57c21238c7b..f2f490c6cfc 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -18,7 +18,7 @@ import ( lockfile "github.com/ipfs/go-ipfs/repo/fsrepo/lock" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/root.go b/core/commands/root.go index bbc03e7e56c..82fd0dec2fd 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -12,8 +12,8 @@ import ( unixfs "github.com/ipfs/go-ipfs/core/commands/unixfs" lgc "github.com/ipfs/go-ipfs/commands/legacy" + "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/stat.go b/core/commands/stat.go index 0e991836b63..03ef5889d03 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -8,10 +8,10 @@ import ( "time" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index f31bfd547a8..4d6a33d1ff9 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -15,10 +15,10 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/repo/fsrepo" - swarm "gx/ipfs/QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d/go-libp2p-swarm" + iaddr "gx/ipfs/QmPWejECnZ4a2eShmnMFBfaLQR7AjuNDPxiY7jmR4fPjg6/go-ipfs-addr" + swarm "gx/ipfs/QmSKrS9EF4V8FpD1d5FUGQiwYLNkXcxKabWgT2aWNVnQie/go-libp2p-swarm" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" - iaddr "gx/ipfs/QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp/go-ipfs-addr" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) diff --git a/core/core.go b/core/core.go index d0ab326df44..859e887ecdf 100644 --- a/core/core.go +++ b/core/core.go @@ -42,22 +42,22 @@ import ( offroute "github.com/ipfs/go-ipfs/routing/offline" ft "github.com/ipfs/go-ipfs/unixfs" - discovery "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/discovery" - p2pbhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/routed" - identify "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" - ping "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/ping" yamux "gx/ipfs/QmNWCEvi7bPRcvqAV8AKLGVNoQdArWi7NJayka2SM4XtRe/go-smux-yamux" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + discovery "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/discovery" + p2pbhost "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/host/routed" + identify "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/protocol/identify" + ping "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/protocol/ping" ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" connmgr "gx/ipfs/QmQqCKzSsjnsvoLxFeNJUCkeicXU4hY47GTCeTwEUnsvyx/go-libp2p-connmgr" mplex "gx/ipfs/QmREBy6TSjLQMtYFhjf97cypsUTzBagcwamWocKHFCTb1e/go-smux-multiplex" ipnet "gx/ipfs/QmRFDGFgeKQjEjZdVcDUBiGYLkRDHbH151dLwa5K7dgGZy/go-libp2p-interface-pnet" routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" - circuit "gx/ipfs/QmS1Cmc1ZP4vwvwSuJ92pWdrdmd51YPqpxYu8byYKwPnKv/go-libp2p-circuit" - swarm "gx/ipfs/QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d/go-libp2p-swarm" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" + swarm "gx/ipfs/QmSKrS9EF4V8FpD1d5FUGQiwYLNkXcxKabWgT2aWNVnQie/go-libp2p-swarm" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" + floodsub "gx/ipfs/QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4/go-libp2p-floodsub" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" addrutil "gx/ipfs/QmUBVwiWc4Xv1U8qky2eZab7UqfJ1WFmCKVGjFfdDkxr8W/go-addr-util" pnet "gx/ipfs/QmUvHSZFyrZSRDUKzfE2ASstVUKtSbUCK24TTkWK73iZfc/go-libp2p-pnet" @@ -65,15 +65,15 @@ import ( ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" ifconnmgr "gx/ipfs/QmZdqgq4h6AdodSmPwb5FZzhwnmhchu1hhJgv8tnFdod1o/go-libp2p-interface-connmgr" - floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ic "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" + dht "gx/ipfs/Qmdm5sm2xHCXNaWdxpjhFeStvSNMRhKQkqpBX7aDcqXtfT/go-libp2p-kad-dht" node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" + circuit "gx/ipfs/Qmet8Dv4K3w6aGjNfX5MCRmu1KzJtkKhw1sCzQm2bvGNwP/go-libp2p-circuit" mafilter "gx/ipfs/Qmf2UAmRwDG4TvnkQpHZWPAzw7rpCYVhxmRXmYxXr5LD1g/go-maddr-filter" - dht "gx/ipfs/QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL/go-libp2p-kad-dht" p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" ) diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 108792cc77c..e555970df94 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -15,8 +15,8 @@ import ( path "github.com/ipfs/go-ipfs/path" config "github.com/ipfs/go-ipfs/repo/config" - cmds "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds" - cmdsHttp "gx/ipfs/Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46/go-ipfs-cmds/http" + cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds" + cmdsHttp "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds/http" ) var ( diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index 14d3be7ffe1..ecd5876bdec 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -9,7 +9,7 @@ import ( coreapi "github.com/ipfs/go-ipfs/core/coreapi" config "github.com/ipfs/go-ipfs/repo/config" - id "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/protocol/identify" ) type GatewayConfig struct { diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index ca03dcca52b..f032192647a 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -19,7 +19,7 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" - id "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/protocol/identify" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" ) diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 4401b460c6c..1c04ecaf833 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -7,9 +7,9 @@ import ( core "github.com/ipfs/go-ipfs/core" - bhost "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/host/basic" + bhost "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/host/basic" inet "gx/ipfs/QmQm7WmgYCa4RSz76tKEYpRjApjnRw8ZTUVQC15b8JM4a2/go-libp2p-net" - testutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + testutil "gx/ipfs/QmWUugnJBbcuin8qdfiCYKAsNkG8NeDLhzoBqRaqXhAHd4/go-libp2p-netutil" ) // This test is based on go-libp2p/p2p/net/swarm.TestConnectednessCorrect diff --git a/core/mock/mock.go b/core/mock/mock.go index aa1098685e2..b33b4f285ce 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -11,7 +11,7 @@ import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" ipnet "gx/ipfs/QmRFDGFgeKQjEjZdVcDUBiGYLkRDHbH151dLwa5K7dgGZy/go-libp2p-interface-pnet" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" diff --git a/exchange/bitswap/bitswap_test.go b/exchange/bitswap/bitswap_test.go index 23cce9303f3..0504991fd9f 100644 --- a/exchange/bitswap/bitswap_test.go +++ b/exchange/bitswap/bitswap_test.go @@ -17,7 +17,7 @@ import ( detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race" - p2ptestutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + p2ptestutil "gx/ipfs/QmWUugnJBbcuin8qdfiCYKAsNkG8NeDLhzoBqRaqXhAHd4/go-libp2p-netutil" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" tu "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" diff --git a/exchange/bitswap/session.go b/exchange/bitswap/session.go index 33875f069c4..d562ac23500 100644 --- a/exchange/bitswap/session.go +++ b/exchange/bitswap/session.go @@ -7,10 +7,10 @@ import ( notifications "github.com/ipfs/go-ipfs/exchange/bitswap/notifications" + loggables "gx/ipfs/QmQ3c5AP6yjqD3E4get5atkvfaUU4rubWquoL2e8ycjUSu/go-libp2p-loggables" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" - loggables "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) diff --git a/exchange/bitswap/testnet/peernet.go b/exchange/bitswap/testnet/peernet.go index af7b05940e4..7f768e13741 100644 --- a/exchange/bitswap/testnet/peernet.go +++ b/exchange/bitswap/testnet/peernet.go @@ -5,7 +5,7 @@ import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" mockrouting "github.com/ipfs/go-ipfs/routing/mock" - mockpeernet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mockpeernet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" diff --git a/exchange/bitswap/testutils.go b/exchange/bitswap/testutils.go index b361e53f3f8..48dd356536a 100644 --- a/exchange/bitswap/testutils.go +++ b/exchange/bitswap/testutils.go @@ -12,7 +12,7 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" ds_sync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" - p2ptestutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + p2ptestutil "gx/ipfs/QmWUugnJBbcuin8qdfiCYKAsNkG8NeDLhzoBqRaqXhAHd4/go-libp2p-netutil" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ) diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 17f43b08612..3f2c30bd47d 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -16,9 +16,9 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" + lgbl "gx/ipfs/QmQ3c5AP6yjqD3E4get5atkvfaUU4rubWquoL2e8ycjUSu/go-libp2p-loggables" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - lgbl "gx/ipfs/QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT/go-libp2p-loggables" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" diff --git a/namesys/namesys.go b/namesys/namesys.go index e38d58455fb..673583d96b8 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -11,9 +11,9 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + floodsub "gx/ipfs/QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4/go-libp2p-floodsub" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" - floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" p2phost "gx/ipfs/QmfCtHMCd9xFvehvHeVxtKVXJTMVTuHhyPRVHEXetn87vL/go-libp2p-host" diff --git a/namesys/pubsub.go b/namesys/pubsub.go index c71d82a7d89..1bb45ae90d9 100644 --- a/namesys/pubsub.go +++ b/namesys/pubsub.go @@ -16,9 +16,9 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" + floodsub "gx/ipfs/QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4/go-libp2p-floodsub" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" - floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" record "gx/ipfs/QmbsY8Pr6s3uZsKg7rzBtGDKeCtdoAhNaMTCXBUbvb1eCV/go-libp2p-record" diff --git a/namesys/pubsub_test.go b/namesys/pubsub_test.go index abafa732b6e..bda40899da8 100644 --- a/namesys/pubsub_test.go +++ b/namesys/pubsub_test.go @@ -11,9 +11,9 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" - netutil "gx/ipfs/QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY/go-libp2p-netutil" + floodsub "gx/ipfs/QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4/go-libp2p-floodsub" + netutil "gx/ipfs/QmWUugnJBbcuin8qdfiCYKAsNkG8NeDLhzoBqRaqXhAHd4/go-libp2p-netutil" bhost "gx/ipfs/QmZ15dDSCo4DKn4o4GnqqLExKATBeeo3oNyQ5FBKtNjEQT/go-libp2p-blankhost" - floodsub "gx/ipfs/Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm/go-libp2p-floodsub" peer "gx/ipfs/Qma7H6RW8wRrfZpNSXwxYGcd1E149s42FpWNpDNieSVrnU/go-libp2p-peer" ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 08bb700a398..0339572001e 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -12,7 +12,7 @@ import ( . "github.com/ipfs/go-ipfs/namesys/republisher" path "github.com/ipfs/go-ipfs/path" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) diff --git a/package.json b/package.json index 735fa3a13c3..085119ab803 100644 --- a/package.json +++ b/package.json @@ -190,9 +190,9 @@ }, { "author": "whyrusleeping", - "hash": "QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio", + "hash": "QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX", "name": "go-libp2p", - "version": "5.0.11" + "version": "5.0.12" }, { "author": "whyrusleeping", @@ -220,9 +220,9 @@ }, { "author": "whyrusleeping", - "hash": "QmaDoQyTYCS3DrPLBLXMixXfuCstBVVR81J3UY1vMxghpT", + "hash": "QmQ3c5AP6yjqD3E4get5atkvfaUU4rubWquoL2e8ycjUSu", "name": "go-libp2p-loggables", - "version": "1.1.11" + "version": "1.1.12" }, { "author": "ipfs", @@ -237,9 +237,9 @@ "version": "0.1.2" }, { - "hash": "QmfChjky1VNaHUQR9F2xqR1QEyX45pqU78nhsoq5GDYoKL", + "hash": "Qmdm5sm2xHCXNaWdxpjhFeStvSNMRhKQkqpBX7aDcqXtfT", "name": "go-libp2p-kad-dht", - "version": "3.0.14" + "version": "3.0.15" }, { "author": "whyrusleeping", @@ -249,9 +249,9 @@ }, { "author": "whyrusleeping", - "hash": "Qma2TkMxcFLVGkYECTo4hrQohBYPx7uhpYL9EejEi8y3Nm", + "hash": "QmSjoxpBJV71bpSojnUY1K382Ly3Up55EspnDx6EKAmQX4", "name": "go-libp2p-floodsub", - "version": "0.9.8" + "version": "0.9.9" }, { "author": "whyrusleeping", @@ -308,9 +308,9 @@ }, { "author": "whyrusleeping", - "hash": "QmV1axkk86DDkYwS269AvPy9eV5h7mUyHveJkSVHPjrQtY", + "hash": "QmWUugnJBbcuin8qdfiCYKAsNkG8NeDLhzoBqRaqXhAHd4", "name": "go-libp2p-netutil", - "version": "0.3.7" + "version": "0.3.8" }, { "hash": "QmYe9YR9fibxCaExayDXUAN7eX7Q4N7jsMcPs8KgpGdiEV", @@ -403,14 +403,14 @@ }, { "author": "whyrusleeping", - "hash": "QmSD9fajyipwNQw3Hza2k2ifcBfbhGoC1ZHHgQBy4yqU8d", + "hash": "QmSKrS9EF4V8FpD1d5FUGQiwYLNkXcxKabWgT2aWNVnQie", "name": "go-libp2p-swarm", - "version": "2.1.3" + "version": "2.1.4" }, { - "hash": "Qmc5paX4ECBARnAKkcAmUYHBGor228Tkfxeya3Nu2KRL46", + "hash": "QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp", "name": "go-ipfs-cmds", - "version": "1.0.3" + "version": "1.0.4" }, { "hash": "QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM", @@ -458,9 +458,9 @@ }, { "author": "vyzo", - "hash": "QmS1Cmc1ZP4vwvwSuJ92pWdrdmd51YPqpxYu8byYKwPnKv", + "hash": "Qmet8Dv4K3w6aGjNfX5MCRmu1KzJtkKhw1sCzQm2bvGNwP", "name": "go-libp2p-circuit", - "version": "2.0.8" + "version": "2.0.9" }, { "author": "magik6k", @@ -488,9 +488,9 @@ }, { "author": "why", - "hash": "QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp", + "hash": "QmPWejECnZ4a2eShmnMFBfaLQR7AjuNDPxiY7jmR4fPjg6", "name": "go-ipfs-addr", - "version": "0.1.5" + "version": "0.1.6" }, { "author": "The Go Authors", diff --git a/repo/config/bootstrap_peers.go b/repo/config/bootstrap_peers.go index f59a3f65528..ee8b7419dfa 100644 --- a/repo/config/bootstrap_peers.go +++ b/repo/config/bootstrap_peers.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - iaddr "gx/ipfs/QmWto9a6kfznUoW9owbLoBiLUMgRvgsVHRKFzs8zzzKYwp/go-ipfs-addr" + iaddr "gx/ipfs/QmPWejECnZ4a2eShmnMFBfaLQR7AjuNDPxiY7jmR4fPjg6/go-ipfs-addr" ) // DefaultBootstrapAddresses are the hardcoded bootstrap addresses diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 53cfadc41a6..1cd0c9e3782 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -18,7 +18,7 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index 1667277a959..64a47d5ed9c 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -13,7 +13,7 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 4197a9512af..a0ce0e79a79 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -9,7 +9,7 @@ import ( "github.com/ipfs/go-ipfs/core/mock" "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index df5b40b410e..c98edba6966 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -14,7 +14,7 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmNRN4eZGmY89CRC4T5PC4xDYRx6GkDKEfRnvrT65fVeio/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmPd5qhppUqewTQMfStvNNCFtcxiWGsnE6Vs3va6788gsX/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" testutil "gx/ipfs/QmfB65MYJqaKzBiMvW47fquCRhmEeXW6AhrJSGM7TeY5eG/go-testutil" ) From faae63fcf1895a11603beaed9fcd994015146da3 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 27 Jan 2018 18:59:58 -0800 Subject: [PATCH 20/25] handle error from changed NewFloodSub method License: MIT Signed-off-by: Steven Allen --- core/core.go | 6 +++++- namesys/pubsub_test.go | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/core/core.go b/core/core.go index 859e887ecdf..a9a2aff8a09 100644 --- a/core/core.go +++ b/core/core.go @@ -250,7 +250,11 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin } if pubsub || ipnsps { - n.Floodsub = floodsub.NewFloodSub(ctx, peerhost) + service, err := floodsub.NewFloodSub(ctx, peerhost) + if err != nil { + return err + } + n.Floodsub = service } if ipnsps { diff --git a/namesys/pubsub_test.go b/namesys/pubsub_test.go index bda40899da8..1fe590cd1ae 100644 --- a/namesys/pubsub_test.go +++ b/namesys/pubsub_test.go @@ -100,7 +100,11 @@ func TestPubsubPublishSubscribe(t *testing.T) { pubhost := newNetHost(ctx, t) pubmr := newMockRouting(ms, ks, pubhost) - pub := NewPubsubPublisher(ctx, pubhost, ds.NewMapDatastore(), pubmr, floodsub.NewFloodSub(ctx, pubhost)) + fs, err := floodsub.NewFloodSub(ctx, pubhost) + if err != nil { + t.Fatal(err) + } + pub := NewPubsubPublisher(ctx, pubhost, ds.NewMapDatastore(), pubmr, fs) privk := pubhost.Peerstore().PrivKey(pubhost.ID()) pubpinfo := pstore.PeerInfo{ID: pubhost.ID(), Addrs: pubhost.Addrs()} @@ -110,7 +114,13 @@ func TestPubsubPublishSubscribe(t *testing.T) { resmrs := newMockRoutingForHosts(ms, ks, reshosts) res := make([]*PubsubResolver, len(reshosts)) for i := 0; i < len(res); i++ { - res[i] = NewPubsubResolver(ctx, reshosts[i], resmrs[i], ks, floodsub.NewFloodSub(ctx, reshosts[i])) + + fs, err := floodsub.NewFloodSub(ctx, reshosts[i]) + if err != nil { + t.Fatal(err) + } + + res[i] = NewPubsubResolver(ctx, reshosts[i], resmrs[i], ks, fs) if err := reshosts[i].Connect(ctx, pubpinfo); err != nil { t.Fatal(err) } @@ -127,7 +137,7 @@ func TestPubsubPublishSubscribe(t *testing.T) { time.Sleep(time.Second * 1) val := path.Path("/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY") - err := pub.Publish(ctx, privk, val) + err = pub.Publish(ctx, privk, val) if err != nil { t.Fatal(err) } From 1054826ac49f66d329d3088143f1a7f2b9930dcc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 28 Jan 2018 14:13:16 -0800 Subject: [PATCH 21/25] switch base64 decoder based on OS Less magical. License: MIT Signed-off-by: Steven Allen --- test/ipfs-test-lib.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/ipfs-test-lib.sh b/test/ipfs-test-lib.sh index 6c31c8380b5..9cd99c2e761 100644 --- a/test/ipfs-test-lib.sh +++ b/test/ipfs-test-lib.sh @@ -111,11 +111,11 @@ test_seq() { } b64decode() { - for flag in "-D" "-d"; do - if base64 "$flag" 2>/dev/null; then - return - fi - done - echo "no compatible base64 command found" >&2 - return 1 + case `uname` in + Linux|FreeBSD) base64 -d ;; + Darwin) base64 -D ;; + *) + echo "no compatible base64 command found" >&2 + return 1 + esac } From f1aba9764f6df5aa51dcc160c61dca7569aadb90 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 29 Jan 2018 11:32:34 -0800 Subject: [PATCH 22/25] fix error in test case License: MIT Signed-off-by: Steven Allen --- core/coreapi/key_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/coreapi/key_test.go b/core/coreapi/key_test.go index 6ec279e4b1b..92d4c8d4a33 100644 --- a/core/coreapi/key_test.go +++ b/core/coreapi/key_test.go @@ -32,7 +32,7 @@ func TestListSelf(t *testing.T) { } if keys[0].Path().String() != "/ipns/"+testPeerID { - t.Errorf("expected the key to have path '/ipns/Qmfoo', got '%s'", keys[0].Path().String()) + t.Errorf("expected the key to have path '/ipns/%s', got '%s'", testPeerID, keys[0].Path().String()) } } From f9d935b9841ec061e8e10fb9c3aac5b7917720cd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 29 Jan 2018 11:55:34 -0800 Subject: [PATCH 23/25] rename import of go-ipld-format from node/format to ipld License: MIT Signed-off-by: Steven Allen --- core/commands/dag/dag.go | 4 +- core/commands/dht.go | 4 +- core/commands/files/files.go | 6 +-- core/commands/ls.go | 8 ++-- core/commands/object/object.go | 12 ++--- core/commands/refs.go | 16 +++---- core/core.go | 4 +- core/coreapi/unixfs.go | 4 +- core/coredag/cbor.go | 10 ++-- core/coredag/dagpb.go | 10 ++-- core/coredag/dagtransl.go | 8 ++-- core/coredag/raw.go | 6 +-- core/corehttp/gateway_handler.go | 8 ++-- core/coreunix/add.go | 24 +++++----- core/coreunix/metadata_test.go | 4 +- core/pathresolver.go | 4 +- exchange/reprovide/providers.go | 6 +-- fuse/readonly/ipfs_test.go | 6 +-- fuse/readonly/readonly_unix.go | 8 ++-- importer/balanced/balanced_test.go | 6 +-- importer/balanced/builder.go | 4 +- importer/helpers/dagbuilder.go | 14 +++--- importer/helpers/helpers.go | 8 ++-- importer/importer.go | 8 ++-- importer/importer_test.go | 8 ++-- importer/trickle/trickle_test.go | 4 +- importer/trickle/trickledag.go | 12 ++--- merkledag/coding.go | 10 ++-- merkledag/merkledag.go | 72 ++++++++++++++--------------- merkledag/merkledag_test.go | 20 ++++---- merkledag/node.go | 46 +++++++++--------- merkledag/node_test.go | 12 ++--- merkledag/raw.go | 18 ++++---- merkledag/test/utils.go | 4 +- merkledag/traverse/traverse.go | 14 +++--- merkledag/traverse/traverse_test.go | 16 +++---- merkledag/utils/diff.go | 6 +-- merkledag/utils/diffenum.go | 10 ++-- merkledag/utils/diffenum_test.go | 18 ++++---- merkledag/utils/utils.go | 28 +++++------ merkledag/utils/utils_test.go | 4 +- mfs/dir.go | 24 +++++----- mfs/file.go | 10 ++-- mfs/mfs_test.go | 16 +++---- mfs/ops.go | 4 +- mfs/system.go | 12 ++--- path/resolver.go | 22 ++++----- path/resolver_test.go | 4 +- pin/gc/gc.go | 14 +++--- pin/pin.go | 20 ++++---- pin/set.go | 24 +++++----- plugin/ipld.go | 4 +- plugin/loader/initializer.go | 4 +- tar/format.go | 10 ++-- thirdparty/posinfo/posinfo.go | 4 +- unixfs/archive/archive.go | 4 +- unixfs/archive/tar/writer.go | 10 ++-- unixfs/hamt/hamt.go | 44 +++++++++--------- unixfs/hamt/hamt_stress_test.go | 4 +- unixfs/hamt/hamt_test.go | 10 ++-- unixfs/io/dagreader.go | 4 +- unixfs/io/dirbuilder.go | 18 ++++---- unixfs/io/pbdagreader.go | 14 +++--- unixfs/io/resolve.go | 4 +- unixfs/mod/dagmodifier.go | 20 ++++---- unixfs/test/utils.go | 12 ++--- 66 files changed, 405 insertions(+), 405 deletions(-) diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index a029022a14a..2051537d37b 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -18,7 +18,7 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("cmds/files") @@ -103,7 +103,7 @@ into an object of the specified format. addAllAndPin := func(f files.File) error { cids := cid.NewSet() - b := node.NewBatch(req.Context(), n.DAG) + b := ipld.NewBatch(req.Context(), n.DAG) for { file, err := f.NextFile() diff --git a/core/commands/dht.go b/core/commands/dht.go index e2f4f5b368a..7c155af709d 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -20,7 +20,7 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ipdht "gx/ipfs/Qmdm5sm2xHCXNaWdxpjhFeStvSNMRhKQkqpBX7aDcqXtfT/go-libp2p-kad-dht" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" ) @@ -378,7 +378,7 @@ func provideKeys(ctx context.Context, r routing.IpfsRouting, cids []*cid.Cid) er return nil } -func provideKeysRec(ctx context.Context, r routing.IpfsRouting, dserv node.DAGService, cids []*cid.Cid) error { +func provideKeysRec(ctx context.Context, r routing.IpfsRouting, dserv ipld.DAGService, cids []*cid.Cid) error { provided := cid.NewSet() for _, c := range cids { kset := cid.NewSet() diff --git a/core/commands/files/files.go b/core/commands/files/files.go index 90f2cd6d256..b153804d110 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -23,7 +23,7 @@ import ( mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("cmds/files") @@ -170,7 +170,7 @@ func statGetFormatOptions(req cmds.Request) (string, error) { } } -func statNode(ds node.DAGService, fsn mfs.FSNode) (*Object, error) { +func statNode(ds ipld.DAGService, fsn mfs.FSNode) (*Object, error) { nd, err := fsn.GetNode() if err != nil { return nil, err @@ -278,7 +278,7 @@ var FilesCpCmd = &cmds.Command{ }, } -func getNodeFromPath(ctx context.Context, node *core.IpfsNode, p string) (node.Node, error) { +func getNodeFromPath(ctx context.Context, node *core.IpfsNode, p string) (ipld.Node, error) { switch { case strings.HasPrefix(p, "/ipfs/"): np, err := path.ParsePath(p) diff --git a/core/commands/ls.go b/core/commands/ls.go index 8c7ac404746..6e5f0bdb824 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -18,7 +18,7 @@ import ( unixfspb "github.com/ipfs/go-ipfs/unixfs/pb" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type LsLink struct { @@ -84,7 +84,7 @@ The JSON output contains type information. paths := req.Arguments() - var dagnodes []node.Node + var dagnodes []ipld.Node for _, fpath := range paths { p, err := path.ParsePath(fpath) if err != nil { @@ -114,7 +114,7 @@ The JSON output contains type information. return } - var links []*node.Link + var links []*ipld.Link if dir == nil { links = dagnode.Links() } else { @@ -134,7 +134,7 @@ The JSON output contains type information. t := unixfspb.Data_DataType(-1) linkNode, err := link.GetNode(req.Context(), dserv) - if err == node.ErrNotFound && !resolve { + if err == ipld.ErrNotFound && !resolve { // not an error linkNode = nil } else if err != nil { diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 6eae3034ea3..f5d36620fd6 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -23,7 +23,7 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ErrObjectTooLarge is returned when too much data was read from stdin. current limit 2m @@ -313,7 +313,7 @@ var ObjectStatCmd = &cmds.Command{ res.SetOutput(ns) }, - Type: node.NodeStat{}, + Type: ipld.NodeStat{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { v, err := unwrapOutput(res.Output()) @@ -321,7 +321,7 @@ var ObjectStatCmd = &cmds.Command{ return nil, err } - ns, ok := v.(*node.NodeStat) + ns, ok := v.(*ipld.NodeStat) if !ok { return nil, e.TypeErr(ns, v) } @@ -632,7 +632,7 @@ func getObjectEnc(o interface{}) objectEncoding { return objectEncoding(v) } -func getOutput(dagnode node.Node) (*Object, error) { +func getOutput(dagnode ipld.Node) (*Object, error) { c := dagnode.Cid() output := &Object{ Hash: c.String(), @@ -663,13 +663,13 @@ func deserializeNode(nd *Node, dataFieldEncoding string) (*dag.ProtoNode, error) return nil, fmt.Errorf("Unkown data field encoding") } - dagnode.SetLinks(make([]*node.Link, len(nd.Links))) + dagnode.SetLinks(make([]*ipld.Link, len(nd.Links))) for i, link := range nd.Links { c, err := cid.Decode(link.Hash) if err != nil { return nil, err } - dagnode.Links()[i] = &node.Link{ + dagnode.Links()[i] = &ipld.Link{ Name: link.Name, Size: link.Size, Cid: c, diff --git a/core/commands/refs.go b/core/commands/refs.go index 75e845989c0..f0e523b5dc8 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -14,7 +14,7 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // KeyList is a general type for outputting lists of keys @@ -197,8 +197,8 @@ var refsMarshallerMap = cmds.MarshalerMap{ }, } -func objectsForPaths(ctx context.Context, n *core.IpfsNode, paths []string) ([]node.Node, error) { - objects := make([]node.Node, len(paths)) +func objectsForPaths(ctx context.Context, n *core.IpfsNode, paths []string) ([]ipld.Node, error) { + objects := make([]ipld.Node, len(paths)) for i, sp := range paths { p, err := path.ParsePath(sp) if err != nil { @@ -221,7 +221,7 @@ type RefWrapper struct { type RefWriter struct { out chan interface{} - DAG node.DAGService + DAG ipld.DAGService Ctx context.Context Unique bool @@ -232,18 +232,18 @@ type RefWriter struct { } // WriteRefs writes refs of the given object to the underlying writer. -func (rw *RefWriter) WriteRefs(n node.Node) (int, error) { +func (rw *RefWriter) WriteRefs(n ipld.Node) (int, error) { if rw.Recursive { return rw.writeRefsRecursive(n) } return rw.writeRefsSingle(n) } -func (rw *RefWriter) writeRefsRecursive(n node.Node) (int, error) { +func (rw *RefWriter) writeRefsRecursive(n ipld.Node) (int, error) { nc := n.Cid() var count int - for i, ng := range node.GetDAG(rw.Ctx, rw.DAG, n) { + for i, ng := range ipld.GetDAG(rw.Ctx, rw.DAG, n) { lc := n.Links()[i].Cid if rw.skip(lc) { continue @@ -267,7 +267,7 @@ func (rw *RefWriter) writeRefsRecursive(n node.Node) (int, error) { return count, nil } -func (rw *RefWriter) writeRefsSingle(n node.Node) (int, error) { +func (rw *RefWriter) writeRefsSingle(n ipld.Node) (int, error) { c := n.Cid() if rw.skip(c) { diff --git a/core/core.go b/core/core.go index a9a2aff8a09..2df7154900a 100644 --- a/core/core.go +++ b/core/core.go @@ -70,7 +70,7 @@ import ( metrics "gx/ipfs/Qmb1QrSXKwGFWgiGEcyac4s5wakJG4yPvCPk49xZHxr5ux/go-libp2p-metrics" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" dht "gx/ipfs/Qmdm5sm2xHCXNaWdxpjhFeStvSNMRhKQkqpBX7aDcqXtfT/go-libp2p-kad-dht" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" pstore "gx/ipfs/QmeZVQzUrXqaszo24DAoHfGzcmCptN9JyngLkGAiEfk2x7/go-libp2p-peerstore" circuit "gx/ipfs/Qmet8Dv4K3w6aGjNfX5MCRmu1KzJtkKhw1sCzQm2bvGNwP/go-libp2p-circuit" mafilter "gx/ipfs/Qmf2UAmRwDG4TvnkQpHZWPAzw7rpCYVhxmRXmYxXr5LD1g/go-maddr-filter" @@ -118,7 +118,7 @@ type IpfsNode struct { BaseBlocks bstore.Blockstore // the raw blockstore, no filestore wrapping GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc Blocks bserv.BlockService // the block service, get/add blocks. - DAG node.DAGService // the merkle dag service, get/add objects. + DAG ipld.DAGService // the merkle dag service, get/add objects. Resolver *path.Resolver // the path resolution system Reporter metrics.Reporter Discovery discovery.Service diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index dbfdca3cc1c..f8a0ab23ac6 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -9,7 +9,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type UnixfsAPI CoreAPI @@ -52,7 +52,7 @@ func (api *UnixfsAPI) Ls(ctx context.Context, p coreiface.Path) ([]*coreiface.Li return nil, err } - var ndlinks []*node.Link + var ndlinks []*ipld.Link dir, err := uio.NewDirectoryFromNode(api.node.DAG, dagnode) switch err { case nil: diff --git a/core/coredag/cbor.go b/core/coredag/cbor.go index 0355c6b4bf6..51593f827d7 100644 --- a/core/coredag/cbor.go +++ b/core/coredag/cbor.go @@ -5,19 +5,19 @@ import ( "io/ioutil" ipldcbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func cborJSONParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func cborJSONParser(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { nd, err := ipldcbor.FromJson(r, mhType, mhLen) if err != nil { return nil, err } - return []node.Node{nd}, nil + return []ipld.Node{nd}, nil } -func cborRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func cborRawParser(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { data, err := ioutil.ReadAll(r) if err != nil { return nil, err @@ -28,5 +28,5 @@ func cborRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { return nil, err } - return []node.Node{nd}, nil + return []ipld.Node{nd}, nil } diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index 581a1692d0a..6ea5d4c4319 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -9,10 +9,10 @@ import ( mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func dagpbJSONParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func dagpbJSONParser(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { data, err := ioutil.ReadAll(r) if err != nil { return nil, err @@ -27,10 +27,10 @@ func dagpbJSONParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) nd.SetPrefix(cidPrefix(mhType, mhLen)) - return []node.Node{nd}, nil + return []ipld.Node{nd}, nil } -func dagpbRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func dagpbRawParser(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { data, err := ioutil.ReadAll(r) if err != nil { return nil, err @@ -43,7 +43,7 @@ func dagpbRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) nd.SetPrefix(cidPrefix(mhType, mhLen)) - return []node.Node{nd}, nil + return []ipld.Node{nd}, nil } func cidPrefix(mhType uint64, mhLen int) *cid.Prefix { diff --git a/core/coredag/dagtransl.go b/core/coredag/dagtransl.go index ca877b2b56e..b20afef942b 100644 --- a/core/coredag/dagtransl.go +++ b/core/coredag/dagtransl.go @@ -4,11 +4,11 @@ import ( "fmt" "io" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DagParser is function used for parsing stream into Node -type DagParser func(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) +type DagParser func(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) // FormatParsers is used for mapping format descriptors to DagParsers type FormatParsers map[string]DagParser @@ -48,7 +48,7 @@ var defaultCborParsers = FormatParsers{ // ParseInputs uses DefaultInputEncParsers to parse io.Reader described by // input encoding and format to an instance of ipld Node -func ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { return DefaultInputEncParsers.ParseInputs(ienc, format, r, mhType, mhLen) } @@ -65,7 +65,7 @@ func (iep InputEncParsers) AddParser(ienv, format string, f DagParser) { // ParseInputs parses io.Reader described by input encoding and format to // an instance of ipld Node -func (iep InputEncParsers) ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func (iep InputEncParsers) ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { parsers, ok := iep[ienc] if !ok { return nil, fmt.Errorf("no input parser for %q", ienc) diff --git a/core/coredag/raw.go b/core/coredag/raw.go index a109e4668c1..2537618a4e0 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -9,11 +9,11 @@ import ( mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" block "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) -func rawRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { +func rawRawParser(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error) { if mhType == math.MaxUint64 { mhType = mh.SHA2_256 } @@ -33,5 +33,5 @@ func rawRawParser(r io.Reader, mhType uint64, mhLen int) ([]node.Node, error) { return nil, err } nd := &merkledag.RawNode{Block: blk} - return []node.Node{nd}, nil + return []ipld.Node{nd}, nil } diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 1dbc8f4f2e5..aedcac2278f 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -26,7 +26,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" routing "gx/ipfs/QmRijoA6zGS98ELTDbGsLWPZbVotYsGbjp3RbXcKCYBeon/go-libp2p-routing" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" multibase "gx/ipfs/QmexBtiTTEwwn42Yi6ouKt6VqzpA6wjJgiW1oh9VfaRrup/go-multibase" ) @@ -53,7 +53,7 @@ func newGatewayHandler(n *core.IpfsNode, c GatewayConfig, api coreiface.CoreAPI) } // TODO(cryptix): find these helpers somewhere else -func (i *gatewayHandler) newDagFromReader(r io.Reader) (node.Node, error) { +func (i *gatewayHandler) newDagFromReader(r io.Reader) (ipld.Node, error) { // TODO(cryptix): change and remove this helper once PR1136 is merged // return ufs.AddFromReader(i.node, r.Body) return importer.BuildDagFromReader( @@ -316,7 +316,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr // storage for directory listing var dirListing []directoryItem - dirr.ForEachLink(ctx, func(link *node.Link) error { + dirr.ForEachLink(ctx, func(link *ipld.Link) error { // See comment above where originalUrlPath is declared. di := directoryItem{humanize.Bytes(link.Size), link.Name, gopath.Join(originalUrlPath, link.Name)} dirListing = append(dirListing, di) @@ -425,7 +425,7 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) { return } - var newnode node.Node + var newnode ipld.Node if rsegs[len(rsegs)-1] == "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn" { newnode = ft.EmptyDirNode() } else { diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 6540bc576f6..b7841808d3f 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -29,7 +29,7 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("coreunix") @@ -74,7 +74,7 @@ type AddedObject struct { } // NewAdder Returns a new Adder used for a file add operation. -func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds node.DAGService) (*Adder, error) { +func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds ipld.DAGService) (*Adder, error) { return &Adder{ ctx: ctx, pinning: p, @@ -94,7 +94,7 @@ type Adder struct { ctx context.Context pinning pin.Pinner blockstore bstore.GCBlockstore - dagService node.DAGService + dagService ipld.DAGService Out chan interface{} Progress bool Hidden bool @@ -105,7 +105,7 @@ type Adder struct { Wrap bool NoCopy bool Chunker string - root node.Node + root ipld.Node mroot *mfs.Root unlocker bs.Unlocker tempRoot *cid.Cid @@ -133,7 +133,7 @@ func (adder *Adder) SetMfsRoot(r *mfs.Root) { } // Constructs a node from reader's data, and adds it. Doesn't pin. -func (adder *Adder) add(reader io.Reader) (node.Node, error) { +func (adder *Adder) add(reader io.Reader) (ipld.Node, error) { chnk, err := chunk.FromString(reader, adder.Chunker) if err != nil { return nil, err @@ -155,7 +155,7 @@ func (adder *Adder) add(reader io.Reader) (node.Node, error) { } // RootNode returns the root node of the Added. -func (adder *Adder) RootNode() (node.Node, error) { +func (adder *Adder) RootNode() (ipld.Node, error) { // for memoizing if adder.root != nil { return adder.root, nil @@ -215,7 +215,7 @@ func (adder *Adder) PinRoot() error { } // Finalize flushes the mfs root directory and returns the mfs root node. -func (adder *Adder) Finalize() (node.Node, error) { +func (adder *Adder) Finalize() (ipld.Node, error) { mr, err := adder.mfsRoot() if err != nil { return nil, err @@ -365,7 +365,7 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) { // to preserve the filename. // Returns the path of the added file ("/filename"), the DAG node of // the directory, and and error if any. -func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, node.Node, error) { +func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, ipld.Node, error) { file := files.NewReaderFile(filename, filename, ioutil.NopCloser(r), nil) fileAdder, err := NewAdder(n.Context(), n.Pinning, n.Blockstore, n.DAG) if err != nil { @@ -389,7 +389,7 @@ func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, node.No return gopath.Join(c.String(), filename), dagnode, nil } -func (adder *Adder) addNode(node node.Node, path string) error { +func (adder *Adder) addNode(node ipld.Node, path string) error { // patch it into the root if path == "" { path = node.Cid().String() @@ -555,7 +555,7 @@ func (adder *Adder) maybePauseForGC() error { } // outputDagnode sends dagnode info over the output channel -func outputDagnode(out chan interface{}, name string, dn node.Node) error { +func outputDagnode(out chan interface{}, name string, dn ipld.Node) error { if out == nil { return nil } @@ -575,7 +575,7 @@ func outputDagnode(out chan interface{}, name string, dn node.Node) error { } // NewMemoryDagService builds and returns a new mem-datastore. -func NewMemoryDagService() node.DAGService { +func NewMemoryDagService() ipld.DAGService { // build mem-datastore for editor's intermediary nodes bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) bsrv := bserv.New(bs, offline.Exchange(bs)) @@ -583,7 +583,7 @@ func NewMemoryDagService() node.DAGService { } // from core/commands/object.go -func getOutput(dagnode node.Node) (*Object, error) { +func getOutput(dagnode ipld.Node) (*Object, error) { c := dagnode.Cid() s, err := dagnode.Size() if err != nil { diff --git a/core/coreunix/metadata_test.go b/core/coreunix/metadata_test.go index eef92b86586..cee40458553 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -20,10 +20,10 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func getDagserv(t *testing.T) node.DAGService { +func getDagserv(t *testing.T) ipld.DAGService { db := dssync.MutexWrap(ds.NewMapDatastore()) bs := bstore.NewBlockstore(db) blockserv := bserv.New(bs, offline.Exchange(bs)) diff --git a/core/pathresolver.go b/core/pathresolver.go index 5ed8842f703..7cfebbb0675 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -10,7 +10,7 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // ErrNoNamesys is an explicit error for when an IPFS node doesn't @@ -21,7 +21,7 @@ var ErrNoNamesys = errors.New( // Resolve resolves the given path by parsing out protocol-specific // entries (e.g. /ipns/) and then going through the /ipfs/ // entries and returning the final node. -func Resolve(ctx context.Context, nsys namesys.NameSystem, r *path.Resolver, p path.Path) (node.Node, error) { +func Resolve(ctx context.Context, nsys namesys.NameSystem, r *path.Resolver, p path.Path) (ipld.Node, error) { if strings.HasPrefix(p.String(), "/ipns/") { evt := log.EventBegin(ctx, "resolveIpnsPath") defer evt.Done() diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index 5c592903b1f..f36966d0bcb 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -6,7 +6,7 @@ import ( blocks "github.com/ipfs/go-ipfs/blocks/blockstore" merkledag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) @@ -19,7 +19,7 @@ func NewBlockstoreProvider(bstore blocks.Blockstore) KeyChanFunc { } // NewPinnedProvider returns provider supplying pinned keys -func NewPinnedProvider(pinning pin.Pinner, dag node.DAGService, onlyRoots bool) KeyChanFunc { +func NewPinnedProvider(pinning pin.Pinner, dag ipld.DAGService, onlyRoots bool) KeyChanFunc { return func(ctx context.Context) (<-chan *cid.Cid, error) { set, err := pinSet(ctx, pinning, dag, onlyRoots) if err != nil { @@ -43,7 +43,7 @@ func NewPinnedProvider(pinning pin.Pinner, dag node.DAGService, onlyRoots bool) } } -func pinSet(ctx context.Context, pinning pin.Pinner, dag node.DAGService, onlyRoots bool) (*streamingSet, error) { +func pinSet(ctx context.Context, pinning pin.Pinner, dag ipld.DAGService, onlyRoots bool) (*streamingSet, error) { set := newStreamingSet() go func() { diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 554a3e132e1..005339793bd 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -24,7 +24,7 @@ import ( u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" fstest "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs/fstestutil" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func maybeSkipFuseTests(t *testing.T) { @@ -33,7 +33,7 @@ func maybeSkipFuseTests(t *testing.T) { } } -func randObj(t *testing.T, nd *core.IpfsNode, size int64) (node.Node, []byte) { +func randObj(t *testing.T, nd *core.IpfsNode, size int64) (ipld.Node, []byte) { buf := make([]byte, size) u.NewTimeSeededRand().Read(buf) read := bytes.NewReader(buf) @@ -116,7 +116,7 @@ func TestIpfsStressRead(t *testing.T) { nd, mnt := setupIpfsTest(t, nil) defer mnt.Close() - var nodes []node.Node + var nodes []ipld.Node var paths []string nobj := 50 diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 3f2c30bd47d..55374efa466 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -21,7 +21,7 @@ import ( proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("fuse/ipfs") @@ -92,7 +92,7 @@ func (*Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { // Node is the core object representing a filesystem tree node. type Node struct { Ipfs *core.IpfsNode - Nd node.Node + Nd ipld.Node cached *ftpb.Data } @@ -157,7 +157,7 @@ func (s *Node) Lookup(ctx context.Context, name string) (fs.Node, error) { nd, err := s.Ipfs.DAG.Get(ctx, link.Cid) switch err { - case node.ErrNotFound: + case ipld.ErrNotFound: default: log.Errorf("fuse lookup %q: %s", name, err) return nil, err @@ -177,7 +177,7 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { } var entries []fuse.Dirent - err = dir.ForEachLink(ctx, func(lnk *node.Link) error { + err = dir.ForEachLink(ctx, func(lnk *ipld.Link) error { n := lnk.Name if len(n) == 0 { n = lnk.Cid.String() diff --git a/importer/balanced/balanced_test.go b/importer/balanced/balanced_test.go index 26cb058de3e..8a9cee75eae 100644 --- a/importer/balanced/balanced_test.go +++ b/importer/balanced/balanced_test.go @@ -16,12 +16,12 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // TODO: extract these tests and more as a generic layout test suite -func buildTestDag(ds node.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) { +func buildTestDag(ds ipld.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, @@ -35,7 +35,7 @@ func buildTestDag(ds node.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error return nd.(*dag.ProtoNode), nil } -func getTestDag(t *testing.T, ds node.DAGService, size int64, blksize int64) (*dag.ProtoNode, []byte) { +func getTestDag(t *testing.T, ds ipld.DAGService, size int64, blksize int64) (*dag.ProtoNode, []byte) { data := make([]byte, size) u.NewTimeSeededRand().Read(data) r := bytes.NewReader(data) diff --git a/importer/balanced/builder.go b/importer/balanced/builder.go index a2e58a4a107..63d725a7354 100644 --- a/importer/balanced/builder.go +++ b/importer/balanced/builder.go @@ -5,10 +5,10 @@ import ( h "github.com/ipfs/go-ipfs/importer/helpers" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func BalancedLayout(db *h.DagBuilderHelper) (node.Node, error) { +func BalancedLayout(db *h.DagBuilderHelper) (ipld.Node, error) { var offset uint64 = 0 var root *h.UnixfsNode for level := 0; !db.Done(); level++ { diff --git a/importer/helpers/dagbuilder.go b/importer/helpers/dagbuilder.go index 34c19ea0520..7d8375b0ad4 100644 --- a/importer/helpers/dagbuilder.go +++ b/importer/helpers/dagbuilder.go @@ -11,19 +11,19 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DagBuilderHelper wraps together a bunch of objects needed to // efficiently create unixfs dag trees type DagBuilderHelper struct { - dserv node.DAGService + dserv ipld.DAGService spl chunk.Splitter recvdErr error rawLeaves bool nextData []byte // the next item to return. maxlinks int - batch *node.Batch + batch *ipld.Batch fullPath string stat os.FileInfo prefix *cid.Prefix @@ -41,7 +41,7 @@ type DagBuilderParams struct { Prefix *cid.Prefix // DAGService to write blocks to (required) - Dagserv node.DAGService + Dagserv ipld.DAGService // NoCopy signals to the chunker that it should track fileinfo for // filestore adds @@ -57,7 +57,7 @@ func (dbp *DagBuilderParams) New(spl chunk.Splitter) *DagBuilderHelper { rawLeaves: dbp.RawLeaves, prefix: dbp.Prefix, maxlinks: dbp.Maxlinks, - batch: node.NewBatch(context.TODO(), dbp.Dagserv), + batch: ipld.NewBatch(context.TODO(), dbp.Dagserv), } if fi, ok := spl.Reader().(files.FileInfo); dbp.NoCopy && ok { db.fullPath = fi.AbsPath() @@ -107,7 +107,7 @@ func (db *DagBuilderHelper) Next() ([]byte, error) { } // GetDagServ returns the dagservice object this Helper is using -func (db *DagBuilderHelper) GetDagServ() node.DAGService { +func (db *DagBuilderHelper) GetDagServ() ipld.DAGService { return db.dserv } @@ -194,7 +194,7 @@ func (db *DagBuilderHelper) SetPosInfo(node *UnixfsNode, offset uint64) { } } -func (db *DagBuilderHelper) Add(node *UnixfsNode) (node.Node, error) { +func (db *DagBuilderHelper) Add(node *UnixfsNode) (ipld.Node, error) { dn, err := node.GetDagNode() if err != nil { return nil, err diff --git a/importer/helpers/helpers.go b/importer/helpers/helpers.go index 64b91d38ba4..651a9449bc5 100644 --- a/importer/helpers/helpers.go +++ b/importer/helpers/helpers.go @@ -10,7 +10,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // BlockSizeLimit specifies the maximum size an imported block can have. @@ -81,7 +81,7 @@ func (n *UnixfsNode) Set(other *UnixfsNode) { } // GetChild gets the ith child of this node from the given DAGService. -func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds node.DAGService) (*UnixfsNode, error) { +func (n *UnixfsNode) GetChild(ctx context.Context, i int, ds ipld.DAGService) (*UnixfsNode, error) { nd, err := n.node.Links()[i].GetNode(ctx, ds) if err != nil { return nil, err @@ -145,7 +145,7 @@ func (n *UnixfsNode) SetPosInfo(offset uint64, fullPath string, stat os.FileInfo // GetDagNode fills out the proper formatting for the unixfs node // inside of a DAG node and returns the dag node -func (n *UnixfsNode) GetDagNode() (node.Node, error) { +func (n *UnixfsNode) GetDagNode() (ipld.Node, error) { nd, err := n.getBaseDagNode() if err != nil { return nil, err @@ -163,7 +163,7 @@ func (n *UnixfsNode) GetDagNode() (node.Node, error) { return nd, nil } -func (n *UnixfsNode) getBaseDagNode() (node.Node, error) { +func (n *UnixfsNode) getBaseDagNode() (ipld.Node, error) { if n.raw { return n.rawnode, nil } diff --git a/importer/importer.go b/importer/importer.go index f209f3cc573..4358ee39c93 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -12,12 +12,12 @@ import ( trickle "github.com/ipfs/go-ipfs/importer/trickle" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // BuildDagFromFile builds a DAG from the given file, writing created blocks to // disk as they are created -func BuildDagFromFile(fpath string, ds node.DAGService) (node.Node, error) { +func BuildDagFromFile(fpath string, ds ipld.DAGService) (ipld.Node, error) { stat, err := os.Lstat(fpath) if err != nil { return nil, err @@ -38,7 +38,7 @@ func BuildDagFromFile(fpath string, ds node.DAGService) (node.Node, error) { // BuildDagFromReader builds a DAG from the chunks returned by the given chunk // splitter. -func BuildDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { +func BuildDagFromReader(ds ipld.DAGService, spl chunk.Splitter) (ipld.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, @@ -48,7 +48,7 @@ func BuildDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, erro } // BuildTrickleDagFromReader is similar to BuildDagFromReader but uses the trickle layout. -func BuildTrickleDagFromReader(ds node.DAGService, spl chunk.Splitter) (node.Node, error) { +func BuildTrickleDagFromReader(ds ipld.DAGService, spl chunk.Splitter) (ipld.Node, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, diff --git a/importer/importer_test.go b/importer/importer_test.go index 85504443a37..c9a7a98aba4 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -12,10 +12,10 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, node.DAGService) { +func getBalancedDag(t testing.TB, size int64, blksize int64) (ipld.Node, ipld.DAGService) { ds := mdtest.Mock() r := io.LimitReader(u.NewTimeSeededRand(), size) nd, err := BuildDagFromReader(ds, chunk.NewSizeSplitter(r, blksize)) @@ -25,7 +25,7 @@ func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, node.DA return nd, ds } -func getTrickleDag(t testing.TB, size int64, blksize int64) (node.Node, node.DAGService) { +func getTrickleDag(t testing.TB, size int64, blksize int64) (ipld.Node, ipld.DAGService) { ds := mdtest.Mock() r := io.LimitReader(u.NewTimeSeededRand(), size) nd, err := BuildTrickleDagFromReader(ds, chunk.NewSizeSplitter(r, blksize)) @@ -101,7 +101,7 @@ func BenchmarkTrickleReadFull(b *testing.B) { runReadBench(b, nd, ds) } -func runReadBench(b *testing.B, nd node.Node, ds node.DAGService) { +func runReadBench(b *testing.B, nd ipld.Node, ds ipld.DAGService) { for i := 0; i < b.N; i++ { ctx, cancel := context.WithCancel(context.Background()) read, err := uio.NewDagReader(ctx, nd, ds) diff --git a/importer/trickle/trickle_test.go b/importer/trickle/trickle_test.go index 5a95cc4c6c5..3791afe5c8d 100644 --- a/importer/trickle/trickle_test.go +++ b/importer/trickle/trickle_test.go @@ -17,7 +17,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type UseRawLeaves bool @@ -32,7 +32,7 @@ func runBothSubtests(t *testing.T, tfunc func(*testing.T, UseRawLeaves)) { t.Run("leaves=Raw", func(t *testing.T) { tfunc(t, RawLeaves) }) } -func buildTestDag(ds node.DAGService, spl chunk.Splitter, rawLeaves UseRawLeaves) (*merkledag.ProtoNode, error) { +func buildTestDag(ds ipld.DAGService, spl chunk.Splitter, rawLeaves UseRawLeaves) (*merkledag.ProtoNode, error) { dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, diff --git a/importer/trickle/trickledag.go b/importer/trickle/trickledag.go index 2d9789a5fd6..ff5d28f663f 100644 --- a/importer/trickle/trickledag.go +++ b/importer/trickle/trickledag.go @@ -10,7 +10,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // layerRepeat specifies how many times to append a child tree of a @@ -18,7 +18,7 @@ import ( // improves seek speeds. const layerRepeat = 4 -func TrickleLayout(db *h.DagBuilderHelper) (node.Node, error) { +func TrickleLayout(db *h.DagBuilderHelper) (ipld.Node, error) { root := db.NewUnixfsNode() if err := db.FillNodeLayer(root); err != nil { return nil, err @@ -69,7 +69,7 @@ func fillTrickleRec(db *h.DagBuilderHelper, node *h.UnixfsNode, depth int) error } // TrickleAppend appends the data in `db` to the dag, using the Trickledag format -func TrickleAppend(ctx context.Context, basen node.Node, db *h.DagBuilderHelper) (out node.Node, err_out error) { +func TrickleAppend(ctx context.Context, basen ipld.Node, db *h.DagBuilderHelper) (out ipld.Node, err_out error) { base, ok := basen.(*dag.ProtoNode) if !ok { return nil, dag.ErrNotProtobuf @@ -237,7 +237,7 @@ func trickleDepthInfo(node *h.UnixfsNode, maxlinks int) (int, int) { // VerifyParams is used by VerifyTrickleDagStructure type VerifyParams struct { - Getter node.NodeGetter + Getter ipld.NodeGetter Direct int LayerRepeat int Prefix *cid.Prefix @@ -246,12 +246,12 @@ type VerifyParams struct { // VerifyTrickleDagStructure checks that the given dag matches exactly the trickle dag datastructure // layout -func VerifyTrickleDagStructure(nd node.Node, p VerifyParams) error { +func VerifyTrickleDagStructure(nd ipld.Node, p VerifyParams) error { return verifyTDagRec(nd, -1, p) } // Recursive call for verifying the structure of a trickledag -func verifyTDagRec(n node.Node, depth int, p VerifyParams) error { +func verifyTDagRec(n ipld.Node, depth int, p VerifyParams) error { codec := cid.DagProtobuf if depth == 0 { if len(n.Links()) > 0 { diff --git a/merkledag/coding.go b/merkledag/coding.go index 6600527964b..37d2a56a0d6 100644 --- a/merkledag/coding.go +++ b/merkledag/coding.go @@ -10,7 +10,7 @@ import ( pb "github.com/ipfs/go-ipfs/merkledag/pb" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // for now, we use a PBNode intermediate thing. @@ -25,9 +25,9 @@ func (n *ProtoNode) unmarshal(encoded []byte) error { } pbnl := pbn.GetLinks() - n.links = make([]*node.Link, len(pbnl)) + n.links = make([]*ipld.Link, len(pbnl)) for i, l := range pbnl { - n.links[i] = &node.Link{Name: l.GetName(), Size: l.GetTsize()} + n.links[i] = &ipld.Link{Name: l.GetName(), Size: l.GetTsize()} c, err := cid.Cast(l.GetHash()) if err != nil { return fmt.Errorf("Link hash #%d is not valid multihash. %v", i, err) @@ -114,7 +114,7 @@ func DecodeProtobuf(encoded []byte) (*ProtoNode, error) { // DecodeProtobufBlock is a block decoder for protobuf IPLD nodes conforming to // node.DecodeBlockFunc -func DecodeProtobufBlock(b blocks.Block) (node.Node, error) { +func DecodeProtobufBlock(b blocks.Block) (ipld.Node, error) { c := b.Cid() if c.Type() != cid.DagProtobuf { return nil, fmt.Errorf("this function can only decode protobuf nodes") @@ -134,4 +134,4 @@ func DecodeProtobufBlock(b blocks.Block) (node.Node, error) { } // Type assertion -var _ node.DecodeBlockFunc = DecodeProtobufBlock +var _ ipld.DecodeBlockFunc = DecodeProtobufBlock diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 33b097510b7..fd66fb26974 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -10,7 +10,7 @@ import ( ipldcbor "gx/ipfs/QmNRz7BDWfdFNVLt7AVvmRefkrURD25EeoipcXqo6yoXU1/go-ipld-cbor" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" ) @@ -18,9 +18,9 @@ import ( // functionality should go in a `go-ipld` repo but that will take a lot of work // and design. func init() { - node.Register(cid.DagProtobuf, DecodeProtobufBlock) - node.Register(cid.Raw, DecodeRawBlock) - node.Register(cid.DagCBOR, ipldcbor.DecodeBlock) + ipld.Register(cid.DagProtobuf, DecodeProtobufBlock) + ipld.Register(cid.Raw, DecodeRawBlock) + ipld.Register(cid.DagCBOR, ipldcbor.DecodeBlock) } // NewDAGService constructs a new DAGService (using the default implementation). @@ -38,7 +38,7 @@ type dagService struct { } // Add adds a node to the dagService, storing the block in the BlockService -func (n *dagService) Add(ctx context.Context, nd node.Node) error { +func (n *dagService) Add(ctx context.Context, nd ipld.Node) error { if n == nil { // FIXME remove this assertion. protect with constructor invariant return fmt.Errorf("dagService is nil") } @@ -46,7 +46,7 @@ func (n *dagService) Add(ctx context.Context, nd node.Node) error { return n.Blocks.AddBlock(nd) } -func (n *dagService) AddMany(ctx context.Context, nds []node.Node) error { +func (n *dagService) AddMany(ctx context.Context, nds []ipld.Node) error { blks := make([]blocks.Block, len(nds)) for i, nd := range nds { blks[i] = nd @@ -55,7 +55,7 @@ func (n *dagService) AddMany(ctx context.Context, nds []node.Node) error { } // Get retrieves a node from the dagService, fetching the block in the BlockService -func (n *dagService) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { +func (n *dagService) Get(ctx context.Context, c *cid.Cid) (ipld.Node, error) { if n == nil { return nil, fmt.Errorf("dagService is nil") } @@ -66,17 +66,17 @@ func (n *dagService) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { b, err := n.Blocks.GetBlock(ctx, c) if err != nil { if err == bserv.ErrNotFound { - return nil, node.ErrNotFound + return nil, ipld.ErrNotFound } return nil, fmt.Errorf("Failed to get block for %s: %v", c, err) } - return node.Decode(b) + return ipld.Decode(b) } // GetLinks return the links for the node, the node doesn't necessarily have // to exist locally. -func (n *dagService) GetLinks(ctx context.Context, c *cid.Cid) ([]*node.Link, error) { +func (n *dagService) GetLinks(ctx context.Context, c *cid.Cid) ([]*ipld.Link, error) { if c.Type() == cid.Raw { return nil, nil } @@ -109,12 +109,12 @@ func (n *dagService) RemoveMany(ctx context.Context, cids []*cid.Cid) error { // GetLinksDirect creates a function to get the links for a node, from // the node, bypassing the LinkService. If the node does not exist // locally (and can not be retrieved) an error will be returned. -func GetLinksDirect(serv node.NodeGetter) GetLinks { - return func(ctx context.Context, c *cid.Cid) ([]*node.Link, error) { +func GetLinksDirect(serv ipld.NodeGetter) GetLinks { + return func(ctx context.Context, c *cid.Cid) ([]*ipld.Link, error) { nd, err := serv.Get(ctx, c) if err != nil { if err == bserv.ErrNotFound { - err = node.ErrNotFound + err = ipld.ErrNotFound } return nil, err } @@ -127,28 +127,28 @@ type sesGetter struct { } // Get gets a single node from the DAG. -func (sg *sesGetter) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { +func (sg *sesGetter) Get(ctx context.Context, c *cid.Cid) (ipld.Node, error) { blk, err := sg.bs.GetBlock(ctx, c) switch err { case bserv.ErrNotFound: - return nil, node.ErrNotFound + return nil, ipld.ErrNotFound default: return nil, err case nil: // noop } - return node.Decode(blk) + return ipld.Decode(blk) } // GetMany gets many nodes at once, batching the request if possible. -func (sg *sesGetter) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *node.NodeOption { +func (sg *sesGetter) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *ipld.NodeOption { return getNodesFromBG(ctx, sg.bs, keys) } // FetchGraph fetches all nodes that are children of the given node -func FetchGraph(ctx context.Context, root *cid.Cid, serv node.DAGService) error { - var ng node.NodeGetter = serv +func FetchGraph(ctx context.Context, root *cid.Cid, serv ipld.DAGService) error { + var ng ipld.NodeGetter = serv ds, ok := serv.(*dagService) if ok { ng = &sesGetter{bserv.NewSession(ctx, ds.Blocks)} @@ -187,12 +187,12 @@ func FindLinks(links []*cid.Cid, c *cid.Cid, start int) []int { // This method may not return all requested nodes (and may or may not return an // error indicating that it failed to do so. It is up to the caller to verify // that it received all nodes. -func (n *dagService) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *node.NodeOption { +func (n *dagService) GetMany(ctx context.Context, keys []*cid.Cid) <-chan *ipld.NodeOption { return getNodesFromBG(ctx, n.Blocks, keys) } -func getNodesFromBG(ctx context.Context, bs bserv.BlockGetter, keys []*cid.Cid) <-chan *node.NodeOption { - out := make(chan *node.NodeOption, len(keys)) +func getNodesFromBG(ctx context.Context, bs bserv.BlockGetter, keys []*cid.Cid) <-chan *ipld.NodeOption { + out := make(chan *ipld.NodeOption, len(keys)) blocks := bs.GetBlocks(ctx, keys) var count int @@ -203,22 +203,22 @@ func getNodesFromBG(ctx context.Context, bs bserv.BlockGetter, keys []*cid.Cid) case b, ok := <-blocks: if !ok { if count != len(keys) { - out <- &node.NodeOption{Err: fmt.Errorf("failed to fetch all nodes")} + out <- &ipld.NodeOption{Err: fmt.Errorf("failed to fetch all nodes")} } return } - nd, err := node.Decode(b) + nd, err := ipld.Decode(b) if err != nil { - out <- &node.NodeOption{Err: err} + out <- &ipld.NodeOption{Err: err} return } - out <- &node.NodeOption{Node: nd} + out <- &ipld.NodeOption{Node: nd} count++ case <-ctx.Done(): - out <- &node.NodeOption{Err: ctx.Err()} + out <- &ipld.NodeOption{Err: ctx.Err()} return } } @@ -228,15 +228,15 @@ func getNodesFromBG(ctx context.Context, bs bserv.BlockGetter, keys []*cid.Cid) // GetLinks is the type of function passed to the EnumerateChildren function(s) // for getting the children of an IPLD node. -type GetLinks func(context.Context, *cid.Cid) ([]*node.Link, error) +type GetLinks func(context.Context, *cid.Cid) ([]*ipld.Link, error) // GetLinksWithDAG returns a GetLinks function that tries to use the given // NodeGetter as a LinkGetter to get the children of a given IPLD node. This may // allow us to traverse the DAG without actually loading and parsing the node in // question (if we already have the links cached). -func GetLinksWithDAG(ng node.NodeGetter) GetLinks { - return func(ctx context.Context, c *cid.Cid) ([]*node.Link, error) { - return node.GetLinks(ctx, ng, c) +func GetLinksWithDAG(ng ipld.NodeGetter) GetLinks { + return func(ctx context.Context, c *cid.Cid) ([]*ipld.Link, error) { + return ipld.GetLinks(ctx, ng, c) } } @@ -291,7 +291,7 @@ var FetchGraphConcurrency = 8 // NOTE: It *does not* make multiple concurrent calls to the passed `visit` function. func EnumerateChildrenAsync(ctx context.Context, getLinks GetLinks, c *cid.Cid, visit func(*cid.Cid) bool) error { feed := make(chan *cid.Cid) - out := make(chan []*node.Link) + out := make(chan []*ipld.Link) done := make(chan struct{}) var setlk sync.Mutex @@ -370,7 +370,7 @@ func EnumerateChildrenAsync(ctx context.Context, getLinks GetLinks, c *cid.Cid, } -var _ node.LinkGetter = &dagService{} -var _ node.NodeGetter = &dagService{} -var _ node.NodeGetter = &sesGetter{} -var _ node.DAGService = &dagService{} +var _ ipld.LinkGetter = &dagService{} +var _ ipld.NodeGetter = &dagService{} +var _ ipld.NodeGetter = &sesGetter{} +var _ ipld.DAGService = &dagService{} diff --git a/merkledag/merkledag_test.go b/merkledag/merkledag_test.go index b23cc4feb19..9ca3d79e39c 100644 --- a/merkledag/merkledag_test.go +++ b/merkledag/merkledag_test.go @@ -26,7 +26,7 @@ import ( u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestNode(t *testing.T) { @@ -88,7 +88,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) { k := n.Cid() - expected := node.NodeStat{ + expected := ipld.NodeStat{ NumLinks: len(n.Links()), BlockSize: len(enc), LinksSize: len(enc) - len(n.Data()), // includes framing. @@ -131,7 +131,7 @@ func TestBatchFetchDupBlock(t *testing.T) { func runBatchFetchTest(t *testing.T, read io.Reader) { ctx := context.Background() - var dagservs []node.DAGService + var dagservs []ipld.DAGService for _, bsi := range bstest.Mocks(5) { dagservs = append(dagservs, NewDAGService(bsi)) } @@ -221,7 +221,7 @@ func TestCantGet(t *testing.T) { } func TestFetchGraph(t *testing.T) { - var dservs []node.DAGService + var dservs []ipld.DAGService bsis := bstest.Mocks(2) for _, bsi := range bsis { dservs = append(dservs, NewDAGService(bsi)) @@ -265,8 +265,8 @@ func TestEnumerateChildren(t *testing.T) { t.Fatal(err) } - var traverse func(n node.Node) - traverse = func(n node.Node) { + var traverse func(n ipld.Node) + traverse = func(n ipld.Node) { // traverse dag and check for _, lnk := range n.Links() { c := lnk.Cid @@ -317,7 +317,7 @@ func TestFetchFailure(t *testing.T) { } } - getters := node.GetDAG(ctx, ds, top) + getters := ipld.GetDAG(ctx, ds, top) for i, getter := range getters { _, err := getter.Get(ctx) if err != nil && i < 10 { @@ -433,7 +433,7 @@ func TestGetRawNodes(t *testing.T) { func TestProtoNodeResolve(t *testing.T) { nd := new(ProtoNode) - nd.SetLinks([]*node.Link{{Name: "foo"}}) + nd.SetLinks([]*ipld.Link{{Name: "foo"}}) lnk, left, err := nd.ResolveLink([]string{"foo", "bar"}) if err != nil { @@ -517,7 +517,7 @@ func TestEnumerateAsyncFailsNotFound(t *testing.T) { d := NodeWithData([]byte("foo4")) ds := dstest.Mock() - for _, n := range []node.Node{a, b, c} { + for _, n := range []ipld.Node{a, b, c} { err := ds.Add(ctx, n) if err != nil { t.Fatal(err) @@ -580,7 +580,7 @@ func testProgressIndicator(t *testing.T, depth int) { } } -func mkDag(ds node.DAGService, depth int) (*cid.Cid, int) { +func mkDag(ds ipld.DAGService, depth int) (*cid.Cid, int) { ctx := context.Background() totalChildren := 0 diff --git a/merkledag/node.go b/merkledag/node.go index 4cb79ca9c33..215161258a7 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -7,7 +7,7 @@ import ( mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotProtobuf = fmt.Errorf("expected protobuf dag node") @@ -16,7 +16,7 @@ var ErrLinkNotFound = fmt.Errorf("no link by that name") // Node represents a node in the IPFS Merkle DAG. // nodes have opaque data and a set of navigable links. type ProtoNode struct { - links []*node.Link + links []*ipld.Link data []byte // cache encoded/marshaled value @@ -73,7 +73,7 @@ func (n *ProtoNode) SetPrefix(prefix *cid.Prefix) { } } -type LinkSlice []*node.Link +type LinkSlice []*ipld.Link func (ls LinkSlice) Len() int { return len(ls) } func (ls LinkSlice) Swap(a, b int) { ls[a], ls[b] = ls[b], ls[a] } @@ -84,10 +84,10 @@ func NodeWithData(d []byte) *ProtoNode { } // AddNodeLink adds a link to another node. -func (n *ProtoNode) AddNodeLink(name string, that node.Node) error { +func (n *ProtoNode) AddNodeLink(name string, that ipld.Node) error { n.encoded = nil - lnk, err := node.MakeLink(that) + lnk, err := ipld.MakeLink(that) if err != nil { return err } @@ -101,9 +101,9 @@ func (n *ProtoNode) AddNodeLink(name string, that node.Node) error { // AddNodeLinkClean adds a link to another node. without keeping a reference to // the child node -func (n *ProtoNode) AddNodeLinkClean(name string, that node.Node) error { +func (n *ProtoNode) AddNodeLinkClean(name string, that ipld.Node) error { n.encoded = nil - lnk, err := node.MakeLink(that) + lnk, err := ipld.MakeLink(that) if err != nil { return err } @@ -113,9 +113,9 @@ func (n *ProtoNode) AddNodeLinkClean(name string, that node.Node) error { } // AddRawLink adds a copy of a link to this node -func (n *ProtoNode) AddRawLink(name string, l *node.Link) error { +func (n *ProtoNode) AddRawLink(name string, l *ipld.Link) error { n.encoded = nil - n.links = append(n.links, &node.Link{ + n.links = append(n.links, &ipld.Link{ Name: name, Size: l.Size, Cid: l.Cid, @@ -127,7 +127,7 @@ func (n *ProtoNode) AddRawLink(name string, l *node.Link) error { // RemoveNodeLink removes a link on this node by the given name. func (n *ProtoNode) RemoveNodeLink(name string) error { n.encoded = nil - good := make([]*node.Link, 0, len(n.links)) + good := make([]*ipld.Link, 0, len(n.links)) var found bool for _, l := range n.links { @@ -140,17 +140,17 @@ func (n *ProtoNode) RemoveNodeLink(name string) error { n.links = good if !found { - return node.ErrNotFound + return ipld.ErrNotFound } return nil } // GetNodeLink returns a copy of the link with the given name. -func (n *ProtoNode) GetNodeLink(name string) (*node.Link, error) { +func (n *ProtoNode) GetNodeLink(name string) (*ipld.Link, error) { for _, l := range n.links { if l.Name == name { - return &node.Link{ + return &ipld.Link{ Name: l.Name, Size: l.Size, Cid: l.Cid, @@ -161,7 +161,7 @@ func (n *ProtoNode) GetNodeLink(name string) (*node.Link, error) { } // GetLinkedProtoNode returns a copy of the ProtoNode with the given name. -func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds node.DAGService, name string) (*ProtoNode, error) { +func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds ipld.DAGService, name string) (*ProtoNode, error) { nd, err := n.GetLinkedNode(ctx, ds, name) if err != nil { return nil, err @@ -176,7 +176,7 @@ func (n *ProtoNode) GetLinkedProtoNode(ctx context.Context, ds node.DAGService, } // GetLinkedNode returns a copy of the IPLD Node with the given name. -func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds node.DAGService, name string) (node.Node, error) { +func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds ipld.DAGService, name string) (ipld.Node, error) { lnk, err := n.GetNodeLink(name) if err != nil { return nil, err @@ -187,7 +187,7 @@ func (n *ProtoNode) GetLinkedNode(ctx context.Context, ds node.DAGService, name // Copy returns a copy of the node. // NOTE: Does not make copies of Node objects in the links. -func (n *ProtoNode) Copy() node.Node { +func (n *ProtoNode) Copy() ipld.Node { nnode := new(ProtoNode) if len(n.data) > 0 { nnode.data = make([]byte, len(n.data)) @@ -195,7 +195,7 @@ func (n *ProtoNode) Copy() node.Node { } if len(n.links) > 0 { - nnode.links = make([]*node.Link, len(n.links)) + nnode.links = make([]*ipld.Link, len(n.links)) copy(nnode.links, n.links) } @@ -244,7 +244,7 @@ func (n *ProtoNode) Size() (uint64, error) { } // Stat returns statistics on the node. -func (n *ProtoNode) Stat() (*node.NodeStat, error) { +func (n *ProtoNode) Stat() (*ipld.NodeStat, error) { enc, err := n.EncodeProtobuf(false) if err != nil { return nil, err @@ -255,7 +255,7 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) { return nil, err } - return &node.NodeStat{ + return &ipld.NodeStat{ Hash: n.Cid().String(), NumLinks: len(n.links), BlockSize: len(enc), @@ -274,7 +274,7 @@ func (n *ProtoNode) Loggable() map[string]interface{} { func (n *ProtoNode) UnmarshalJSON(b []byte) error { s := struct { Data []byte `json:"data"` - Links []*node.Link `json:"links"` + Links []*ipld.Link `json:"links"` }{} err := json.Unmarshal(b, &s) @@ -332,11 +332,11 @@ func (n *ProtoNode) Multihash() mh.Multihash { return n.cached.Hash() } -func (n *ProtoNode) Links() []*node.Link { +func (n *ProtoNode) Links() []*ipld.Link { return n.links } -func (n *ProtoNode) SetLinks(links []*node.Link) { +func (n *ProtoNode) SetLinks(links []*ipld.Link) { n.links = links } @@ -344,7 +344,7 @@ func (n *ProtoNode) Resolve(path []string) (interface{}, []string, error) { return n.ResolveLink(path) } -func (n *ProtoNode) ResolveLink(path []string) (*node.Link, []string, error) { +func (n *ProtoNode) ResolveLink(path []string) (*ipld.Link, []string, error) { if len(path) == 0 { return nil, nil, fmt.Errorf("end of path, no more links to resolve") } diff --git a/merkledag/node_test.go b/merkledag/node_test.go index 4b6a412d222..273aaa5b492 100644 --- a/merkledag/node_test.go +++ b/merkledag/node_test.go @@ -8,12 +8,12 @@ import ( . "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestRemoveLink(t *testing.T) { nd := &ProtoNode{} - nd.SetLinks([]*node.Link{ + nd.SetLinks([]*ipld.Link{ {Name: "a"}, {Name: "b"}, {Name: "a"}, @@ -41,7 +41,7 @@ func TestRemoveLink(t *testing.T) { // should fail err = nd.RemoveNodeLink("a") - if err != node.ErrNotFound { + if err != ipld.ErrNotFound { t.Fatal("should have failed to remove link") } @@ -72,7 +72,7 @@ func TestFindLink(t *testing.T) { kEmpty := ndEmpty.Cid() nd := &ProtoNode{} - nd.SetLinks([]*node.Link{ + nd.SetLinks([]*ipld.Link{ {Name: "a", Cid: kEmpty}, {Name: "c", Cid: kEmpty}, {Name: "b", Cid: kEmpty}, @@ -119,7 +119,7 @@ func TestFindLink(t *testing.T) { func TestNodeCopy(t *testing.T) { nd := &ProtoNode{} - nd.SetLinks([]*node.Link{ + nd.SetLinks([]*ipld.Link{ {Name: "a"}, {Name: "c"}, {Name: "b"}, @@ -137,7 +137,7 @@ func TestNodeCopy(t *testing.T) { func TestJsonRoundtrip(t *testing.T) { nd := new(ProtoNode) - nd.SetLinks([]*node.Link{ + nd.SetLinks([]*ipld.Link{ {Name: "a"}, {Name: "c"}, {Name: "b"}, diff --git a/merkledag/raw.go b/merkledag/raw.go index 2d195dd5a95..33f881550db 100644 --- a/merkledag/raw.go +++ b/merkledag/raw.go @@ -6,7 +6,7 @@ import ( u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type RawNode struct { @@ -24,7 +24,7 @@ func NewRawNode(data []byte) *RawNode { } // DecodeRawBlock is a block decoder for raw IPLD nodes conforming to `node.DecodeBlockFunc`. -func DecodeRawBlock(block blocks.Block) (node.Node, error) { +func DecodeRawBlock(block blocks.Block) (ipld.Node, error) { if block.Cid().Type() != cid.Raw { return nil, fmt.Errorf("raw nodes cannot be decoded from non-raw blocks: %d", block.Cid().Type()) } @@ -32,7 +32,7 @@ func DecodeRawBlock(block blocks.Block) (node.Node, error) { return &RawNode{block}, nil } -var _ node.DecodeBlockFunc = DecodeRawBlock +var _ ipld.DecodeBlockFunc = DecodeRawBlock // NewRawNodeWPrefix creates a RawNode with the hash function // specified in prefix. @@ -52,11 +52,11 @@ func NewRawNodeWPrefix(data []byte, prefix cid.Prefix) (*RawNode, error) { return &RawNode{blk}, nil } -func (rn *RawNode) Links() []*node.Link { +func (rn *RawNode) Links() []*ipld.Link { return nil } -func (rn *RawNode) ResolveLink(path []string) (*node.Link, []string, error) { +func (rn *RawNode) ResolveLink(path []string) (*ipld.Link, []string, error) { return nil, nil, ErrLinkNotFound } @@ -68,7 +68,7 @@ func (rn *RawNode) Tree(p string, depth int) []string { return nil } -func (rn *RawNode) Copy() node.Node { +func (rn *RawNode) Copy() ipld.Node { copybuf := make([]byte, len(rn.RawData())) copy(copybuf, rn.RawData()) nblk, err := blocks.NewBlockWithCid(rn.RawData(), rn.Cid()) @@ -84,11 +84,11 @@ func (rn *RawNode) Size() (uint64, error) { return uint64(len(rn.RawData())), nil } -func (rn *RawNode) Stat() (*node.NodeStat, error) { - return &node.NodeStat{ +func (rn *RawNode) Stat() (*ipld.NodeStat, error) { + return &ipld.NodeStat{ CumulativeSize: len(rn.RawData()), DataSize: len(rn.RawData()), }, nil } -var _ node.Node = (*RawNode)(nil) +var _ ipld.Node = (*RawNode)(nil) diff --git a/merkledag/test/utils.go b/merkledag/test/utils.go index b4a180ac6e4..efaec1d4534 100644 --- a/merkledag/test/utils.go +++ b/merkledag/test/utils.go @@ -8,11 +8,11 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Mock returns a new thread-safe, mock DAGService. -func Mock() node.DAGService { +func Mock() ipld.DAGService { return dag.NewDAGService(Bserv()) } diff --git a/merkledag/traverse/traverse.go b/merkledag/traverse/traverse.go index d12c9f3014c..c649cb02a64 100644 --- a/merkledag/traverse/traverse.go +++ b/merkledag/traverse/traverse.go @@ -5,7 +5,7 @@ import ( "context" "errors" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Order is an identifier for traversal algorithm orders @@ -19,7 +19,7 @@ const ( // Options specifies a series of traversal options type Options struct { - DAG node.NodeGetter // the dagservice to fetch nodes + DAG ipld.NodeGetter // the dagservice to fetch nodes Order Order // what order to traverse in Func Func // the function to perform at each step ErrFunc ErrFunc // see ErrFunc. Optional @@ -29,7 +29,7 @@ type Options struct { // State is a current traversal state type State struct { - Node node.Node + Node ipld.Node Depth int } @@ -38,7 +38,7 @@ type traversal struct { seen map[string]struct{} } -func (t *traversal) shouldSkip(n node.Node) (bool, error) { +func (t *traversal) shouldSkip(n ipld.Node) (bool, error) { if t.opts.SkipDuplicates { k := n.Cid() if _, found := t.seen[k.KeyString()]; found { @@ -58,9 +58,9 @@ func (t *traversal) callFunc(next State) error { // stop processing. if it returns a nil node, just skip it. // // the error handling is a little complicated. -func (t *traversal) getNode(link *node.Link) (node.Node, error) { +func (t *traversal) getNode(link *ipld.Link) (ipld.Node, error) { - getNode := func(l *node.Link) (node.Node, error) { + getNode := func(l *ipld.Link) (ipld.Node, error) { next, err := l.GetNode(context.TODO(), t.opts.DAG) if err != nil { return nil, err @@ -98,7 +98,7 @@ type Func func(current State) error // type ErrFunc func(err error) error -func Traverse(root node.Node, o Options) error { +func Traverse(root ipld.Node, o Options) error { t := traversal{ opts: o, seen: map[string]struct{}{}, diff --git a/merkledag/traverse/traverse_test.go b/merkledag/traverse/traverse_test.go index 8c32a69345d..c9fcb4136aa 100644 --- a/merkledag/traverse/traverse_test.go +++ b/merkledag/traverse/traverse_test.go @@ -9,7 +9,7 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" mdagtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestDFSPreNoSkip(t *testing.T) { @@ -324,7 +324,7 @@ func TestBFSSkip(t *testing.T) { `)) } -func testWalkOutputs(t *testing.T, root node.Node, opts Options, expect []byte) { +func testWalkOutputs(t *testing.T, root ipld.Node, opts Options, expect []byte) { expect = bytes.TrimLeft(expect, "\n") buf := new(bytes.Buffer) @@ -351,7 +351,7 @@ func testWalkOutputs(t *testing.T, root node.Node, opts Options, expect []byte) } } -func newFan(t *testing.T, ds node.DAGService) node.Node { +func newFan(t *testing.T, ds ipld.DAGService) ipld.Node { a := mdag.NodeWithData([]byte("/a")) addLink(t, ds, a, child(t, ds, a, "aa")) addLink(t, ds, a, child(t, ds, a, "ab")) @@ -360,7 +360,7 @@ func newFan(t *testing.T, ds node.DAGService) node.Node { return a } -func newLinkedList(t *testing.T, ds node.DAGService) node.Node { +func newLinkedList(t *testing.T, ds ipld.DAGService) ipld.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") aaa := child(t, ds, aa, "aaa") @@ -373,7 +373,7 @@ func newLinkedList(t *testing.T, ds node.DAGService) node.Node { return a } -func newBinaryTree(t *testing.T, ds node.DAGService) node.Node { +func newBinaryTree(t *testing.T, ds ipld.DAGService) ipld.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") ab := child(t, ds, a, "ab") @@ -386,7 +386,7 @@ func newBinaryTree(t *testing.T, ds node.DAGService) node.Node { return a } -func newBinaryDAG(t *testing.T, ds node.DAGService) node.Node { +func newBinaryDAG(t *testing.T, ds ipld.DAGService) ipld.Node { a := mdag.NodeWithData([]byte("/a")) aa := child(t, ds, a, "aa") aaa := child(t, ds, aa, "aaa") @@ -403,7 +403,7 @@ func newBinaryDAG(t *testing.T, ds node.DAGService) node.Node { return a } -func addLink(t *testing.T, ds node.DAGService, a, b node.Node) { +func addLink(t *testing.T, ds ipld.DAGService, a, b ipld.Node) { to := string(a.(*mdag.ProtoNode).Data()) + "2" + string(b.(*mdag.ProtoNode).Data()) if err := ds.Add(context.Background(), b); err != nil { t.Error(err) @@ -413,6 +413,6 @@ func addLink(t *testing.T, ds node.DAGService, a, b node.Node) { } } -func child(t *testing.T, ds node.DAGService, a node.Node, name string) node.Node { +func child(t *testing.T, ds ipld.DAGService, a ipld.Node, name string) ipld.Node { return mdag.NodeWithData([]byte(string(a.(*mdag.ProtoNode).Data()) + "/" + name)) } diff --git a/merkledag/utils/diff.go b/merkledag/utils/diff.go index 5dfd37fb75b..648e9b2c3d4 100644 --- a/merkledag/utils/diff.go +++ b/merkledag/utils/diff.go @@ -8,7 +8,7 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const ( @@ -38,7 +38,7 @@ func (c *Change) String() string { } // ApplyChange applies the requested changes to the given node in the given dag. -func ApplyChange(ctx context.Context, ds node.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error) { +func ApplyChange(ctx context.Context, ds ipld.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error) { e := NewDagEditor(nd, ds) for _, c := range cs { switch c.Type { @@ -90,7 +90,7 @@ func ApplyChange(ctx context.Context, ds node.DAGService, nd *dag.ProtoNode, cs } // Diff returns a set of changes that transform node 'a' into node 'b' -func Diff(ctx context.Context, ds node.DAGService, a, b node.Node) ([]*Change, error) { +func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, error) { if len(a.Links()) == 0 && len(b.Links()) == 0 { return []*Change{ &Change{ diff --git a/merkledag/utils/diffenum.go b/merkledag/utils/diffenum.go index 1dc8e4ecd88..d815102e715 100644 --- a/merkledag/utils/diffenum.go +++ b/merkledag/utils/diffenum.go @@ -7,13 +7,13 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DiffEnumerate fetches every object in the graph pointed to by 'to' that is // not in 'from'. This can be used to more efficiently fetch a graph if you can // guarantee you already have the entirety of 'from' -func DiffEnumerate(ctx context.Context, dserv node.NodeGetter, from, to *cid.Cid) error { +func DiffEnumerate(ctx context.Context, dserv ipld.NodeGetter, from, to *cid.Cid) error { fnd, err := dserv.Get(ctx, from) if err != nil { return fmt.Errorf("get %s: %s", from, err) @@ -64,9 +64,9 @@ type diffpair struct { // getLinkDiff returns a changeset between nodes 'a' and 'b'. Currently does // not log deletions as our usecase doesnt call for this. -func getLinkDiff(a, b node.Node) []diffpair { - ina := make(map[string]*node.Link) - inb := make(map[string]*node.Link) +func getLinkDiff(a, b ipld.Node) []diffpair { + ina := make(map[string]*ipld.Link) + inb := make(map[string]*ipld.Link) var aonly []*cid.Cid for _, l := range b.Links() { inb[l.Cid.KeyString()] = l diff --git a/merkledag/utils/diffenum_test.go b/merkledag/utils/diffenum_test.go index 5fd463aec82..bc9728fe7b8 100644 --- a/merkledag/utils/diffenum_test.go +++ b/merkledag/utils/diffenum_test.go @@ -9,10 +9,10 @@ import ( mdtest "github.com/ipfs/go-ipfs/merkledag/test" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) -func buildNode(name string, desc map[string]ndesc, out map[string]node.Node) node.Node { +func buildNode(name string, desc map[string]ndesc, out map[string]ipld.Node) ipld.Node { this := desc[name] nd := new(dag.ProtoNode) nd.SetData([]byte(name)) @@ -33,8 +33,8 @@ func buildNode(name string, desc map[string]ndesc, out map[string]node.Node) nod type ndesc map[string]string -func mkGraph(desc map[string]ndesc) map[string]node.Node { - out := make(map[string]node.Node) +func mkGraph(desc map[string]ndesc) map[string]ipld.Node { + out := make(map[string]ipld.Node) for name := range desc { if _, ok := out[name]; ok { continue @@ -154,11 +154,11 @@ func TestDiffEnumBasic(t *testing.T) { } type getLogger struct { - ds node.NodeGetter + ds ipld.NodeGetter log []*cid.Cid } -func (gl *getLogger) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { +func (gl *getLogger) Get(ctx context.Context, c *cid.Cid) (ipld.Node, error) { nd, err := gl.ds.Get(ctx, c) if err != nil { return nil, err @@ -167,8 +167,8 @@ func (gl *getLogger) Get(ctx context.Context, c *cid.Cid) (node.Node, error) { return nd, nil } -func (gl *getLogger) GetMany(ctx context.Context, cids []*cid.Cid) <-chan *node.NodeOption { - outCh := make(chan *node.NodeOption, len(cids)) +func (gl *getLogger) GetMany(ctx context.Context, cids []*cid.Cid) <-chan *ipld.NodeOption { + outCh := make(chan *ipld.NodeOption, len(cids)) nds := gl.ds.GetMany(ctx, cids) for no := range nds { if no.Err == nil { @@ -211,7 +211,7 @@ func TestDiffEnumFail(t *testing.T) { } err := DiffEnumerate(ctx, lgds, nds["a1"].Cid(), nds["a2"].Cid()) - if err != node.ErrNotFound { + if err != ipld.ErrNotFound { t.Fatal("expected err not found") } diff --git a/merkledag/utils/utils.go b/merkledag/utils/utils.go index eb4413f155b..ed8eec07c43 100644 --- a/merkledag/utils/utils.go +++ b/merkledag/utils/utils.go @@ -12,7 +12,7 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" syncds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type Editor struct { @@ -20,15 +20,15 @@ type Editor struct { // tmp is a temporary in memory (for now) dagstore for all of the // intermediary nodes to be stored in - tmp node.DAGService + tmp ipld.DAGService // src is the dagstore with *all* of the data on it, it is used to pull // nodes from for modification (nil is a valid value) - src node.DAGService + src ipld.DAGService } // NewMemoryDagService returns a new, thread-safe in-memory DAGService. -func NewMemoryDagService() node.DAGService { +func NewMemoryDagService() ipld.DAGService { // build mem-datastore for editor's intermediary nodes bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) bsrv := bserv.New(bs, offline.Exchange(bs)) @@ -39,7 +39,7 @@ func NewMemoryDagService() node.DAGService { // // * root is the node to be modified // * source is the dagstore to pull nodes from (optional) -func NewDagEditor(root *dag.ProtoNode, source node.DAGService) *Editor { +func NewDagEditor(root *dag.ProtoNode, source ipld.DAGService) *Editor { return &Editor{ root: root, tmp: NewMemoryDagService(), @@ -53,11 +53,11 @@ func (e *Editor) GetNode() *dag.ProtoNode { } // GetDagService returns the DAGService used by this editor. -func (e *Editor) GetDagService() node.DAGService { +func (e *Editor) GetDagService() ipld.DAGService { return e.tmp } -func addLink(ctx context.Context, ds node.DAGService, root *dag.ProtoNode, childname string, childnd node.Node) (*dag.ProtoNode, error) { +func addLink(ctx context.Context, ds ipld.DAGService, root *dag.ProtoNode, childname string, childnd ipld.Node) (*dag.ProtoNode, error) { if childname == "" { return nil, errors.New("cannot create link with no name") } @@ -83,7 +83,7 @@ func addLink(ctx context.Context, ds node.DAGService, root *dag.ProtoNode, child return root, nil } -func (e *Editor) InsertNodeAtPath(ctx context.Context, pth string, toinsert node.Node, create func() *dag.ProtoNode) error { +func (e *Editor) InsertNodeAtPath(ctx context.Context, pth string, toinsert ipld.Node, create func() *dag.ProtoNode) error { splpath := path.SplitList(pth) nd, err := e.insertNodeAtPath(ctx, e.root, splpath, toinsert, create) if err != nil { @@ -93,7 +93,7 @@ func (e *Editor) InsertNodeAtPath(ctx context.Context, pth string, toinsert node return nil } -func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path []string, toinsert node.Node, create func() *dag.ProtoNode) (*dag.ProtoNode, error) { +func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path []string, toinsert ipld.Node, create func() *dag.ProtoNode) (*dag.ProtoNode, error) { if len(path) == 1 { return addLink(ctx, e.tmp, root, path[0], toinsert) } @@ -104,7 +104,7 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.ProtoNode, path if err == dag.ErrLinkNotFound && create != nil { nd = create() err = nil // no longer an error case - } else if err == node.ErrNotFound { + } else if err == ipld.ErrNotFound { // try finding it in our source dagstore nd, err = root.GetLinkedProtoNode(ctx, e.src, path[0]) } @@ -165,7 +165,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) // search for node in both tmp dagstore and source dagstore nd, err := root.GetLinkedProtoNode(ctx, e.tmp, path[0]) - if err == node.ErrNotFound { + if err == ipld.ErrNotFound { nd, err = root.GetLinkedProtoNode(ctx, e.src, path[0]) } @@ -196,13 +196,13 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.ProtoNode, path []string) // Finalize writes the new DAG to the given DAGService and returns the modified // root node. -func (e *Editor) Finalize(ctx context.Context, ds node.DAGService) (*dag.ProtoNode, error) { +func (e *Editor) Finalize(ctx context.Context, ds ipld.DAGService) (*dag.ProtoNode, error) { nd := e.GetNode() err := copyDag(ctx, nd, e.tmp, ds) return nd, err } -func copyDag(ctx context.Context, nd node.Node, from, to node.DAGService) error { +func copyDag(ctx context.Context, nd ipld.Node, from, to ipld.DAGService) error { // TODO(#4609): make this batch. err := to.Add(ctx, nd) if err != nil { @@ -212,7 +212,7 @@ func copyDag(ctx context.Context, nd node.Node, from, to node.DAGService) error for _, lnk := range nd.Links() { child, err := lnk.GetNode(ctx, from) if err != nil { - if err == node.ErrNotFound { + if err == ipld.ErrNotFound { // not found means we didnt modify it, and it should // already be in the target datastore continue diff --git a/merkledag/utils/utils_test.go b/merkledag/utils/utils_test.go index 345bd2928b2..eb440c39cf7 100644 --- a/merkledag/utils/utils_test.go +++ b/merkledag/utils/utils_test.go @@ -9,7 +9,7 @@ import ( path "github.com/ipfs/go-ipfs/path" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func TestAddLink(t *testing.T) { @@ -41,7 +41,7 @@ func TestAddLink(t *testing.T) { } } -func assertNodeAtPath(t *testing.T, ds node.DAGService, root *dag.ProtoNode, pth string, exp *cid.Cid) { +func assertNodeAtPath(t *testing.T, ds ipld.DAGService, root *dag.ProtoNode, pth string, exp *cid.Cid) { parts := path.SplitList(pth) cur := root for _, e := range parts { diff --git a/mfs/dir.go b/mfs/dir.go index 901f69952f1..08b703fb26d 100644 --- a/mfs/dir.go +++ b/mfs/dir.go @@ -16,7 +16,7 @@ import ( ufspb "github.com/ipfs/go-ipfs/unixfs/pb" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotYetImplemented = errors.New("not yet implemented") @@ -24,7 +24,7 @@ var ErrInvalidChild = errors.New("invalid child node") var ErrDirExists = errors.New("directory already has entry by that name") type Directory struct { - dserv node.DAGService + dserv ipld.DAGService parent childCloser childDirs map[string]*Directory @@ -44,7 +44,7 @@ type Directory struct { // // You probably don't want to call this directly. Instead, construct a new root // using NewRoot. -func NewDirectory(ctx context.Context, name string, node node.Node, parent childCloser, dserv node.DAGService) (*Directory, error) { +func NewDirectory(ctx context.Context, name string, node ipld.Node, parent childCloser, dserv ipld.DAGService) (*Directory, error) { db, err := uio.NewDirectoryFromNode(dserv, node) if err != nil { return nil, err @@ -74,7 +74,7 @@ func (d *Directory) SetPrefix(prefix *cid.Prefix) { // closeChild updates the child by the given name to the dag node 'nd' // and changes its own dag node -func (d *Directory) closeChild(name string, nd node.Node, sync bool) error { +func (d *Directory) closeChild(name string, nd ipld.Node, sync bool) error { mynd, err := d.closeChildUpdate(name, nd, sync) if err != nil { return err @@ -87,7 +87,7 @@ func (d *Directory) closeChild(name string, nd node.Node, sync bool) error { } // closeChildUpdate is the portion of closeChild that needs to be locked around -func (d *Directory) closeChildUpdate(name string, nd node.Node, sync bool) (*dag.ProtoNode, error) { +func (d *Directory) closeChildUpdate(name string, nd ipld.Node, sync bool) (*dag.ProtoNode, error) { d.lock.Lock() defer d.lock.Unlock() @@ -121,7 +121,7 @@ func (d *Directory) flushCurrentNode() (*dag.ProtoNode, error) { return pbnd.Copy().(*dag.ProtoNode), nil } -func (d *Directory) updateChild(name string, nd node.Node) error { +func (d *Directory) updateChild(name string, nd ipld.Node) error { err := d.dirbuilder.AddChild(d.ctx, name, nd) if err != nil { return err @@ -148,7 +148,7 @@ func (d *Directory) childNode(name string) (FSNode, error) { } // cacheNode caches a node into d.childDirs or d.files and returns the FSNode. -func (d *Directory) cacheNode(name string, nd node.Node) (FSNode, error) { +func (d *Directory) cacheNode(name string, nd ipld.Node) (FSNode, error) { switch nd := nd.(type) { case *dag.ProtoNode: i, err := ft.FromBytes(nd.Data()) @@ -205,7 +205,7 @@ func (d *Directory) Uncache(name string) { // childFromDag searches through this directories dag node for a child link // with the given name -func (d *Directory) childFromDag(name string) (node.Node, error) { +func (d *Directory) childFromDag(name string) (ipld.Node, error) { return d.dirbuilder.Find(d.ctx, name) } @@ -237,7 +237,7 @@ func (d *Directory) ListNames(ctx context.Context) ([]string, error) { defer d.lock.Unlock() var out []string - err := d.dirbuilder.ForEachLink(ctx, func(l *node.Link) error { + err := d.dirbuilder.ForEachLink(ctx, func(l *ipld.Link) error { out = append(out, l.Name) return nil }) @@ -262,7 +262,7 @@ func (d *Directory) List(ctx context.Context) ([]NodeListing, error) { func (d *Directory) ForEachEntry(ctx context.Context, f func(NodeListing) error) error { d.lock.Lock() defer d.lock.Unlock() - return d.dirbuilder.ForEachLink(ctx, func(l *node.Link) error { + return d.dirbuilder.ForEachLink(ctx, func(l *ipld.Link) error { c, err := d.childUnsync(l.Name) if err != nil { return err @@ -349,7 +349,7 @@ func (d *Directory) Flush() error { } // AddChild adds the node 'nd' under this directory giving it the name 'name' -func (d *Directory) AddChild(name string, nd node.Node) error { +func (d *Directory) AddChild(name string, nd ipld.Node) error { d.lock.Lock() defer d.lock.Unlock() @@ -410,7 +410,7 @@ func (d *Directory) Path() string { return out } -func (d *Directory) GetNode() (node.Node, error) { +func (d *Directory) GetNode() (ipld.Node, error) { d.lock.Lock() defer d.lock.Unlock() diff --git a/mfs/file.go b/mfs/file.go index 033965fa204..496b05d8e65 100644 --- a/mfs/file.go +++ b/mfs/file.go @@ -10,7 +10,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" mod "github.com/ipfs/go-ipfs/unixfs/mod" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type File struct { @@ -20,8 +20,8 @@ type File struct { desclock sync.RWMutex - dserv node.DAGService - node node.Node + dserv ipld.DAGService + node ipld.Node nodelk sync.Mutex RawLeaves bool @@ -29,7 +29,7 @@ type File struct { // NewFile returns a NewFile object with the given parameters. If the // Cid version is non-zero RawLeaves will be enabled. -func NewFile(name string, node node.Node, parent childCloser, dserv node.DAGService) (*File, error) { +func NewFile(name string, node ipld.Node, parent childCloser, dserv ipld.DAGService) (*File, error) { fi := &File{ dserv: dserv, parent: parent, @@ -115,7 +115,7 @@ func (fi *File) Size() (int64, error) { } // GetNode returns the dag node associated with this file -func (fi *File) GetNode() (node.Node, error) { +func (fi *File) GetNode() (ipld.Node, error) { fi.nodelk.Lock() defer fi.nodelk.Unlock() return fi.node, nil diff --git a/mfs/mfs_test.go b/mfs/mfs_test.go index 3745d88871b..5db5d4987b8 100644 --- a/mfs/mfs_test.go +++ b/mfs/mfs_test.go @@ -28,26 +28,26 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" dssync "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/sync" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func emptyDirNode() *dag.ProtoNode { return dag.NodeWithData(ft.FolderPBData()) } -func getDagserv(t *testing.T) node.DAGService { +func getDagserv(t *testing.T) ipld.DAGService { db := dssync.MutexWrap(ds.NewMapDatastore()) bs := bstore.NewBlockstore(db) blockserv := bserv.New(bs, offline.Exchange(bs)) return dag.NewDAGService(blockserv) } -func getRandFile(t *testing.T, ds node.DAGService, size int64) node.Node { +func getRandFile(t *testing.T, ds ipld.DAGService, size int64) ipld.Node { r := io.LimitReader(u.NewTimeSeededRand(), size) return fileNodeFromReader(t, ds, r) } -func fileNodeFromReader(t *testing.T, ds node.DAGService, r io.Reader) node.Node { +func fileNodeFromReader(t *testing.T, ds ipld.DAGService, r io.Reader) ipld.Node { nd, err := importer.BuildDagFromReader(ds, chunk.DefaultSplitter(r)) if err != nil { t.Fatal(err) @@ -128,7 +128,7 @@ func compStrArrs(a, b []string) bool { return true } -func assertFileAtPath(ds node.DAGService, root *Directory, expn node.Node, pth string) error { +func assertFileAtPath(ds ipld.DAGService, root *Directory, expn ipld.Node, pth string) error { exp, ok := expn.(*dag.ProtoNode) if !ok { return dag.ErrNotProtobuf @@ -182,7 +182,7 @@ func assertFileAtPath(ds node.DAGService, root *Directory, expn node.Node, pth s return nil } -func catNode(ds node.DAGService, nd *dag.ProtoNode) ([]byte, error) { +func catNode(ds ipld.DAGService, nd *dag.ProtoNode) ([]byte, error) { r, err := uio.NewDagReader(context.TODO(), nd, ds) if err != nil { return nil, err @@ -192,7 +192,7 @@ func catNode(ds node.DAGService, nd *dag.ProtoNode) ([]byte, error) { return ioutil.ReadAll(r) } -func setupRoot(ctx context.Context, t *testing.T) (node.DAGService, *Root) { +func setupRoot(ctx context.Context, t *testing.T) (ipld.DAGService, *Root) { ds := getDagserv(t) root := emptyDirNode() @@ -300,7 +300,7 @@ func TestDirectoryLoadFromDag(t *testing.T) { dirhash := dir.Cid() top := emptyDirNode() - top.SetLinks([]*node.Link{ + top.SetLinks([]*ipld.Link{ { Name: "a", Cid: fihash, diff --git a/mfs/ops.go b/mfs/ops.go index 9d7182124dd..e6ad1a3bea1 100644 --- a/mfs/ops.go +++ b/mfs/ops.go @@ -10,7 +10,7 @@ import ( path "github.com/ipfs/go-ipfs/path" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Mv moves the file or directory at 'src' to 'dst' @@ -84,7 +84,7 @@ func lookupDir(r *Root, path string) (*Directory, error) { } // PutNode inserts 'nd' at 'path' in the given mfs -func PutNode(r *Root, path string, nd node.Node) error { +func PutNode(r *Root, path string, nd ipld.Node) error { dirp, filename := gopath.Split(path) if filename == "" { return fmt.Errorf("cannot create file with empty name") diff --git a/mfs/system.go b/mfs/system.go index 5c30db57c18..2150dc6211c 100644 --- a/mfs/system.go +++ b/mfs/system.go @@ -21,7 +21,7 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var ErrNotExist = errors.New("no such rootfs") @@ -31,7 +31,7 @@ var log = logging.Logger("mfs") var ErrIsDirectory = errors.New("error: is a directory") type childCloser interface { - closeChild(string, node.Node, bool) error + closeChild(string, ipld.Node, bool) error } type NodeType int @@ -43,7 +43,7 @@ const ( // FSNode represents any node (directory, root, or file) in the mfs filesystem. type FSNode interface { - GetNode() (node.Node, error) + GetNode() (ipld.Node, error) Flush() error Type() NodeType } @@ -58,7 +58,7 @@ type Root struct { repub *Republisher - dserv node.DAGService + dserv ipld.DAGService Type string } @@ -67,7 +67,7 @@ type Root struct { type PubFunc func(context.Context, *cid.Cid) error // NewRoot creates a new Root and starts up a republisher routine for it. -func NewRoot(parent context.Context, ds node.DAGService, node *dag.ProtoNode, pf PubFunc) (*Root, error) { +func NewRoot(parent context.Context, ds ipld.DAGService, node *dag.ProtoNode, pf PubFunc) (*Root, error) { var repub *Republisher if pf != nil { @@ -159,7 +159,7 @@ func (kr *Root) FlushMemFree(ctx context.Context) error { // closeChild implements the childCloser interface, and signals to the publisher that // there are changes ready to be published. -func (kr *Root) closeChild(name string, nd node.Node, sync bool) error { +func (kr *Root) closeChild(name string, nd ipld.Node, sync bool) error { err := kr.dserv.Add(context.TODO(), nd) if err != nil { return err diff --git a/path/resolver.go b/path/resolver.go index 68865283add..2609454a45c 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -11,7 +11,7 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("path") @@ -35,13 +35,13 @@ func (e ErrNoLink) Error() string { // TODO: now that this is more modular, try to unify this code with the // the resolvers in namesys type Resolver struct { - DAG node.DAGService + DAG ipld.DAGService - ResolveOnce func(ctx context.Context, ds node.DAGService, nd node.Node, names []string) (*node.Link, []string, error) + ResolveOnce func(ctx context.Context, ds ipld.DAGService, nd ipld.Node, names []string) (*ipld.Link, []string, error) } // NewBasicResolver constructs a new basic resolver. -func NewBasicResolver(ds node.DAGService) *Resolver { +func NewBasicResolver(ds ipld.DAGService) *Resolver { return &Resolver{ DAG: ds, ResolveOnce: ResolveSingle, @@ -74,7 +74,7 @@ func SplitAbsPath(fpath Path) (*cid.Cid, []string, error) { return c, parts[1:], nil } -func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath Path) (node.Node, []string, error) { +func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath Path) (ipld.Node, []string, error) { c, p, err := SplitAbsPath(fpath) if err != nil { return nil, nil, err @@ -92,7 +92,7 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath Path) (node.Node } switch val := val.(type) { - case *node.Link: + case *ipld.Link: next, err := val.GetNode(ctx, r.DAG) if err != nil { return nil, nil, err @@ -109,7 +109,7 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath Path) (node.Node // ResolvePath fetches the node for given path. It returns the last item // returned by ResolvePathComponents. -func (s *Resolver) ResolvePath(ctx context.Context, fpath Path) (node.Node, error) { +func (s *Resolver) ResolvePath(ctx context.Context, fpath Path) (ipld.Node, error) { // validate path if err := fpath.IsValid(); err != nil { return nil, err @@ -124,14 +124,14 @@ func (s *Resolver) ResolvePath(ctx context.Context, fpath Path) (node.Node, erro // ResolveSingle simply resolves one hop of a path through a graph with no // extra context (does not opaquely resolve through sharded nodes) -func ResolveSingle(ctx context.Context, ds node.DAGService, nd node.Node, names []string) (*node.Link, []string, error) { +func ResolveSingle(ctx context.Context, ds ipld.DAGService, nd ipld.Node, names []string) (*ipld.Link, []string, error) { return nd.ResolveLink(names) } // ResolvePathComponents fetches the nodes for each segment of the given path. // It uses the first path component as a hash (key) of the first node, then // resolves all other components walking the links, with ResolveLinks. -func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]node.Node, error) { +func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]ipld.Node, error) { evt := log.EventBegin(ctx, "resolvePathComponents", logging.LoggableMap{"fpath": fpath}) defer evt.Done() @@ -158,11 +158,11 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod // // ResolveLinks(nd, []string{"foo", "bar", "baz"}) // would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links -func (s *Resolver) ResolveLinks(ctx context.Context, ndd node.Node, names []string) ([]node.Node, error) { +func (s *Resolver) ResolveLinks(ctx context.Context, ndd ipld.Node, names []string) ([]ipld.Node, error) { evt := log.EventBegin(ctx, "resolveLinks", logging.LoggableMap{"names": names}) defer evt.Done() - result := make([]node.Node, 0, len(names)+1) + result := make([]ipld.Node, 0, len(names)+1) result = append(result, ndd) nd := ndd // dup arg workaround diff --git a/path/resolver_test.go b/path/resolver_test.go index 5f5a9ee50ab..d741bbcf1e5 100644 --- a/path/resolver_test.go +++ b/path/resolver_test.go @@ -10,7 +10,7 @@ import ( path "github.com/ipfs/go-ipfs/path" util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func randNode() *merkledag.ProtoNode { @@ -38,7 +38,7 @@ func TestRecurivePathResolution(t *testing.T) { t.Fatal(err) } - for _, n := range []node.Node{a, b, c} { + for _, n := range []ipld.Node{a, b, c} { err = dagService.Add(ctx, n) if err != nil { t.Fatal(err) diff --git a/pin/gc/gc.go b/pin/gc/gc.go index c3ab3db9006..f48ebacb69c 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -13,7 +13,7 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("gc") @@ -128,13 +128,13 @@ func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots // ColoredSet computes the set of nodes in the graph that are pinned by the // pins in the given pinner. -func ColoredSet(ctx context.Context, pn pin.Pinner, ng node.NodeGetter, bestEffortRoots []*cid.Cid, output chan<- Result) (*cid.Set, error) { +func ColoredSet(ctx context.Context, pn pin.Pinner, ng ipld.NodeGetter, bestEffortRoots []*cid.Cid, output chan<- Result) (*cid.Set, error) { // KeySet currently implemented in memory, in the future, may be bloom filter or // disk backed to conserve memory. errors := false gcs := cid.NewSet() - getLinks := func(ctx context.Context, cid *cid.Cid) ([]*node.Link, error) { - links, err := node.GetLinks(ctx, ng, cid) + getLinks := func(ctx context.Context, cid *cid.Cid) ([]*ipld.Link, error) { + links, err := ipld.GetLinks(ctx, ng, cid) if err != nil { errors = true output <- Result{Error: &CannotFetchLinksError{cid, err}} @@ -147,9 +147,9 @@ func ColoredSet(ctx context.Context, pn pin.Pinner, ng node.NodeGetter, bestEffo output <- Result{Error: err} } - bestEffortGetLinks := func(ctx context.Context, cid *cid.Cid) ([]*node.Link, error) { - links, err := node.GetLinks(ctx, ng, cid) - if err != nil && err != node.ErrNotFound { + bestEffortGetLinks := func(ctx context.Context, cid *cid.Cid) ([]*ipld.Link, error) { + links, err := ipld.GetLinks(ctx, ng, cid) + if err != nil && err != ipld.ErrNotFound { errors = true output <- Result{Error: &CannotFetchLinksError{cid, err}} } diff --git a/pin/pin.go b/pin/pin.go index 9387439fb5c..268d8e0049c 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -15,7 +15,7 @@ import ( ds "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("pin") @@ -102,7 +102,7 @@ type Pinner interface { IsPinnedWithType(*cid.Cid, PinMode) (string, bool, error) // Pin the given node, optionally recursively. - Pin(ctx context.Context, node node.Node, recursive bool) error + Pin(ctx context.Context, node ipld.Node, recursive bool) error // Unpin the given cid. If recursive is true, removes either a recursive or // a direct pin. If recursive is false, only removes a direct pin. @@ -178,13 +178,13 @@ type pinner struct { // Track the keys used for storing the pinning state, so gc does // not delete them. internalPin *cid.Set - dserv node.DAGService - internal node.DAGService // dagservice used to store internal objects + dserv ipld.DAGService + internal ipld.DAGService // dagservice used to store internal objects dstore ds.Datastore } // NewPinner creates a new pinner using the given datastore as a backend -func NewPinner(dstore ds.Datastore, serv, internal node.DAGService) Pinner { +func NewPinner(dstore ds.Datastore, serv, internal ipld.DAGService) Pinner { rcset := cid.NewSet() dirset := cid.NewSet() @@ -200,7 +200,7 @@ func NewPinner(dstore ds.Datastore, serv, internal node.DAGService) Pinner { } // Pin the given node, optionally recursive -func (p *pinner) Pin(ctx context.Context, node node.Node, recurse bool) error { +func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error { p.lock.Lock() defer p.lock.Unlock() err := p.dserv.Add(ctx, node) @@ -358,7 +358,7 @@ func (p *pinner) CheckIfPinned(cids ...*cid.Cid) ([]Pinned, error) { // Now walk all recursive pins to check for indirect pins var checkChildren func(*cid.Cid, *cid.Cid) error checkChildren = func(rk, parentKey *cid.Cid) error { - links, err := node.GetLinks(context.TODO(), p.dserv, parentKey) + links, err := ipld.GetLinks(context.TODO(), p.dserv, parentKey) if err != nil { return err } @@ -427,7 +427,7 @@ func cidSetWithValues(cids []*cid.Cid) *cid.Set { } // LoadPinner loads a pinner and its keysets from the given datastore -func LoadPinner(d ds.Datastore, dserv, internal node.DAGService) (Pinner, error) { +func LoadPinner(d ds.Datastore, dserv, internal ipld.DAGService) (Pinner, error) { p := new(pinner) rootKeyI, err := d.Get(pinDatastoreKey) @@ -597,8 +597,8 @@ func (p *pinner) PinWithMode(c *cid.Cid, mode PinMode) { // hasChild recursively looks for a Cid among the children of a root Cid. // The visit function can be used to shortcut already-visited branches. -func hasChild(ng node.NodeGetter, root *cid.Cid, child *cid.Cid, visit func(*cid.Cid) bool) (bool, error) { - links, err := node.GetLinks(context.TODO(), ng, root) +func hasChild(ng ipld.NodeGetter, root *cid.Cid, child *cid.Cid, visit func(*cid.Cid) bool) (bool, error) { + links, err := ipld.GetLinks(context.TODO(), ng, root) if err != nil { return false, err } diff --git a/pin/set.go b/pin/set.go index 8778df9603f..e2ba3ed112d 100644 --- a/pin/set.go +++ b/pin/set.go @@ -14,7 +14,7 @@ import ( "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) const ( @@ -39,7 +39,7 @@ type itemIterator func() (c *cid.Cid, ok bool) type keyObserver func(*cid.Cid) type sortByHash struct { - links []*node.Link + links []*ipld.Link } func (s sortByHash) Len() int { @@ -54,10 +54,10 @@ func (s sortByHash) Swap(a, b int) { s.links[a], s.links[b] = s.links[b], s.links[a] } -func storeItems(ctx context.Context, dag node.DAGService, estimatedLen uint64, depth uint32, iter itemIterator, internalKeys keyObserver) (*merkledag.ProtoNode, error) { - links := make([]*node.Link, 0, defaultFanout+maxItems) +func storeItems(ctx context.Context, dag ipld.DAGService, estimatedLen uint64, depth uint32, iter itemIterator, internalKeys keyObserver) (*merkledag.ProtoNode, error) { + links := make([]*ipld.Link, 0, defaultFanout+maxItems) for i := 0; i < defaultFanout; i++ { - links = append(links, &node.Link{Cid: emptyKey}) + links = append(links, &ipld.Link{Cid: emptyKey}) } // add emptyKey to our set of internal pinset objects @@ -85,7 +85,7 @@ func storeItems(ctx context.Context, dag node.DAGService, estimatedLen uint64, d break } - links = append(links, &node.Link{Cid: k}) + links = append(links, &ipld.Link{Cid: k}) } n.SetLinks(links) @@ -148,7 +148,7 @@ func storeItems(ctx context.Context, dag node.DAGService, estimatedLen uint64, d internalKeys(childKey) // overwrite the 'empty key' in the existing links array - n.Links()[h] = &node.Link{ + n.Links()[h] = &ipld.Link{ Cid: childKey, Size: size, } @@ -201,9 +201,9 @@ func writeHdr(n *merkledag.ProtoNode, hdr *pb.Set) error { return nil } -type walkerFunc func(idx int, link *node.Link) error +type walkerFunc func(idx int, link *ipld.Link) error -func walkItems(ctx context.Context, dag node.DAGService, n *merkledag.ProtoNode, fn walkerFunc, children keyObserver) error { +func walkItems(ctx context.Context, dag ipld.DAGService, n *merkledag.ProtoNode, fn walkerFunc, children keyObserver) error { hdr, err := readHdr(n) if err != nil { return err @@ -238,7 +238,7 @@ func walkItems(ctx context.Context, dag node.DAGService, n *merkledag.ProtoNode, return nil } -func loadSet(ctx context.Context, dag node.DAGService, root *merkledag.ProtoNode, name string, internalKeys keyObserver) ([]*cid.Cid, error) { +func loadSet(ctx context.Context, dag ipld.DAGService, root *merkledag.ProtoNode, name string, internalKeys keyObserver) ([]*cid.Cid, error) { l, err := root.GetNodeLink(name) if err != nil { return nil, err @@ -258,7 +258,7 @@ func loadSet(ctx context.Context, dag node.DAGService, root *merkledag.ProtoNode } var res []*cid.Cid - walk := func(idx int, link *node.Link) error { + walk := func(idx int, link *ipld.Link) error { res = append(res, link.Cid) return nil } @@ -281,7 +281,7 @@ func getCidListIterator(cids []*cid.Cid) itemIterator { } } -func storeSet(ctx context.Context, dag node.DAGService, cids []*cid.Cid, internalKeys keyObserver) (*merkledag.ProtoNode, error) { +func storeSet(ctx context.Context, dag ipld.DAGService, cids []*cid.Cid, internalKeys keyObserver) (*merkledag.ProtoNode, error) { iter := getCidListIterator(cids) n, err := storeItems(ctx, dag, uint64(len(cids)), 0, iter, internalKeys) diff --git a/plugin/ipld.go b/plugin/ipld.go index 71b7a8170dc..1dd9d1d8db0 100644 --- a/plugin/ipld.go +++ b/plugin/ipld.go @@ -3,7 +3,7 @@ package plugin import ( "github.com/ipfs/go-ipfs/core/coredag" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // PluginIPLD is an interface that can be implemented to add handlers for @@ -11,6 +11,6 @@ import ( type PluginIPLD interface { Plugin - RegisterBlockDecoders(dec node.BlockDecoder) error + RegisterBlockDecoders(dec ipld.BlockDecoder) error RegisterInputEncParsers(iec coredag.InputEncParsers) error } diff --git a/plugin/loader/initializer.go b/plugin/loader/initializer.go index b9e9d00f21f..c25e13f6c84 100644 --- a/plugin/loader/initializer.go +++ b/plugin/loader/initializer.go @@ -4,7 +4,7 @@ import ( "github.com/ipfs/go-ipfs/core/coredag" "github.com/ipfs/go-ipfs/plugin" - format "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) func initialize(plugins []plugin.Plugin) error { @@ -34,7 +34,7 @@ func runIPLDPlugin(pl plugin.Plugin) error { return nil } - err := ipldpl.RegisterBlockDecoders(format.DefaultBlockDecoder) + err := ipldpl.RegisterBlockDecoders(ipld.DefaultBlockDecoder) if err != nil { return err } diff --git a/tar/format.go b/tar/format.go index ee03fea3d9a..fa97ee77e7b 100644 --- a/tar/format.go +++ b/tar/format.go @@ -16,7 +16,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) var log = logging.Logger("tarfmt") @@ -36,7 +36,7 @@ func marshalHeader(h *tar.Header) ([]byte, error) { // ImportTar imports a tar file into the given DAGService and returns the root // node. -func ImportTar(ctx context.Context, r io.Reader, ds node.DAGService) (*dag.ProtoNode, error) { +func ImportTar(ctx context.Context, r io.Reader, ds ipld.DAGService) (*dag.ProtoNode, error) { tr := tar.NewReader(r) root := new(dag.ProtoNode) @@ -101,8 +101,8 @@ func escapePath(pth string) string { } type tarReader struct { - links []*node.Link - ds node.DAGService + links []*ipld.Link + ds ipld.DAGService childRead *tarReader hdrBuf *bytes.Reader @@ -198,7 +198,7 @@ func (tr *tarReader) Read(b []byte) (int, error) { // ExportTar exports the passed DAG as a tar file. This function is the inverse // of ImportTar. -func ExportTar(ctx context.Context, root *dag.ProtoNode, ds node.DAGService) (io.Reader, error) { +func ExportTar(ctx context.Context, root *dag.ProtoNode, ds ipld.DAGService) (io.Reader, error) { if string(root.Data()) != "ipfs/tar" { return nil, errors.New("not an IPFS tarchive") } diff --git a/thirdparty/posinfo/posinfo.go b/thirdparty/posinfo/posinfo.go index 8ab873a9182..ff7fdcd364a 100644 --- a/thirdparty/posinfo/posinfo.go +++ b/thirdparty/posinfo/posinfo.go @@ -3,7 +3,7 @@ package posinfo import ( "os" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) type PosInfo struct { @@ -13,6 +13,6 @@ type PosInfo struct { } type FilestoreNode struct { - node.Node + ipld.Node PosInfo *PosInfo } diff --git a/unixfs/archive/archive.go b/unixfs/archive/archive.go index 2f6dc718319..72b3e2dacdd 100644 --- a/unixfs/archive/archive.go +++ b/unixfs/archive/archive.go @@ -10,7 +10,7 @@ import ( tar "github.com/ipfs/go-ipfs/unixfs/archive/tar" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // DefaultBufSize is the buffer size for gets. for now, 1MB, which is ~4 blocks. @@ -30,7 +30,7 @@ func (i *identityWriteCloser) Close() error { } // DagArchive is equivalent to `ipfs getdag $hash | maybe_tar | maybe_gzip` -func DagArchive(ctx context.Context, nd node.Node, name string, dag node.DAGService, archive bool, compression int) (io.Reader, error) { +func DagArchive(ctx context.Context, nd ipld.Node, name string, dag ipld.DAGService, archive bool, compression int) (io.Reader, error) { _, filename := path.Split(name) diff --git a/unixfs/archive/tar/writer.go b/unixfs/archive/tar/writer.go index 9cd69666023..17614e10e6c 100644 --- a/unixfs/archive/tar/writer.go +++ b/unixfs/archive/tar/writer.go @@ -14,21 +14,21 @@ import ( upb "github.com/ipfs/go-ipfs/unixfs/pb" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" ) // Writer is a utility structure that helps to write // unixfs merkledag nodes as a tar archive format. // It wraps any io.Writer. type Writer struct { - Dag node.DAGService + Dag ipld.DAGService TarW *tar.Writer ctx context.Context } // NewWriter wraps given io.Writer. -func NewWriter(ctx context.Context, dag node.DAGService, archive bool, compression int, w io.Writer) (*Writer, error) { +func NewWriter(ctx context.Context, dag ipld.DAGService, archive bool, compression int, w io.Writer) (*Writer, error) { return &Writer{ Dag: dag, TarW: tar.NewWriter(w), @@ -41,7 +41,7 @@ func (w *Writer) writeDir(nd *mdag.ProtoNode, fpath string) error { return err } - for i, ng := range node.GetDAG(w.ctx, w.Dag, nd) { + for i, ng := range ipld.GetDAG(w.ctx, w.Dag, nd) { child, err := ng.Get(w.ctx) if err != nil { return err @@ -69,7 +69,7 @@ func (w *Writer) writeFile(nd *mdag.ProtoNode, pb *upb.Data, fpath string) error return nil } -func (w *Writer) WriteNode(nd node.Node, fpath string) error { +func (w *Writer) WriteNode(nd ipld.Node, fpath string) error { switch nd := nd.(type) { case *mdag.ProtoNode: pb := new(upb.Data) diff --git a/unixfs/hamt/hamt.go b/unixfs/hamt/hamt.go index e0b063e4f7b..80d97d8ec00 100644 --- a/unixfs/hamt/hamt.go +++ b/unixfs/hamt/hamt.go @@ -33,7 +33,7 @@ import ( proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" - node "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" + ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" "gx/ipfs/QmfJHywXQu98UeZtGJBQrPAR6AtmDjjbe3qjTo9piXHPnx/murmur3" ) @@ -57,17 +57,17 @@ type HamtShard struct { prefixPadStr string maxpadlen int - dserv node.DAGService + dserv ipld.DAGService } // child can either be another shard, or a leaf node value type child interface { - Link() (*node.Link, error) + Link() (*ipld.Link, error) Label() string } // NewHamtShard creates a new, empty HAMT shard with the given size. -func NewHamtShard(dserv node.DAGService, size int) (*HamtShard, error) { +func NewHamtShard(dserv ipld.DAGService, size int) (*HamtShard, error) { ds, err := makeHamtShard(dserv, size) if err != nil { return nil, err @@ -79,7 +79,7 @@ func NewHamtShard(dserv node.DAGService, size int) (*HamtShard, error) { return ds, nil } -func makeHamtShard(ds node.DAGService, size int) (*HamtShard, error) { +func makeHamtShard(ds ipld.DAGService, size int) (*HamtShard, error) { lg2s := int(math.Log2(float64(size))) if 1< Date: Mon, 29 Jan 2018 12:56:13 -0800 Subject: [PATCH 24/25] update go-ds-badger fixes #4524 License: MIT Signed-off-by: Steven Allen --- package.json | 4 ++-- repo/fsrepo/datastores.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 085119ab803..f218e71996d 100644 --- a/package.json +++ b/package.json @@ -464,9 +464,9 @@ }, { "author": "magik6k", - "hash": "QmeJHZio8XaK919S4pN9uJLRdt2qP2WipU7beXrejANvaB", + "hash": "Qmbjb3c2KRPVNZWSvQED8zAf12Brdbp3ksSnGdsJiytqUs", "name": "go-ds-badger", - "version": "1.4.3" + "version": "1.4.4" }, { "author": "whyrusleeping", diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index 2a6d98571ec..828d7d94c4b 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -17,8 +17,8 @@ import ( mount "gx/ipfs/QmPpegoMqhAEqjncrzArm7KVWAkCm78rqL2DPuNjhPrshg/go-datastore/syncmount" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" + badgerds "gx/ipfs/Qmbjb3c2KRPVNZWSvQED8zAf12Brdbp3ksSnGdsJiytqUs/go-ds-badger" levelds "gx/ipfs/Qmbkc8BMfEixGCeKRuGGbf34mAjTb9xPmJ8Pm5gHU7ohZ4/go-ds-leveldb" - badgerds "gx/ipfs/QmeJHZio8XaK919S4pN9uJLRdt2qP2WipU7beXrejANvaB/go-ds-badger" ) // ConfigFromMap creates a new datastore config from a map From 2379aa0dd1258f84c1cf6d17099b93347e142fbd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 29 Jan 2018 15:05:57 -0800 Subject: [PATCH 25/25] update comment to note that we're punting on this License: MIT Signed-off-by: Steven Allen --- blockservice/blockservice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 3969dad69b1..0c3261daca0 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -139,7 +139,7 @@ func (s *blockService) AddBlock(o blocks.Block) error { } if err := s.exchange.HasBlock(o); err != nil { - // TODO(stebalien): really an error? + // TODO(#4623): really an error? return errors.New("blockservice is closed") } @@ -170,7 +170,7 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error { for _, o := range toput { if err := s.exchange.HasBlock(o); err != nil { - // TODO(stebalien): Should this really *return*? + // TODO(#4623): Should this really *return*? return fmt.Errorf("blockservice is closed (%s)", err) } }