From 26a3ebf00fc6bc3b9b92e1b145330d78ca9f7b01 Mon Sep 17 00:00:00 2001 From: Overbool Date: Sun, 16 Sep 2018 01:03:49 +0800 Subject: [PATCH 01/85] fix(object): add support for raw leaves in object diff License: MIT Signed-off-by: Overbool --- dagutils/diff.go | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dagutils/diff.go b/dagutils/diff.go index 97d50c88ec4..9034db35c60 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -112,8 +112,8 @@ func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, e } var out []*Change - cleanA := a.Copy().(*dag.ProtoNode) - cleanB := b.Copy().(*dag.ProtoNode) + cleanA := a.Copy() + cleanB := b.Copy() // strip out unchanged stuff for _, lnk := range a.Links() { @@ -132,17 +132,7 @@ func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, e return nil, err } - anodepb, ok := anode.(*dag.ProtoNode) - if !ok { - return nil, dag.ErrNotProtobuf - } - - bnodepb, ok := bnode.(*dag.ProtoNode) - if !ok { - return nil, dag.ErrNotProtobuf - } - - sub, err := Diff(ctx, ds, anodepb, bnodepb) + sub, err := Diff(ctx, ds, anode, bnode) if err != nil { return nil, err } @@ -152,8 +142,12 @@ func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, e out = append(out, subc) } } - cleanA.RemoveNodeLink(l.Name) - cleanB.RemoveNodeLink(l.Name) + if cleanA, ok := cleanA.(*dag.ProtoNode); ok { + cleanA.RemoveNodeLink(l.Name) + } + if cleanB, ok := cleanB.(*dag.ProtoNode); ok { + cleanB.RemoveNodeLink(l.Name) + } } } From 5b0a94895f87bfc4c8ff686846b5d4989d33b399 Mon Sep 17 00:00:00 2001 From: Overbool Date: Mon, 17 Sep 2018 11:24:33 +0800 Subject: [PATCH 02/85] fix(object): add Diff() comment and test case License: MIT Signed-off-by: Overbool --- dagutils/diff.go | 8 +++-- test/sharness/t0052-object-diff.sh | 54 +++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/dagutils/diff.go b/dagutils/diff.go index 9034db35c60..b1c46815489 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -94,7 +94,11 @@ func ApplyChange(ctx context.Context, ds ipld.DAGService, nd *dag.ProtoNode, cs return e.Finalize(ctx, ds) } -// Diff returns a set of changes that transform node 'a' into node 'b' +// Diff returns a set of changes that transform node 'a' into node 'b'. +// It supports two nodes forms: ProtoNode and RawNode. Because we treats +// the nodes as IPLD nodes as long as possible and only convert them +// to ProtoNode when necessary: when we need to remove links, and at that point +// (if they have links to remove) we know they are not raw nodes. func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, error) { // Base case where both nodes are leaves, just compare // their CIDs. @@ -103,7 +107,7 @@ func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, e return []*Change{}, nil } return []*Change{ - &Change{ + { Type: Mod, Before: a.Cid(), After: b.Cid(), diff --git a/test/sharness/t0052-object-diff.sh b/test/sharness/t0052-object-diff.sh index 949088c27f0..eb6b0bf4525 100755 --- a/test/sharness/t0052-object-diff.sh +++ b/test/sharness/t0052-object-diff.sh @@ -15,82 +15,112 @@ test_expect_success "create some objects for testing diffs" ' echo "stuff" > foo/bar && mkdir foo/baz && A=$(ipfs add -r -q foo | tail -n1) && + AR=$(ipfs add --raw-leaves -r -q foo | tail -n1) && echo "more things" > foo/cat && B=$(ipfs add -r -q foo | tail -n1) && + BR=$(ipfs add --raw-leaves -r -q foo | tail -n1) && echo "nested" > foo/baz/dog && C=$(ipfs add -r -q foo | tail -n1) + CR=$(ipfs add --raw-leaves -r -q foo | tail -n1) echo "changed" > foo/bar && D=$(ipfs add -r -q foo | tail -n1) && + DR=$(ipfs add --raw-leaves -r -q foo | tail -n1) && echo "" > single_file && SINGLE_FILE=$(ipfs add -r -q single_file | tail -n1) && + SINGLE_FILE_RAW=$(ipfs add --raw-leaves -r -q single_file | tail -n1) && mkdir empty_dir EMPTY_DIR=$(ipfs add -r -q empty_dir | tail -n1) + EMPTY_DIR_RAW=$(ipfs add --raw-leaves -r -q empty_dir | tail -n1) ' test_expect_success "diff against self is empty" ' - ipfs object diff $A $A > diff_out + ipfs object diff $A $A > diff_out && + ipfs object diff $AR $AR > diff_raw_out ' test_expect_success "identity diff output looks good" ' printf "" > diff_exp && + printf "" > diff_raw_exp && test_cmp diff_exp diff_out + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff against self (single file) is empty" ' - ipfs object diff $SINGLE_FILE $SINGLE_FILE > diff_out + ipfs object diff $SINGLE_FILE $SINGLE_FILE > diff_out && + ipfs object diff $SINGLE_FILE_RAW $SINGLE_FILE_RAW > diff_raw_out printf "" > diff_exp && - test_cmp diff_exp diff_out + printf "" > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff against self (empty dir) is empty" ' ipfs object diff $EMPTY_DIR $EMPTY_DIR > diff_out + ipfs object diff $EMPTY_DIR_RAW $EMPTY_DIR_RAW > diff_raw_out printf "" > diff_exp && - test_cmp diff_exp diff_out + printf "" > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff added link works" ' ipfs object diff $A $B > diff_out + ipfs object diff $AR $BR > diff_raw_out ' test_expect_success "diff added link looks right" ' echo + QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A \"cat\" > diff_exp && - test_cmp diff_exp diff_out + echo + zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4 \"cat\" > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "verbose diff added link works" ' ipfs object diff -v $A $B > diff_out + ipfs object diff -v $AR $BR > diff_raw_out ' test_expect_success "verbose diff added link looks right" ' echo Added new link \"cat\" pointing to QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A. > diff_exp && - test_cmp diff_exp diff_out + echo Added new link \"cat\" pointing to zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4. > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff removed link works" ' - ipfs object diff -v $B $A > diff_out + ipfs object diff -v $B $A > diff_out && + ipfs object diff -v $BR $AR > diff_raw_out ' test_expect_success "diff removed link looks right" ' echo Removed link \"cat\" \(was QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A\). > diff_exp && - test_cmp diff_exp diff_out + echo Removed link \"cat\" \(was zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4\). > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff nested add works" ' - ipfs object diff -v $B $C > diff_out + ipfs object diff -v $B $C > diff_out && + ipfs object diff -v $BR $CR > diff_raw_out ' test_expect_success "diff looks right" ' echo Added new link \"baz/dog\" pointing to QmdNJQUTZuDpsUcec7YDuCfRfvw1w4J13DCm7YcU4VMZdS. > diff_exp && - test_cmp diff_exp diff_out + echo Added new link \"baz/dog\" pointing to zb2rhaM8wjDfi8A22dEqk89raWtViq8pjxvKQu2eaKtWhYKgE. > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff changed link works" ' - ipfs object diff -v $C $D > diff_out + ipfs object diff -v $C $D > diff_out && + ipfs object diff -v $CR $DR > diff_raw_out ' test_expect_success "diff looks right" ' echo Changed \"bar\" from QmNgd5cz2jNftnAHBhcRUGdtiaMzb5Rhjqd4etondHHST8 to QmRfFVsjSXkhFxrfWnLpMae2M4GBVsry6VAuYYcji5MiZb. > diff_exp && - test_cmp diff_exp diff_out + echo Changed \"bar\" from zb2rhdUECGnPgMJNgmghaMKdqqGdpTe9GmEJiPna488ThfLBz to zb2rhfEA1M13SPoeayrsPcKhCezgMQPjguGFLH56G8qQ2qpDn. > diff_raw_exp && + test_cmp diff_exp diff_out && + test_cmp diff_raw_exp diff_raw_out ' test_done From 7cda005a5f8bd87f112f23e8d84becd7a3690169 Mon Sep 17 00:00:00 2001 From: Overbool Date: Tue, 18 Sep 2018 08:56:01 +0800 Subject: [PATCH 03/85] test(diff): separate diff test cases License: MIT Signed-off-by: Overbool --- dagutils/diff.go | 2 +- test/sharness/t0052-object-diff.sh | 82 ++++++++++++++++++++++-------- 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/dagutils/diff.go b/dagutils/diff.go index b1c46815489..6fc92140078 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -95,7 +95,7 @@ func ApplyChange(ctx context.Context, ds ipld.DAGService, nd *dag.ProtoNode, cs } // Diff returns a set of changes that transform node 'a' into node 'b'. -// It supports two nodes forms: ProtoNode and RawNode. Because we treats +// It supports two nodes forms: ProtoNode and RawNode. Because we treat // the nodes as IPLD nodes as long as possible and only convert them // to ProtoNode when necessary: when we need to remove links, and at that point // (if they have links to remove) we know they are not raw nodes. diff --git a/test/sharness/t0052-object-diff.sh b/test/sharness/t0052-object-diff.sh index eb6b0bf4525..aa0bcd11deb 100755 --- a/test/sharness/t0052-object-diff.sh +++ b/test/sharness/t0052-object-diff.sh @@ -34,92 +34,134 @@ test_expect_success "create some objects for testing diffs" ' ' test_expect_success "diff against self is empty" ' - ipfs object diff $A $A > diff_out && - ipfs object diff $AR $AR > diff_raw_out + ipfs object diff $A $A > diff_out ' test_expect_success "identity diff output looks good" ' printf "" > diff_exp && - printf "" > diff_raw_exp && test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) against self is empty" ' + ipfs object diff $AR $AR > diff_raw_out +' + +test_expect_success "identity diff (raw-leaves) output looks good" ' + printf "" > diff_raw_exp && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff against self (single file) is empty" ' ipfs object diff $SINGLE_FILE $SINGLE_FILE > diff_out && - ipfs object diff $SINGLE_FILE_RAW $SINGLE_FILE_RAW > diff_raw_out printf "" > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) against self (single file) is empty" ' + ipfs object diff $SINGLE_FILE_RAW $SINGLE_FILE_RAW > diff_raw_out printf "" > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff against self (empty dir) is empty" ' ipfs object diff $EMPTY_DIR $EMPTY_DIR > diff_out - ipfs object diff $EMPTY_DIR_RAW $EMPTY_DIR_RAW > diff_raw_out printf "" > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) against self (empty dir) is empty" ' + ipfs object diff $EMPTY_DIR_RAW $EMPTY_DIR_RAW > diff_raw_out printf "" > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff added link works" ' ipfs object diff $A $B > diff_out - ipfs object diff $AR $BR > diff_raw_out ' test_expect_success "diff added link looks right" ' echo + QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A \"cat\" > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) added link works" ' + ipfs object diff $AR $BR > diff_raw_out +' + +test_expect_success "diff (raw-leaves) added link looks right" ' echo + zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4 \"cat\" > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "verbose diff added link works" ' ipfs object diff -v $A $B > diff_out - ipfs object diff -v $AR $BR > diff_raw_out ' test_expect_success "verbose diff added link looks right" ' echo Added new link \"cat\" pointing to QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A. > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "verbose diff (raw-leaves) added link works" ' + ipfs object diff -v $AR $BR > diff_raw_out +' + +test_expect_success "verbose diff (raw-leaves) added link looks right" ' echo Added new link \"cat\" pointing to zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4. > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff removed link works" ' - ipfs object diff -v $B $A > diff_out && - ipfs object diff -v $BR $AR > diff_raw_out + ipfs object diff -v $B $A > diff_out ' test_expect_success "diff removed link looks right" ' echo Removed link \"cat\" \(was QmUSvcqzhdfYM1KLDbM76eLPdS9ANFtkJvFuPYeZt73d7A\). > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) removed link works" ' + ipfs object diff -v $BR $AR > diff_raw_out +' + +test_expect_success "diff (raw-leaves) removed link looks right" ' echo Removed link \"cat\" \(was zb2rhmWNFDCdMjJoCZPE5b5NuU38yoRzRmEtfzb4exxk3R8g4\). > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff nested add works" ' - ipfs object diff -v $B $C > diff_out && - ipfs object diff -v $BR $CR > diff_raw_out + ipfs object diff -v $B $C > diff_out ' test_expect_success "diff looks right" ' echo Added new link \"baz/dog\" pointing to QmdNJQUTZuDpsUcec7YDuCfRfvw1w4J13DCm7YcU4VMZdS. > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) nested add works" ' + ipfs object diff -v $BR $CR > diff_raw_out +' + +test_expect_success "diff (raw-leaves) looks right" ' echo Added new link \"baz/dog\" pointing to zb2rhaM8wjDfi8A22dEqk89raWtViq8pjxvKQu2eaKtWhYKgE. > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff changed link works" ' - ipfs object diff -v $C $D > diff_out && - ipfs object diff -v $CR $DR > diff_raw_out + ipfs object diff -v $C $D > diff_out ' test_expect_success "diff looks right" ' echo Changed \"bar\" from QmNgd5cz2jNftnAHBhcRUGdtiaMzb5Rhjqd4etondHHST8 to QmRfFVsjSXkhFxrfWnLpMae2M4GBVsry6VAuYYcji5MiZb. > diff_exp && + test_cmp diff_exp diff_out +' + +test_expect_success "diff (raw-leaves) changed link works" ' + ipfs object diff -v $CR $DR > diff_raw_out +' + +test_expect_success "diff(raw-leaves) looks right" ' echo Changed \"bar\" from zb2rhdUECGnPgMJNgmghaMKdqqGdpTe9GmEJiPna488ThfLBz to zb2rhfEA1M13SPoeayrsPcKhCezgMQPjguGFLH56G8qQ2qpDn. > diff_raw_exp && - test_cmp diff_exp diff_out && test_cmp diff_raw_exp diff_raw_out ' From 47f3c4048d979b5de0ccc81856421d1a55c5a34d Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Fri, 21 Sep 2018 16:02:23 -0700 Subject: [PATCH 04/85] Add sessions to LS command Uses sessions when fetching MerkleDAG License: MIT Signed-off-by: hannahhoward --- core/commands/ls.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/commands/ls.go b/core/commands/ls.go index 566e0ad0135..a41baf642b0 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -108,9 +108,11 @@ The JSON output contains type information. } output := make([]LsObject, len(req.Arguments())) + ng := merkledag.NewSession(req.Context(), nd.DAG) + ro := merkledag.NewReadOnlyDagService(ng) for i, dagnode := range dagnodes { - dir, err := uio.NewDirectoryFromNode(nd.DAG, dagnode) + dir, err := uio.NewDirectoryFromNode(ro, dagnode) if err != nil && err != uio.ErrNotADir { res.SetError(fmt.Errorf("the data in %s (at %q) is not a UnixFS directory: %s", dagnode.Cid(), paths[i], err), cmdkit.ErrNormal) return From 7b9cfda0841db03a1292cd0198ada14c061be2af Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 4 Jul 2018 10:50:57 -0700 Subject: [PATCH 05/85] add support for datastore plugins License: MIT Signed-off-by: Jeromy --- plugin/datastore.go | 14 ++++++++++++++ plugin/loader/initializer.go | 8 +++++++- repo/fsrepo/datastores.go | 17 ++++++++++++++++- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 plugin/datastore.go diff --git a/plugin/datastore.go b/plugin/datastore.go new file mode 100644 index 00000000000..735eedc9d76 --- /dev/null +++ b/plugin/datastore.go @@ -0,0 +1,14 @@ +package plugin + +import ( + "github.com/ipfs/go-ipfs/repo/fsrepo" +) + +// PluginDatastore is an interface that can be implemented to add handlers for +// for different datastores +type PluginDatastore interface { + Plugin + + DatastoreTypeName() string + DatastoreConfigParser() fsrepo.ConfigFromMap +} diff --git a/plugin/loader/initializer.go b/plugin/loader/initializer.go index 10e0fc11258..9d03dfeeaba 100644 --- a/plugin/loader/initializer.go +++ b/plugin/loader/initializer.go @@ -3,8 +3,9 @@ package loader import ( "github.com/ipfs/go-ipfs/core/coredag" "github.com/ipfs/go-ipfs/plugin" - "gx/ipfs/QmWLWmRVSiagqP15jczsGME1qpob6HDbtbHAY2he9W5iUo/opentracing-go" + "github.com/ipfs/go-ipfs/repo/fsrepo" + "gx/ipfs/QmWLWmRVSiagqP15jczsGME1qpob6HDbtbHAY2he9W5iUo/opentracing-go" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -32,6 +33,11 @@ func run(plugins []plugin.Plugin) error { if err != nil { return err } + case plugin.PluginDatastore: + err := fsrepo.AddDatastoreConfigHandler(pl.DatastoreTypeName(), pl.DatastoreConfigParser()) + if err != nil { + return err + } default: panic(pl) } diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index 111aaad89cb..ab8b0696f91 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -36,7 +36,12 @@ type DatastoreConfig interface { Create(path string) (repo.Datastore, error) } -// DiskSpec is the type returned by the DatastoreConfig's DiskSpec method +// DiskSpec is a minimal representation of the characteristic values of the +// datastore. If two diskspecs are the same, the loader assumes that they refer +// to exactly the same datastore. If they differ at all, it is assumed they are +// completely different datastores and a migration will be performed. Runtime +// values such as cache options or concurrency options should not be added +// here. type DiskSpec map[string]interface{} // Bytes returns a minimal JSON encoding of the DiskSpec @@ -68,6 +73,16 @@ func init() { } } +func AddDatastoreConfigHandler(name string, dsc ConfigFromMap) error { + _, ok := datastores[name] + if ok { + return fmt.Errorf("already have a datastore named %q", name) + } + + datastores[name] = dsc + return nil +} + // AnyDatastoreConfig returns a DatastoreConfig from a spec based on // the "type" parameter func AnyDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error) { From c6daf934ea355b6115ec7222e00aef969ef1783a Mon Sep 17 00:00:00 2001 From: Overbool Date: Sat, 22 Sep 2018 09:58:12 +0800 Subject: [PATCH 06/85] fix(diff): modify diff logic and comment License: MIT Signed-off-by: Overbool --- dagutils/diff.go | 47 ++++++++++++++++-------------- test/sharness/t0052-object-diff.sh | 6 ++-- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/dagutils/diff.go b/dagutils/diff.go index 6fc92140078..c63aacafbc5 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -95,29 +95,23 @@ func ApplyChange(ctx context.Context, ds ipld.DAGService, nd *dag.ProtoNode, cs } // Diff returns a set of changes that transform node 'a' into node 'b'. -// It supports two nodes forms: ProtoNode and RawNode. Because we treat -// the nodes as IPLD nodes as long as possible and only convert them -// to ProtoNode when necessary: when we need to remove links, and at that point -// (if they have links to remove) we know they are not raw nodes. +// It only traverses links in the following cases: +// 1. two node's links number are greater than 0. +// 2. both of two nodes are ProtoNode. +// Otherwise, it compares the cid and emits a Mod change object. func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, error) { // Base case where both nodes are leaves, just compare // their CIDs. if len(a.Links()) == 0 && len(b.Links()) == 0 { - if a.Cid().Equals(b.Cid()) { - return []*Change{}, nil - } - return []*Change{ - { - Type: Mod, - Before: a.Cid(), - After: b.Cid(), - }, - }, nil + return getChange(a, b) } var out []*Change - cleanA := a.Copy() - cleanB := b.Copy() + cleanA, okA := a.Copy().(*dag.ProtoNode) + cleanB, okB := b.Copy().(*dag.ProtoNode) + if !okA || !okB { + return getChange(a, b) + } // strip out unchanged stuff for _, lnk := range a.Links() { @@ -146,12 +140,8 @@ func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*Change, e out = append(out, subc) } } - if cleanA, ok := cleanA.(*dag.ProtoNode); ok { - cleanA.RemoveNodeLink(l.Name) - } - if cleanB, ok := cleanB.(*dag.ProtoNode); ok { - cleanB.RemoveNodeLink(l.Name) - } + cleanA.RemoveNodeLink(l.Name) + cleanB.RemoveNodeLink(l.Name) } } @@ -207,3 +197,16 @@ func MergeDiffs(a, b []*Change) ([]*Change, []Conflict) { } return out, conflicts } + +func getChange(a, b ipld.Node) ([]*Change, error) { + if a.Cid().Equals(b.Cid()) { + return []*Change{}, nil + } + return []*Change{ + { + Type: Mod, + Before: a.Cid(), + After: b.Cid(), + }, + }, nil +} diff --git a/test/sharness/t0052-object-diff.sh b/test/sharness/t0052-object-diff.sh index aa0bcd11deb..e512c4b18b8 100755 --- a/test/sharness/t0052-object-diff.sh +++ b/test/sharness/t0052-object-diff.sh @@ -58,19 +58,19 @@ test_expect_success "diff against self (single file) is empty" ' ' test_expect_success "diff (raw-leaves) against self (single file) is empty" ' - ipfs object diff $SINGLE_FILE_RAW $SINGLE_FILE_RAW > diff_raw_out + ipfs object diff $SINGLE_FILE_RAW $SINGLE_FILE_RAW > diff_raw_out && printf "" > diff_raw_exp && test_cmp diff_raw_exp diff_raw_out ' test_expect_success "diff against self (empty dir) is empty" ' - ipfs object diff $EMPTY_DIR $EMPTY_DIR > diff_out + ipfs object diff $EMPTY_DIR $EMPTY_DIR > diff_out && printf "" > diff_exp && test_cmp diff_exp diff_out ' test_expect_success "diff (raw-leaves) against self (empty dir) is empty" ' - ipfs object diff $EMPTY_DIR_RAW $EMPTY_DIR_RAW > diff_raw_out + ipfs object diff $EMPTY_DIR_RAW $EMPTY_DIR_RAW > diff_raw_out && printf "" > diff_raw_exp && test_cmp diff_raw_exp diff_raw_out ' From 1373218519ab9d8ed7ae2229438e3470e019ce83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 10 Mar 2018 18:54:58 +0100 Subject: [PATCH 07/85] coreapi: swarm interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/swarm.go | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 core/coreapi/interface/swarm.go diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go new file mode 100644 index 00000000000..1ec260e07a6 --- /dev/null +++ b/core/coreapi/interface/swarm.go @@ -0,0 +1,37 @@ +package iface + +import ( + "time" + + "context" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" +) + +// PeerInfo contains information about a peer +type PeerInfo interface { + // ID returns PeerID + ID() peer.ID + + // Address returns the multiaddress via which we are connected with the peer + Address() ma.Multiaddr + + // Latency returns last known round trip time to the peer + Latency() time.Duration + + // Streams returns list of streams established with the peer + // TODO: should this return multicodecs? + Streams() []string +} + +// SwarmAPI specifies the interface to libp2p swarm +type SwarmAPI interface { + // Connect to a given address + Connect(context.Context, ma.Multiaddr) error + + // Disconnect from a given address + Disconnect(context.Context, ma.Multiaddr) error + + // Peers returns the list of peers we are connected to + Peers(context.Context) ([]PeerInfo, error) +} From 8358c8d0410c9da896ade974c9d08212b1f2b39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 10 Mar 2018 19:02:57 +0100 Subject: [PATCH 08/85] coreapi: implement swarm api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/coreapi.go | 5 + core/coreapi/interface/coreapi.go | 3 + core/coreapi/interface/swarm.go | 6 +- core/coreapi/swarm.go | 147 ++++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 core/coreapi/swarm.go diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index bb7afd61a51..8a0410a2dae 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -67,3 +67,8 @@ func (api *CoreAPI) Pin() coreiface.PinAPI { func (api *CoreAPI) Dht() coreiface.DhtAPI { return (*DhtAPI)(api) } + +// Swarm returns the SwarmAPI interface implementation backed by the go-ipfs node +func (api *CoreAPI) Swarm() coreiface.SwarmAPI { + return &SwarmAPI{api} +} diff --git a/core/coreapi/interface/coreapi.go b/core/coreapi/interface/coreapi.go index 0053d472e6b..0b153b6f9a1 100644 --- a/core/coreapi/interface/coreapi.go +++ b/core/coreapi/interface/coreapi.go @@ -34,6 +34,9 @@ type CoreAPI interface { // Dht returns an implementation of Dht API Dht() DhtAPI + // Swarm returns an implementation of Swarm API + Swarm() SwarmAPI + // ResolvePath resolves the path using Unixfs resolver ResolvePath(context.Context, Path) (ResolvedPath, error) diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 1ec260e07a6..1f0b1216f63 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -1,9 +1,9 @@ package iface import ( + "context" "time" - "context" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" ) @@ -17,11 +17,11 @@ type PeerInfo interface { Address() ma.Multiaddr // Latency returns last known round trip time to the peer - Latency() time.Duration + Latency(context.Context) (time.Duration, error) // Streams returns list of streams established with the peer // TODO: should this return multicodecs? - Streams() []string + Streams(context.Context) ([]string, error) } // SwarmAPI specifies the interface to libp2p swarm diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go new file mode 100644 index 00000000000..4af0ce61aa9 --- /dev/null +++ b/core/coreapi/swarm.go @@ -0,0 +1,147 @@ +package coreapi + +import ( + "context" + "errors" + "fmt" + "time" + + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + + iaddr "gx/ipfs/QmQViVWBHbU6HmYjXcdNq7tVASCNgdg64ZGcauuDkLCivW/go-ipfs-addr" + swarm "gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm" + ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" + pstore "gx/ipfs/QmXauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore" + net "gx/ipfs/QmXfkENeeBvh3zYA51MaSdGUdBjhQ99cP5WQe8zgr6wchG/go-libp2p-net" + peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" +) + +type SwarmAPI struct { + *CoreAPI +} + +type connInfo struct { + api *CoreAPI + conn net.Conn + + addr ma.Multiaddr + peer peer.ID + muxer string +} + +func (api *SwarmAPI) Connect(ctx context.Context, addr ma.Multiaddr) error { + if api.node.PeerHost == nil { + return coreiface.ErrOffline + } + + snet, ok := api.node.PeerHost.Network().(*swarm.Network) + if !ok { + return fmt.Errorf("peerhost network was not swarm") + } + + swrm := snet.Swarm() + + ia, err := iaddr.ParseMultiaddr(ma.Multiaddr(addr)) + if err != nil { + return err + } + + pi := pstore.PeerInfo{ + ID: ia.ID(), + Addrs: []ma.Multiaddr{ia.Transport()}, + } + + swrm.Backoff().Clear(pi.ID) + + return api.node.PeerHost.Connect(ctx, pi) +} + +func (api *SwarmAPI) Disconnect(ctx context.Context, addr ma.Multiaddr) error { + if api.node.PeerHost == nil { + return coreiface.ErrOffline + } + + ia, err := iaddr.ParseMultiaddr(ma.Multiaddr(addr)) + if err != nil { + return err + } + + taddr := ia.Transport() + + found := false + conns := api.node.PeerHost.Network().ConnsToPeer(ia.ID()) + for _, conn := range conns { + if !conn.RemoteMultiaddr().Equal(taddr) { + continue + } + + if err := conn.Close(); err != nil { + return err + } + found = true + break + } + + if !found { + return errors.New("conn not found") + } + + return nil +} + +func (api *SwarmAPI) Peers(context.Context) ([]coreiface.PeerInfo, error) { + if api.node.PeerHost == nil { + return nil, coreiface.ErrOffline + } + + conns := api.node.PeerHost.Network().Conns() + + var out []coreiface.PeerInfo + for _, c := range conns { + pid := c.RemotePeer() + addr := c.RemoteMultiaddr() + + ci := &connInfo{ + api: api.CoreAPI, + conn: c, + + addr: addr, + peer: pid, + } + + swcon, ok := c.(*swarm.Conn) + if ok { + ci.muxer = fmt.Sprintf("%T", swcon.StreamConn().Conn()) + } + + out = append(out, ci) + } + + return out, nil +} + +func (ci *connInfo) ID() peer.ID { + return ci.ID() +} + +func (ci *connInfo) Address() ma.Multiaddr { + return ci.addr +} + +func (ci *connInfo) Latency(context.Context) (time.Duration, error) { + return ci.api.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil +} + +func (ci *connInfo) Streams(context.Context) ([]string, error) { + streams, err := ci.conn.GetStreams() + if err != nil { + return nil, err + } + + out := make([]string, len(streams)) + for i, s := range streams { + out[i] = string(s.Protocol()) + } + + return out, nil +} From e7f493b5696f427fd29c5de58ac960ab55a9ac56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 5 Apr 2018 20:22:49 +0200 Subject: [PATCH 09/85] fix infinite loop in connInfo.ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/swarm.go | 4 ++-- core/coreapi/swarm.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 1f0b1216f63..92817e6f4e9 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -4,8 +4,8 @@ import ( "context" "time" - ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" - peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" + peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" + ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" ) // PeerInfo contains information about a peer diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 4af0ce61aa9..3a9ffcf3692 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -8,12 +8,12 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - iaddr "gx/ipfs/QmQViVWBHbU6HmYjXcdNq7tVASCNgdg64ZGcauuDkLCivW/go-ipfs-addr" - swarm "gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm" - ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" - pstore "gx/ipfs/QmXauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore" - net "gx/ipfs/QmXfkENeeBvh3zYA51MaSdGUdBjhQ99cP5WQe8zgr6wchG/go-libp2p-net" - peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" + peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" + ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" + net "gx/ipfs/QmZNJyx9GGCX4GeuHnLB8fxaxMLs4MjTjHokxfQcCd6Nve/go-libp2p-net" + pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore" + swarm "gx/ipfs/QmeDpqUwwdye8ABKVMPXKuWwPVURFdqTqssbTUB39E2Nwd/go-libp2p-swarm" + iaddr "gx/ipfs/QmePSRaGafvmURQwQkHPDBJsaGwKXC1WpBBHVCQxdr8FPn/go-ipfs-addr" ) type SwarmAPI struct { @@ -121,7 +121,7 @@ func (api *SwarmAPI) Peers(context.Context) ([]coreiface.PeerInfo, error) { } func (ci *connInfo) ID() peer.ID { - return ci.ID() + return ci.peer } func (ci *connInfo) Address() ma.Multiaddr { From 44bab585a5a79ff8f7a084996dcb012f6cd600a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 11 Sep 2018 13:36:55 +0200 Subject: [PATCH 10/85] coreapi swarm: swarm refactor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/swarm.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 3a9ffcf3692..bc208e26ae9 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -34,13 +34,11 @@ func (api *SwarmAPI) Connect(ctx context.Context, addr ma.Multiaddr) error { return coreiface.ErrOffline } - snet, ok := api.node.PeerHost.Network().(*swarm.Network) + swrm, ok := api.node.PeerHost.Network().(*swarm.Swarm) if !ok { return fmt.Errorf("peerhost network was not swarm") } - swrm := snet.Swarm() - ia, err := iaddr.ParseMultiaddr(ma.Multiaddr(addr)) if err != nil { return err @@ -109,10 +107,13 @@ func (api *SwarmAPI) Peers(context.Context) ([]coreiface.PeerInfo, error) { peer: pid, } - swcon, ok := c.(*swarm.Conn) - if ok { - ci.muxer = fmt.Sprintf("%T", swcon.StreamConn().Conn()) - } + /* + // FIXME(steb): + swcon, ok := c.(*swarm.Conn) + if ok { + ci.muxer = fmt.Sprintf("%T", swcon.StreamConn().Conn()) + } + */ out = append(out, ci) } @@ -133,10 +134,7 @@ func (ci *connInfo) Latency(context.Context) (time.Duration, error) { } func (ci *connInfo) Streams(context.Context) ([]string, error) { - streams, err := ci.conn.GetStreams() - if err != nil { - return nil, err - } + streams := ci.conn.GetStreams() out := make([]string, len(streams)) for i, s := range streams { From 30d42f4550ec80c9d77f0d0cd1421f622fcffcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 11 Sep 2018 20:50:15 +0200 Subject: [PATCH 11/85] swarm cmd: port to new cmd lib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/log.go | 22 +++ core/commands/root.go | 2 +- core/commands/swarm.go | 322 ++++++++++++-------------------- core/coreapi/interface/swarm.go | 2 +- core/coreapi/swarm.go | 10 +- 5 files changed, 151 insertions(+), 207 deletions(-) diff --git a/core/commands/log.go b/core/commands/log.go index 028061d1376..b4be7354edf 100644 --- a/core/commands/log.go +++ b/core/commands/log.go @@ -1,10 +1,12 @@ package commands import ( + "bytes" "fmt" "io" cmds "github.com/ipfs/go-ipfs/commands" + e "github.com/ipfs/go-ipfs/core/commands/e" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" @@ -110,3 +112,23 @@ Outputs event log messages (not other log messages) as they are generated. res.SetOutput(r) }, } + +func stringListMarshaler(res cmds.Response) (io.Reader, error) { + v, err := unwrapOutput(res.Output()) + if err != nil { + return nil, err + } + + list, ok := v.(*stringList) + if !ok { + return nil, e.TypeErr(list, v) + } + + buf := new(bytes.Buffer) + for _, s := range list.Strings { + buf.WriteString(s) + buf.WriteString("\n") + } + + return buf, nil +} diff --git a/core/commands/root.go b/core/commands/root.go index 0268136f610..c141b61c2e3 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -136,7 +136,7 @@ var rootSubcommands = map[string]*cmds.Command{ "p2p": lgc.NewCommand(P2PCmd), "refs": lgc.NewCommand(RefsCmd), "resolve": ResolveCmd, - "swarm": lgc.NewCommand(SwarmCmd), + "swarm": SwarmCmd, "tar": lgc.NewCommand(TarCmd), "file": lgc.NewCommand(unixfs.UnixFSCmd), "update": lgc.NewCommand(ExternalBinary()), diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 685a8113b59..6779f8aee18 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -1,7 +1,6 @@ package commands import ( - "bytes" "errors" "fmt" "io" @@ -9,18 +8,20 @@ import ( "sort" "strings" - cmds "github.com/ipfs/go-ipfs/commands" - e "github.com/ipfs/go-ipfs/core/commands/e" - repo "github.com/ipfs/go-ipfs/repo" + "github.com/ipfs/go-ipfs/commands" + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + "github.com/ipfs/go-ipfs/core/commands/e" + "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/fsrepo" - swarm "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" + "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" - cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" iaddr "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) @@ -64,23 +65,20 @@ var swarmPeersCmd = &cmds.Command{ cmdkit.BoolOption("latency", "Also list information about latency to each peer"), cmdkit.BoolOption("direction", "Also list information about the direction of connection"), }, - Run: func(req cmds.Request, res cmds.Response) { - - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return err } - verbose, _, _ := req.Option("verbose").Bool() - latency, _, _ := req.Option("latency").Bool() - streams, _, _ := req.Option("streams").Bool() - direction, _, _ := req.Option("direction").Bool() + verbose, _ := req.Options["verbose"].(bool) + latency, _ := req.Options["latency"].(bool) + streams, _ := req.Options["streams"].(bool) + direction, _ := req.Options["direction"].(bool) conns := n.PeerHost.Network().Conns() var out connInfos @@ -125,50 +123,43 @@ var swarmPeersCmd = &cmds.Command{ } sort.Sort(&out) - res.SetOutput(&out) + return cmds.EmitOnce(res, &out) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: func(res cmds.Response) (io.Reader, error) { - v, err := unwrapOutput(res.Output()) - if err != nil { - return nil, err - } - + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { ci, ok := v.(*connInfos) if !ok { - return nil, e.TypeErr(ci, v) + return e.TypeErr(ci, v) } - buf := new(bytes.Buffer) pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name for _, info := range ci.Peers { ids := fmt.Sprintf("/%s/%s", pipfs, info.Peer) if strings.HasSuffix(info.Addr, ids) { - fmt.Fprintf(buf, "%s", info.Addr) + fmt.Fprintf(w, "%s", info.Addr) } else { - fmt.Fprintf(buf, "%s%s", info.Addr, ids) + fmt.Fprintf(w, "%s%s", info.Addr, ids) } if info.Latency != "" { - fmt.Fprintf(buf, " %s", info.Latency) + fmt.Fprintf(w, " %s", info.Latency) } if info.Direction != inet.DirUnknown { - fmt.Fprintf(buf, " %s", directionString(info.Direction)) + fmt.Fprintf(w, " %s", directionString(info.Direction)) } - - fmt.Fprintln(buf) + fmt.Fprintln(w) for _, s := range info.Streams { if s.Protocol == "" { s.Protocol = "" } - fmt.Fprintf(buf, " %s\n", s.Protocol) + fmt.Fprintf(w, " %s\n", s.Protocol) } } - return buf, nil - }, + return nil + }), }, Type: connInfos{}, } @@ -237,17 +228,14 @@ var swarmAddrsCmd = &cmds.Command{ "local": swarmAddrsLocalCmd, "listen": swarmAddrsListenCmd, }, - Run: func(req cmds.Request, res cmds.Response) { - - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return err } addrs := make(map[string][]string) @@ -260,18 +248,13 @@ var swarmAddrsCmd = &cmds.Command{ sort.Sort(sort.StringSlice(addrs[s])) } - res.SetOutput(&addrMap{Addrs: addrs}) + return cmds.EmitOnce(res, &addrMap{Addrs: addrs}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: func(res cmds.Response) (io.Reader, error) { - v, err := unwrapOutput(res.Output()) - if err != nil { - return nil, err - } - + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { m, ok := v.(*addrMap) if !ok { - return nil, e.TypeErr(m, v) + return e.TypeErr(m, v) } // sort the ids first @@ -281,16 +264,15 @@ var swarmAddrsCmd = &cmds.Command{ } sort.Sort(sort.StringSlice(ids)) - buf := new(bytes.Buffer) for _, p := range ids { paddrs := m.Addrs[p] - buf.WriteString(fmt.Sprintf("%s (%d)\n", p, len(paddrs))) + fmt.Fprintf(w, "%s (%d)\n", p, len(paddrs)) for _, addr := range paddrs { - buf.WriteString("\t" + addr + "\n") + fmt.Fprintf(w, "\t"+addr+"\n") } } - return buf, nil - }, + return nil + }), }, Type: addrMap{}, } @@ -305,20 +287,17 @@ var swarmAddrsLocalCmd = &cmds.Command{ Options: []cmdkit.Option{ cmdkit.BoolOption("id", "Show peer ID in addresses."), }, - Run: func(req cmds.Request, res cmds.Response) { - iCtx := req.InvocContext() - n, err := iCtx.GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return err } - showid, _, _ := req.Option("id").Bool() + showid, _ := req.Options["id"].(bool) id := n.Identity.Pretty() var addrs []string @@ -330,11 +309,11 @@ var swarmAddrsLocalCmd = &cmds.Command{ addrs = append(addrs, saddr) } sort.Sort(sort.StringSlice(addrs)) - res.SetOutput(&stringList{addrs}) + return cmds.EmitOnce(res, &stringList{addrs}) }, Type: stringList{}, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, } @@ -345,24 +324,20 @@ var swarmAddrsListenCmd = &cmds.Command{ 'ipfs swarm addrs listen' lists all interface addresses the node is listening on. `, }, - Run: func(req cmds.Request, res cmds.Response) { - - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return err } var addrs []string maddrs, err := n.PeerHost.Network().InterfaceListenAddresses() if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } for _, addr := range maddrs { @@ -370,11 +345,11 @@ var swarmAddrsListenCmd = &cmds.Command{ } sort.Sort(sort.StringSlice(addrs)) - res.SetOutput(&stringList{addrs}) + return cmds.EmitOnce(res, &stringList{addrs}) }, Type: stringList{}, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, } @@ -392,33 +367,27 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 Arguments: []cmdkit.Argument{ cmdkit.StringArg("address", true, true, "Address of peer to connect to.").EnableStdin(), }, - Run: func(req cmds.Request, res cmds.Response) { - ctx := req.Context() - - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - addrs := req.Arguments() + addrs := req.Arguments if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return err } // FIXME(steb): Nasty swrm, ok := n.PeerHost.Network().(*swarm.Swarm) if !ok { - res.SetError(fmt.Errorf("peerhost network was not swarm"), cmdkit.ErrNormal) - return + return fmt.Errorf("peerhost network was not swarm") } pis, err := peersWithAddresses(addrs) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } output := make([]string, len(pis)) @@ -427,18 +396,17 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 output[i] = "connect " + pi.ID.Pretty() - err := n.PeerHost.Connect(ctx, pi) + err := n.PeerHost.Connect(req.Context, pi) if err != nil { - res.SetError(fmt.Errorf("%s failure: %s", output[i], err), cmdkit.ErrNormal) - return + return fmt.Errorf("%s failure: %s", output[i], err) } output[i] += " success" } - res.SetOutput(&stringList{output}) + return cmds.EmitOnce(res, &stringList{addrs}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, Type: stringList{}, } @@ -459,24 +427,21 @@ it will reconnect. Arguments: []cmdkit.Argument{ cmdkit.StringArg("address", true, true, "Address of peer to disconnect from.").EnableStdin(), }, - Run: func(req cmds.Request, res cmds.Response) { - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - addrs := req.Arguments() + addrs := req.Arguments if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrClient) - return + return ErrNotOnline } iaddrs, err := parseAddresses(addrs) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } output := make([]string, len(iaddrs)) @@ -516,34 +481,14 @@ it will reconnect. } } } - res.SetOutput(&stringList{output}) + return cmds.EmitOnce(res, &stringList{output}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, Type: stringList{}, } -func stringListMarshaler(res cmds.Response) (io.Reader, error) { - v, err := unwrapOutput(res.Output()) - if err != nil { - return nil, err - } - - list, ok := v.(*stringList) - if !ok { - return nil, e.TypeErr(list, v) - } - - buf := new(bytes.Buffer) - for _, s := range list.Strings { - buf.WriteString(s) - buf.WriteString("\n") - } - - return buf, nil -} - // parseAddresses is a function that takes in a slice of string peer addresses // (multiaddr + peerid) and returns slices of multiaddrs and peerids. func parseAddresses(addrs []string) (iaddrs []iaddr.IPFSAddr, err error) { @@ -608,38 +553,34 @@ Filters default to those specified under the "Swarm.AddrFilters" config key. "add": swarmFiltersAddCmd, "rm": swarmFiltersRmCmd, }, - Run: func(req cmds.Request, res cmds.Response) { - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrNormal) - return + return ErrNotOnline } // FIXME(steb) swrm, ok := n.PeerHost.Network().(*swarm.Swarm) if !ok { - res.SetError(errors.New("failed to cast network to swarm network"), cmdkit.ErrNormal) - return + return errors.New("failed to cast network to swarm network") } var output []string for _, f := range swrm.Filters.Filters() { s, err := mafilter.ConvertIPNet(f) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } output = append(output, s) } - res.SetOutput(&stringList{output}) + return cmds.EmitOnce(res, &stringList{output}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, Type: stringList{}, } @@ -656,63 +597,54 @@ add your filters to the ipfs config file. Arguments: []cmdkit.Argument{ cmdkit.StringArg("address", true, true, "Multiaddr to filter.").EnableStdin(), }, - Run: func(req cmds.Request, res cmds.Response) { - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrNormal) - return + return ErrNotOnline } // FIXME(steb) swrm, ok := n.PeerHost.Network().(*swarm.Swarm) if !ok { - res.SetError(errors.New("failed to cast network to swarm network"), cmdkit.ErrNormal) - return + return errors.New("failed to cast network to swarm network") } - if len(req.Arguments()) == 0 { - res.SetError(errors.New("no filters to add"), cmdkit.ErrClient) - return + if len(req.Arguments) == 0 { + return errors.New("no filters to add") } - r, err := fsrepo.Open(req.InvocContext().ConfigRoot) + r, err := fsrepo.Open(env.(*commands.Context).ConfigRoot) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } defer r.Close() cfg, err := r.Config() if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - for _, arg := range req.Arguments() { + for _, arg := range req.Arguments { mask, err := mafilter.NewMask(arg) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } swrm.Filters.AddDialFilter(mask) } - added, err := filtersAdd(r, cfg, req.Arguments()) + added, err := filtersAdd(r, cfg, req.Arguments) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return - + return err } - res.SetOutput(&stringList{added}) + return cmds.EmitOnce(res, &stringList{added}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, Type: stringList{}, } @@ -729,37 +661,32 @@ remove your filters from the ipfs config file. Arguments: []cmdkit.Argument{ cmdkit.StringArg("address", true, true, "Multiaddr filter to remove.").EnableStdin(), }, - Run: func(req cmds.Request, res cmds.Response) { - n, err := req.InvocContext().GetNode() + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + n, err := cmdenv.GetNode(env) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } if n.PeerHost == nil { - res.SetError(ErrNotOnline, cmdkit.ErrNormal) - return + return ErrNotOnline } swrm, ok := n.PeerHost.Network().(*swarm.Swarm) if !ok { - res.SetError(errors.New("failed to cast network to swarm network"), cmdkit.ErrNormal) - return + return errors.New("failed to cast network to swarm network") } - r, err := fsrepo.Open(req.InvocContext().ConfigRoot) + r, err := fsrepo.Open(env.(*commands.Context).ConfigRoot) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } defer r.Close() cfg, err := r.Config() if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - if req.Arguments()[0] == "all" || req.Arguments()[0] == "*" { + if req.Arguments[0] == "all" || req.Arguments[0] == "*" { fs := swrm.Filters.Filters() for _, f := range fs { swrm.Filters.Remove(f) @@ -767,35 +694,30 @@ remove your filters from the ipfs config file. removed, err := filtersRemoveAll(r, cfg) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - res.SetOutput(&stringList{removed}) - - return + return cmds.EmitOnce(res, &stringList{removed}) } - for _, arg := range req.Arguments() { + for _, arg := range req.Arguments { mask, err := mafilter.NewMask(arg) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } swrm.Filters.Remove(mask) } - removed, err := filtersRemove(r, cfg, req.Arguments()) + removed, err := filtersRemove(r, cfg, req.Arguments) if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return + return err } - res.SetOutput(&stringList{removed}) + return cmds.EmitOnce(res, &stringList{removed}) }, - Marshalers: cmds.MarshalerMap{ - cmds.Text: stringListMarshaler, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(stringListEncoder), }, Type: stringList{}, } diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 92817e6f4e9..2492f26967f 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -4,8 +4,8 @@ import ( "context" "time" - peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" + peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) // PeerInfo contains information about a peer diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index bc208e26ae9..044473b6636 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -8,12 +8,12 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" + swarm "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" + iaddr "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - net "gx/ipfs/QmZNJyx9GGCX4GeuHnLB8fxaxMLs4MjTjHokxfQcCd6Nve/go-libp2p-net" - pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore" - swarm "gx/ipfs/QmeDpqUwwdye8ABKVMPXKuWwPVURFdqTqssbTUB39E2Nwd/go-libp2p-swarm" - iaddr "gx/ipfs/QmePSRaGafvmURQwQkHPDBJsaGwKXC1WpBBHVCQxdr8FPn/go-ipfs-addr" + peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) type SwarmAPI struct { From df9f10189210804bb4bdc9b99d0e796a20f701e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 17 Sep 2018 16:45:59 +0200 Subject: [PATCH 12/85] coreapi swarm: rewire connect/disconnect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/swarm.go | 63 +++++---------------------------- core/coreapi/interface/swarm.go | 23 +++++++----- core/coreapi/swarm.go | 51 ++++++++++++-------------- 3 files changed, 46 insertions(+), 91 deletions(-) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 6779f8aee18..b02f379f879 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -368,23 +368,13 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 cmdkit.StringArg("address", true, true, "Address of peer to connect to.").EnableStdin(), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } addrs := req.Arguments - if n.PeerHost == nil { - return err - } - - // FIXME(steb): Nasty - swrm, ok := n.PeerHost.Network().(*swarm.Swarm) - if !ok { - return fmt.Errorf("peerhost network was not swarm") - } - pis, err := peersWithAddresses(addrs) if err != nil { return err @@ -392,18 +382,16 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 output := make([]string, len(pis)) for i, pi := range pis { - swrm.Backoff().Clear(pi.ID) - output[i] = "connect " + pi.ID.Pretty() - err := n.PeerHost.Connect(req.Context, pi) + err := api.Swarm().Connect(req.Context, pi) if err != nil { return fmt.Errorf("%s failure: %s", output[i], err) } output[i] += " success" } - return cmds.EmitOnce(res, &stringList{addrs}) + return cmds.EmitOnce(res, &stringList{output}) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(stringListEncoder), @@ -428,57 +416,24 @@ it will reconnect. cmdkit.StringArg("address", true, true, "Address of peer to disconnect from.").EnableStdin(), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - addrs := req.Arguments - - if n.PeerHost == nil { - return ErrNotOnline - } - - iaddrs, err := parseAddresses(addrs) + iaddrs, err := parseAddresses(req.Arguments) if err != nil { return err } output := make([]string, len(iaddrs)) for i, addr := range iaddrs { - taddr := addr.Transport() - id := addr.ID() - output[i] = "disconnect " + id.Pretty() - - net := n.PeerHost.Network() + output[i] = "disconnect " + addr.ID().Pretty() - if taddr == nil { - if net.Connectedness(id) != inet.Connected { - output[i] += " failure: not connected" - } else if err := net.ClosePeer(id); err != nil { - output[i] += " failure: " + err.Error() - } else { - output[i] += " success" - } + if err := api.Swarm().Disconnect(req.Context, addr.Multiaddr()); err != nil { + output[i] += " failure: " + err.Error() } else { - found := false - for _, conn := range net.ConnsToPeer(id) { - if !conn.RemoteMultiaddr().Equal(taddr) { - continue - } - - if err := conn.Close(); err != nil { - output[i] += " failure: " + err.Error() - } else { - output[i] += " success" - } - found = true - break - } - - if !found { - output[i] += " failure: conn not found" - } + output[i] += " success" } } return cmds.EmitOnce(res, &stringList{output}) diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 2492f26967f..7bd009f16f9 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -2,14 +2,22 @@ package iface import ( "context" + "errors" "time" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" + "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" ) -// PeerInfo contains information about a peer -type PeerInfo interface { +var ( + ErrNotConnected = errors.New("not connected") + ErrConnNotFound = errors.New("conn not found") + ) + +// ConnectionInfo contains information about a peer +type ConnectionInfo interface { // ID returns PeerID ID() peer.ID @@ -20,18 +28,17 @@ type PeerInfo interface { Latency(context.Context) (time.Duration, error) // Streams returns list of streams established with the peer - // TODO: should this return multicodecs? - Streams(context.Context) ([]string, error) + Streams(context.Context) ([]protocol.ID, error) } // SwarmAPI specifies the interface to libp2p swarm type SwarmAPI interface { - // Connect to a given address - Connect(context.Context, ma.Multiaddr) error + // Connect to a given peer + Connect(context.Context, pstore.PeerInfo) error // Disconnect from a given address Disconnect(context.Context, ma.Multiaddr) error // Peers returns the list of peers we are connected to - Peers(context.Context) ([]PeerInfo, error) + Peers(context.Context) ([]ConnectionInfo, error) } diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 044473b6636..de072c8cdee 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -2,7 +2,6 @@ package coreapi import ( "context" - "errors" "fmt" "time" @@ -11,8 +10,10 @@ import ( swarm "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" iaddr "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" + protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) @@ -29,7 +30,7 @@ type connInfo struct { muxer string } -func (api *SwarmAPI) Connect(ctx context.Context, addr ma.Multiaddr) error { +func (api *SwarmAPI) Connect(ctx context.Context, pi pstore.PeerInfo) error { if api.node.PeerHost == nil { return coreiface.ErrOffline } @@ -39,16 +40,6 @@ func (api *SwarmAPI) Connect(ctx context.Context, addr ma.Multiaddr) error { return fmt.Errorf("peerhost network was not swarm") } - ia, err := iaddr.ParseMultiaddr(ma.Multiaddr(addr)) - if err != nil { - return err - } - - pi := pstore.PeerInfo{ - ID: ia.ID(), - Addrs: []ma.Multiaddr{ia.Transport()}, - } - swrm.Backoff().Clear(pi.ID) return api.node.PeerHost.Connect(ctx, pi) @@ -65,36 +56,38 @@ func (api *SwarmAPI) Disconnect(ctx context.Context, addr ma.Multiaddr) error { } taddr := ia.Transport() + id := ia.ID() + net := api.node.PeerHost.Network() - found := false - conns := api.node.PeerHost.Network().ConnsToPeer(ia.ID()) - for _, conn := range conns { - if !conn.RemoteMultiaddr().Equal(taddr) { - continue + if taddr == nil { + if net.Connectedness(id) != inet.Connected { + return coreiface.ErrNotConnected + } else if err := net.ClosePeer(id); err != nil { + return err } + } else { + for _, conn := range net.ConnsToPeer(id) { + if !conn.RemoteMultiaddr().Equal(taddr) { + continue + } - if err := conn.Close(); err != nil { - return err + return conn.Close() } - found = true - break - } - if !found { - return errors.New("conn not found") + return coreiface.ErrConnNotFound } return nil } -func (api *SwarmAPI) Peers(context.Context) ([]coreiface.PeerInfo, error) { +func (api *SwarmAPI) Peers(context.Context) ([]coreiface.ConnectionInfo, error) { if api.node.PeerHost == nil { return nil, coreiface.ErrOffline } conns := api.node.PeerHost.Network().Conns() - var out []coreiface.PeerInfo + var out []coreiface.ConnectionInfo for _, c := range conns { pid := c.RemotePeer() addr := c.RemoteMultiaddr() @@ -133,12 +126,12 @@ func (ci *connInfo) Latency(context.Context) (time.Duration, error) { return ci.api.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil } -func (ci *connInfo) Streams(context.Context) ([]string, error) { +func (ci *connInfo) Streams(context.Context) ([]protocol.ID, error) { streams := ci.conn.GetStreams() - out := make([]string, len(streams)) + out := make([]protocol.ID, len(streams)) for i, s := range streams { - out[i] = string(s.Protocol()) + out[i] = s.Protocol() } return out, nil From 6fa2ab0d411689073ed45ee9c17303d9d6e60e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 17 Sep 2018 19:53:15 +0200 Subject: [PATCH 13/85] coreapi swarm: rewire address listing cmds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/swarm.go | 84 ++++++++++++++++----------------- core/coreapi/interface/key.go | 3 ++ core/coreapi/interface/swarm.go | 10 +++- core/coreapi/key.go | 4 ++ core/coreapi/swarm.go | 42 +++++++++++++++++ test/sharness/lib/test-lib.sh | 5 +- 6 files changed, 102 insertions(+), 46 deletions(-) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index b02f379f879..09fe464b03a 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -21,7 +21,7 @@ import ( "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) @@ -66,45 +66,39 @@ var swarmPeersCmd = &cmds.Command{ cmdkit.BoolOption("direction", "Also list information about the direction of connection"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - if n.PeerHost == nil { - return err - } - verbose, _ := req.Options["verbose"].(bool) latency, _ := req.Options["latency"].(bool) streams, _ := req.Options["streams"].(bool) direction, _ := req.Options["direction"].(bool) - conns := n.PeerHost.Network().Conns() + conns, err := api.Swarm().Peers(req.Context) + if err != nil { + return err + } + var out connInfos for _, c := range conns { - pid := c.RemotePeer() - addr := c.RemoteMultiaddr() ci := connInfo{ - Addr: addr.String(), - Peer: pid.Pretty(), + Addr: c.Address().String(), + Peer: c.ID().Pretty(), } - /* - // FIXME(steb): - swcon, ok := c.(*swarm.Conn) - if ok { - ci.Muxer = fmt.Sprintf("%T", swcon.StreamConn().Conn()) - } - */ - if verbose || direction { // set direction - ci.Direction = c.Stat().Direction + ci.Direction = c.Direction() } if verbose || latency { - lat := n.Peerstore.LatencyEWMA(pid) + lat, err := c.Latency(req.Context) + if err != nil { + return err + } + if lat == 0 { ci.Latency = "n/a" } else { @@ -112,10 +106,13 @@ var swarmPeersCmd = &cmds.Command{ } } if verbose || streams { - strs := c.GetStreams() + strs, err := c.Streams(req.Context) + if err != nil { + return err + } for _, s := range strs { - ci.Streams = append(ci.Streams, streamInfo{Protocol: string(s.Protocol())}) + ci.Streams = append(ci.Streams, streamInfo{Protocol: string(s)}) } } sort.Sort(&ci) @@ -229,26 +226,25 @@ var swarmAddrsCmd = &cmds.Command{ "listen": swarmAddrsListenCmd, }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - if n.PeerHost == nil { + addrs, err := api.Swarm().KnownAddrs(req.Context) + if err != nil { return err } - addrs := make(map[string][]string) - ps := n.PeerHost.Network().Peerstore() - for _, p := range ps.Peers() { + out := make(map[string][]string) + for p, paddrs := range addrs { s := p.Pretty() - for _, a := range ps.Addrs(p) { - addrs[s] = append(addrs[s], a.String()) + for _, a := range paddrs { + out[s] = append(out[s], a.String()) } - sort.Sort(sort.StringSlice(addrs[s])) } - return cmds.EmitOnce(res, &addrMap{Addrs: addrs}) + return cmds.EmitOnce(res, &addrMap{Addrs: out}) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { @@ -288,23 +284,27 @@ var swarmAddrsLocalCmd = &cmds.Command{ cmdkit.BoolOption("id", "Show peer ID in addresses."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - if n.PeerHost == nil { + showid, _ := req.Options["id"].(bool) + self, err := api.Key().Self(req.Context) + if err != nil { return err } - showid, _ := req.Options["id"].(bool) - id := n.Identity.Pretty() + maddrs, err := api.Swarm().LocalAddrs(req.Context) + if err != nil { + return err + } var addrs []string - for _, addr := range n.PeerHost.Addrs() { + for _, addr := range maddrs { saddr := addr.String() if showid { - saddr = path.Join(saddr, "ipfs", id) + saddr = path.Join(saddr, "ipfs", self.ID().Pretty()) } addrs = append(addrs, saddr) } @@ -325,17 +325,13 @@ var swarmAddrsListenCmd = &cmds.Command{ `, }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - if n.PeerHost == nil { - return err - } - var addrs []string - maddrs, err := n.PeerHost.Network().InterfaceListenAddresses() + maddrs, err := api.Swarm().ListenAddrs(req.Context) if err != nil { return err } diff --git a/core/coreapi/interface/key.go b/core/coreapi/interface/key.go index 4305ae20d20..cc6dc890044 100644 --- a/core/coreapi/interface/key.go +++ b/core/coreapi/interface/key.go @@ -33,6 +33,9 @@ type KeyAPI interface { // List lists keys stored in keystore List(ctx context.Context) ([]Key, error) + // Self returns the 'main' node key + Self(ctx context.Context) (Key, error) + // Remove removes keys from keystore. Returns ipns path of the removed key Remove(ctx context.Context, name string) (Key, error) } diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 7bd009f16f9..caa6a70e327 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -9,12 +9,13 @@ import ( "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) var ( ErrNotConnected = errors.New("not connected") ErrConnNotFound = errors.New("conn not found") - ) +) // ConnectionInfo contains information about a peer type ConnectionInfo interface { @@ -24,6 +25,9 @@ type ConnectionInfo interface { // Address returns the multiaddress via which we are connected with the peer Address() ma.Multiaddr + // Direction returns which way the connection was established + Direction() net.Direction + // Latency returns last known round trip time to the peer Latency(context.Context) (time.Duration, error) @@ -41,4 +45,8 @@ type SwarmAPI interface { // Peers returns the list of peers we are connected to Peers(context.Context) ([]ConnectionInfo, error) + + KnownAddrs(context.Context) (map[peer.ID][]ma.Multiaddr, error) + LocalAddrs(context.Context) ([]ma.Multiaddr, error) + ListenAddrs(context.Context) ([]ma.Multiaddr, error) } diff --git a/core/coreapi/key.go b/core/coreapi/key.go index 9bc4e1aef19..9fe207785ba 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -216,3 +216,7 @@ func (api *KeyAPI) Remove(ctx context.Context, name string) (coreiface.Key, erro return &key{"", pid}, nil } + +func (api *KeyAPI) Self(ctx context.Context) (coreiface.Key, error) { + return &key{"self", api.node.Identity}, nil +} diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index de072c8cdee..b780682b25e 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -3,6 +3,7 @@ package coreapi import ( "context" "fmt" + "sort" "time" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" @@ -24,6 +25,7 @@ type SwarmAPI struct { type connInfo struct { api *CoreAPI conn net.Conn + dir net.Direction addr ma.Multiaddr peer peer.ID @@ -80,6 +82,41 @@ func (api *SwarmAPI) Disconnect(ctx context.Context, addr ma.Multiaddr) error { return nil } +func (api *SwarmAPI) KnownAddrs(context.Context) (map[peer.ID][]ma.Multiaddr, error) { + if api.node.PeerHost == nil { + return nil, coreiface.ErrOffline + } + + addrs := make(map[peer.ID][]ma.Multiaddr) + ps := api.node.PeerHost.Network().Peerstore() + for _, p := range ps.Peers() { + for _, a := range ps.Addrs(p) { + addrs[p] = append(addrs[p], a) + } + sort.Slice(addrs[p], func(i, j int) bool { + return addrs[p][i].String() < addrs[p][j].String() + }) + } + + return addrs, nil +} + +func (api *SwarmAPI) LocalAddrs(context.Context) ([]ma.Multiaddr, error) { + if api.node.PeerHost == nil { + return nil, coreiface.ErrOffline + } + + return api.node.PeerHost.Addrs(), nil +} + +func (api *SwarmAPI) ListenAddrs(context.Context) ([]ma.Multiaddr, error) { + if api.node.PeerHost == nil { + return nil, coreiface.ErrOffline + } + + return api.node.PeerHost.Network().InterfaceListenAddresses() +} + func (api *SwarmAPI) Peers(context.Context) ([]coreiface.ConnectionInfo, error) { if api.node.PeerHost == nil { return nil, coreiface.ErrOffline @@ -95,6 +132,7 @@ func (api *SwarmAPI) Peers(context.Context) ([]coreiface.ConnectionInfo, error) ci := &connInfo{ api: api.CoreAPI, conn: c, + dir: c.Stat().Direction, addr: addr, peer: pid, @@ -122,6 +160,10 @@ func (ci *connInfo) Address() ma.Multiaddr { return ci.addr } +func (ci *connInfo) Direction() net.Direction { + return ci.dir +} + func (ci *connInfo) Latency(context.Context) (time.Duration, error) { return ci.api.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil } diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 8a54a6abf14..05cfc57d1fa 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -199,8 +199,11 @@ test_set_address_vars() { ' if ipfs swarm addrs local >/dev/null 2>&1; then + test_expect_success "get swarm addresses" ' + ipfs swarm addrs local > addrs_out + ' + test_expect_success "set swarm address vars" ' - ipfs swarm addrs local > addrs_out && SWARM_MADDR=$(grep "127.0.0.1" addrs_out) && SWARM_PORT=$(port_from_maddr $SWARM_MADDR) ' From 254ac1b11876fec3febec27ffcbf0d028ba59949 Mon Sep 17 00:00:00 2001 From: Michael Avila Date: Sat, 22 Sep 2018 17:36:14 -0700 Subject: [PATCH 14/85] Fix inability to pin two things at once License: MIT Signed-off-by: Michael Avila --- pin/pin.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pin/pin.go b/pin/pin.go index cadc4530a3c..233e99623b8 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -228,16 +228,20 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error { if p.directPin.Has(c) { p.directPin.Remove(c) } - + p.lock.Unlock() // fetch entire graph err := mdag.FetchGraph(ctx, c, p.dserv) + p.lock.Lock() if err != nil { return err } p.recursePin.Add(c) } else { - if _, err := p.dserv.Get(ctx, c); err != nil { + p.lock.Unlock() + _, err := p.dserv.Get(ctx, c) + p.lock.Lock() + if err != nil { return err } From 7ed1a5361f7516d223dda15ce5539c5afbb23d2d Mon Sep 17 00:00:00 2001 From: Michael Avila Date: Sun, 23 Sep 2018 09:29:00 -0700 Subject: [PATCH 15/85] Repeat recurse/direct pin checks since they could have changed License: MIT Signed-off-by: Michael Avila --- pin/pin.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pin/pin.go b/pin/pin.go index 233e99623b8..f6100749ffa 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -236,6 +236,14 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error { return err } + if p.recursePin.Has(c) { + return nil + } + + if p.directPin.Has(c) { + p.directPin.Remove(c) + } + p.recursePin.Add(c) } else { p.lock.Unlock() From ae7fd9a1cbd5dc02334d79fd96625e9ffaf10b67 Mon Sep 17 00:00:00 2001 From: rob-deutsch Date: Sat, 29 Sep 2018 13:44:11 +1000 Subject: [PATCH 16/85] added binary executable files to .dockerignore fixed #5038 License: MIT Signed-off-by: Rob Deutsch --- .dockerignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.dockerignore b/.dockerignore index 7f6bbbfe91f..10dd5fd886d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,9 @@ Dockerfile.fast !.git/refs/ !.git/packed-refs test/sharness/lib/sharness/ + +# The Docker client might not be running on Linux +# so delete any compiled binaries +bin/gx +bin/gx* +bin/tmp From 57f96019f7b94f7f8b412b3e9a34dbcdfa19a95e Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Wed, 15 Aug 2018 20:02:18 -0400 Subject: [PATCH 17/85] Provide new "cid" sub-command. License: MIT Signed-off-by: Kevin Atkinson --- cmd/ipfs/ipfs.go | 1 + core/commands/cid.go | 307 +++++++++++++++++++++++++++++++++ core/commands/commands_test.go | 6 + core/commands/root.go | 2 + 4 files changed, 316 insertions(+) create mode 100644 core/commands/cid.go diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index 0342007a12a..8e74139b075 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -92,4 +92,5 @@ var cmdDetailsMap = map[string]cmdDetails{ "diag/cmds": {cannotRunOnClient: true}, "repo/fsck": {cannotRunOnDaemon: true}, "config/edit": {cannotRunOnDaemon: true, doesNotUseRepo: true}, + "cid": {doesNotUseRepo: true}, } diff --git a/core/commands/cid.go b/core/commands/cid.go new file mode 100644 index 00000000000..284f79c426e --- /dev/null +++ b/core/commands/cid.go @@ -0,0 +1,307 @@ +package commands + +import ( + "fmt" + "io" + "sort" + "strings" + "text/tabwriter" + "unicode" + + cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mhash "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" + cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" + cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + verifcid "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" + cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + mbase "gx/ipfs/QmekxXDhCxCJRNuzmHreuaT3BsuJcsjcXWNrtV9C8DRHtd/go-multibase" +) + +var CidCmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "Convert and discover properties of CIDs", + }, + Subcommands: map[string]*cmds.Command{ + "format": cidFmtCmd, + "base32": base32Cmd, + "bases": basesCmd, + "codecs": codecsCmd, + "hashes": hashesCmd, + }, +} + +var cidFmtCmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "Format and convert a CID in various useful ways.", + LongDescription: ` +Format and converts 's in various useful ways. + +The optional format string either "prefix" or or a printf style format string: +` + cidutil.FormatRef, + }, + Arguments: []cmdkit.Argument{ + cmdkit.StringArg("cid", true, true, "Cids to format."), + }, + Options: []cmdkit.Option{ + cmdkit.StringOption("f", "Format string."), + cmdkit.StringOption("v", "CID version to convert to."), + cmdkit.StringOption("b", "Multibase to display CID in."), + }, + Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { + fmtStr, _ := req.Options["f"].(string) + verStr, _ := req.Options["v"].(string) + baseStr, _ := req.Options["b"].(string) + + opts := cidFormatOpts{} + + switch fmtStr { + case "": + opts.fmtStr = "%s" + case "prefix": + opts.fmtStr = "%P" + default: + if strings.IndexByte(fmtStr, '%') == -1 { + return fmt.Errorf("invalid format string: %s", fmtStr) + } + opts.fmtStr = fmtStr + } + + switch verStr { + case "": + // noop + case "0": + opts.verConv = toCidV0 + case "1": + opts.verConv = toCidV1 + default: + return fmt.Errorf("invalid cid version: %s\n", verStr) + } + + if baseStr != "" { + encoder, err := mbase.EncoderByName(baseStr) + if err != nil { + return err + } + opts.newBase = encoder.Encoding() + } else { + opts.newBase = mbase.Encoding(-1) + } + + res, err := formatCids(req.Arguments, opts) + if err != nil { + return err + } + cmds.EmitOnce(resp, res) + return nil + }, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val interface{}) error { + for _, v := range val.([]string) { + fmt.Fprintf(w, "%s\n", v) + } + return nil + }), + }, + Type: []string{}, +} + +var base32Cmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "Convert CIDs to Base32 CID version 1.", + }, + Arguments: []cmdkit.Argument{ + cmdkit.StringArg("cid", true, true, "Cids to convert."), + }, + Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { + opts := cidFormatOpts{ + fmtStr: "%s", + newBase: mbase.Encoding(mbase.Base32), + verConv: toCidV1, + } + res, err := formatCids(req.Arguments, opts) + if err != nil { + return err + } + + cmds.EmitOnce(resp, res) + return nil + }, + Encoders: cidFmtCmd.Encoders, + Type: cidFmtCmd.Type, +} + +type cidFormatOpts struct { + fmtStr string + newBase mbase.Encoding + verConv func(cid cid.Cid) (cid.Cid, error) +} + +func formatCids(args []string, opts cidFormatOpts) ([]string, error) { + var res []string + for _, cidStr := range args { + c, err := cid.Decode(cidStr) + if err != nil { + return nil, fmt.Errorf("%s: %v", cidStr, err) + } + base := opts.newBase + if base == -1 { + base, _ = cid.ExtractEncoding(cidStr) + } + if opts.verConv != nil { + c, err = opts.verConv(c) + if err != nil { + return nil, fmt.Errorf("%s: %v", cidStr, err) + } + } + str, err := cidutil.Format(opts.fmtStr, base, c) + if _, ok := err.(cidutil.FormatStringError); ok { + return nil, err + } else if err != nil { + return nil, fmt.Errorf("%s: %v", cidStr, err) + } + res = append(res, str) + } + return res, nil +} + +func toCidV0(c cid.Cid) (cid.Cid, error) { + if c.Type() != cid.DagProtobuf { + return cid.Cid{}, fmt.Errorf("can't convert non-protobuf nodes to cidv0") + } + return cid.NewCidV0(c.Hash()), nil +} + +func toCidV1(c cid.Cid) (cid.Cid, error) { + return cid.NewCidV1(c.Type(), c.Hash()), nil +} + +type CodeAndName struct { + Code int + Name string +} + +var basesCmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "List available multibase encodings.", + }, + Options: []cmdkit.Option{ + cmdkit.BoolOption("prefix", "also include the single leter prefixes in addition to the code"), + cmdkit.BoolOption("numeric", "also include numeric codes"), + }, + Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { + var res []CodeAndName + // use EncodingToStr in case at some point there are multiple names for a given code + for code, name := range mbase.EncodingToStr { + res = append(res, CodeAndName{int(code), name}) + } + cmds.EmitOnce(resp, res) + return nil + }, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w0 io.Writer, val0 interface{}) error { + w := tabwriter.NewWriter(w0, 0, 0, 2, ' ', 0) + prefixes, _ := req.Options["prefix"].(bool) + numeric, _ := req.Options["numeric"].(bool) + val := val0.([]CodeAndName) + sort.Sort(multibaseSorter{val}) + for _, v := range val { + if prefixes && v.Code >= 32 && v.Code < 127 { + fmt.Fprintf(w, "%c\t", v.Code) + } else if prefixes { + // don't display non-printable prefixes + fmt.Fprintf(w, "\t") + } + if numeric { + fmt.Fprintf(w, "%d\t%s\n", v.Code, v.Name) + } else { + fmt.Fprintf(w, "%s\n", v.Name) + } + } + w.Flush() + return nil + }), + }, + Type: []CodeAndName{}, +} + +var codecsCmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "List available CID codecs.", + }, + Options: []cmdkit.Option{ + cmdkit.BoolOption("numeric", "also include numeric codes"), + }, + Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { + var res []CodeAndName + // use CodecToStr as there are multiple names for a given code + for code, name := range cid.CodecToStr { + res = append(res, CodeAndName{int(code), name}) + } + cmds.EmitOnce(resp, res) + return nil + }, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w0 io.Writer, val0 interface{}) error { + w := tabwriter.NewWriter(w0, 0, 0, 2, ' ', 0) + numeric, _ := req.Options["numeric"].(bool) + val := val0.([]CodeAndName) + sort.Sort(codeAndNameSorter{val}) + for _, v := range val { + if numeric { + fmt.Fprintf(w, "%d\t%s\n", v.Code, v.Name) + } else { + fmt.Fprintf(w, "%s\n", v.Name) + } + } + w.Flush() + return nil + }), + }, + Type: []CodeAndName{}, +} + +var hashesCmd = &cmds.Command{ + Helptext: cmdkit.HelpText{ + Tagline: "List available multihashes.", + }, + Options: codecsCmd.Options, + Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { + var res []CodeAndName + // use mhash.Codes in case at some point there are multiple names for a given code + for code, name := range mhash.Codes { + if !verifcid.IsGoodHash(code) { + continue + } + res = append(res, CodeAndName{int(code), name}) + } + cmds.EmitOnce(resp, res) + return nil + }, + Encoders: codecsCmd.Encoders, + Type: codecsCmd.Type, +} + +type multibaseSorter struct { + data []CodeAndName +} + +func (s multibaseSorter) Len() int { return len(s.data) } +func (s multibaseSorter) Swap(i, j int) { s.data[i], s.data[j] = s.data[j], s.data[i] } + +func (s multibaseSorter) Less(i, j int) bool { + a := unicode.ToLower(rune(s.data[i].Code)) + b := unicode.ToLower(rune(s.data[j].Code)) + if a != b { + return a < b + } + // lowecase letters should come before uppercase + return s.data[i].Code > s.data[j].Code +} + +type codeAndNameSorter struct { + data []CodeAndName +} + +func (s codeAndNameSorter) Len() int { return len(s.data) } +func (s codeAndNameSorter) Swap(i, j int) { s.data[i], s.data[j] = s.data[j], s.data[i] } +func (s codeAndNameSorter) Less(i, j int) bool { return s.data[i].Code < s.data[j].Code } diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index ec4b4ba5f04..74d58903488 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -211,6 +211,12 @@ func TestCommands(t *testing.T) { "/urlstore", "/urlstore/add", "/version", + "/cid", + "/cid/format", + "/cid/base32", + "/cid/codecs", + "/cid/bases", + "/cid/hashes", } cmdSet := make(map[string]struct{}) diff --git a/core/commands/root.go b/core/commands/root.go index 0268136f610..900530a216b 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -71,6 +71,7 @@ TOOL COMMANDS version Show ipfs version information update Download and apply go-ipfs updates commands List all available commands + cid Convert and discover properties of CIDs Use 'ipfs --help' to learn more about each command. @@ -143,6 +144,7 @@ var rootSubcommands = map[string]*cmds.Command{ "urlstore": urlStoreCmd, "version": lgc.NewCommand(VersionCmd), "shutdown": daemonShutdownCmd, + "cid": CidCmd, } // RootRO is the readonly version of Root From 30b861bc5a5f47683d587dd81ae4683672ace9fd Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Fri, 24 Aug 2018 23:19:03 -0400 Subject: [PATCH 18/85] Remove "prefix" format string. Use WithDefault("%s') for `-f- option. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index 284f79c426e..f1b4a5e9fef 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -36,14 +36,14 @@ var cidFmtCmd = &cmds.Command{ LongDescription: ` Format and converts 's in various useful ways. -The optional format string either "prefix" or or a printf style format string: +The optional format string is a printf style format string: ` + cidutil.FormatRef, }, Arguments: []cmdkit.Argument{ cmdkit.StringArg("cid", true, true, "Cids to format."), }, Options: []cmdkit.Option{ - cmdkit.StringOption("f", "Format string."), + cmdkit.StringOption("f", "Printf style format string.").WithDefault("%s"), cmdkit.StringOption("v", "CID version to convert to."), cmdkit.StringOption("b", "Multibase to display CID in."), }, @@ -54,17 +54,10 @@ The optional format string either "prefix" or or a printf style format string: opts := cidFormatOpts{} - switch fmtStr { - case "": - opts.fmtStr = "%s" - case "prefix": - opts.fmtStr = "%P" - default: - if strings.IndexByte(fmtStr, '%') == -1 { - return fmt.Errorf("invalid format string: %s", fmtStr) - } - opts.fmtStr = fmtStr + if strings.IndexByte(fmtStr, '%') == -1 { + return fmt.Errorf("invalid format string: %s", fmtStr) } + opts.fmtStr = fmtStr switch verStr { case "": From 98e5999761bf97f9dba8487d70afcdca23540e24 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Sun, 26 Aug 2018 20:10:19 -0400 Subject: [PATCH 19/85] Factor out boiler plate code for PostRun in "ipfs filestore ls". License: MIT Signed-off-by: Kevin Atkinson --- core/commands/commands.go | 40 ++++++++++++++++++++++++++++++++++++++ core/commands/filestore.go | 37 +++++++---------------------------- 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/core/commands/commands.go b/core/commands/commands.go index 51c707c6e41..a89b279f773 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -8,6 +8,7 @@ package commands import ( "fmt" "io" + "os" "sort" "strings" @@ -149,3 +150,42 @@ func unwrapOutput(i interface{}) (interface{}, error) { return <-ch, nil } + +type nonFatalError string + +// streamRes is a helper function to stream results, that possibly +// contain with non-fatal, the helper function is allowed to panic on +// internal errors +func streamRes(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error { + return func(res cmds.Response, re cmds.ResponseEmitter) (err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("internal error: %v", r) + } + re.Close() + }() + + var errors bool + for { + v, err := res.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + errorMsg := procVal(v, os.Stdout) + + if errorMsg != "" { + errors = true + fmt.Fprintf(os.Stderr, "%s\n", errorMsg) + } + } + + if errors { + return fmt.Errorf("errors while displaying some entries") + } + return nil + } +} diff --git a/core/commands/filestore.go b/core/commands/filestore.go index a45e01ef93f..deb7520d22f 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "os" oldCmds "github.com/ipfs/go-ipfs/commands" lgc "github.com/ipfs/go-ipfs/commands/legacy" @@ -73,36 +72,14 @@ The output is: return res.Emit(out) }, PostRun: cmds.PostRunMap{ - cmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error { - var errors bool - for { - v, err := res.Next() - if err != nil { - if err == io.EOF { - break - } - return err - } - - r, ok := v.(*filestore.ListRes) - if !ok { - return e.New(e.TypeErr(r, v)) - } - - if r.ErrorMsg != "" { - errors = true - fmt.Fprintf(os.Stderr, "%s\n", r.ErrorMsg) - } else { - fmt.Fprintf(os.Stdout, "%s\n", r.FormatLong()) - } - } - - if errors { - return fmt.Errorf("errors while displaying some entries") + cmds.CLI: streamRes(func(v interface{}, out io.Writer) nonFatalError { + r := v.(*filestore.ListRes) + if r.ErrorMsg != "" { + return nonFatalError(r.ErrorMsg) } - - return nil - }, + fmt.Fprintf(out, "%s\n", r.FormatLong()) + return "" + }), }, Type: filestore.ListRes{}, } From e5622f628a8d5e92f66f81758e3800a766e9d297 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Sun, 26 Aug 2018 20:30:54 -0400 Subject: [PATCH 20/85] Stream results for "ipfs cid format". Note reading input from Stdin is broken. Only the first result is accepted. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 68 +++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index f1b4a5e9fef..fc26b692d96 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -80,22 +80,25 @@ The optional format string is a printf style format string: opts.newBase = mbase.Encoding(-1) } - res, err := formatCids(req.Arguments, opts) - if err != nil { - return err - } - cmds.EmitOnce(resp, res) - return nil + return emitCids(req, resp, opts) }, - Encoders: cmds.EncoderMap{ - cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val interface{}) error { - for _, v := range val.([]string) { - fmt.Fprintf(w, "%s\n", v) + PostRun: cmds.PostRunMap{ + cmds.CLI: streamRes(func(v interface{}, out io.Writer) nonFatalError { + r := v.(*CidFormatRes) + if r.ErrorMsg != "" { + return nonFatalError(fmt.Sprintf("%s: %s", r.CidStr, r.ErrorMsg)) } - return nil + fmt.Fprintf(out, "%s\n", r.Formatted) + return "" }), }, - Type: []string{}, + Type: CidFormatRes{}, +} + +type CidFormatRes struct { + CidStr string // Original Cid String passed in + Formatted string // Formated Result + ErrorMsg string // Error } var base32Cmd = &cmds.Command{ @@ -103,7 +106,7 @@ var base32Cmd = &cmds.Command{ Tagline: "Convert CIDs to Base32 CID version 1.", }, Arguments: []cmdkit.Argument{ - cmdkit.StringArg("cid", true, true, "Cids to convert."), + cmdkit.StringArg("cid", true, true, "Cids to convert.").EnableStdin(), }, Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { opts := cidFormatOpts{ @@ -111,16 +114,10 @@ var base32Cmd = &cmds.Command{ newBase: mbase.Encoding(mbase.Base32), verConv: toCidV1, } - res, err := formatCids(req.Arguments, opts) - if err != nil { - return err - } - - cmds.EmitOnce(resp, res) - return nil + return emitCids(req, resp, opts) }, - Encoders: cidFmtCmd.Encoders, - Type: cidFmtCmd.Type, + PostRun: cidFmtCmd.PostRun, + Type: cidFmtCmd.Type, } type cidFormatOpts struct { @@ -129,12 +126,19 @@ type cidFormatOpts struct { verConv func(cid cid.Cid) (cid.Cid, error) } -func formatCids(args []string, opts cidFormatOpts) ([]string, error) { - var res []string - for _, cidStr := range args { +func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) error { + for _, cidStr := range req.Arguments { + emit := func(fmtd string, err error) { + res := &CidFormatRes{CidStr: cidStr, Formatted: fmtd} + if err != nil { + res.ErrorMsg = err.Error() + } + resp.Emit(res) + } c, err := cid.Decode(cidStr) if err != nil { - return nil, fmt.Errorf("%s: %v", cidStr, err) + emit("", err) + continue } base := opts.newBase if base == -1 { @@ -143,18 +147,18 @@ func formatCids(args []string, opts cidFormatOpts) ([]string, error) { if opts.verConv != nil { c, err = opts.verConv(c) if err != nil { - return nil, fmt.Errorf("%s: %v", cidStr, err) + emit("", err) + continue } } str, err := cidutil.Format(opts.fmtStr, base, c) if _, ok := err.(cidutil.FormatStringError); ok { - return nil, err - } else if err != nil { - return nil, fmt.Errorf("%s: %v", cidStr, err) + // no point in continuing if there is a problem with the format string + return err } - res = append(res, str) + emit(str, err) } - return res, nil + return nil } func toCidV0(c cid.Cid) (cid.Cid, error) { From 599bb7302ea93eeed93b64eaebe00b4eace77f53 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Mon, 27 Aug 2018 18:12:52 -0400 Subject: [PATCH 21/85] Right align numbers in "ipfs cid bases|codecs|hashes" output. This also avoid using TabWriter as it doesn't support right aligning a single column and also because its an overkill for this case. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index fc26b692d96..ffc9df7d19e 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -5,7 +5,6 @@ import ( "io" "sort" "strings" - "text/tabwriter" "unicode" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" @@ -195,26 +194,28 @@ var basesCmd = &cmds.Command{ return nil }, Encoders: cmds.EncoderMap{ - cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w0 io.Writer, val0 interface{}) error { - w := tabwriter.NewWriter(w0, 0, 0, 2, ' ', 0) + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { prefixes, _ := req.Options["prefix"].(bool) numeric, _ := req.Options["numeric"].(bool) val := val0.([]CodeAndName) sort.Sort(multibaseSorter{val}) for _, v := range val { - if prefixes && v.Code >= 32 && v.Code < 127 { - fmt.Fprintf(w, "%c\t", v.Code) - } else if prefixes { + code := v.Code + if code < 32 || code >= 127 { // don't display non-printable prefixes - fmt.Fprintf(w, "\t") + code = ' ' } - if numeric { - fmt.Fprintf(w, "%d\t%s\n", v.Code, v.Name) - } else { + switch { + case prefixes && numeric: + fmt.Fprintf(w, "%c %5d %s\n", code, v.Code, v.Name) + case prefixes: + fmt.Fprintf(w, "%c %s\n", code, v.Name) + case numeric: + fmt.Fprintf(w, "%5d %s\n", v.Code, v.Name) + default: fmt.Fprintf(w, "%s\n", v.Name) } } - w.Flush() return nil }), }, @@ -238,19 +239,17 @@ var codecsCmd = &cmds.Command{ return nil }, Encoders: cmds.EncoderMap{ - cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w0 io.Writer, val0 interface{}) error { - w := tabwriter.NewWriter(w0, 0, 0, 2, ' ', 0) + cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { numeric, _ := req.Options["numeric"].(bool) val := val0.([]CodeAndName) sort.Sort(codeAndNameSorter{val}) for _, v := range val { if numeric { - fmt.Fprintf(w, "%d\t%s\n", v.Code, v.Name) + fmt.Fprintf(w, "%5d %s\n", v.Code, v.Name) } else { fmt.Fprintf(w, "%s\n", v.Name) } } - w.Flush() return nil }), }, From f3ea21c821403c6b07bf594dc316163341adb630 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Mon, 27 Aug 2018 18:52:31 -0400 Subject: [PATCH 22/85] Reenable Stdin argument reading. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index ffc9df7d19e..1211b027d47 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -39,7 +39,7 @@ The optional format string is a printf style format string: ` + cidutil.FormatRef, }, Arguments: []cmdkit.Argument{ - cmdkit.StringArg("cid", true, true, "Cids to format."), + cmdkit.StringArg("cid", true, true, "Cids to format.").EnableStdin(), }, Options: []cmdkit.Option{ cmdkit.StringOption("f", "Printf style format string.").WithDefault("%s"), @@ -125,8 +125,37 @@ type cidFormatOpts struct { verConv func(cid cid.Cid) (cid.Cid, error) } +type argumentIterator struct { + args []string + body cmds.StdinArguments +} + +func (i *argumentIterator) next() (string, bool) { + if len(i.args) > 0 { + arg := i.args[0] + i.args = i.args[1:] + return arg, true + } + if i.body == nil || !i.body.Scan() { + return "", false + } + return strings.TrimSpace(i.body.Argument()), true +} + +func (i *argumentIterator) err() error { + if i.body == nil { + return nil + } + return i.body.Err() +} + func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) error { - for _, cidStr := range req.Arguments { + itr := argumentIterator{req.Arguments, req.BodyArgs()} + for { + cidStr, ok := itr.next() + if !ok { + break + } emit := func(fmtd string, err error) { res := &CidFormatRes{CidStr: cidStr, Formatted: fmtd} if err != nil { @@ -157,6 +186,10 @@ func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) } emit(str, err) } + err := itr.err() + if err != nil { + return err + } return nil } From 88a7e58b582ed81105d09e595a8635d69c502afc Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Mon, 27 Aug 2018 19:39:14 -0400 Subject: [PATCH 23/85] Add basic sharness tests. License: MIT Signed-off-by: Kevin Atkinson --- test/sharness/t0290-cid.sh | 228 +++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100755 test/sharness/t0290-cid.sh diff --git a/test/sharness/t0290-cid.sh b/test/sharness/t0290-cid.sh new file mode 100755 index 00000000000..ecc2ba19e4b --- /dev/null +++ b/test/sharness/t0290-cid.sh @@ -0,0 +1,228 @@ +#!/usr/bin/env bash + +test_description="Test cid commands" + +. lib/test-lib.sh + +# note: all "ipfs cid" commands should work without requiring a repo + +CIDv0="QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv" +CIDv1="zdj7WZAAFKPvYPPzyJLso2hhxo8a7ZACFQ4DvvfrNXTHidofr" +CIDb32="bafybeibxm2nsadl3fnxv2sxcxmxaco2jl53wpeorjdzidjwf5aqdg7wa6u" + +test_expect_success "cid base32 works" ' + echo $CIDb32 > expected && + ipfs cid base32 $CIDv0 > actual1 && + test_cmp actual1 expected && + ipfs cid base32 $CIDv1 > actual2 && + test_cmp expected actual2 +' + +test_expect_success "cid format -v 1 -b base58btc" ' + echo $CIDv1 > expected && + ipfs cid format -v 1 -b base58btc $CIDv0 > actual1 && + test_cmp actual1 expected && + ipfs cid format -v 1 -b base58btc $CIDb32 > actual2 && + test_cmp expected actual2 +' + +cat < various_cids +QmZZRTyhDpL5Jgift1cHbAhexeE1m2Hw8x8g7rTcPahDvo + QmPhk6cJkRcFfZCdYam4c9MKYjFG9V29LswUnbrFNhtk2S +bafybeihtwdtifv43rn5cyilnmkwofdcxi2suqimmo62vn3etf45gjoiuwy +bafybeiek4tfxkc4ov6jsmb63fzbirrsalnjw24zd5xawo2fgxisd4jmpyq +zdj7WgYfT2gfsgiUxzPYboaRbP9H9CxZE5jVMK9pDDwCcKDCR +zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi +uAXASIDsp4T3Wnd6kXFOQaljH3GFK_ixkjMtVhB9VOBrPK3bp + uAXASIDdmmyANeytvXUriuy4BO0lfd2eR0UjygabF6CAzfsD1 +EOF + +cat < various_cids_base32 +bafybeifgwyq5gs4l2mru5klgwjfmftjvkmbyyjurbupuz2bst7mhmg2hwa +bafybeiauil46g3lb32jemjbl7yspca3twdcg4wwkbsgdgvgdj5fpfv2f64 +bafybeihtwdtifv43rn5cyilnmkwofdcxi2suqimmo62vn3etf45gjoiuwy +bafybeiek4tfxkc4ov6jsmb63fzbirrsalnjw24zd5xawo2fgxisd4jmpyq +bafybeifffq3aeaymxejo37sn5fyaf7nn7hkfmzwdxyjculx3lw4tyhk7uy +bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354 +bafybeib3fhqt3vu532sfyu4qnjmmpxdbjl7cyzemznkyih2vhanm6k3w5e +bafybeibxm2nsadl3fnxv2sxcxmxaco2jl53wpeorjdzidjwf5aqdg7wa6u +EOF + +cat < various_cids_v1 +zdj7WgefqQm5HogBQ2bckZuTYYDarRTUZi51GYCnerHD2G86j +zdj7WWnzU3Nbu5rYGWZHKigUXBtAwShs2SHDCM1TQEvC9TeCN +zdj7WmqAbpsfXgiRBtZP1oAP9QWuuY3mqbc5JhpxJkfT3vYCu +zdj7Wen5gtfr7AivXip3zYd1peuq2QfKrqAn4FGiciVWb96YB +zdj7WgYfT2gfsgiUxzPYboaRbP9H9CxZE5jVMK9pDDwCcKDCR +zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi +zdj7WZQrAvnY5ge3FNg5cmCsNwsvpYjdtu2yEmnWYQ4ES7Nzk +zdj7WZAAFKPvYPPzyJLso2hhxo8a7ZACFQ4DvvfrNXTHidofr +EOF + +test_expect_success "cid base32 works from stdin" ' + cat various_cids | ipfs cid base32 > actual && + test_cmp various_cids_base32 actual +' + +test_expect_success "cid format -v 1 -b base58btc works from stdin" ' + cat various_cids | ipfs cid format -v 1 -b base58btc > actual && + test_cmp various_cids_v1 actual +' + +cat < bases_expect + 0 identity +b 98 base32 +B 66 base32upper +c 99 base32pad +C 67 base32padupper +f 102 base16 +F 70 base16upper +m 109 base64 +M 77 base64pad +t 116 base32hexpad +T 84 base32hexpadupper +u 117 base64url +U 85 base64urlpad +v 118 base32hex +V 86 base32hexupper +z 122 base58btc +Z 90 base58flickr +EOF + +cat < codecs_expect + 85 raw + 112 protobuf + 113 cbor + 120 git-raw + 144 eth-block + 145 eth-block-list + 146 eth-tx-trie + 147 eth-tx + 148 eth-tx-receipt-trie + 149 eth-tx-receipt + 150 eth-state-trie + 151 eth-account-snapshot + 152 eth-storage-trie + 176 bitcoin-block + 177 bitcoin-tx + 192 zcash-block + 193 zcash-tx + 224 decred-block + 225 decred-tx +EOF + +cat < hashes_expect + 0 id + 17 sha1 + 18 sha2-256 + 19 sha2-512 + 20 sha3-512 + 21 sha3-384 + 22 sha3-256 + 23 sha3-224 + 25 shake-256 + 26 keccak-224 + 27 keccak-256 + 28 keccak-384 + 29 keccak-512 + 86 dbl-sha2-256 +45588 blake2b-160 +45589 blake2b-168 +45590 blake2b-176 +45591 blake2b-184 +45592 blake2b-192 +45593 blake2b-200 +45594 blake2b-208 +45595 blake2b-216 +45596 blake2b-224 +45597 blake2b-232 +45598 blake2b-240 +45599 blake2b-248 +45600 blake2b-256 +45601 blake2b-264 +45602 blake2b-272 +45603 blake2b-280 +45604 blake2b-288 +45605 blake2b-296 +45606 blake2b-304 +45607 blake2b-312 +45608 blake2b-320 +45609 blake2b-328 +45610 blake2b-336 +45611 blake2b-344 +45612 blake2b-352 +45613 blake2b-360 +45614 blake2b-368 +45615 blake2b-376 +45616 blake2b-384 +45617 blake2b-392 +45618 blake2b-400 +45619 blake2b-408 +45620 blake2b-416 +45621 blake2b-424 +45622 blake2b-432 +45623 blake2b-440 +45624 blake2b-448 +45625 blake2b-456 +45626 blake2b-464 +45627 blake2b-472 +45628 blake2b-480 +45629 blake2b-488 +45630 blake2b-496 +45631 blake2b-504 +45632 blake2b-512 +45652 blake2s-160 +45653 blake2s-168 +45654 blake2s-176 +45655 blake2s-184 +45656 blake2s-192 +45657 blake2s-200 +45658 blake2s-208 +45659 blake2s-216 +45660 blake2s-224 +45661 blake2s-232 +45662 blake2s-240 +45663 blake2s-248 +45664 blake2s-256 +EOF + +test_expect_success "cid bases" ' + cut -c 10- bases_expect > expect && + ipfs cid bases > actual && + test_cmp expect actual +' + +test_expect_success "cid bases --prefix" ' + cut -c 1-3,10- bases_expect > expect && + ipfs cid bases --prefix > actual && + test_cmp expect actual +' + +test_expect_success "cid bases --prefix --numeric" ' + ipfs cid bases --prefix --numeric > actual && + test_cmp bases_expect actual +' + +test_expect_success "cid codecs" ' + cut -c 8- codecs_expect > expect && + ipfs cid codecs > actual + test_cmp expect actual +' + +test_expect_success "cid codecs --numeric" ' + ipfs cid codecs --numeric > actual && + test_cmp codecs_expect actual +' + +test_expect_success "cid hashes" ' + cut -c 8- hashes_expect > expect && + ipfs cid hashes > actual + test_cmp expect actual +' + +test_expect_success "cid hashes --numeric" ' + ipfs cid hashes --numeric > actual && + test_cmp hashes_expect actual +' + +test_done From c0a873c27fe412a1ad76e5e479aa5d6a314381da Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Wed, 29 Aug 2018 23:39:05 -0400 Subject: [PATCH 24/85] Address code review. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 16 ++++++++++++---- core/commands/commands.go | 8 ++++---- core/commands/filestore.go | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index 1211b027d47..16c5d19e7fc 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -6,6 +6,8 @@ import ( "sort" "strings" "unicode" + + "github.com/ipfs/go-ipfs/core/commands/e" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mhash "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" @@ -66,7 +68,7 @@ The optional format string is a printf style format string: case "1": opts.verConv = toCidV1 default: - return fmt.Errorf("invalid cid version: %s\n", verStr) + return fmt.Errorf("invalid cid version: %s", verStr) } if baseStr != "" { @@ -82,7 +84,7 @@ The optional format string is a printf style format string: return emitCids(req, resp, opts) }, PostRun: cmds.PostRunMap{ - cmds.CLI: streamRes(func(v interface{}, out io.Writer) nonFatalError { + cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError { r := v.(*CidFormatRes) if r.ErrorMsg != "" { return nonFatalError(fmt.Sprintf("%s: %s", r.CidStr, r.ErrorMsg)) @@ -230,7 +232,10 @@ var basesCmd = &cmds.Command{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { prefixes, _ := req.Options["prefix"].(bool) numeric, _ := req.Options["numeric"].(bool) - val := val0.([]CodeAndName) + val, ok := val0.([]CodeAndName) + if !ok { + return e.TypeErr(val, val0) + } sort.Sort(multibaseSorter{val}) for _, v := range val { code := v.Code @@ -274,7 +279,10 @@ var codecsCmd = &cmds.Command{ Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { numeric, _ := req.Options["numeric"].(bool) - val := val0.([]CodeAndName) + val, ok := val0.([]CodeAndName) + if !ok { + return e.TypeErr(val, val0) + } sort.Sort(codeAndNameSorter{val}) for _, v := range val { if numeric { diff --git a/core/commands/commands.go b/core/commands/commands.go index a89b279f773..fcfafcee395 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -153,10 +153,10 @@ func unwrapOutput(i interface{}) (interface{}, error) { type nonFatalError string -// streamRes is a helper function to stream results, that possibly -// contain with non-fatal, the helper function is allowed to panic on -// internal errors -func streamRes(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error { +// streamResults is a helper function to stream results that possibly +// contain non-fatal errors. The helper function is allowed to panic +// on internal errors. +func streamResults(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error { return func(res cmds.Response, re cmds.ResponseEmitter) (err error) { defer func() { if r := recover(); r != nil { diff --git a/core/commands/filestore.go b/core/commands/filestore.go index deb7520d22f..9dd94269873 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -72,7 +72,7 @@ The output is: return res.Emit(out) }, PostRun: cmds.PostRunMap{ - cmds.CLI: streamRes(func(v interface{}, out io.Writer) nonFatalError { + cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError { r := v.(*filestore.ListRes) if r.ErrorMsg != "" { return nonFatalError(r.ErrorMsg) From 7edc7de28822b6ea0fe237e2d1ad6e230919d3f8 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Thu, 30 Aug 2018 03:19:29 -0400 Subject: [PATCH 25/85] Eliminate `emit` closure, so something with errors on call to emit. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index 16c5d19e7fc..6defab4c862 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -6,7 +6,7 @@ import ( "sort" "strings" "unicode" - + "github.com/ipfs/go-ipfs/core/commands/e" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" @@ -153,21 +153,17 @@ func (i *argumentIterator) err() error { func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) error { itr := argumentIterator{req.Arguments, req.BodyArgs()} - for { + var emitErr error + for emitErr == nil { cidStr, ok := itr.next() if !ok { break } - emit := func(fmtd string, err error) { - res := &CidFormatRes{CidStr: cidStr, Formatted: fmtd} - if err != nil { - res.ErrorMsg = err.Error() - } - resp.Emit(res) - } + res := &CidFormatRes{CidStr: cidStr} c, err := cid.Decode(cidStr) if err != nil { - emit("", err) + res.ErrorMsg = err.Error() + emitErr = resp.Emit(res) continue } base := opts.newBase @@ -177,7 +173,8 @@ func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) if opts.verConv != nil { c, err = opts.verConv(c) if err != nil { - emit("", err) + res.ErrorMsg = err.Error() + emitErr = resp.Emit(res) continue } } @@ -186,7 +183,15 @@ func emitCids(req *cmds.Request, resp cmds.ResponseEmitter, opts cidFormatOpts) // no point in continuing if there is a problem with the format string return err } - emit(str, err) + if err != nil { + res.ErrorMsg = err.Error() + } else { + res.Formatted = str + } + emitErr = resp.Emit(res) + } + if emitErr != nil { + return emitErr } err := itr.err() if err != nil { From 54904a76914121a4017ae22d0c2090caf91f8858 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Thu, 20 Sep 2018 03:20:17 -0400 Subject: [PATCH 26/85] Rename streamResults to streamResult. License: MIT Signed-off-by: Kevin Atkinson --- core/commands/cid.go | 2 +- core/commands/commands.go | 4 ++-- core/commands/filestore.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/commands/cid.go b/core/commands/cid.go index 6defab4c862..aa44e3d685e 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -84,7 +84,7 @@ The optional format string is a printf style format string: return emitCids(req, resp, opts) }, PostRun: cmds.PostRunMap{ - cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError { + cmds.CLI: streamResult(func(v interface{}, out io.Writer) nonFatalError { r := v.(*CidFormatRes) if r.ErrorMsg != "" { return nonFatalError(fmt.Sprintf("%s: %s", r.CidStr, r.ErrorMsg)) diff --git a/core/commands/commands.go b/core/commands/commands.go index fcfafcee395..65757c1cf75 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -153,10 +153,10 @@ func unwrapOutput(i interface{}) (interface{}, error) { type nonFatalError string -// streamResults is a helper function to stream results that possibly +// streamResult is a helper function to stream results that possibly // contain non-fatal errors. The helper function is allowed to panic // on internal errors. -func streamResults(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error { +func streamResult(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error { return func(res cmds.Response, re cmds.ResponseEmitter) (err error) { defer func() { if r := recover(); r != nil { diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 9dd94269873..1a78dd761f1 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -72,7 +72,7 @@ The output is: return res.Emit(out) }, PostRun: cmds.PostRunMap{ - cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError { + cmds.CLI: streamResult(func(v interface{}, out io.Writer) nonFatalError { r := v.(*filestore.ListRes) if r.ErrorMsg != "" { return nonFatalError(r.ErrorMsg) From 0f3cea6a8e4112348c55d3dc49f5a389e2f13602 Mon Sep 17 00:00:00 2001 From: rob-deutsch Date: Sat, 29 Sep 2018 16:45:12 +1000 Subject: [PATCH 27/85] debug-guide.md added memory statistics command License: MIT Signed-off-by: Rob Deutsch --- docs/debug-guide.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/debug-guide.md b/docs/debug-guide.md index b7f5e0b42d3..9ef046a47e1 100644 --- a/docs/debug-guide.md +++ b/docs/debug-guide.md @@ -4,8 +4,9 @@ This is a document for helping debug go-ipfs. Please add to it if you can! ### Table of Contents - [Beginning](#beginning) -- [Analysing the stack dump](#analysing-the-stack-dump) +- [Analyzing the stack dump](#analyzing-the-stack-dump) - [Analyzing the CPU Profile](#analyzing-the-cpu-profile) +- [Analyzing vars and memory statistics](#analyzing-vars-and-memory-statistics) - [Other](#other) ### Beginning @@ -20,6 +21,8 @@ profiling information. - `curl localhost:5001/debug/pprof/profile > ipfs.cpuprof` - heap trace dump - `curl localhost:5001/debug/pprof/heap > ipfs.heap` +- memory statistics (in json, see "memstats" object) + - `curl localhost:5001/debug/vars > ipfs.vars` - system information - `ipfs diag sys > ipfs.sysinfo` @@ -28,7 +31,7 @@ Bundle all that up and include a copy of the ipfs binary that you are running You can investigate yourself if you feel intrepid: -### Analysing the stack dump +### Analyzing the stack dump The first thing to look for is hung goroutines -- any goroutine thats been stuck for over a minute will note that in the trace. It looks something like: @@ -84,6 +87,10 @@ about `go tool pprof`. My go-to method of analyzing these is to run the `web` command, which generates an SVG dotgraph and opens it in your browser. This is the quickest way to easily point out where the hot spots in the code are. +### Analyzing vars and memory statistics + +The output is JSON formatted and includes badger store statistics, the command line run, and the output from Go's [runtime.ReadMemStats](https://golang.org/pkg/runtime/#ReadMemStats). The [MemStats](https://golang.org/pkg/runtime/#MemStats) has useful information about memory allocation and garbage collection. + ### Other If you have any questions, or want us to analyze some weird go-ipfs behaviour, From b2f6c3e3ed145725c7c9a1e9b6cdb705c8c87bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 2 Oct 2018 12:31:50 +0200 Subject: [PATCH 28/85] coreapi swarm: missing docs, review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/swarm.go | 4 ++-- core/coreapi/interface/swarm.go | 9 +++++++-- core/coreapi/swarm.go | 12 ++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 09fe464b03a..295f955f430 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -94,7 +94,7 @@ var swarmPeersCmd = &cmds.Command{ } if verbose || latency { - lat, err := c.Latency(req.Context) + lat, err := c.Latency() if err != nil { return err } @@ -106,7 +106,7 @@ var swarmPeersCmd = &cmds.Command{ } } if verbose || streams { - strs, err := c.Streams(req.Context) + strs, err := c.Streams() if err != nil { return err } diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index caa6a70e327..8b464e5c1f0 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -29,10 +29,10 @@ type ConnectionInfo interface { Direction() net.Direction // Latency returns last known round trip time to the peer - Latency(context.Context) (time.Duration, error) + Latency() (time.Duration, error) // Streams returns list of streams established with the peer - Streams(context.Context) ([]protocol.ID, error) + Streams() ([]protocol.ID, error) } // SwarmAPI specifies the interface to libp2p swarm @@ -46,7 +46,12 @@ type SwarmAPI interface { // Peers returns the list of peers we are connected to Peers(context.Context) ([]ConnectionInfo, error) + // KnownAddrs returns the list of all addresses this node is aware of KnownAddrs(context.Context) (map[peer.ID][]ma.Multiaddr, error) + + // LocalAddrs returns the list of announced listening addresses LocalAddrs(context.Context) ([]ma.Multiaddr, error) + + // ListenAddrs returns the list of all listening addresses ListenAddrs(context.Context) ([]ma.Multiaddr, error) } diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index b780682b25e..47641c9dc1f 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -2,7 +2,6 @@ package coreapi import ( "context" - "fmt" "sort" "time" @@ -37,13 +36,10 @@ func (api *SwarmAPI) Connect(ctx context.Context, pi pstore.PeerInfo) error { return coreiface.ErrOffline } - swrm, ok := api.node.PeerHost.Network().(*swarm.Swarm) - if !ok { - return fmt.Errorf("peerhost network was not swarm") + if swrm, ok := api.node.PeerHost.Network().(*swarm.Swarm); ok { + swrm.Backoff().Clear(pi.ID) } - swrm.Backoff().Clear(pi.ID) - return api.node.PeerHost.Connect(ctx, pi) } @@ -164,11 +160,11 @@ func (ci *connInfo) Direction() net.Direction { return ci.dir } -func (ci *connInfo) Latency(context.Context) (time.Duration, error) { +func (ci *connInfo) Latency() (time.Duration, error) { return ci.api.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil } -func (ci *connInfo) Streams(context.Context) ([]protocol.ID, error) { +func (ci *connInfo) Streams() ([]protocol.ID, error) { streams := ci.conn.GetStreams() out := make([]protocol.ID, len(streams)) From 1ed555b87f3d933bd3e234d083168254bf6f309d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 19 Sep 2018 23:40:45 +0200 Subject: [PATCH 29/85] Cleanup instances of manual resolver construction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/cat.go | 21 +++++-- core/commands/files.go | 36 ++++++----- core/commands/ls.go | 27 ++++---- core/commands/pin.go | 75 ++++++++++------------- core/commands/unixfs/ls.go | 28 +++++---- core/coreapi/interface/util.go | 12 +++- core/coreapi/pin.go | 15 +++-- core/corerepo/pinning.go | 32 +++------- core/coreunix/cat.go | 24 -------- core/pathresolver.go | 39 +----------- fuse/readonly/ipfs_test.go | 17 ++--- test/integration/addcat_test.go | 11 +++- test/integration/bench_cat_test.go | 11 +++- test/integration/three_legged_cat_test.go | 12 +++- 14 files changed, 170 insertions(+), 190 deletions(-) delete mode 100644 core/coreunix/cat.go diff --git a/core/commands/cat.go b/core/commands/cat.go index 125d6a3ed22..0ade25daa59 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -6,9 +6,8 @@ import ( "io" "os" - core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" - coreunix "github.com/ipfs/go-ipfs/core/coreunix" + "github.com/ipfs/go-ipfs/core/coreapi/interface" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" @@ -35,6 +34,11 @@ var CatCmd = &cmds.Command{ return err } + api, err := cmdenv.GetApi(env) + if err != nil { + return err + } + if !node.OnlineMode() { if err := node.SetupOfflineRouting(); err != nil { return err @@ -62,7 +66,7 @@ var CatCmd = &cmds.Command{ return err } - readers, length, err := cat(req.Context, node, req.Arguments, int64(offset), int64(max)) + readers, length, err := cat(req.Context, api, req.Arguments, int64(offset), int64(max)) if err != nil { return err } @@ -115,14 +119,19 @@ var CatCmd = &cmds.Command{ }, } -func cat(ctx context.Context, node *core.IpfsNode, paths []string, offset int64, max int64) ([]io.Reader, uint64, error) { +func cat(ctx context.Context, api iface.CoreAPI, paths []string, offset int64, max int64) ([]io.Reader, uint64, error) { readers := make([]io.Reader, 0, len(paths)) length := uint64(0) if max == 0 { return nil, 0, nil } - for _, fpath := range paths { - read, err := coreunix.Cat(ctx, node, fpath) + for _, p := range paths { + fpath, err := iface.ParsePath(p) + if err != nil { + return nil, 0, err + } + + read, err := api.Unixfs().Cat(ctx, fpath) if err != nil { return nil, 0, err } diff --git a/core/commands/files.go b/core/commands/files.go index 7ad62dabfea..bf6b06b5e9b 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -16,21 +16,19 @@ import ( core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + "github.com/ipfs/go-ipfs/core/coreapi/interface" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + bservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -120,6 +118,11 @@ var filesStatCmd = &cmds.Command{ return err } + api, err := cmdenv.GetApi(env) + if err != nil { + return err + } + path, err := checkPath(req.Arguments[0]) if err != nil { return err @@ -138,7 +141,7 @@ var filesStatCmd = &cmds.Command{ dagserv = node.DAG } - nd, err := getNodeFromPath(req.Context, node, dagserv, path) + nd, err := getNodeFromPath(req.Context, node, api, path) if err != nil { return err } @@ -305,6 +308,12 @@ var filesCpCmd = &oldcmds.Command{ return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + flush, _, _ := req.Option("flush").Bool() src, err := checkPath(req.Arguments()[0]) @@ -324,7 +333,7 @@ var filesCpCmd = &oldcmds.Command{ dst += gopath.Base(src) } - nd, err := getNodeFromPath(req.Context(), node, node.DAG, src) + nd, err := getNodeFromPath(req.Context(), node, api, src) if err != nil { res.SetError(fmt.Errorf("cp: cannot get node from path %s: %s", src, err), cmdkit.ErrNormal) return @@ -348,20 +357,15 @@ var filesCpCmd = &oldcmds.Command{ }, } -func getNodeFromPath(ctx context.Context, node *core.IpfsNode, dagservice ipld.DAGService, p string) (ipld.Node, error) { +func getNodeFromPath(ctx context.Context, node *core.IpfsNode, api iface.CoreAPI, p string) (ipld.Node, error) { switch { case strings.HasPrefix(p, "/ipfs/"): - np, err := path.ParsePath(p) + np, err := iface.ParsePath(p) if err != nil { return nil, err } - resolver := &resolver.Resolver{ - DAG: dagservice, - ResolveOnce: uio.ResolveUnixfsOnce, - } - - return core.Resolve(ctx, node.Namesys, resolver, np) + return api.ResolveNode(ctx, np) default: fsn, err := mfs.Lookup(node.FilesRoot, p) if err != nil { diff --git a/core/commands/ls.go b/core/commands/ls.go index 491ab671a4d..754b9db2a6c 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -7,19 +7,17 @@ import ( "text/tabwriter" cmds "github.com/ipfs/go-ipfs/commands" - core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" + iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + + cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" + "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" unixfspb "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/pb" merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" - - cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -65,6 +63,12 @@ The JSON output contains type information. return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + // get options early -> exit early in case of error if _, _, err := req.Option("headers").Bool(); err != nil { res.SetError(err, cmdkit.ErrNormal) @@ -88,18 +92,13 @@ The JSON output contains type information. var dagnodes []ipld.Node for _, fpath := range paths { - p, err := path.ParsePath(fpath) + p, err := iface.ParsePath(fpath) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - r := &resolver.Resolver{ - DAG: nd.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - - dagnode, err := core.Resolve(req.Context(), nd.Namesys, r, p) + dagnode, err := api.ResolveNode(req.Context(), p) if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/pin.go b/core/commands/pin.go index bb6540fa5ec..ce0903465e5 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -10,9 +10,10 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" + iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" corerepo "github.com/ipfs/go-ipfs/core/corerepo" pin "github.com/ipfs/go-ipfs/pin" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" @@ -20,8 +21,6 @@ import ( "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" ) var PinCmd = &cmds.Command{ @@ -68,6 +67,12 @@ var addPinCmd = &cmds.Command{ return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + defer n.Blockstore.PinLock().Unlock() // set recursive flag @@ -79,7 +84,7 @@ var addPinCmd = &cmds.Command{ showProgress, _, _ := req.Option("progress").Bool() if !showProgress { - added, err := corerepo.Pin(n, req.Context(), req.Arguments(), recursive) + added, err := corerepo.Pin(n, api, req.Context(), req.Arguments(), recursive) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -99,7 +104,7 @@ var addPinCmd = &cmds.Command{ } ch := make(chan pinResult, 1) go func() { - added, err := corerepo.Pin(n, ctx, req.Arguments(), recursive) + added, err := corerepo.Pin(n, api, ctx, req.Arguments(), recursive) ch <- pinResult{pins: added, err: err} }() @@ -193,6 +198,12 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + // set recursive flag recursive, _, err := req.Option("recursive").Bool() if err != nil { @@ -200,7 +211,7 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) return } - removed, err := corerepo.Unpin(n, req.Context(), req.Arguments(), recursive) + removed, err := corerepo.Unpin(n, api, req.Context(), req.Arguments(), recursive) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -287,6 +298,12 @@ Example: return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + typeStr, _, err := req.Option("type").String() if err != nil { res.SetError(err, cmdkit.ErrNormal) @@ -304,7 +321,7 @@ Example: var keys map[string]RefKeyObject if len(req.Arguments()) > 0 { - keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n) + keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n, api) } else { keys, err = pinLsAll(req.Context(), typeStr, n) } @@ -364,7 +381,7 @@ new pin and removing the old one. }, Type: PinOutput{}, Run: func(req cmds.Request, res cmds.Response) { - n, err := req.InvocContext().GetNode() + api, err := req.InvocContext().GetApi() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -376,42 +393,19 @@ new pin and removing the old one. return } - from, err := path.ParsePath(req.Arguments()[0]) + from, err := iface.ParsePath(req.Arguments()[0]) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - to, err := path.ParsePath(req.Arguments()[1]) + to, err := iface.ParsePath(req.Arguments()[1]) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - r := &resolver.Resolver{ - DAG: n.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - - fromc, err := core.ResolveToCid(req.Context(), n.Namesys, r, from) - if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return - } - - toc, err := core.ResolveToCid(req.Context(), n.Namesys, r, to) - if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return - } - - err = n.Pinning.Update(req.Context(), fromc, toc, unpin) - if err != nil { - res.SetError(err, cmdkit.ErrNormal) - return - } - - err = n.Pinning.Flush() + err = api.Pin().Update(req.Context(), from, to, options.Pin.Unpin(unpin)) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -501,7 +495,7 @@ type RefKeyList struct { Keys map[string]RefKeyObject } -func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) { +func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsNode, api iface.CoreAPI) (map[string]RefKeyObject, error) { mode, ok := pin.StringToMode(typeStr) if !ok { @@ -510,23 +504,18 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN keys := make(map[string]RefKeyObject) - r := &resolver.Resolver{ - DAG: n.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - for _, p := range args { - pth, err := path.ParsePath(p) + pth, err := iface.ParsePath(p) if err != nil { return nil, err } - c, err := core.ResolveToCid(ctx, n.Namesys, r, pth) + c, err := api.ResolvePath(ctx, pth) if err != nil { return nil, err } - pinType, pinned, err := n.Pinning.IsPinnedWithType(c, mode) + pinType, pinned, err := n.Pinning.IsPinnedWithType(c.Cid(), mode) if err != nil { return nil, err } diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index 598823cfa9b..ae92514e67d 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -7,16 +7,13 @@ import ( "sort" "text/tabwriter" - cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - cmds "github.com/ipfs/go-ipfs/commands" - core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" + iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + + cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" ) type LsLink struct { @@ -82,6 +79,12 @@ possible, please use 'ipfs ls' instead. return } + api, err := req.InvocContext().GetApi() + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return + } + paths := req.Arguments() output := LsOutput{ @@ -89,15 +92,16 @@ possible, please use 'ipfs ls' instead. Objects: map[string]*LsObject{}, } - for _, fpath := range paths { + for _, p := range paths { ctx := req.Context() - resolver := &resolver.Resolver{ - DAG: node.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, + fpath, err := iface.ParsePath(p) + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return } - merkleNode, err := core.Resolve(ctx, node.Namesys, resolver, path.Path(fpath)) + merkleNode, err := api.ResolveNode(ctx, fpath) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -106,7 +110,7 @@ possible, please use 'ipfs ls' instead. c := merkleNode.Cid() hash := c.String() - output.Arguments[fpath] = hash + output.Arguments[p] = hash if _, ok := output.Objects[hash]; ok { // duplicate argument for an already-listed node diff --git a/core/coreapi/interface/util.go b/core/coreapi/interface/util.go index 8fd3e058fa5..6d58bf40d2b 100644 --- a/core/coreapi/interface/util.go +++ b/core/coreapi/interface/util.go @@ -1,10 +1,20 @@ package iface import ( + "context" "io" ) type Reader interface { - io.ReadSeeker + ReadSeekCloser + Size() uint64 + CtxReadFull(context.Context, []byte) (int, error) +} + +// A ReadSeekCloser implements interfaces to read, copy, seek and close. +type ReadSeekCloser interface { + io.Reader + io.Seeker io.Closer + io.WriterTo } diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 3f1139b302e..c99224cb0e7 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -29,12 +29,12 @@ func (api *PinAPI) Add(ctx context.Context, p coreiface.Path, opts ...caopts.Pin return err } - _, err = corerepo.Pin(api.node, ctx, []string{rp.Cid().String()}, settings.Recursive) + _, err = corerepo.Pin(api.node, api.core(), ctx, []string{rp.Cid().String()}, settings.Recursive) if err != nil { return err } - return nil + return api.node.Pinning.Flush() } func (api *PinAPI) Ls(ctx context.Context, opts ...caopts.PinLsOption) ([]coreiface.Pin, error) { @@ -53,12 +53,12 @@ func (api *PinAPI) Ls(ctx context.Context, opts ...caopts.PinLsOption) ([]coreif } func (api *PinAPI) Rm(ctx context.Context, p coreiface.Path) error { - _, err := corerepo.Unpin(api.node, ctx, []string{p.String()}, true) + _, err := corerepo.Unpin(api.node, api.core(), ctx, []string{p.String()}, true) if err != nil { return err } - return nil + return api.node.Pinning.Flush() } func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface.Path, opts ...caopts.PinUpdateOption) error { @@ -77,7 +77,12 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface return err } - return api.node.Pinning.Update(ctx, fp.Cid(), tp.Cid(), settings.Unpin) + err = api.node.Pinning.Update(ctx, fp.Cid(), tp.Cid(), settings.Unpin) + if err != nil { + return err + } + + return api.node.Pinning.Flush() } type pinStatus struct { diff --git a/core/corerepo/pinning.go b/core/corerepo/pinning.go index 517437879fc..c943bf3fd63 100644 --- a/core/corerepo/pinning.go +++ b/core/corerepo/pinning.go @@ -18,28 +18,21 @@ import ( "fmt" "github.com/ipfs/go-ipfs/core" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + "github.com/ipfs/go-ipfs/core/coreapi/interface" - cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ) -func Pin(n *core.IpfsNode, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error) { +func Pin(n *core.IpfsNode, api iface.CoreAPI, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error) { out := make([]cid.Cid, len(paths)) - r := &resolver.Resolver{ - DAG: n.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - for i, fpath := range paths { - p, err := path.ParsePath(fpath) + p, err := iface.ParsePath(fpath) if err != nil { return nil, err } - dagnode, err := core.Resolve(ctx, n.Namesys, r, p) + dagnode, err := api.ResolveNode(ctx, p) if err != nil { return nil, fmt.Errorf("pin: %s", err) } @@ -58,30 +51,25 @@ func Pin(n *core.IpfsNode, ctx context.Context, paths []string, recursive bool) return out, nil } -func Unpin(n *core.IpfsNode, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error) { +func Unpin(n *core.IpfsNode, api iface.CoreAPI, ctx context.Context, paths []string, recursive bool) ([]cid.Cid, error) { unpinned := make([]cid.Cid, len(paths)) - r := &resolver.Resolver{ - DAG: n.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - for i, p := range paths { - p, err := path.ParsePath(p) + p, err := iface.ParsePath(p) if err != nil { return nil, err } - k, err := core.ResolveToCid(ctx, n.Namesys, r, p) + k, err := api.ResolvePath(ctx, p) if err != nil { return nil, err } - err = n.Pinning.Unpin(ctx, k, recursive) + err = n.Pinning.Unpin(ctx, k.Cid(), recursive) if err != nil { return nil, err } - unpinned[i] = k + unpinned[i] = k.Cid() } err := n.Pinning.Flush() diff --git a/core/coreunix/cat.go b/core/coreunix/cat.go deleted file mode 100644 index 76635751e05..00000000000 --- a/core/coreunix/cat.go +++ /dev/null @@ -1,24 +0,0 @@ -package coreunix - -import ( - "context" - - core "github.com/ipfs/go-ipfs/core" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" -) - -func Cat(ctx context.Context, n *core.IpfsNode, pstr string) (uio.DagReader, error) { - r := &resolver.Resolver{ - DAG: n.DAG, - ResolveOnce: uio.ResolveUnixfsOnce, - } - - dagNode, err := core.Resolve(ctx, n.Namesys, r, path.Path(pstr)) - if err != nil { - return nil, err - } - - return uio.NewDagReader(ctx, dagNode, n.DAG) -} diff --git a/core/pathresolver.go b/core/pathresolver.go index db8a0dcaecb..65c45a77dd0 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -6,11 +6,10 @@ import ( "strings" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" - cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -74,37 +73,3 @@ func Resolve(ctx context.Context, nsys namesys.NameSystem, r *resolver.Resolver, // ok, we have an IPFS path now (or what we'll treat as one) return r.ResolvePath(ctx, p) } - -// ResolveToCid resolves a path to a cid. -// -// It first checks if the path is already in the form of just a cid ( or -// /ipfs/) and returns immediately if so. Otherwise, it falls back onto -// Resolve to perform resolution of the dagnode being referenced. -func ResolveToCid(ctx context.Context, nsys namesys.NameSystem, r *resolver.Resolver, p path.Path) (cid.Cid, error) { - - // If the path is simply a cid, parse and return it. Parsed paths are already - // normalized (read: prepended with /ipfs/ if needed), so segment[1] should - // always be the key. - if p.IsJustAKey() { - return cid.Decode(p.Segments()[1]) - } - - // Fall back onto regular dagnode resolution. Retrieve the second-to-last - // segment of the path and resolve its link to the last segment. - head, tail, err := p.PopLastSegment() - if err != nil { - return cid.Cid{}, err - } - dagnode, err := Resolve(ctx, nsys, r, head) - if err != nil { - return cid.Cid{}, err - } - - // Extract and return the cid of the link to the target dag node. - link, _, err := dagnode.ResolveLink([]string{tail}) - if err != nil { - return cid.Cid{}, err - } - - return link.Cid, nil -} diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index e17892d0a97..9740be58508 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -14,16 +14,17 @@ import ( "testing" core "github.com/ipfs/go-ipfs/core" - coreunix "github.com/ipfs/go-ipfs/core/coreunix" + coreapi "github.com/ipfs/go-ipfs/core/coreapi" + iface "github.com/ipfs/go-ipfs/core/coreapi/interface" coremock "github.com/ipfs/go-ipfs/core/mock" - importer "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" + importer "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" + uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -116,6 +117,8 @@ func TestIpfsStressRead(t *testing.T) { nd, mnt := setupIpfsTest(t, nil) defer mnt.Close() + api := coreapi.NewCoreAPI(nd) + var nodes []ipld.Node var paths []string @@ -165,14 +168,14 @@ func TestIpfsStressRead(t *testing.T) { defer wg.Done() for i := 0; i < 2000; i++ { - item := paths[rand.Intn(len(paths))] - fname := path.Join(mnt.Dir, item) + item, _ := iface.ParsePath(paths[rand.Intn(len(paths))]) + fname := path.Join(mnt.Dir, item.String()) rbuf, err := ioutil.ReadFile(fname) if err != nil { errs <- err } - read, err := coreunix.Cat(nd.Context(), nd, item) + read, err := api.Unixfs().Cat(nd.Context(), item) if err != nil { errs <- err } diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 2e83dfcf905..0bdea0bd96e 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -12,6 +12,8 @@ import ( "time" "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" @@ -118,6 +120,8 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error { } defer catter.Close() + catterApi := coreapi.NewCoreAPI(catter) + err = mn.LinkAll() if err != nil { return err @@ -138,7 +142,12 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error { return err } - readerCatted, err := coreunix.Cat(ctx, catter, added) + ap, err := iface.ParsePath(added) + if err != nil { + return err + } + + readerCatted, err := catterApi.Unixfs().Cat(ctx, ap) if err != nil { return err } diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index 794a4955824..7eb86055710 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -9,6 +9,8 @@ import ( "testing" "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" @@ -64,6 +66,8 @@ func benchCat(b *testing.B, data []byte, conf testutil.LatencyConfig) error { } defer catter.Close() + catterApi := coreapi.NewCoreAPI(catter) + err = mn.LinkAll() if err != nil { return err @@ -84,8 +88,13 @@ func benchCat(b *testing.B, data []byte, conf testutil.LatencyConfig) error { return err } + ap, err := iface.ParsePath(added) + if err != nil { + return err + } + b.StartTimer() - readerCatted, err := coreunix.Cat(ctx, catter, added) + readerCatted, err := catterApi.Unixfs().Cat(ctx, ap) if err != nil { return err } diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index 20197d43043..a8d9fbbf0ec 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -10,6 +10,8 @@ import ( "time" core "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" @@ -100,6 +102,9 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error { return err } defer catter.Close() + + catterApi := coreapi.NewCoreAPI(catter) + mn.LinkAll() bis := bootstrap.Peerstore.PeerInfo(bootstrap.PeerHost.ID()) @@ -116,7 +121,12 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error { return err } - readerCatted, err := coreunix.Cat(ctx, catter, added) + ap, err := iface.ParsePath(added) + if err != nil { + return err + } + + readerCatted, err := catterApi.Unixfs().Cat(ctx, ap) if err != nil { return err } From 1379ee76f36468ce646750afa008ede66b25c5b9 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Fri, 21 Sep 2018 14:55:15 +0800 Subject: [PATCH 30/85] add pin lock in AddallPin function License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/add.go | 33 ++----------------------------- core/coreunix/add.go | 41 ++++++++++++++++++++++++++++++++++++--- core/coreunix/add_test.go | 4 ++-- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index b7f3d6a8437..fc50f3dc2b2 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -276,6 +276,7 @@ You can now check what blocks have been created by: fileAdder.NoCopy = nocopy fileAdder.Name = pathName fileAdder.CidBuilder = prefix + fileAdder.Hash = hash if inline { fileAdder.CidBuilder = cidutil.InlineBuilder{ @@ -297,42 +298,12 @@ You can now check what blocks have been created by: fileAdder.SetMfsRoot(mr) } - addAllAndPin := func(f files.File) error { - // Iterate over each top-level file and add individually. Otherwise the - // single files.File f is treated as a directory, affecting hidden file - // semantics. - for { - file, err := f.NextFile() - if err == io.EOF { - // Finished the list of files. - break - } else if err != nil { - return err - } - if err := fileAdder.AddFile(file); err != nil { - return err - } - } - - // copy intermediary nodes from editor to our actual dagservice - _, err := fileAdder.Finalize() - if err != nil { - return err - } - - if hash { - return nil - } - - return fileAdder.PinRoot() - } - errCh := make(chan error) go func() { var err error defer func() { errCh <- err }() defer close(outChan) - err = addAllAndPin(req.Files) + err = fileAdder.AddAllAndPin(req.Files) }() err = res.Emit(outChan) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index ad8450f6a2b..64fa7ca1321 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -86,6 +86,7 @@ type Adder struct { Name string NoCopy bool Chunker string + Hash bool root ipld.Node mroot *mfs.Root unlocker bstore.Unlocker @@ -398,8 +399,8 @@ func (adder *Adder) addNode(node ipld.Node, path string) error { return nil } -// AddFile adds the given file while respecting the adder. -func (adder *Adder) AddFile(file files.File) error { +// AddAllAndPin adds the given request's files and pin them. +func (adder *Adder) AddAllAndPin(file files.File) error { if adder.Pin { adder.unlocker = adder.blockstore.PinLock() } @@ -409,7 +410,41 @@ func (adder *Adder) AddFile(file files.File) error { } }() - return adder.addFile(file) + switch { + case file.IsDirectory(): + // Iterate over each top-level file and add individually. Otherwise the + // single files.File f is treated as a directory, affecting hidden file + // semantics. + for { + file, err := file.NextFile() + if err == io.EOF { + // Finished the list of files. + break + } else if err != nil { + return err + } + if err := adder.addFile(file); err != nil { + return err + } + } + break + default: + if err := adder.addFile(file); err != nil { + return err + } + break + } + + // copy intermediary nodes from editor to our actual dagservice + _, err := adder.Finalize() + if err != nil { + return err + } + + if adder.Hash { + return nil + } + return adder.PinRoot() } func (adder *Adder) addFile(file files.File) error { diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index d2c9c7337d4..bba5d7ce8e7 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -85,7 +85,7 @@ func TestAddGCLive(t *testing.T) { go func() { defer close(addDone) defer close(out) - err := adder.AddFile(slf) + err := adder.AddAllAndPin(slf) if err != nil { t.Fatal(err) @@ -191,7 +191,7 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) { go func() { defer close(adder.Out) - err = adder.AddFile(file) + err = adder.AddAllAndPin(file) if err != nil { t.Fatal(err) } From dde11416f6a717acd00743dc75556cc58ac09d31 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Sun, 23 Sep 2018 22:26:32 +0800 Subject: [PATCH 31/85] delete useless hash param in adder License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/add.go | 3 +-- core/coreunix/add.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index fc50f3dc2b2..40e170cdb71 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -270,13 +270,12 @@ You can now check what blocks have been created by: fileAdder.Hidden = hidden fileAdder.Trickle = trickle fileAdder.Wrap = wrap - fileAdder.Pin = dopin + fileAdder.Pin = dopin && !hash fileAdder.Silent = silent fileAdder.RawLeaves = rawblks fileAdder.NoCopy = nocopy fileAdder.Name = pathName fileAdder.CidBuilder = prefix - fileAdder.Hash = hash if inline { fileAdder.CidBuilder = cidutil.InlineBuilder{ diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 64fa7ca1321..3792db9430a 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -86,7 +86,6 @@ type Adder struct { Name string NoCopy bool Chunker string - Hash bool root ipld.Node mroot *mfs.Root unlocker bstore.Unlocker @@ -441,7 +440,7 @@ func (adder *Adder) AddAllAndPin(file files.File) error { return err } - if adder.Hash { + if !adder.Pin { return nil } return adder.PinRoot() From ab69f0fb4d85e7a133c87138953b3975bec20f8b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 2 Oct 2018 14:36:12 -0700 Subject: [PATCH 32/85] take the pinlock when updating pins License: MIT Signed-off-by: Steven Allen --- core/coreapi/pin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index c99224cb0e7..0452c37597c 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -67,6 +67,8 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface return err } + defer api.node.Blockstore.PinLock().Unlock() + fp, err := api.core().ResolvePath(ctx, from) if err != nil { return err From bf654ea4f879c7bc75c52a6fcacda24fe1214dc9 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 2 Oct 2018 15:39:32 -0700 Subject: [PATCH 33/85] defer the pinlock till we actually need it License: MIT Signed-off-by: Steven Allen --- core/coreapi/pin.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 0452c37597c..ad6dfe92270 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -22,13 +22,13 @@ func (api *PinAPI) Add(ctx context.Context, p coreiface.Path, opts ...caopts.Pin return err } - defer api.node.Blockstore.PinLock().Unlock() - rp, err := api.core().ResolvePath(ctx, p) if err != nil { return err } + defer api.node.Blockstore.PinLock().Unlock() + _, err = corerepo.Pin(api.node, api.core(), ctx, []string{rp.Cid().String()}, settings.Recursive) if err != nil { return err @@ -67,8 +67,6 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface return err } - defer api.node.Blockstore.PinLock().Unlock() - fp, err := api.core().ResolvePath(ctx, from) if err != nil { return err @@ -79,6 +77,8 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface return err } + defer api.node.Blockstore.PinLock().Unlock() + err = api.node.Pinning.Update(ctx, fp.Cid(), tp.Cid(), settings.Unpin) if err != nil { return err From 7b478209b940addcaa993c7577a79af50f8c046f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 01:49:39 +0200 Subject: [PATCH 34/85] coreapi swarm: unify type with other apis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/coreapi.go | 2 +- core/coreapi/swarm.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 8a0410a2dae..29a8b78fb63 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -70,5 +70,5 @@ func (api *CoreAPI) Dht() coreiface.DhtAPI { // Swarm returns the SwarmAPI interface implementation backed by the go-ipfs node func (api *CoreAPI) Swarm() coreiface.SwarmAPI { - return &SwarmAPI{api} + return (*SwarmAPI)(api) } diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 47641c9dc1f..72e7706006d 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -5,6 +5,7 @@ import ( "sort" "time" + core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" swarm "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" @@ -17,12 +18,10 @@ import ( net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) -type SwarmAPI struct { - *CoreAPI -} +type SwarmAPI CoreAPI type connInfo struct { - api *CoreAPI + node *core.IpfsNode conn net.Conn dir net.Direction @@ -126,7 +125,7 @@ func (api *SwarmAPI) Peers(context.Context) ([]coreiface.ConnectionInfo, error) addr := c.RemoteMultiaddr() ci := &connInfo{ - api: api.CoreAPI, + node: api.node, conn: c, dir: c.Stat().Direction, @@ -161,7 +160,7 @@ func (ci *connInfo) Direction() net.Direction { } func (ci *connInfo) Latency() (time.Duration, error) { - return ci.api.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil + return ci.node.Peerstore.LatencyEWMA(peer.ID(ci.ID())), nil } func (ci *connInfo) Streams() ([]protocol.ID, error) { From 035ce914ff83d552da33aab939a185b43b848f57 Mon Sep 17 00:00:00 2001 From: John Reed Date: Tue, 2 Oct 2018 18:59:45 -0500 Subject: [PATCH 35/85] add version, usage, and planning info for urlstore License: MIT Signed-off-by: John Reed --- docs/experimental-features.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/experimental-features.md b/docs/experimental-features.md index 596b8e7f3b0..0acd5820f18 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -183,7 +183,7 @@ Allows ipfs to retrieve blocks contents via a url instead of storing it in the d experimental. ### In Version -???. +master, v0.4.17 ### How to enable Modify your ipfs config: @@ -191,8 +191,14 @@ Modify your ipfs config: ipfs config --json Experimental.UrlstoreEnabled true ``` +And then add a file at a specific URL using `ipfs urlstore add ` + ### Road to being a real feature -???. +- [ ] Needs more people to use and report on how well it works. +- [ ] Need to address error states and failure conditions +- [ ] Need to write docs on usage, advantages, disadvantages +- [ ] Need to implement caching +- [ ] Need to add metrics to monitor performance --- From 795d1ea5400eb3bb18d8b248e8494251ea8db359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 15:00:51 +0200 Subject: [PATCH 36/85] coreapi unixfs: use fileAdder directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 50 ++++++++++++++++++++++++ core/coreapi/interface/unixfs.go | 4 +- core/coreapi/name_test.go | 3 +- core/coreapi/pin_test.go | 9 +++-- core/coreapi/unixfs.go | 40 ++++++++++++++++--- core/coreapi/unixfs_test.go | 5 ++- 6 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 core/coreapi/interface/options/unixfs.go diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go new file mode 100644 index 00000000000..8dc9806a776 --- /dev/null +++ b/core/coreapi/interface/options/unixfs.go @@ -0,0 +1,50 @@ +package options + +import ( + mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" +) + +type UnixfsAddSettings struct { + CidVersion int + MhType uint64 + + InlineLimit int +} + +type UnixfsAddOption func(*UnixfsAddSettings) error + +func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { + options := &UnixfsAddSettings{ + CidVersion: -1, + MhType: mh.SHA2_256, + + InlineLimit: 0, + } + + for _, opt := range opts { + err := opt(options) + if err != nil { + return nil, err + } + } + + return options, nil +} + +type unixfsOpts struct{} + +var Unixfs unixfsOpts + +func (unixfsOpts) CidVersion(version int) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.CidVersion = version + return nil + } +} + +func (unixfsOpts) Hash(mhtype uint64) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.MhType = mhtype + return nil + } +} diff --git a/core/coreapi/interface/unixfs.go b/core/coreapi/interface/unixfs.go index 4a3aff6fc53..10febd9faa7 100644 --- a/core/coreapi/interface/unixfs.go +++ b/core/coreapi/interface/unixfs.go @@ -4,13 +4,15 @@ import ( "context" "io" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) // UnixfsAPI is the basic interface to immutable files in IPFS type UnixfsAPI interface { // Add imports the data from the reader into merkledag file - Add(context.Context, io.Reader) (ResolvedPath, error) + Add(context.Context, io.ReadCloser, ...options.UnixfsAddOption) (ResolvedPath, error) // Cat returns a reader for the file Cat(context.Context, Path) (Reader, error) diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index d226664842d..650d487b4e8 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -3,6 +3,7 @@ package coreapi_test import ( "context" "io" + "io/ioutil" "math/rand" "testing" "time" @@ -16,7 +17,7 @@ import ( var rnd = rand.New(rand.NewSource(0x62796532303137)) func addTestObject(ctx context.Context, api coreiface.CoreAPI) (coreiface.Path, error) { - return api.Unixfs().Add(ctx, &io.LimitedReader{R: rnd, N: 4092}) + return api.Unixfs().Add(ctx, ioutil.NopCloser(&io.LimitedReader{R: rnd, N: 4092})) } func TestBasicPublishResolve(t *testing.T) { diff --git a/core/coreapi/pin_test.go b/core/coreapi/pin_test.go index 9bbf16c9cfa..fbae2280291 100644 --- a/core/coreapi/pin_test.go +++ b/core/coreapi/pin_test.go @@ -2,6 +2,7 @@ package coreapi_test import ( "context" + "io/ioutil" "strings" "testing" @@ -15,7 +16,7 @@ func TestPinAdd(t *testing.T) { t.Error(err) } - p, err := api.Unixfs().Add(ctx, strings.NewReader("foo")) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) if err != nil { t.Error(err) } @@ -33,7 +34,7 @@ func TestPinSimple(t *testing.T) { t.Error(err) } - p, err := api.Unixfs().Add(ctx, strings.NewReader("foo")) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) if err != nil { t.Error(err) } @@ -82,12 +83,12 @@ func TestPinRecursive(t *testing.T) { t.Error(err) } - p0, err := api.Unixfs().Add(ctx, strings.NewReader("foo")) + p0, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) if err != nil { t.Error(err) } - p1, err := api.Unixfs().Add(ctx, strings.NewReader("bar")) + p1, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("bar"))) if err != nil { t.Error(err) } diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 1a2479ab995..27962202e23 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -5,10 +5,12 @@ import ( "io" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -16,16 +18,44 @@ type UnixfsAPI CoreAPI // Add builds a merkledag node from a reader, adds it to the blockstore, // and returns the key representing that node. -func (api *UnixfsAPI) Add(ctx context.Context, r io.Reader) (coreiface.ResolvedPath, error) { - k, err := coreunix.AddWithContext(ctx, api.node, r) +func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options.UnixfsAddOption) (coreiface.ResolvedPath, error) { + _, err := options.UnixfsAddOptions(opts...) + if err != nil { + return nil, err + } + + outChan := make(chan interface{}, 1) + + fileAdder, err := coreunix.NewAdder(ctx, api.node.Pinning, api.node.Blockstore, api.node.DAG) if err != nil { return nil, err } - c, err := cid.Decode(k) + + fileAdder.Out = outChan + + err = fileAdder.AddFile(files.NewReaderFile("", "", r, nil)) if err != nil { return nil, err } - return coreiface.IpfsPath(c), nil + + if _, err = fileAdder.Finalize(); err != nil { + return nil, err + } + + for { + select { + case r := <-outChan: + output := r.(*coreunix.AddedObject) + if output.Hash != "" { + c, err := cid.Parse(output.Hash) + if err != nil { + return nil, err + } + + return coreiface.IpfsPath(c), err + } + } + } } // Cat returns the data contained by an IPFS or IPNS object(s) at path `p`. diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index bc78448f551..e7c6d153778 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -6,6 +6,7 @@ import ( "encoding/base64" "fmt" "io" + "io/ioutil" "math" "strings" "testing" @@ -133,7 +134,7 @@ func TestAdd(t *testing.T) { } str := strings.NewReader(helloStr) - p, err := api.Unixfs().Add(ctx, str) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str)) if err != nil { t.Error(err) } @@ -165,7 +166,7 @@ func TestAddEmptyFile(t *testing.T) { } str := strings.NewReader("") - p, err := api.Unixfs().Add(ctx, str) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str)) if err != nil { t.Error(err) } From c68ab5620a8a1026c2f817c5831ca671b24ca70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 15:59:53 +0200 Subject: [PATCH 37/85] coreapi unixfs: cid prefix options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 8 +++- core/coreapi/interface/unixfs.go | 1 + core/coreapi/unixfs.go | 52 ++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 8dc9806a776..ffed75577ea 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -8,7 +8,9 @@ type UnixfsAddSettings struct { CidVersion int MhType uint64 - InlineLimit int + InlineLimit int + RawLeaves bool + RawLeavesSet bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -18,7 +20,9 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { CidVersion: -1, MhType: mh.SHA2_256, - InlineLimit: 0, + InlineLimit: 0, + RawLeaves: false, + RawLeavesSet: false, } for _, opt := range opts { diff --git a/core/coreapi/interface/unixfs.go b/core/coreapi/interface/unixfs.go index 10febd9faa7..acc3b960ce3 100644 --- a/core/coreapi/interface/unixfs.go +++ b/core/coreapi/interface/unixfs.go @@ -10,6 +10,7 @@ import ( ) // UnixfsAPI is the basic interface to immutable files in IPFS +// NOTE: This API is heavily WIP, things are guaranteed to break frequently type UnixfsAPI interface { // Add imports the data from the reader into merkledag file Add(context.Context, io.ReadCloser, ...options.UnixfsAddOption) (ResolvedPath, error) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 27962202e23..afa66f0aeab 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -2,15 +2,19 @@ package coreapi import ( "context" + "errors" + "fmt" "io" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - coreunix "github.com/ipfs/go-ipfs/core/coreunix" + "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + "github.com/ipfs/go-ipfs/core/coreunix" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -19,11 +23,42 @@ type UnixfsAPI CoreAPI // Add builds a merkledag node from a reader, adds it to the blockstore, // and returns the key representing that node. func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options.UnixfsAddOption) (coreiface.ResolvedPath, error) { - _, err := options.UnixfsAddOptions(opts...) + settings, err := options.UnixfsAddOptions(opts...) if err != nil { return nil, err } + // TODO: move to options + // (hash != "sha2-256") -> CIDv1 + if settings.MhType != mh.SHA2_256 { + switch settings.CidVersion { + case 0: + return nil, errors.New("CIDv0 only supports sha2-256") + case 1, -1: + settings.CidVersion = 1 + default: + return nil, fmt.Errorf("unknown CID version: %d", settings.CidVersion) + } + } else { + if settings.CidVersion < 0 { + // Default to CIDv0 + settings.CidVersion = 0 + } + } + + // cidV1 -> raw blocks (by default) + if settings.CidVersion > 0 && !settings.RawLeavesSet { + settings.RawLeaves = true + } + + prefix, err := dag.PrefixForCidVersion(settings.CidVersion) + if err != nil { + return nil, err + } + + prefix.MhType = settings.MhType + prefix.MhLength = -1 + outChan := make(chan interface{}, 1) fileAdder, err := coreunix.NewAdder(ctx, api.node.Pinning, api.node.Blockstore, api.node.DAG) @@ -32,6 +67,17 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. } fileAdder.Out = outChan + //fileAdder.Chunker = chunker + //fileAdder.Progress = progress + //fileAdder.Hidden = hidden + //fileAdder.Trickle = trickle + //fileAdder.Wrap = wrap + //fileAdder.Pin = dopin + fileAdder.Silent = false + fileAdder.RawLeaves = settings.RawLeaves + //fileAdder.NoCopy = nocopy + //fileAdder.Name = pathName + fileAdder.CidBuilder = prefix err = fileAdder.AddFile(files.NewReaderFile("", "", r, nil)) if err != nil { From 06a4218a0324beb4addff61ffa737a22294b17e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 16:00:28 +0200 Subject: [PATCH 38/85] coreapi unixfs: better add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/unixfs_test.go | 157 +++++++++++++++++------------------- 1 file changed, 76 insertions(+), 81 deletions(-) diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index e7c6d153778..f8f63b909dd 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -11,15 +11,16 @@ import ( "strings" "testing" - core "github.com/ipfs/go-ipfs/core" - coreapi "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - coreunix "github.com/ipfs/go-ipfs/core/coreunix" + "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + "github.com/ipfs/go-ipfs/core/coreunix" mock "github.com/ipfs/go-ipfs/core/mock" - keystore "github.com/ipfs/go-ipfs/keystore" - repo "github.com/ipfs/go-ipfs/repo" + "github.com/ipfs/go-ipfs/keystore" + "github.com/ipfs/go-ipfs/repo" + mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" @@ -39,7 +40,6 @@ var hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk" var helloStr = "hello, world!" // `echo -n | ipfs add` -var emptyFile = "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" func makeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]*core.IpfsNode, []coreiface.CoreAPI, error) { mn := mocknet.New(ctx) @@ -133,84 +133,79 @@ func TestAdd(t *testing.T) { t.Error(err) } - str := strings.NewReader(helloStr) - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str)) - if err != nil { - t.Error(err) - } - - if p.String() != hello { - t.Fatalf("expected path %s, got: %s", hello, p) - } - - r, err := api.Unixfs().Cat(ctx, p) - if err != nil { - t.Fatal(err) - } - buf := make([]byte, len(helloStr)) - _, err = io.ReadFull(r, buf) - if err != nil { - t.Error(err) - } - - if string(buf) != helloStr { - t.Fatalf("expected [%s], got [%s] [err=%s]", helloStr, string(buf), err) - } -} - -func TestAddEmptyFile(t *testing.T) { - ctx := context.Background() - _, api, err := makeAPI(ctx) - if err != nil { - t.Error(err) - } - - str := strings.NewReader("") - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str)) - if err != nil { - t.Error(err) - } - - if p.String() != emptyFile { - t.Fatalf("expected path %s, got: %s", hello, p) - } -} - -func TestCatBasic(t *testing.T) { - ctx := context.Background() - node, api, err := makeAPI(ctx) - if err != nil { - t.Fatal(err) - } - - hr := strings.NewReader(helloStr) - p, err := coreunix.Add(node, hr) - if err != nil { - t.Fatal(err) + cases := []struct { + name string + data string + path string + err string + opts []options.UnixfsAddOption + }{ + { + name: "simpleAdd", + data: helloStr, + path: hello, + opts: []options.UnixfsAddOption{}, + }, + { + name: "addEmpty", + data: "", + path: "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH", + }, + { + name: "addCidV1", + data: helloStr, + path: "/ipfs/zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", + opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(1)}, + }, + { + name: "addCidSha3", + data: helloStr, + path: "/ipfs/zb2wwnYtXBxpndNABjtYxWAPt3cwWNRnc11iT63fvkYV78iRb", + opts: []options.UnixfsAddOption{options.Unixfs.Hash(mh.SHA3_256)}, + }, + { + name: "addCidSha3Cid0", + data: helloStr, + err: "CIDv0 only supports sha2-256", + opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(0), options.Unixfs.Hash(mh.SHA3_256)}, + }, } - p = "/ipfs/" + p - if p != hello { - t.Fatalf("expected CID %s, got: %s", hello, p) - } + for _, testCase := range cases { + t.Run(testCase.name, func(t *testing.T) { + str := strings.NewReader(testCase.data) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str), testCase.opts...) + if testCase.err != "" { + if err == nil { + t.Fatalf("expected an error: %s", testCase.err) + } + if err.Error() != testCase.err { + t.Fatalf("expected an error: '%s' != '%s'", err.Error(), testCase.err) + } + return + } + if err != nil { + t.Error(err) + } - helloPath, err := coreiface.ParsePath(hello) - if err != nil { - t.Fatal(err) - } + if p.String() != testCase.path { + t.Fatalf("expected path %s, got: %s", hello, p) + } - r, err := api.Unixfs().Cat(ctx, helloPath) - if err != nil { - t.Fatal(err) - } + r, err := api.Unixfs().Cat(ctx, p) + if err != nil { + t.Fatal(err) + } + buf := make([]byte, len(testCase.data)) + _, err = io.ReadFull(r, buf) + if err != nil { + t.Error(err) + } - buf := make([]byte, len(helloStr)) - _, err = io.ReadFull(r, buf) - if err != nil { - t.Error(err) - } - if string(buf) != helloStr { - t.Fatalf("expected [%s], got [%s] [err=%s]", helloStr, string(buf), err) + if string(buf) != testCase.data { + t.Fatalf("expected [%s], got [%s] [err=%s]", helloStr, string(buf), err) + } + }) } } @@ -226,7 +221,7 @@ func TestCatEmptyFile(t *testing.T) { t.Fatal(err) } - emptyFilePath, err := coreiface.ParsePath(emptyFile) + emptyFilePath, err := coreiface.ParsePath("/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH") if err != nil { t.Fatal(err) } From 041e55d7066c78f6d209460548c4eb4b858c6f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 16:19:32 +0200 Subject: [PATCH 39/85] coreapi unixfs: options for RawLeaves / Inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 15 +++++++++++++++ core/coreapi/unixfs.go | 10 +++++++++- core/coreapi/unixfs_test.go | 22 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index ffed75577ea..3c46ed086e6 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -52,3 +52,18 @@ func (unixfsOpts) Hash(mhtype uint64) UnixfsAddOption { return nil } } + +func (unixfsOpts) RawLeaves(enable bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.RawLeaves = enable + settings.RawLeavesSet = true + return nil + } +} + +func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.InlineLimit = limit + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index afa66f0aeab..19e4fc90c07 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -12,7 +12,8 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" + "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" @@ -79,6 +80,13 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. //fileAdder.Name = pathName fileAdder.CidBuilder = prefix + if settings.InlineLimit > 0 { + fileAdder.CidBuilder = cidutil.InlineBuilder{ + Builder: fileAdder.CidBuilder, + Limit: settings.InlineLimit, + } + } + err = fileAdder.AddFile(files.NewReaderFile("", "", r, nil)) if err != nil { return nil, err diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index f8f63b909dd..c5d483a080f 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -140,6 +140,7 @@ func TestAdd(t *testing.T) { err string opts []options.UnixfsAddOption }{ + // Simple cases { name: "simpleAdd", data: helloStr, @@ -151,12 +152,20 @@ func TestAdd(t *testing.T) { data: "", path: "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH", }, + // CIDv1 version / rawLeaves { name: "addCidV1", data: helloStr, path: "/ipfs/zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(1)}, }, + { + name: "addCidV1NoLeaves", + data: helloStr, + path: "/ipfs/zdj7WY4GbN8NDbTW1dfCShAQNVovams2xhq9hVCx5vXcjvT8g", + opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(1), options.Unixfs.RawLeaves(false)}, + }, + // Non sha256 hash vs CID { name: "addCidSha3", data: helloStr, @@ -169,6 +178,19 @@ func TestAdd(t *testing.T) { err: "CIDv0 only supports sha2-256", opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(0), options.Unixfs.Hash(mh.SHA3_256)}, }, + // Inline + { + name: "addInline", + data: helloStr, + path: "/ipfs/zaYomJdLndMku8P9LHngHB5w2CQ7NenLbv", + opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32)}, + }, + { //TODO: after coreapi add is used in `ipfs add`, consider making this default for inline + name: "addInlineRaw", + data: helloStr, + path: "/ipfs/zj7Gr8AcBreqGEfrnR5kPFe", + opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.RawLeaves(true)}, + }, } for _, testCase := range cases { From 6337e69ff7e00b31c7cfe101161d652ac27c2502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 16:40:31 +0200 Subject: [PATCH 40/85] coreapi unixfs: layout/chunker options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 27 ++++++++++++++++++++++++ core/coreapi/unixfs.go | 12 +++++++++-- core/coreapi/unixfs_test.go | 15 ++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 3c46ed086e6..fe41af9a801 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -4,6 +4,13 @@ import ( mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ) +type Layout int + +const ( + BalancedLayout Layout = iota + TrickleLeyout +) + type UnixfsAddSettings struct { CidVersion int MhType uint64 @@ -11,6 +18,9 @@ type UnixfsAddSettings struct { InlineLimit int RawLeaves bool RawLeavesSet bool + + Chunker string + Layout Layout } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -23,6 +33,9 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { InlineLimit: 0, RawLeaves: false, RawLeavesSet: false, + + Chunker: "size-262144", + Layout: BalancedLayout, } for _, opt := range opts { @@ -67,3 +80,17 @@ func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { return nil } } + +func (unixfsOpts) Chunker(chunker string) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Chunker = chunker + return nil + } +} + +func (unixfsOpts) Layout(layout Layout) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Layout = layout + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 19e4fc90c07..1133964cb5e 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -68,10 +68,9 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. } fileAdder.Out = outChan - //fileAdder.Chunker = chunker + fileAdder.Chunker = settings.Chunker //fileAdder.Progress = progress //fileAdder.Hidden = hidden - //fileAdder.Trickle = trickle //fileAdder.Wrap = wrap //fileAdder.Pin = dopin fileAdder.Silent = false @@ -80,6 +79,15 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. //fileAdder.Name = pathName fileAdder.CidBuilder = prefix + switch settings.Layout { + case options.BalancedLayout: + // Default + case options.TrickleLeyout: + fileAdder.Trickle = true + default: + return nil, fmt.Errorf("unknown layout: %d", settings.Layout) + } + if settings.InlineLimit > 0 { fileAdder.CidBuilder = cidutil.InlineBuilder{ Builder: fileAdder.CidBuilder, diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index c5d483a080f..bcad984a5ce 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -191,6 +191,19 @@ func TestAdd(t *testing.T) { path: "/ipfs/zj7Gr8AcBreqGEfrnR5kPFe", opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.RawLeaves(true)}, }, + // Chunker / Layout + { + name: "addChunks", + data: strings.Repeat("aoeuidhtns", 200), + path: "/ipfs/QmRo11d4QJrST47aaiGVJYwPhoNA4ihRpJ5WaxBWjWDwbX", + opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4")}, + }, + { + name: "addChunksTrickle", + data: strings.Repeat("aoeuidhtns", 200), + path: "/ipfs/QmNNhDGttafX3M1wKWixGre6PrLFGjnoPEDXjBYpTv93HP", + opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLeyout)}, + }, } for _, testCase := range cases { @@ -211,7 +224,7 @@ func TestAdd(t *testing.T) { } if p.String() != testCase.path { - t.Fatalf("expected path %s, got: %s", hello, p) + t.Errorf("expected path %s, got: %s", testCase.path, p) } r, err := api.Unixfs().Cat(ctx, p) From c056e5a8dee4f7e36c2a077fbd2fc49f938ed541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 17:02:03 +0200 Subject: [PATCH 41/85] coreapi unixfs: Simpler output handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/unixfs.go | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 1133964cb5e..1ea3f222a67 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -10,11 +10,10 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/core/coreunix" - cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + uio "gx/ipfs/QmPL8bYtbACcSFFiSr4s2du7Na382NxRADR8hC7D9FkEA2/go-unixfs/io" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -60,20 +59,17 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. prefix.MhType = settings.MhType prefix.MhLength = -1 - outChan := make(chan interface{}, 1) - fileAdder, err := coreunix.NewAdder(ctx, api.node.Pinning, api.node.Blockstore, api.node.DAG) if err != nil { return nil, err } - fileAdder.Out = outChan fileAdder.Chunker = settings.Chunker //fileAdder.Progress = progress //fileAdder.Hidden = hidden //fileAdder.Wrap = wrap //fileAdder.Pin = dopin - fileAdder.Silent = false + fileAdder.Silent = true fileAdder.RawLeaves = settings.RawLeaves //fileAdder.NoCopy = nocopy //fileAdder.Name = pathName @@ -100,24 +96,13 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. return nil, err } - if _, err = fileAdder.Finalize(); err != nil { + nd, err := fileAdder.Finalize() + if err != nil { return nil, err } - for { - select { - case r := <-outChan: - output := r.(*coreunix.AddedObject) - if output.Hash != "" { - c, err := cid.Parse(output.Hash) - if err != nil { - return nil, err - } - - return coreiface.IpfsPath(c), err - } - } - } + return coreiface.IpfsPath(nd.Cid()), err + } // Cat returns the data contained by an IPFS or IPNS object(s) at path `p`. From 49946c69c4f3e12faa2d8c68116c9f863f666e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 23:05:22 +0200 Subject: [PATCH 42/85] coreapi unixfs: pin/local/hash-only options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 29 ++++++++++++ core/coreapi/unixfs.go | 57 ++++++++++++++++++++++-- core/coreapi/unixfs_test.go | 56 +++++++++++++++++++++++ 3 files changed, 138 insertions(+), 4 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index fe41af9a801..6012ce77b23 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -21,6 +21,10 @@ type UnixfsAddSettings struct { Chunker string Layout Layout + + Pin bool + OnlyHash bool + Local bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -36,6 +40,10 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { Chunker: "size-262144", Layout: BalancedLayout, + + Pin: false, + OnlyHash: false, + Local: false, } for _, opt := range opts { @@ -94,3 +102,24 @@ func (unixfsOpts) Layout(layout Layout) UnixfsAddOption { return nil } } + +func (unixfsOpts) Pin(pin bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Pin = pin + return nil + } +} + +func (unixfsOpts) HashOnly(hashOnly bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.OnlyHash = hashOnly + return nil + } +} + +func (unixfsOpts) Local(local bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Local = local + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 1ea3f222a67..0d10b025235 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -4,18 +4,25 @@ import ( "context" "errors" "fmt" + "github.com/ipfs/go-ipfs/core" "io" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/core/coreunix" - uio "gx/ipfs/QmPL8bYtbACcSFFiSr4s2du7Na382NxRADR8hC7D9FkEA2/go-unixfs/io" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" + offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" + uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" + mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dagtest "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag/test" + blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" ) type UnixfsAPI CoreAPI @@ -59,7 +66,33 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. prefix.MhType = settings.MhType prefix.MhLength = -1 - fileAdder, err := coreunix.NewAdder(ctx, api.node.Pinning, api.node.Blockstore, api.node.DAG) + n := api.node + if settings.OnlyHash { + nilnode, err := core.NewNode(ctx, &core.BuildCfg{ + //TODO: need this to be true or all files + // hashed will be stored in memory! + NilRepo: true, + }) + if err != nil { + return nil, err + } + n = nilnode + } + + addblockstore := n.Blockstore + //if !(fscache || nocopy) { + addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker) + //} + + exch := n.Exchange + if settings.Local { + exch = offline.Exchange(addblockstore) + } + + bserv := blockservice.New(addblockstore, exch) // hash security 001 + dserv := dag.NewDAGService(bserv) + + fileAdder, err := coreunix.NewAdder(ctx, n.Pinning, n.Blockstore, dserv) if err != nil { return nil, err } @@ -68,7 +101,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. //fileAdder.Progress = progress //fileAdder.Hidden = hidden //fileAdder.Wrap = wrap - //fileAdder.Pin = dopin + fileAdder.Pin = settings.Pin fileAdder.Silent = true fileAdder.RawLeaves = settings.RawLeaves //fileAdder.NoCopy = nocopy @@ -91,6 +124,19 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. } } + if settings.OnlyHash { + md := dagtest.Mock() + emptyDirNode := ft.EmptyDirNode() + // Use the same prefix for the "empty" MFS root as for the file adder. + emptyDirNode.SetCidBuilder(fileAdder.CidBuilder) + mr, err := mfs.NewRoot(ctx, md, emptyDirNode, nil) + if err != nil { + return nil, err + } + + fileAdder.SetMfsRoot(mr) + } + err = fileAdder.AddFile(files.NewReaderFile("", "", r, nil)) if err != nil { return nil, err @@ -101,8 +147,11 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. return nil, err } - return coreiface.IpfsPath(nd.Cid()), err + if settings.Pin { + err = fileAdder.PinRoot() + } + return coreiface.IpfsPath(nd.Cid()), err } // Cat returns the data contained by an IPFS or IPNS object(s) at path `p`. diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index bcad984a5ce..2c39f7709c3 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -204,6 +204,13 @@ func TestAdd(t *testing.T) { path: "/ipfs/QmNNhDGttafX3M1wKWixGre6PrLFGjnoPEDXjBYpTv93HP", opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLeyout)}, }, + // Local + { + name: "addLocal", // better cases in sharness + data: helloStr, + path: hello, + opts: []options.UnixfsAddOption{options.Unixfs.Local(true)}, + }, } for _, testCase := range cases { @@ -244,6 +251,55 @@ func TestAdd(t *testing.T) { } } +func TestAddPinned(t *testing.T) { + ctx := context.Background() + _, api, err := makeAPI(ctx) + if err != nil { + t.Error(err) + } + + str := strings.NewReader(helloStr) + _, err = api.Unixfs().Add(ctx, ioutil.NopCloser(str), options.Unixfs.Pin(true)) + if err != nil { + t.Error(err) + } + + pins, err := api.Pin().Ls(ctx) + if len(pins) != 1 { + t.Fatalf("expected 1 pin, got %d", len(pins)) + } + + if pins[0].Path().String() != "/ipld/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk" { + t.Fatalf("got unexpected pin: %s", pins[0].Path().String()) + } +} + +func TestAddHashOnly(t *testing.T) { + ctx := context.Background() + _, api, err := makeAPI(ctx) + if err != nil { + t.Error(err) + } + + str := strings.NewReader(helloStr) + p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str), options.Unixfs.HashOnly(true)) + if err != nil { + t.Error(err) + } + + if p.String() != hello { + t.Errorf("unxepected path: %s", p.String()) + } + + _, err = api.Block().Get(ctx, p) + if err == nil { + t.Fatal("expected an error") + } + if err.Error() != "blockservice: key not found" { + t.Errorf("unxepected error: %s", err.Error()) + } +} + func TestCatEmptyFile(t *testing.T) { ctx := context.Background() node, api, err := makeAPI(ctx) From 679d60993d7b6782d5e68d20bc73aa3d2fbbff0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 23:15:07 +0200 Subject: [PATCH 43/85] coreapi unixfs: cleanup options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 41 ++++++++++++++++++++++-- core/coreapi/unixfs.go | 35 +------------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 6012ce77b23..6abfd9622ab 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -1,7 +1,12 @@ package options import ( + "errors" + "fmt" + + cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ) type Layout int @@ -29,7 +34,7 @@ type UnixfsAddSettings struct { type UnixfsAddOption func(*UnixfsAddSettings) error -func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { +func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, error) { options := &UnixfsAddSettings{ CidVersion: -1, MhType: mh.SHA2_256, @@ -49,11 +54,41 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) { for _, opt := range opts { err := opt(options) if err != nil { - return nil, err + return nil, cid.Prefix{}, err + } + } + + // (hash != "sha2-256") -> CIDv1 + if options.MhType != mh.SHA2_256 { + switch options.CidVersion { + case 0: + return nil, cid.Prefix{}, errors.New("CIDv0 only supports sha2-256") + case 1, -1: + options.CidVersion = 1 + default: + return nil, cid.Prefix{}, fmt.Errorf("unknown CID version: %d", options.CidVersion) + } + } else { + if options.CidVersion < 0 { + // Default to CIDv0 + options.CidVersion = 0 } } - return options, nil + // cidV1 -> raw blocks (by default) + if options.CidVersion > 0 && !options.RawLeavesSet { + options.RawLeaves = true + } + + prefix, err := dag.PrefixForCidVersion(options.CidVersion) + if err != nil { + return nil, cid.Prefix{}, err + } + + prefix.MhType = options.MhType + prefix.MhLength = -1 + + return options, prefix, nil } type unixfsOpts struct{} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 0d10b025235..399e2688885 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -2,7 +2,6 @@ package coreapi import ( "context" - "errors" "fmt" "github.com/ipfs/go-ipfs/core" "io" @@ -11,7 +10,6 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/core/coreunix" - mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" @@ -30,42 +28,11 @@ type UnixfsAPI CoreAPI // Add builds a merkledag node from a reader, adds it to the blockstore, // and returns the key representing that node. func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options.UnixfsAddOption) (coreiface.ResolvedPath, error) { - settings, err := options.UnixfsAddOptions(opts...) + settings, prefix, err := options.UnixfsAddOptions(opts...) if err != nil { return nil, err } - // TODO: move to options - // (hash != "sha2-256") -> CIDv1 - if settings.MhType != mh.SHA2_256 { - switch settings.CidVersion { - case 0: - return nil, errors.New("CIDv0 only supports sha2-256") - case 1, -1: - settings.CidVersion = 1 - default: - return nil, fmt.Errorf("unknown CID version: %d", settings.CidVersion) - } - } else { - if settings.CidVersion < 0 { - // Default to CIDv0 - settings.CidVersion = 0 - } - } - - // cidV1 -> raw blocks (by default) - if settings.CidVersion > 0 && !settings.RawLeavesSet { - settings.RawLeaves = true - } - - prefix, err := dag.PrefixForCidVersion(settings.CidVersion) - if err != nil { - return nil, err - } - - prefix.MhType = settings.MhType - prefix.MhLength = -1 - n := api.node if settings.OnlyHash { nilnode, err := core.NewNode(ctx, &core.BuildCfg{ From 9887a05e43906db7a0d9fc9ae05f9ed0f74083f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 20 Sep 2018 23:44:49 +0200 Subject: [PATCH 44/85] coreapi unixfs: docs on options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 29 +++++++++++++++++++++++- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 6abfd9622ab..9b003e1aff9 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -13,7 +13,7 @@ type Layout int const ( BalancedLayout Layout = iota - TrickleLeyout + TrickleLayout ) type UnixfsAddSettings struct { @@ -95,6 +95,8 @@ type unixfsOpts struct{} var Unixfs unixfsOpts +// CidVersion specifies which CID version to use. Defaults to 0 unless an option +// that depends on CIDv1 is passed. func (unixfsOpts) CidVersion(version int) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.CidVersion = version @@ -102,6 +104,9 @@ func (unixfsOpts) CidVersion(version int) UnixfsAddOption { } } +// Hash function to use. Implies CIDv1 if not set to sha2-256 (default). +// +// Table of functions is declared in https://github.com/multiformats/go-multihash/blob/master/multihash.go func (unixfsOpts) Hash(mhtype uint64) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.MhType = mhtype @@ -109,6 +114,8 @@ func (unixfsOpts) Hash(mhtype uint64) UnixfsAddOption { } } +// RawLeaves specifies whether to use raw blocks for leaves (data nodes with no +// links) instead of wrapping them with unixfs structures. func (unixfsOpts) RawLeaves(enable bool) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.RawLeaves = enable @@ -117,6 +124,11 @@ func (unixfsOpts) RawLeaves(enable bool) UnixfsAddOption { } } +// InlineLimit sets the amount of bytes below which blocks will be encoded +// directly into CID instead of being stored and addressed by it's hash +// +// Note that while there is no hard limit on the number of bytes here, it should +// be kept at something reasonably low like 32b (default for 'ipfs add') func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.InlineLimit = limit @@ -124,6 +136,11 @@ func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { } } +// Chunker specifies settings for the chunking algorithm to use. +// +// Default: size-262144, formats: +// size-[bytes] - Simple chunker splitting data into blocks of n bytes +// rabin-[min]-[avg]-[max] - Rabin chunker func (unixfsOpts) Chunker(chunker string) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.Chunker = chunker @@ -131,6 +148,10 @@ func (unixfsOpts) Chunker(chunker string) UnixfsAddOption { } } +// Layout tells the adder how to balance data between leaves. +// options.BalancedLayout is the default, it's optimized for static seekable +// files. +// options.TrickleLayout is optimized for streaming data, func (unixfsOpts) Layout(layout Layout) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.Layout = layout @@ -138,6 +159,7 @@ func (unixfsOpts) Layout(layout Layout) UnixfsAddOption { } } +// Pin tells the adder to pin the file root recursively after adding func (unixfsOpts) Pin(pin bool) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.Pin = pin @@ -145,6 +167,8 @@ func (unixfsOpts) Pin(pin bool) UnixfsAddOption { } } +// HashOnly will make the adder calculate data hash without storing it in the +// blockstore or announcing it to the network func (unixfsOpts) HashOnly(hashOnly bool) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.OnlyHash = hashOnly @@ -152,6 +176,9 @@ func (unixfsOpts) HashOnly(hashOnly bool) UnixfsAddOption { } } +// Local will add the data to blockstore without announcing it to the network +// +// Note that this doesn't prevent other nodes from getting this data func (unixfsOpts) Local(local bool) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.Local = local diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 399e2688885..d6800ff77bd 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -78,7 +78,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. switch settings.Layout { case options.BalancedLayout: // Default - case options.TrickleLeyout: + case options.TrickleLayout: fileAdder.Trickle = true default: return nil, fmt.Errorf("unknown layout: %d", settings.Layout) diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 2c39f7709c3..30b7ccf3507 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -202,7 +202,7 @@ func TestAdd(t *testing.T) { name: "addChunksTrickle", data: strings.Repeat("aoeuidhtns", 200), path: "/ipfs/QmNNhDGttafX3M1wKWixGre6PrLFGjnoPEDXjBYpTv93HP", - opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLeyout)}, + opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLayout)}, }, // Local { From 374fb00cc36c7c094d037188e4c082d33c5bfd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 2 Oct 2018 09:42:50 +0200 Subject: [PATCH 45/85] coreapi unixfs: separate option to enable inlining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 25 ++++++++++++++++++++---- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 21 ++++++++++++++++---- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 9b003e1aff9..df6f4fc7112 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -20,6 +20,7 @@ type UnixfsAddSettings struct { CidVersion int MhType uint64 + Inline bool InlineLimit int RawLeaves bool RawLeavesSet bool @@ -39,7 +40,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, CidVersion: -1, MhType: mh.SHA2_256, - InlineLimit: 0, + Inline: false, + InlineLimit: 32, RawLeaves: false, RawLeavesSet: false, @@ -124,11 +126,26 @@ func (unixfsOpts) RawLeaves(enable bool) UnixfsAddOption { } } +// Inline tells the adder to inline small blocks into CIDs +func (unixfsOpts) Inline(enable bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Inline = enable + return nil + } +} + // InlineLimit sets the amount of bytes below which blocks will be encoded -// directly into CID instead of being stored and addressed by it's hash +// directly into CID instead of being stored and addressed by it's hash. +// Specifying this option won't enable block inlining. For that use `Inline` +// option. Default: 32 bytes +// +// Note that while there is no hard limit on the number of bytes, it should +// be kept at a reasonably low value, like 64 bytes if you intend to display +// these hashes. Larger values like 256 bytes will work fine, but may affect +// de-duplication of smaller blocks. // -// Note that while there is no hard limit on the number of bytes here, it should -// be kept at something reasonably low like 32b (default for 'ipfs add') +// Setting this value too high may cause various problems, such as render some +// blocks unfetchable func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.InlineLimit = limit diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index d6800ff77bd..31910afd320 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -84,7 +84,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. return nil, fmt.Errorf("unknown layout: %d", settings.Layout) } - if settings.InlineLimit > 0 { + if settings.Inline { fileAdder.CidBuilder = cidutil.InlineBuilder{ Builder: fileAdder.CidBuilder, Limit: settings.InlineLimit, diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 30b7ccf3507..207470a8144 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -40,6 +40,7 @@ var hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk" var helloStr = "hello, world!" // `echo -n | ipfs add` +var emptyFile = "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" func makeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]*core.IpfsNode, []coreiface.CoreAPI, error) { mn := mocknet.New(ctx) @@ -150,7 +151,7 @@ func TestAdd(t *testing.T) { { name: "addEmpty", data: "", - path: "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH", + path: emptyFile, }, // CIDv1 version / rawLeaves { @@ -183,13 +184,25 @@ func TestAdd(t *testing.T) { name: "addInline", data: helloStr, path: "/ipfs/zaYomJdLndMku8P9LHngHB5w2CQ7NenLbv", - opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32)}, + opts: []options.UnixfsAddOption{options.Unixfs.Inline(true)}, + }, + { + name: "addInlineLimit", + data: helloStr, + path: "/ipfs/zaYomJdLndMku8P9LHngHB5w2CQ7NenLbv", + opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.Inline(true)}, + }, + { + name: "addInlineZero", + data: "", + path: "/ipfs/z2yYDV", + opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(0), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)}, }, { //TODO: after coreapi add is used in `ipfs add`, consider making this default for inline name: "addInlineRaw", data: helloStr, path: "/ipfs/zj7Gr8AcBreqGEfrnR5kPFe", - opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.RawLeaves(true)}, + opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)}, }, // Chunker / Layout { @@ -312,7 +325,7 @@ func TestCatEmptyFile(t *testing.T) { t.Fatal(err) } - emptyFilePath, err := coreiface.ParsePath("/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH") + emptyFilePath, err := coreiface.ParsePath(emptyFile) if err != nil { t.Fatal(err) } From 675106d75968612049c5aba28060cc6c65303b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 02:08:57 +0200 Subject: [PATCH 46/85] coreapi unixfs: rebase fixes for fileAdder.AddAllAndPin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/add.go | 2 +- core/coreapi/unixfs.go | 16 +++------------- core/coreunix/add.go | 16 ++++++++-------- core/coreunix/add_test.go | 4 ++-- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index 40e170cdb71..d7d6b33a267 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -302,7 +302,7 @@ You can now check what blocks have been created by: var err error defer func() { errCh <- err }() defer close(outChan) - err = fileAdder.AddAllAndPin(req.Files) + _, err = fileAdder.AddAllAndPin(req.Files) }() err = res.Emit(outChan) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 31910afd320..03bc6f73c0d 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -68,7 +68,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. //fileAdder.Progress = progress //fileAdder.Hidden = hidden //fileAdder.Wrap = wrap - fileAdder.Pin = settings.Pin + fileAdder.Pin = settings.Pin && !settings.OnlyHash fileAdder.Silent = true fileAdder.RawLeaves = settings.RawLeaves //fileAdder.NoCopy = nocopy @@ -104,21 +104,11 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. fileAdder.SetMfsRoot(mr) } - err = fileAdder.AddFile(files.NewReaderFile("", "", r, nil)) + nd, err := fileAdder.AddAllAndPin(files.NewReaderFile("", "", r, nil)) if err != nil { return nil, err } - - nd, err := fileAdder.Finalize() - if err != nil { - return nil, err - } - - if settings.Pin { - err = fileAdder.PinRoot() - } - - return coreiface.IpfsPath(nd.Cid()), err + return coreiface.IpfsPath(nd.Cid()), nil } // Cat returns the data contained by an IPFS or IPNS object(s) at path `p`. diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 3792db9430a..55be2cd55da 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -399,7 +399,7 @@ func (adder *Adder) addNode(node ipld.Node, path string) error { } // AddAllAndPin adds the given request's files and pin them. -func (adder *Adder) AddAllAndPin(file files.File) error { +func (adder *Adder) AddAllAndPin(file files.File) (ipld.Node, error) { if adder.Pin { adder.unlocker = adder.blockstore.PinLock() } @@ -420,30 +420,30 @@ func (adder *Adder) AddAllAndPin(file files.File) error { // Finished the list of files. break } else if err != nil { - return err + return nil, err } if err := adder.addFile(file); err != nil { - return err + return nil, err } } break default: if err := adder.addFile(file); err != nil { - return err + return nil, err } break } // copy intermediary nodes from editor to our actual dagservice - _, err := adder.Finalize() + nd, err := adder.Finalize() if err != nil { - return err + return nil, err } if !adder.Pin { - return nil + return nd, nil } - return adder.PinRoot() + return nd, adder.PinRoot() } func (adder *Adder) addFile(file files.File) error { diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index bba5d7ce8e7..5185c4f4d8f 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -85,7 +85,7 @@ func TestAddGCLive(t *testing.T) { go func() { defer close(addDone) defer close(out) - err := adder.AddAllAndPin(slf) + _, err := adder.AddAllAndPin(slf) if err != nil { t.Fatal(err) @@ -191,7 +191,7 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) { go func() { defer close(adder.Out) - err = adder.AddAllAndPin(file) + _, err = adder.AddAllAndPin(file) if err != nil { t.Fatal(err) } From e6bc92342503edba0b7d71cfafa1747fa1cc6816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 15:05:46 +0200 Subject: [PATCH 47/85] coreapi unixfs: multi file support in unixfs coreapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/unixfs.go | 4 +-- core/coreapi/name_test.go | 3 +- core/coreapi/pin_test.go | 9 +++--- core/coreapi/unixfs.go | 7 ++--- core/coreapi/unixfs_test.go | 49 ++++++++++++++++++-------------- core/corehttp/gateway_handler.go | 4 ++- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/core/coreapi/interface/unixfs.go b/core/coreapi/interface/unixfs.go index acc3b960ce3..92168503eca 100644 --- a/core/coreapi/interface/unixfs.go +++ b/core/coreapi/interface/unixfs.go @@ -2,10 +2,10 @@ package iface import ( "context" - "io" options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) @@ -13,7 +13,7 @@ import ( // NOTE: This API is heavily WIP, things are guaranteed to break frequently type UnixfsAPI interface { // Add imports the data from the reader into merkledag file - Add(context.Context, io.ReadCloser, ...options.UnixfsAddOption) (ResolvedPath, error) + Add(context.Context, files.File, ...options.UnixfsAddOption) (ResolvedPath, error) // Cat returns a reader for the file Cat(context.Context, Path) (Reader, error) diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index 650d487b4e8..a245b710c4a 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" ipath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" @@ -17,7 +18,7 @@ import ( var rnd = rand.New(rand.NewSource(0x62796532303137)) func addTestObject(ctx context.Context, api coreiface.CoreAPI) (coreiface.Path, error) { - return api.Unixfs().Add(ctx, ioutil.NopCloser(&io.LimitedReader{R: rnd, N: 4092})) + return api.Unixfs().Add(ctx, files.NewReaderFile("", "", ioutil.NopCloser(&io.LimitedReader{R: rnd, N: 4092}), nil)) } func TestBasicPublishResolve(t *testing.T) { diff --git a/core/coreapi/pin_test.go b/core/coreapi/pin_test.go index fbae2280291..a9a7547c3db 100644 --- a/core/coreapi/pin_test.go +++ b/core/coreapi/pin_test.go @@ -2,7 +2,6 @@ package coreapi_test import ( "context" - "io/ioutil" "strings" "testing" @@ -16,7 +15,7 @@ func TestPinAdd(t *testing.T) { t.Error(err) } - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) + p, err := api.Unixfs().Add(ctx, strFile("foo")()) if err != nil { t.Error(err) } @@ -34,7 +33,7 @@ func TestPinSimple(t *testing.T) { t.Error(err) } - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) + p, err := api.Unixfs().Add(ctx, strFile("foo")()) if err != nil { t.Error(err) } @@ -83,12 +82,12 @@ func TestPinRecursive(t *testing.T) { t.Error(err) } - p0, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("foo"))) + p0, err := api.Unixfs().Add(ctx, strFile("foo")()) if err != nil { t.Error(err) } - p1, err := api.Unixfs().Add(ctx, ioutil.NopCloser(strings.NewReader("bar"))) + p1, err := api.Unixfs().Add(ctx, strFile("bar")()) if err != nil { t.Error(err) } diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 03bc6f73c0d..9ba1c29c3cb 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/ipfs/go-ipfs/core" - "io" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreapi/interface/options" @@ -12,7 +11,7 @@ import ( cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" @@ -27,7 +26,7 @@ type UnixfsAPI CoreAPI // Add builds a merkledag node from a reader, adds it to the blockstore, // and returns the key representing that node. -func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options.UnixfsAddOption) (coreiface.ResolvedPath, error) { +func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options.UnixfsAddOption) (coreiface.ResolvedPath, error) { settings, prefix, err := options.UnixfsAddOptions(opts...) if err != nil { return nil, err @@ -104,7 +103,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, r io.ReadCloser, opts ...options. fileAdder.SetMfsRoot(mr) } - nd, err := fileAdder.AddAllAndPin(files.NewReaderFile("", "", r, nil)) + nd, err := fileAdder.AddAllAndPin(files) if err != nil { return nil, err } diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 207470a8144..f1fd90203b3 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -22,6 +22,7 @@ import ( mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" @@ -127,6 +128,12 @@ func makeAPI(ctx context.Context) (*core.IpfsNode, coreiface.CoreAPI, error) { return nd[0], api[0], nil } +func strFile(data string) func() files.File { + return func() files.File { + return files.NewReaderFile("", "", ioutil.NopCloser(strings.NewReader(data)), nil) + } +} + func TestAdd(t *testing.T) { ctx := context.Background() _, api, err := makeAPI(ctx) @@ -136,7 +143,7 @@ func TestAdd(t *testing.T) { cases := []struct { name string - data string + data func() files.File path string err string opts []options.UnixfsAddOption @@ -144,83 +151,83 @@ func TestAdd(t *testing.T) { // Simple cases { name: "simpleAdd", - data: helloStr, + data: strFile(helloStr), path: hello, opts: []options.UnixfsAddOption{}, }, { name: "addEmpty", - data: "", + data: strFile(""), path: emptyFile, }, // CIDv1 version / rawLeaves { name: "addCidV1", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(1)}, }, { name: "addCidV1NoLeaves", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zdj7WY4GbN8NDbTW1dfCShAQNVovams2xhq9hVCx5vXcjvT8g", opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(1), options.Unixfs.RawLeaves(false)}, }, // Non sha256 hash vs CID { name: "addCidSha3", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zb2wwnYtXBxpndNABjtYxWAPt3cwWNRnc11iT63fvkYV78iRb", opts: []options.UnixfsAddOption{options.Unixfs.Hash(mh.SHA3_256)}, }, { name: "addCidSha3Cid0", - data: helloStr, + data: strFile(helloStr), err: "CIDv0 only supports sha2-256", opts: []options.UnixfsAddOption{options.Unixfs.CidVersion(0), options.Unixfs.Hash(mh.SHA3_256)}, }, // Inline { name: "addInline", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zaYomJdLndMku8P9LHngHB5w2CQ7NenLbv", opts: []options.UnixfsAddOption{options.Unixfs.Inline(true)}, }, { name: "addInlineLimit", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zaYomJdLndMku8P9LHngHB5w2CQ7NenLbv", opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.Inline(true)}, }, { name: "addInlineZero", - data: "", + data: strFile(""), path: "/ipfs/z2yYDV", opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(0), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)}, }, { //TODO: after coreapi add is used in `ipfs add`, consider making this default for inline name: "addInlineRaw", - data: helloStr, + data: strFile(helloStr), path: "/ipfs/zj7Gr8AcBreqGEfrnR5kPFe", opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(32), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)}, }, // Chunker / Layout { name: "addChunks", - data: strings.Repeat("aoeuidhtns", 200), + data: strFile(strings.Repeat("aoeuidhtns", 200)), path: "/ipfs/QmRo11d4QJrST47aaiGVJYwPhoNA4ihRpJ5WaxBWjWDwbX", opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4")}, }, { name: "addChunksTrickle", - data: strings.Repeat("aoeuidhtns", 200), + data: strFile(strings.Repeat("aoeuidhtns", 200)), path: "/ipfs/QmNNhDGttafX3M1wKWixGre6PrLFGjnoPEDXjBYpTv93HP", opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLayout)}, }, // Local { name: "addLocal", // better cases in sharness - data: helloStr, + data: strFile(helloStr), path: hello, opts: []options.UnixfsAddOption{options.Unixfs.Local(true)}, }, @@ -228,8 +235,7 @@ func TestAdd(t *testing.T) { for _, testCase := range cases { t.Run(testCase.name, func(t *testing.T) { - str := strings.NewReader(testCase.data) - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str), testCase.opts...) + p, err := api.Unixfs().Add(ctx, testCase.data(), testCase.opts...) if testCase.err != "" { if err == nil { t.Fatalf("expected an error: %s", testCase.err) @@ -247,7 +253,7 @@ func TestAdd(t *testing.T) { t.Errorf("expected path %s, got: %s", testCase.path, p) } - r, err := api.Unixfs().Cat(ctx, p) + /*r, err := api.Unixfs().Cat(ctx, p) if err != nil { t.Fatal(err) } @@ -259,7 +265,8 @@ func TestAdd(t *testing.T) { if string(buf) != testCase.data { t.Fatalf("expected [%s], got [%s] [err=%s]", helloStr, string(buf), err) - } + }*/ + }) } } @@ -271,8 +278,7 @@ func TestAddPinned(t *testing.T) { t.Error(err) } - str := strings.NewReader(helloStr) - _, err = api.Unixfs().Add(ctx, ioutil.NopCloser(str), options.Unixfs.Pin(true)) + _, err = api.Unixfs().Add(ctx, strFile(helloStr)(), options.Unixfs.Pin(true)) if err != nil { t.Error(err) } @@ -294,8 +300,7 @@ func TestAddHashOnly(t *testing.T) { t.Error(err) } - str := strings.NewReader(helloStr) - p, err := api.Unixfs().Add(ctx, ioutil.NopCloser(str), options.Unixfs.HashOnly(true)) + p, err := api.Unixfs().Add(ctx, strFile(helloStr)(), options.Unixfs.HashOnly(true)) if err != nil { t.Error(err) } diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 9e0b8e1ec86..e5e2ae78ac3 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "net/url" "os" @@ -25,6 +26,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" @@ -398,7 +400,7 @@ func (i *gatewayHandler) serveFile(w http.ResponseWriter, req *http.Request, nam } func (i *gatewayHandler) postHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) { - p, err := i.api.Unixfs().Add(ctx, r.Body) + p, err := i.api.Unixfs().Add(ctx, files.NewReaderFile("", "", ioutil.NopCloser(r.Body), nil)) if err != nil { internalWebError(w, err) return From 8dda69575a1c20fd9ed7e458a6cc0f44ebdd9bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 17:21:07 +0200 Subject: [PATCH 48/85] coreapi unixfs: unixfs.Get MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/unixfs.go | 8 ++ core/coreapi/unixfile.go | 199 +++++++++++++++++++++++++++++++ core/coreapi/unixfs.go | 9 ++ 3 files changed, 216 insertions(+) create mode 100644 core/coreapi/unixfile.go diff --git a/core/coreapi/interface/unixfs.go b/core/coreapi/interface/unixfs.go index 92168503eca..69e73182261 100644 --- a/core/coreapi/interface/unixfs.go +++ b/core/coreapi/interface/unixfs.go @@ -13,8 +13,16 @@ import ( // NOTE: This API is heavily WIP, things are guaranteed to break frequently type UnixfsAPI interface { // Add imports the data from the reader into merkledag file + // + // TODO: a long useful comment on how to use this for many different scenarios Add(context.Context, files.File, ...options.UnixfsAddOption) (ResolvedPath, error) + // Get returns a read-only handle to a file tree referenced by a path + // + // Note that some implementations of this API may apply the specified context + // to operations performed on the returned file + Get(context.Context, Path) (files.File, error) + // Cat returns a reader for the file Cat(context.Context, Path) (Reader, error) diff --git a/core/coreapi/unixfile.go b/core/coreapi/unixfile.go new file mode 100644 index 00000000000..95335075416 --- /dev/null +++ b/core/coreapi/unixfile.go @@ -0,0 +1,199 @@ +package coreapi + +import ( + "bytes" + "context" + "errors" + "io" + "io/ioutil" + "os" + gopath "path" + "time" + + files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" + uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" +) + +// Number to file to prefetch in directories +// TODO: should we allow setting this via context hint? +const prefetchFiles = 4 + +// TODO: this probably belongs in go-unixfs (and could probably replace a chunk of it's interface in the long run) + +type sizeInfo struct { + size int64 + name string + modTime time.Time +} + +func (s *sizeInfo) Name() string { + return s.name +} + +func (s *sizeInfo) Size() int64 { + return s.size +} + +func (s *sizeInfo) Mode() os.FileMode { + return 0444 // all read +} + +func (s *sizeInfo) ModTime() time.Time { + return s.modTime +} + +func (s *sizeInfo) IsDir() bool { + return false +} + +func (s *sizeInfo) Sys() interface{} { + return nil +} + +type ufsDirectory struct { + ctx context.Context + dserv ipld.DAGService + + files chan *ipld.Link + + name string + path string +} + +func (d *ufsDirectory) Close() error { + return files.ErrNotReader +} + +func (d *ufsDirectory) Read(_ []byte) (int, error) { + return 0, files.ErrNotReader +} + +func (d *ufsDirectory) FileName() string { + return d.name +} + +func (d *ufsDirectory) FullPath() string { + return d.path +} + +func (d *ufsDirectory) IsDirectory() bool { + return true +} + +func (d *ufsDirectory) NextFile() (files.File, error) { + l, ok := <-d.files + if !ok { + return nil, io.EOF + } + + nd, err := l.GetNode(d.ctx, d.dserv) + if err != nil { + return nil, err + } + + return newUnixfsFile(d.ctx, d.dserv, nd, l.Name, d) +} + +type ufsFile struct { + uio.DagReader + + name string + path string +} + +func (f *ufsFile) IsDirectory() bool { + return false +} + +func (f *ufsFile) NextFile() (files.File, error) { + return nil, files.ErrNotDirectory +} + +func (f *ufsFile) FileName() string { + return f.name +} + +func (f *ufsFile) FullPath() string { + return f.path +} + +func (f *ufsFile) Size() (int64, error) { + return int64(f.DagReader.Size()), nil +} + +func newUnixfsDir(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, name string, path string) (files.File, error) { + dir, err := uio.NewDirectoryFromNode(dserv, nd) + if err != nil { + return nil, err + } + + fileCh := make(chan *ipld.Link, prefetchFiles) + go func() { + dir.ForEachLink(ctx, func(link *ipld.Link) error { + select { + case fileCh <- link: + case <-ctx.Done(): + return ctx.Err() + } + return nil + }) + + close(fileCh) + }() + + return &ufsDirectory{ + ctx: ctx, + dserv: dserv, + + files: fileCh, + + name: name, + path: path, + }, nil +} + +func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, name string, parent files.File) (files.File, error) { + path := name + if parent != nil { + path = gopath.Join(parent.FullPath(), name) + } + + switch dn := nd.(type) { + case *dag.ProtoNode: + fsn, err := ft.FSNodeFromBytes(nd.RawData()) + if err != nil { + return nil, err + } + if fsn.IsDir() { + return newUnixfsDir(ctx, dserv, nd, name, path) + } + + case *dag.RawNode: + + r := ioutil.NopCloser(bytes.NewReader(dn.RawData())) + fi := &sizeInfo{ + size: int64(len(dn.RawData())), + } + + return files.NewReaderFile("", "", r, fi), nil + default: + return nil, errors.New("unknown node type") + } + + dr, err := uio.NewDagReader(ctx, nd, dserv) + if err != nil { + return nil, err + } + + return &ufsFile{ + DagReader: dr, + + name: name, + path: path, + }, nil +} + +var _ os.FileInfo = &sizeInfo{} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 9ba1c29c3cb..80f59d278c3 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -110,6 +110,15 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options return coreiface.IpfsPath(nd.Cid()), nil } +func (api *UnixfsAPI) Get(ctx context.Context, p coreiface.Path) (files.File, error) { + nd, err := api.core().ResolveNode(ctx, p) + if err != nil { + return nil, err + } + + return newUnixfsFile(ctx, api.node.DAG, nd, "", nil) +} + // Cat returns the data contained by an IPFS or IPNS object(s) at path `p`. func (api *UnixfsAPI) Cat(ctx context.Context, p coreiface.Path) (coreiface.Reader, error) { dget := api.node.DAG // TODO: use a session here once routing perf issues are resolved From c6f8e7e2a6d92dd16dc5376cbc930dea68731cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 22:06:35 +0200 Subject: [PATCH 49/85] coreapi unixfs: test recursive adding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/unixfile.go | 3 +- core/coreapi/unixfs_test.go | 106 ++++++++++++++++++++++++++++++------ core/coreunix/add.go | 4 +- 3 files changed, 92 insertions(+), 21 deletions(-) diff --git a/core/coreapi/unixfile.go b/core/coreapi/unixfile.go index 95335075416..dcec250cbb3 100644 --- a/core/coreapi/unixfile.go +++ b/core/coreapi/unixfile.go @@ -163,7 +163,7 @@ func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, nam switch dn := nd.(type) { case *dag.ProtoNode: - fsn, err := ft.FSNodeFromBytes(nd.RawData()) + fsn, err := ft.FSNodeFromBytes(dn.Data()) if err != nil { return nil, err } @@ -172,7 +172,6 @@ func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, nam } case *dag.RawNode: - r := ioutil.NopCloser(bytes.NewReader(dn.RawData())) fi := &sizeInfo{ size: int64(len(dn.RawData())), diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index f1fd90203b3..c446032c0c6 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -142,11 +142,12 @@ func TestAdd(t *testing.T) { } cases := []struct { - name string - data func() files.File - path string - err string - opts []options.UnixfsAddOption + name string + data func() files.File + path string + err string + recursive bool + opts []options.UnixfsAddOption }{ // Simple cases { @@ -231,11 +232,45 @@ func TestAdd(t *testing.T) { path: hello, opts: []options.UnixfsAddOption{options.Unixfs.Local(true)}, }, + // multi file + { + name: "simpleDir", + data: func() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + }, + recursive: true, + path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp", + }, + { + name: "twoLevelDir", + data: func() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewSliceFile("t/abc", "t/abc", []files.File{ + files.NewReaderFile("t/abc/def", "t/abc/def", ioutil.NopCloser(strings.NewReader("world")), nil), + }), + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + }, + recursive: true, + path: "/ipfs/QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", + }, } for _, testCase := range cases { t.Run(testCase.name, func(t *testing.T) { - p, err := api.Unixfs().Add(ctx, testCase.data(), testCase.opts...) + + data := testCase.data() + if testCase.recursive { + data = files.NewSliceFile("", "", []files.File{ + data, + }) + } + + p, err := api.Unixfs().Add(ctx, data, testCase.opts...) if testCase.err != "" { if err == nil { t.Fatalf("expected an error: %s", testCase.err) @@ -246,27 +281,64 @@ func TestAdd(t *testing.T) { return } if err != nil { - t.Error(err) + t.Fatal(err) } if p.String() != testCase.path { t.Errorf("expected path %s, got: %s", testCase.path, p) } - /*r, err := api.Unixfs().Cat(ctx, p) - if err != nil { - t.Fatal(err) + var cmpFile func(orig files.File, got files.File) + cmpFile = func(orig files.File, got files.File) { + if orig.IsDirectory() != got.IsDirectory() { + t.Fatal("file type mismatch") + } + + if !orig.IsDirectory() { + defer orig.Close() + defer got.Close() + + do, err := ioutil.ReadAll(orig) + if err != nil { + t.Fatal(err) + } + + dg, err := ioutil.ReadAll(got) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(do, dg) { + t.Fatal("data not equal") + } + + return + } + + for { + fo, err := orig.NextFile() + fg, err2 := got.NextFile() + + if err != nil { + if err == io.EOF && err2 == io.EOF { + break + } + t.Fatal(err) + } + if err2 != nil { + t.Fatal(err) + } + + cmpFile(fo, fg) + } } - buf := make([]byte, len(testCase.data)) - _, err = io.ReadFull(r, buf) + + f, err := api.Unixfs().Get(ctx, p) if err != nil { - t.Error(err) + t.Fatal(err) } - if string(buf) != testCase.data { - t.Fatalf("expected [%s], got [%s] [err=%s]", helloStr, string(buf), err) - }*/ - + cmpFile(testCase.data(), f) }) } } diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 55be2cd55da..d5a152f57f7 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -415,14 +415,14 @@ func (adder *Adder) AddAllAndPin(file files.File) (ipld.Node, error) { // single files.File f is treated as a directory, affecting hidden file // semantics. for { - file, err := file.NextFile() + f, err := file.NextFile() if err == io.EOF { // Finished the list of files. break } else if err != nil { return nil, err } - if err := adder.addFile(file); err != nil { + if err := adder.addFile(f); err != nil { return nil, err } } From 18fec6eb5f4ec73654baa26903c34e38c0866bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 22:30:45 +0200 Subject: [PATCH 50/85] coreapi unixfs: wrap option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 13 ++++ core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 77 +++++++++++++++++++----- 3 files changed, 76 insertions(+), 16 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index df6f4fc7112..abbea968193 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -31,6 +31,8 @@ type UnixfsAddSettings struct { Pin bool OnlyHash bool Local bool + + Wrap bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -51,6 +53,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, Pin: false, OnlyHash: false, Local: false, + + Wrap: false, } for _, opt := range opts { @@ -202,3 +206,12 @@ func (unixfsOpts) Local(local bool) UnixfsAddOption { return nil } } + +// Wrap tells the adder to wrap the added file structure with an additional +// directory. +func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Wrap = wrap + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 80f59d278c3..650ecda036d 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -66,7 +66,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options fileAdder.Chunker = settings.Chunker //fileAdder.Progress = progress //fileAdder.Hidden = hidden - //fileAdder.Wrap = wrap + fileAdder.Wrap = settings.Wrap fileAdder.Pin = settings.Pin && !settings.OnlyHash fileAdder.Silent = true fileAdder.RawLeaves = settings.RawLeaves diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index c446032c0c6..30b1e571e63 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -134,6 +134,18 @@ func strFile(data string) func() files.File { } } +func twoLevelDir() func() files.File { + return func() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewSliceFile("t/abc", "t/abc", []files.File{ + files.NewReaderFile("t/abc/def", "t/abc/def", ioutil.NopCloser(strings.NewReader("world")), nil), + }), + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + } +} + func TestAdd(t *testing.T) { ctx := context.Background() _, api, err := makeAPI(ctx) @@ -142,12 +154,16 @@ func TestAdd(t *testing.T) { } cases := []struct { - name string - data func() files.File - path string - err string + name string + data func() files.File + + path string + err string + recursive bool - opts []options.UnixfsAddOption + wrapped bool + + opts []options.UnixfsAddOption }{ // Simple cases { @@ -232,6 +248,12 @@ func TestAdd(t *testing.T) { path: hello, opts: []options.UnixfsAddOption{options.Unixfs.Local(true)}, }, + { + name: "hashOnly", // test (non)fetchability + data: strFile(helloStr), + path: hello, + opts: []options.UnixfsAddOption{options.Unixfs.HashOnly(true)}, + }, // multi file { name: "simpleDir", @@ -245,18 +267,36 @@ func TestAdd(t *testing.T) { path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp", }, { - name: "twoLevelDir", + name: "twoLevelDir", + data: twoLevelDir(), + recursive: true, + path: "/ipfs/QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", + }, + // wrapped + { + name: "addWrapped", + path: "/ipfs/QmVE9rNpj5doj7XHzp5zMUxD7BJgXEqx4pe3xZ3JBReWHE", data: func() files.File { - return files.NewSliceFile("t", "t", []files.File{ - files.NewSliceFile("t/abc", "t/abc", []files.File{ - files.NewReaderFile("t/abc/def", "t/abc/def", ioutil.NopCloser(strings.NewReader("world")), nil), - }), - files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), - files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), - }) + return files.NewReaderFile("foo", "foo", ioutil.NopCloser(strings.NewReader(helloStr)), nil) }, + wrapped: true, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, + }, + { + name: "twoLevelDirWrapped", + data: twoLevelDir(), recursive: true, - path: "/ipfs/QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", + wrapped: true, + path: "/ipfs/QmPwsL3T5sWhDmmAWZHAzyjKtMVDS9a11aHNRqb3xoVnmg", + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, + }, + { + name: "twoLevelInlineHash", + data: twoLevelDir(), + recursive: true, + wrapped: true, + path: "/ipfs/zBunoruKoyCHKkALNSWxDvj4L7yuQnMgQ4hUa9j1Z64tVcDEcu6Zdetyu7eeFCxMPfxb7YJvHeFHoFoHMkBUQf6vfdhmi", + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true), options.Unixfs.Hash(mh.SHA3)}, }, } @@ -338,7 +378,14 @@ func TestAdd(t *testing.T) { t.Fatal(err) } - cmpFile(testCase.data(), f) + orig := testCase.data() + if testCase.wrapped { + orig = files.NewSliceFile("", "", []files.File{ + orig, + }) + } + + cmpFile(orig, f) }) } } From 3e754d64fbd9770a1e09af3dfb492f599b7fe21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 22:49:42 +0200 Subject: [PATCH 51/85] coreapi unixfs: hidden opiton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 14 ++++- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 67 ++++++++++++++++++++---- 3 files changed, 69 insertions(+), 14 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index abbea968193..7d7af5b818e 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -32,7 +32,8 @@ type UnixfsAddSettings struct { OnlyHash bool Local bool - Wrap bool + Wrap bool + Hidden bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -54,7 +55,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, OnlyHash: false, Local: false, - Wrap: false, + Wrap: false, + Hidden: false, } for _, opt := range opts { @@ -215,3 +217,11 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption { return nil } } + +// Hidden enables adding of hidden files (files prefixed with '.') +func (unixfsOpts) Hidden(hidden bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Hidden = hidden + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 650ecda036d..7917d18f2c2 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -65,7 +65,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options fileAdder.Chunker = settings.Chunker //fileAdder.Progress = progress - //fileAdder.Hidden = hidden + fileAdder.Hidden = settings.Hidden fileAdder.Wrap = settings.Wrap fileAdder.Pin = settings.Pin && !settings.OnlyHash fileAdder.Silent = true diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 30b1e571e63..14577eae0a9 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -146,6 +146,12 @@ func twoLevelDir() func() files.File { } } +func wrapped(f files.File) files.File { + return files.NewSliceFile("", "", []files.File{ + f, + }) +} + func TestAdd(t *testing.T) { ctx := context.Background() _, api, err := makeAPI(ctx) @@ -154,14 +160,14 @@ func TestAdd(t *testing.T) { } cases := []struct { - name string - data func() files.File + name string + data func() files.File + expect func(files.File) files.File path string err string recursive bool - wrapped bool opts []options.UnixfsAddOption }{ @@ -279,14 +285,14 @@ func TestAdd(t *testing.T) { data: func() files.File { return files.NewReaderFile("foo", "foo", ioutil.NopCloser(strings.NewReader(helloStr)), nil) }, - wrapped: true, - opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, + expect: wrapped, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, }, { name: "twoLevelDirWrapped", data: twoLevelDir(), recursive: true, - wrapped: true, + expect: wrapped, path: "/ipfs/QmPwsL3T5sWhDmmAWZHAzyjKtMVDS9a11aHNRqb3xoVnmg", opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, }, @@ -294,10 +300,51 @@ func TestAdd(t *testing.T) { name: "twoLevelInlineHash", data: twoLevelDir(), recursive: true, - wrapped: true, + expect: wrapped, path: "/ipfs/zBunoruKoyCHKkALNSWxDvj4L7yuQnMgQ4hUa9j1Z64tVcDEcu6Zdetyu7eeFCxMPfxb7YJvHeFHoFoHMkBUQf6vfdhmi", opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true), options.Unixfs.Hash(mh.SHA3)}, }, + // hidden + { + name: "hiddenFiles", + data: func() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewReaderFile("t/.bar", "t/.bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + }, + recursive: true, + path: "/ipfs/QmehGvpf2hY196MzDFmjL8Wy27S4jbgGDUAhBJyvXAwr3g", + opts: []options.UnixfsAddOption{options.Unixfs.Hidden(true)}, + }, + { + name: "hiddenFileAlwaysAdded", + data: func() files.File { + return files.NewReaderFile(".foo", ".foo", ioutil.NopCloser(strings.NewReader(helloStr)), nil) + }, + recursive: true, + path: hello, + }, + { + name: "hiddenFilesNotAdded", + data: func() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewReaderFile("t/.bar", "t/.bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + }, + expect: func(files.File) files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) + }, + recursive: true, + path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp", + opts: []options.UnixfsAddOption{options.Unixfs.Hidden(false)}, + }, } for _, testCase := range cases { @@ -379,10 +426,8 @@ func TestAdd(t *testing.T) { } orig := testCase.data() - if testCase.wrapped { - orig = files.NewSliceFile("", "", []files.File{ - orig, - }) + if testCase.expect != nil { + orig = testCase.expect(orig) } cmpFile(orig, f) From f9cf84965dc88eaed9fc09d92e36f72d214e2994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Oct 2018 23:17:18 +0200 Subject: [PATCH 52/85] coreapi unixfs: stdin-name option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 19 +++++++++++++---- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 27 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 7d7af5b818e..90ad53e9ea3 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -32,8 +32,9 @@ type UnixfsAddSettings struct { OnlyHash bool Local bool - Wrap bool - Hidden bool + Wrap bool + Hidden bool + StdinName string } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -55,8 +56,9 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, OnlyHash: false, Local: false, - Wrap: false, - Hidden: false, + Wrap: false, + Hidden: false, + StdinName: "", } for _, opt := range opts { @@ -225,3 +227,12 @@ func (unixfsOpts) Hidden(hidden bool) UnixfsAddOption { return nil } } + +// StdinName is the name set for files which don specify FilePath as +// os.Stdin.Name() +func (unixfsOpts) StdinName(name string) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.StdinName = name + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 7917d18f2c2..fc971bf6e06 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -71,7 +71,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options fileAdder.Silent = true fileAdder.RawLeaves = settings.RawLeaves //fileAdder.NoCopy = nocopy - //fileAdder.Name = pathName + fileAdder.Name = settings.StdinName fileAdder.CidBuilder = prefix switch settings.Layout { diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 14577eae0a9..ba92e0484d5 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -8,6 +8,7 @@ import ( "io" "io/ioutil" "math" + "os" "strings" "testing" @@ -288,6 +289,32 @@ func TestAdd(t *testing.T) { expect: wrapped, opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, }, + { + name: "stdinWrapped", + path: "/ipfs/QmU3r81oZycjHS9oaSHw37ootMFuFUw1DvMLKXPsezdtqU", + data: func() files.File { + return files.NewReaderFile("", os.Stdin.Name(), ioutil.NopCloser(strings.NewReader(helloStr)), nil) + }, + expect: func(files.File) files.File { + return files.NewSliceFile("", "", []files.File{ + files.NewReaderFile("QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk", "QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk", ioutil.NopCloser(strings.NewReader(helloStr)), nil), + }) + }, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, + }, + { + name: "stdinNamed", + path: "/ipfs/QmQ6cGBmb3ZbdrQW1MRm1RJnYnaxCqfssz7CrTa9NEhQyS", + data: func() files.File { + return files.NewReaderFile("", os.Stdin.Name(), ioutil.NopCloser(strings.NewReader(helloStr)), nil) + }, + expect: func(files.File) files.File { + return files.NewSliceFile("", "", []files.File{ + files.NewReaderFile("test", "test", ioutil.NopCloser(strings.NewReader(helloStr)), nil), + }) + }, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.StdinName("test")}, + }, { name: "twoLevelDirWrapped", data: twoLevelDir(), From a81ec29baa59d7c62622eec8636ec3e49b34b906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 01:00:26 +0200 Subject: [PATCH 53/85] coreapi unixfs: progress events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/add.go | 5 +- core/commands/tar.go | 8 +- core/coreapi/interface/options/unixfs.go | 35 ++++++ core/coreapi/interface/unixfs.go | 9 ++ core/coreapi/unixfs.go | 7 +- core/coreapi/unixfs_test.go | 139 ++++++++++++++++++++--- core/coreunix/add.go | 28 ++--- core/coreunix/add_test.go | 12 +- 8 files changed, 199 insertions(+), 44 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index d7d6b33a267..df811af542f 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -8,6 +8,7 @@ import ( core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreunix" filestore "github.com/ipfs/go-ipfs/filestore" ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" @@ -371,7 +372,7 @@ You can now check what blocks have been created by: break LOOP } - output := out.(*coreunix.AddedObject) + output := out.(*coreiface.AddEvent) if len(output.Hash) > 0 { lastHash = output.Hash if quieter { @@ -451,5 +452,5 @@ You can now check what blocks have been created by: } }, }, - Type: coreunix.AddedObject{}, + Type: coreiface.AddEvent{}, } diff --git a/core/commands/tar.go b/core/commands/tar.go index a2fa3da20cc..670679032f7 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -7,7 +7,7 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" - "github.com/ipfs/go-ipfs/core/coreunix" + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" tar "github.com/ipfs/go-ipfs/tar" dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" @@ -60,12 +60,12 @@ represent it. c := node.Cid() fi.FileName() - res.SetOutput(&coreunix.AddedObject{ + res.SetOutput(&coreiface.AddEvent{ Name: fi.FileName(), Hash: c.String(), }) }, - Type: coreunix.AddedObject{}, + Type: coreiface.AddEvent{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { v, err := unwrapOutput(res.Output()) @@ -73,7 +73,7 @@ represent it. return nil, err } - o, ok := v.(*coreunix.AddedObject) + o, ok := v.(*coreiface.AddEvent) if !ok { return nil, e.TypeErr(o, v) } diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 90ad53e9ea3..da99b42f662 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -35,6 +35,10 @@ type UnixfsAddSettings struct { Wrap bool Hidden bool StdinName string + + Events chan<- interface{} + Silent bool + Progress bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -59,6 +63,10 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, Wrap: false, Hidden: false, StdinName: "", + + Events: nil, + Silent: false, + Progress: false, } for _, opt := range opts { @@ -236,3 +244,30 @@ func (unixfsOpts) StdinName(name string) UnixfsAddOption { return nil } } + +// Events specifies channel which will be used to report events about ongoing +// Add operation. +// +// Note that if this channel blocks it may slowdown the adder +func (unixfsOpts) Events(sink chan<- interface{}) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Events = sink + return nil + } +} + +// Silent reduces event output +func (unixfsOpts) Silent(silent bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Silent = silent + return nil + } +} + +// Progress tells the adder whether to enable progress events +func (unixfsOpts) Progress(enable bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.Progress = enable + return nil + } +} diff --git a/core/coreapi/interface/unixfs.go b/core/coreapi/interface/unixfs.go index 69e73182261..c622e210e58 100644 --- a/core/coreapi/interface/unixfs.go +++ b/core/coreapi/interface/unixfs.go @@ -9,6 +9,14 @@ import ( ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) +// TODO: ideas on making this more coreapi-ish without breaking the http API? +type AddEvent struct { + Name string + Hash string `json:",omitempty"` + Bytes int64 `json:",omitempty"` + Size string `json:",omitempty"` +} + // UnixfsAPI is the basic interface to immutable files in IPFS // NOTE: This API is heavily WIP, things are guaranteed to break frequently type UnixfsAPI interface { @@ -24,6 +32,7 @@ type UnixfsAPI interface { Get(context.Context, Path) (files.File, error) // Cat returns a reader for the file + // TODO: Remove in favour of Get (if we use Get on a file we still have reader directly, so..) Cat(context.Context, Path) (Reader, error) // Ls returns the list of links in a directory diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index fc971bf6e06..4bd60d159e1 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -64,11 +64,14 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options } fileAdder.Chunker = settings.Chunker - //fileAdder.Progress = progress + if settings.Events != nil { + fileAdder.Out = settings.Events + fileAdder.Progress = settings.Progress + } fileAdder.Hidden = settings.Hidden fileAdder.Wrap = settings.Wrap fileAdder.Pin = settings.Pin && !settings.OnlyHash - fileAdder.Silent = true + fileAdder.Silent = settings.Silent fileAdder.RawLeaves = settings.RawLeaves //fileAdder.NoCopy = nocopy fileAdder.Name = settings.StdinName diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index ba92e0484d5..eb02b3e5182 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -9,7 +9,9 @@ import ( "io/ioutil" "math" "os" + "strconv" "strings" + "sync" "testing" "github.com/ipfs/go-ipfs/core" @@ -147,6 +149,13 @@ func twoLevelDir() func() files.File { } } +func flatDir() files.File { + return files.NewSliceFile("t", "t", []files.File{ + files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), + files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), + }) +} + func wrapped(f files.File) files.File { return files.NewSliceFile("", "", []files.File{ f, @@ -170,6 +179,8 @@ func TestAdd(t *testing.T) { recursive bool + events []coreiface.AddEvent + opts []options.UnixfsAddOption }{ // Simple cases @@ -263,13 +274,8 @@ func TestAdd(t *testing.T) { }, // multi file { - name: "simpleDir", - data: func() files.File { - return files.NewSliceFile("t", "t", []files.File{ - files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), - files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), - }) - }, + name: "simpleDir", + data: flatDir, recursive: true, path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp", }, @@ -300,7 +306,7 @@ func TestAdd(t *testing.T) { files.NewReaderFile("QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk", "QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk", ioutil.NopCloser(strings.NewReader(helloStr)), nil), }) }, - opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, }, { name: "stdinNamed", @@ -313,7 +319,7 @@ func TestAdd(t *testing.T) { files.NewReaderFile("test", "test", ioutil.NopCloser(strings.NewReader(helloStr)), nil), }) }, - opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.StdinName("test")}, + opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.StdinName("test")}, }, { name: "twoLevelDirWrapped", @@ -363,19 +369,71 @@ func TestAdd(t *testing.T) { }) }, expect: func(files.File) files.File { - return files.NewSliceFile("t", "t", []files.File{ - files.NewReaderFile("t/bar", "t/bar", ioutil.NopCloser(strings.NewReader("hello2")), nil), - files.NewReaderFile("t/foo", "t/foo", ioutil.NopCloser(strings.NewReader("hello1")), nil), - }) + return flatDir() }, recursive: true, path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp", opts: []options.UnixfsAddOption{options.Unixfs.Hidden(false)}, }, + // Events / Progress + { + name: "simpleAddEvent", + data: strFile(helloStr), + path: "/ipfs/zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", + events: []coreiface.AddEvent{ + {Name: "zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", Hash: "zb2rhdhmJjJZs9qkhQCpCQ7VREFkqWw3h1r8utjVvQugwHPFd", Size: strconv.Itoa(len(helloStr))}, + }, + opts: []options.UnixfsAddOption{options.Unixfs.RawLeaves(true)}, + }, + { + name: "silentAddEvent", + data: twoLevelDir(), + path: "/ipfs/QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", + events: []coreiface.AddEvent{ + {Name: "t/abc", Hash: "QmU7nuGs2djqK99UNsNgEPGh6GV4662p6WtsgccBNGTDxt", Size: "62"}, + {Name: "t", Hash: "QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", Size: "229"}, + }, + recursive: true, + opts: []options.UnixfsAddOption{options.Unixfs.Silent(true)}, + }, + { + name: "dirAddEvents", + data: twoLevelDir(), + path: "/ipfs/QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", + events: []coreiface.AddEvent{ + {Name: "t/abc/def", Hash: "QmNyJpQkU1cEkBwMDhDNFstr42q55mqG5GE5Mgwug4xyGk", Size: "13"}, + {Name: "t/bar", Hash: "QmS21GuXiRMvJKHos4ZkEmQDmRBqRaF5tQS2CQCu2ne9sY", Size: "14"}, + {Name: "t/foo", Hash: "QmfAjGiVpTN56TXi6SBQtstit5BEw3sijKj1Qkxn6EXKzJ", Size: "14"}, + {Name: "t/abc", Hash: "QmU7nuGs2djqK99UNsNgEPGh6GV4662p6WtsgccBNGTDxt", Size: "62"}, + {Name: "t", Hash: "QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr", Size: "229"}, + }, + recursive: true, + }, + { + name: "progress1M", + data: func() files.File { + r := bytes.NewReader(bytes.Repeat([]byte{0}, 1000000)) + return files.NewReaderFile("", "", ioutil.NopCloser(r), nil) + }, + path: "/ipfs/QmXXNNbwe4zzpdMg62ZXvnX1oU7MwSrQ3vAEtuwFKCm1oD", + events: []coreiface.AddEvent{ + {Name: "", Bytes: 262144}, + {Name: "", Bytes: 524288}, + {Name: "", Bytes: 786432}, + {Name: "", Bytes: 1000000}, + {Name: "QmXXNNbwe4zzpdMg62ZXvnX1oU7MwSrQ3vAEtuwFKCm1oD", Hash: "QmXXNNbwe4zzpdMg62ZXvnX1oU7MwSrQ3vAEtuwFKCm1oD", Size: "1000256"}, + }, + recursive: true, + opts: []options.UnixfsAddOption{options.Unixfs.Progress(true)}, + }, } for _, testCase := range cases { t.Run(testCase.name, func(t *testing.T) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + // recursive logic data := testCase.data() if testCase.recursive { @@ -384,7 +442,58 @@ func TestAdd(t *testing.T) { }) } - p, err := api.Unixfs().Add(ctx, data, testCase.opts...) + // handle events if relevant to test case + + opts := testCase.opts + eventOut := make(chan interface{}) + var evtWg sync.WaitGroup + if len(testCase.events) > 0 { + opts = append(opts, options.Unixfs.Events(eventOut)) + evtWg.Add(1) + + go func() { + defer evtWg.Done() + expected := testCase.events + + for evt := range eventOut { + event, ok := evt.(*coreiface.AddEvent) + if !ok { + t.Fatal("unexpected event type") + } + + if len(expected) < 1 { + t.Fatal("got more events than expected") + } + + if expected[0].Size != event.Size { + t.Errorf("Event.Size didn't match, %s != %s", expected[0].Size, event.Size) + } + + if expected[0].Name != event.Name { + t.Errorf("Event.Name didn't match, %s != %s", expected[0].Name, event.Name) + } + + if expected[0].Hash != event.Hash { + t.Errorf("Event.Hash didn't match, %s != %s", expected[0].Hash, event.Hash) + } + if expected[0].Bytes != event.Bytes { + t.Errorf("Event.Bytes didn't match, %d != %d", expected[0].Bytes, event.Bytes) + } + + expected = expected[1:] + } + + if len(expected) > 0 { + t.Fatalf("%d event(s) didn't arrive", len(expected)) + } + }() + } + + // Add! + + p, err := api.Unixfs().Add(ctx, data, opts...) + close(eventOut) + evtWg.Wait() if testCase.err != "" { if err == nil { t.Fatalf("expected an error: %s", testCase.err) @@ -402,6 +511,8 @@ func TestAdd(t *testing.T) { t.Errorf("expected path %s, got: %s", testCase.path, p) } + // compare file structure with Unixfs().Get + var cmpFile func(orig files.File, got files.File) cmpFile = func(orig files.File, got files.File) { if orig.IsDirectory() != got.IsDirectory() { diff --git a/core/coreunix/add.go b/core/coreunix/add.go index d5a152f57f7..84324c7ec41 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -11,19 +11,20 @@ import ( "strconv" core "github.com/ipfs/go-ipfs/core" + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/pin" - unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - balanced "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/trickle" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" + balanced "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/trickle" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" + dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" ) @@ -46,13 +47,6 @@ type Object struct { Size string } -type AddedObject struct { - Name string - Hash string `json:",omitempty"` - Bytes int64 `json:",omitempty"` - Size string `json:",omitempty"` -} - // NewAdder Returns a new Adder used for a file add operation. func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds ipld.DAGService) (*Adder, error) { return &Adder{ @@ -75,7 +69,7 @@ type Adder struct { pinning pin.Pinner blockstore bstore.GCBlockstore dagService ipld.DAGService - Out chan interface{} + Out chan<- interface{} Progress bool Hidden bool Pin bool @@ -570,7 +564,7 @@ func (adder *Adder) maybePauseForGC() error { } // outputDagnode sends dagnode info over the output channel -func outputDagnode(out chan interface{}, name string, dn ipld.Node) error { +func outputDagnode(out chan<- interface{}, name string, dn ipld.Node) error { if out == nil { return nil } @@ -580,7 +574,7 @@ func outputDagnode(out chan interface{}, name string, dn ipld.Node) error { return err } - out <- &AddedObject{ + out <- &coreiface.AddEvent{ Hash: o.Hash, Name: name, Size: o.Size, @@ -615,7 +609,7 @@ func getOutput(dagnode ipld.Node) (*Object, error) { type progressReader struct { file files.File - out chan interface{} + out chan<- interface{} bytes int64 lastProgress int64 } @@ -626,7 +620,7 @@ func (i *progressReader) Read(p []byte) (int, error) { i.bytes += int64(n) if i.bytes-i.lastProgress >= progressReaderIncrement || err == io.EOF { i.lastProgress = i.bytes - i.out <- &AddedObject{ + i.out <- &coreiface.AddEvent{ Name: i.file.FileName(), Bytes: i.bytes, } diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index 5185c4f4d8f..4af1803b35a 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -11,6 +11,7 @@ import ( "time" "github.com/ipfs/go-ipfs/core" + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/pin/gc" "github.com/ipfs/go-ipfs/repo" @@ -96,7 +97,7 @@ func TestAddGCLive(t *testing.T) { addedHashes := make(map[string]struct{}) select { case o := <-out: - addedHashes[o.(*AddedObject).Hash] = struct{}{} + addedHashes[o.(*coreiface.AddEvent).Hash] = struct{}{} case <-addDone: t.Fatal("add shouldnt complete yet") } @@ -124,7 +125,7 @@ func TestAddGCLive(t *testing.T) { // receive next object from adder o := <-out - addedHashes[o.(*AddedObject).Hash] = struct{}{} + addedHashes[o.(*coreiface.AddEvent).Hash] = struct{}{} <-gcstarted @@ -140,7 +141,7 @@ func TestAddGCLive(t *testing.T) { var last cid.Cid for a := range out { // wait for it to finish - c, err := cid.Decode(a.(*AddedObject).Hash) + c, err := cid.Decode(a.(*coreiface.AddEvent).Hash) if err != nil { t.Fatal(err) } @@ -178,7 +179,8 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) { if err != nil { t.Fatal(err) } - adder.Out = make(chan interface{}) + out := make(chan interface{}) + adder.Out = out adder.Progress = true adder.RawLeaves = rawLeaves adder.NoCopy = true @@ -196,7 +198,7 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) { t.Fatal(err) } }() - for range adder.Out { + for range out { } exp := 0 From d51ce96f55b84ea83599487f2a87b43998ac3902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 01:24:57 +0200 Subject: [PATCH 54/85] coreapi unixfs: filestore opts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 35 ++++++++++++++++++++++++ core/coreapi/unixfs.go | 19 ++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index da99b42f662..810e3c6e841 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -31,6 +31,8 @@ type UnixfsAddSettings struct { Pin bool OnlyHash bool Local bool + FsCache bool + NoCopy bool Wrap bool Hidden bool @@ -59,6 +61,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, Pin: false, OnlyHash: false, Local: false, + FsCache: false, + NoCopy: false, Wrap: false, Hidden: false, @@ -76,6 +80,17 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, } } + // nocopy -> rawblocks + if options.NoCopy && !options.RawLeaves { + // fixed? + if options.RawLeavesSet { + return nil, cid.Prefix{}, fmt.Errorf("nocopy option requires '--raw-leaves' to be enabled as well") + } + + // No, satisfy mandatory constraint. + options.RawLeaves = true + } + // (hash != "sha2-256") -> CIDv1 if options.MhType != mh.SHA2_256 { switch options.CidVersion { @@ -271,3 +286,23 @@ func (unixfsOpts) Progress(enable bool) UnixfsAddOption { return nil } } + +// FsCache tells the adder to check the filestore for pre-existing blocks +// +// Experimental +func (unixfsOpts) FsCache(enable bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.FsCache = enable + return nil + } +} + +// NoCopy tells the adder to add the files using filestore. Implies RawLeaves. +// +// Experimental +func (unixfsOpts) Nocopy(enable bool) UnixfsAddOption { + return func(settings *UnixfsAddSettings) error { + settings.NoCopy = enable + return nil + } +} diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 4bd60d159e1..5950985886a 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/filestore" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreapi/interface/options" @@ -33,6 +34,16 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options } n := api.node + + cfg, err := n.Repo.Config() + if err != nil { + return nil, err + } + + if settings.NoCopy && !cfg.Experimental.FilestoreEnabled { + return nil, filestore.ErrFilestoreNotEnabled + } + if settings.OnlyHash { nilnode, err := core.NewNode(ctx, &core.BuildCfg{ //TODO: need this to be true or all files @@ -46,9 +57,9 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options } addblockstore := n.Blockstore - //if !(fscache || nocopy) { - addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker) - //} + if !(settings.FsCache || settings.NoCopy) { + addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker) + } exch := n.Exchange if settings.Local { @@ -73,7 +84,7 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options fileAdder.Pin = settings.Pin && !settings.OnlyHash fileAdder.Silent = settings.Silent fileAdder.RawLeaves = settings.RawLeaves - //fileAdder.NoCopy = nocopy + fileAdder.NoCopy = settings.NoCopy fileAdder.Name = settings.StdinName fileAdder.CidBuilder = prefix From 69eb015b9f043fc6d1d3a276f1677e02961d468c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 01:57:25 +0200 Subject: [PATCH 55/85] ipfs add uses CoreAPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/add.go | 156 ++++++++--------------------------------- core/coreapi/unixfs.go | 8 +++ 2 files changed, 39 insertions(+), 125 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index df811af542f..05484e9ec07 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -6,25 +6,15 @@ import ( "os" "strings" - core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - "github.com/ipfs/go-ipfs/core/coreunix" - filestore "github.com/ipfs/go-ipfs/filestore" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - dagtest "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag/test" - blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" pb "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" - cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" ) // ErrDepthLimitExceeded indicates that the max depth has been exceeded. @@ -149,23 +139,11 @@ You can now check what blocks have been created by: return nil }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - cfg, err := n.Repo.Config() - if err != nil { - return err - } - // check if repo will exceed storage limit if added - // TODO: this doesn't handle the case if the hashed file is already in blocks (deduplicated) - // TODO: conditional GC is disabled due to it is somehow not possible to pass the size to the daemon - //if err := corerepo.ConditionalGC(req.Context(), n, uint64(size)); err != nil { - // res.SetError(err, cmdkit.ErrNormal) - // return - //} - progress, _ := req.Options[progressOptionName].(bool) trickle, _ := req.Options[trickleOptionName].(bool) wrap, _ := req.Options[wrapOptionName].(bool) @@ -182,131 +160,59 @@ You can now check what blocks have been created by: inline, _ := req.Options[inlineOptionName].(bool) inlineLimit, _ := req.Options[inlineLimitOptionName].(int) pathName, _ := req.Options[stdinPathName].(string) - - // The arguments are subject to the following constraints. - // - // nocopy -> filestoreEnabled - // nocopy -> rawblocks - // (hash != sha2-256) -> cidv1 - - // NOTE: 'rawblocks -> cidv1' is missing. Legacy reasons. - - // nocopy -> filestoreEnabled - if nocopy && !cfg.Experimental.FilestoreEnabled { - return cmdkit.Errorf(cmdkit.ErrClient, filestore.ErrFilestoreNotEnabled.Error()) - } - - // nocopy -> rawblocks - if nocopy && !rawblks { - // fixed? - if rbset { - return fmt.Errorf("nocopy option requires '--raw-leaves' to be enabled as well") - } - // No, satisfy mandatory constraint. - rawblks = true - } - - // (hash != "sha2-256") -> CIDv1 - if hashFunStr != "sha2-256" && cidVer == 0 { - if cidVerSet { - return cmdkit.Errorf(cmdkit.ErrClient, "CIDv0 only supports sha2-256") - } - cidVer = 1 - } - - // cidV1 -> raw blocks (by default) - if cidVer > 0 && !rbset { - rawblks = true - } - - prefix, err := dag.PrefixForCidVersion(cidVer) - if err != nil { - return err - } + local, _ := req.Options["local"].(bool) hashFunCode, ok := mh.Names[strings.ToLower(hashFunStr)] if !ok { return fmt.Errorf("unrecognized hash function: %s", strings.ToLower(hashFunStr)) } - prefix.MhType = hashFunCode - prefix.MhLength = -1 - - if hash { - nilnode, err := core.NewNode(n.Context(), &core.BuildCfg{ - //TODO: need this to be true or all files - // hashed will be stored in memory! - NilRepo: true, - }) - if err != nil { - return err - } - n = nilnode - } + events := make(chan interface{}, adderOutChanSize) - addblockstore := n.Blockstore - if !(fscache || nocopy) { - addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker) - } + opts := []options.UnixfsAddOption{ + options.Unixfs.Hash(hashFunCode), - exch := n.Exchange - local, _ := req.Options["local"].(bool) - if local { - exch = offline.Exchange(addblockstore) - } + options.Unixfs.Inline(inline), + options.Unixfs.InlineLimit(inlineLimit), - bserv := blockservice.New(addblockstore, exch) // hash security 001 - dserv := dag.NewDAGService(bserv) + options.Unixfs.Chunker(chunker), - outChan := make(chan interface{}, adderOutChanSize) + options.Unixfs.Pin(dopin), + options.Unixfs.HashOnly(hash), + options.Unixfs.Local(local), + options.Unixfs.FsCache(fscache), + options.Unixfs.Nocopy(nocopy), - fileAdder, err := coreunix.NewAdder(req.Context, n.Pinning, n.Blockstore, dserv) - if err != nil { - return err + options.Unixfs.Wrap(wrap), + options.Unixfs.Hidden(hidden), + options.Unixfs.StdinName(pathName), + + options.Unixfs.Progress(progress), + options.Unixfs.Silent(silent), + options.Unixfs.Events(events), } - fileAdder.Out = outChan - fileAdder.Chunker = chunker - fileAdder.Progress = progress - fileAdder.Hidden = hidden - fileAdder.Trickle = trickle - fileAdder.Wrap = wrap - fileAdder.Pin = dopin && !hash - fileAdder.Silent = silent - fileAdder.RawLeaves = rawblks - fileAdder.NoCopy = nocopy - fileAdder.Name = pathName - fileAdder.CidBuilder = prefix - - if inline { - fileAdder.CidBuilder = cidutil.InlineBuilder{ - Builder: fileAdder.CidBuilder, - Limit: inlineLimit, - } + if cidVerSet { + opts = append(opts, options.Unixfs.CidVersion(cidVer)) } - if hash { - md := dagtest.Mock() - emptyDirNode := ft.EmptyDirNode() - // Use the same prefix for the "empty" MFS root as for the file adder. - emptyDirNode.SetCidBuilder(fileAdder.CidBuilder) - mr, err := mfs.NewRoot(req.Context, md, emptyDirNode, nil) - if err != nil { - return err - } + if rbset { + opts = append(opts, options.Unixfs.RawLeaves(rawblks)) + } - fileAdder.SetMfsRoot(mr) + if trickle { + opts = append(opts, options.Unixfs.Layout(options.TrickleLayout)) } errCh := make(chan error) go func() { var err error defer func() { errCh <- err }() - defer close(outChan) - _, err = fileAdder.AddAllAndPin(req.Files) + defer close(events) + _, err = api.Unixfs().Add(req.Context, req.Files, opts...) }() - err = res.Emit(outChan) + err = res.Emit(events) if err != nil { return err } diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 5950985886a..53a3ea4fb39 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -40,6 +40,14 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options return nil, err } + // check if repo will exceed storage limit if added + // TODO: this doesn't handle the case if the hashed file is already in blocks (deduplicated) + // TODO: conditional GC is disabled due to it is somehow not possible to pass the size to the daemon + //if err := corerepo.ConditionalGC(req.Context(), n, uint64(size)); err != nil { + // res.SetError(err, cmdkit.ErrNormal) + // return + //} + if settings.NoCopy && !cfg.Experimental.FilestoreEnabled { return nil, filestore.ErrFilestoreNotEnabled } From 051c33087ba52461d1708da1e18c06bab57af4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 04:07:22 +0200 Subject: [PATCH 56/85] coreapi unixfile: simplify RawNode case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/unixfile.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/coreapi/unixfile.go b/core/coreapi/unixfile.go index dcec250cbb3..f100bbffb89 100644 --- a/core/coreapi/unixfile.go +++ b/core/coreapi/unixfile.go @@ -1,11 +1,9 @@ package coreapi import ( - "bytes" "context" "errors" "io" - "io/ioutil" "os" gopath "path" "time" @@ -172,12 +170,6 @@ func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, nam } case *dag.RawNode: - r := ioutil.NopCloser(bytes.NewReader(dn.RawData())) - fi := &sizeInfo{ - size: int64(len(dn.RawData())), - } - - return files.NewReaderFile("", "", r, fi), nil default: return nil, errors.New("unknown node type") } From bd23e7d2ed4db6e2058d285fe3a51511b2af1b37 Mon Sep 17 00:00:00 2001 From: Overbool Date: Wed, 3 Oct 2018 21:47:41 +0800 Subject: [PATCH 57/85] feat(command): add force flag for files rm License: MIT Signed-off-by: Overbool --- core/commands/files.go | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/core/commands/files.go b/core/commands/files.go index bf6b06b5e9b..facf13c629f 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -1002,6 +1002,7 @@ Remove files or directories. }, Options: []cmdkit.Option{ cmdkit.BoolOption("recursive", "r", "Recursively remove directories."), + cmdkit.BoolOption("force", "Forcibly remove target at path; implies -r for directories"), }, Run: func(req oldcmds.Request, res oldcmds.Response) { defer res.SetOutput(nil) @@ -1041,8 +1042,6 @@ Remove files or directories. return } - dashr, _, _ := req.Option("r").Bool() - var success bool defer func() { if success { @@ -1054,8 +1053,10 @@ Remove files or directories. } }() - // if '-r' specified, don't check file type (in bad scenarios, the block may not exist) - if dashr { + // if '--force' specified, it will remove anything else, + // including file, directory, corrupted node, etc + force, _, _ := req.Option("force").Bool() + if force { err := pdir.Unlink(name) if err != nil { res.SetError(err, cmdkit.ErrNormal) @@ -1066,25 +1067,31 @@ Remove files or directories. return } - childi, err := pdir.Child(name) + // get child node by name, when the node is corrupted and nonexistent, + // it will return specific error. + child, err := pdir.Child(name) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - switch childi.(type) { + dashr, _, _ := req.Option("r").Bool() + + switch child.(type) { case *mfs.Directory: - res.SetError(fmt.Errorf("%s is a directory, use -r to remove directories", path), cmdkit.ErrNormal) - return - default: - err := pdir.Unlink(name) - if err != nil { - res.SetError(err, cmdkit.ErrNormal) + if !dashr { + res.SetError(fmt.Errorf("%s is a directory, use -r to remove directories", path), cmdkit.ErrNormal) return } + } - success = true + err = pdir.Unlink(name) + if err != nil { + res.SetError(err, cmdkit.ErrNormal) + return } + + success = true }, } From a86cde50de4bd8da0b5eaf6f1936269bafd29c8e Mon Sep 17 00:00:00 2001 From: Overbool Date: Thu, 4 Oct 2018 23:09:39 +0800 Subject: [PATCH 58/85] test(files): add test for force flag License: MIT Signed-off-by: Overbool --- test/sharness/t0250-files-api.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/sharness/t0250-files-api.sh b/test/sharness/t0250-files-api.sh index 7b97f31ded6..793e168bede 100755 --- a/test/sharness/t0250-files-api.sh +++ b/test/sharness/t0250-files-api.sh @@ -629,6 +629,20 @@ test_files_api() { test_expect_success "repo gc $EXTRA" ' ipfs repo gc ' + + # test rm + + test_expect_success "remove file forcibly" ' + echo "hello world" | ipfs files write --create /forcibly && + ipfs files rm --force /forcibly && + verify_dir_contents / + ' + + test_expect_success "remove directory forcibly" ' + ipfs files mkdir /forcibly-dir && + ipfs files rm --force /forcibly-dir && + verify_dir_contents / + ' } # test offline and online From 4b1f733864491216df4641b8f88c4b02fc083384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 20:39:43 +0200 Subject: [PATCH 59/85] coreapi unixfs: fix inline doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/unixfs.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 810e3c6e841..9249af89539 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -170,13 +170,10 @@ func (unixfsOpts) Inline(enable bool) UnixfsAddOption { // Specifying this option won't enable block inlining. For that use `Inline` // option. Default: 32 bytes // -// Note that while there is no hard limit on the number of bytes, it should -// be kept at a reasonably low value, like 64 bytes if you intend to display -// these hashes. Larger values like 256 bytes will work fine, but may affect -// de-duplication of smaller blocks. -// -// Setting this value too high may cause various problems, such as render some -// blocks unfetchable +// Note that while there is no hard limit on the number of bytes, it should be +// kept at a reasonably low value, such as 64 and no more than 1k. Setting this +// value too high may cause various problems, such as render some +// blocks unfetchable. func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.InlineLimit = limit From 7807f575f1e40688a200ce1925fe3cdc6076c67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 22:10:09 +0200 Subject: [PATCH 60/85] coreapi key: error on self if ident not loaded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/key.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/coreapi/key.go b/core/coreapi/key.go index 9fe207785ba..d7de4647685 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -3,6 +3,7 @@ package coreapi import ( "context" "crypto/rand" + "errors" "fmt" "sort" @@ -218,5 +219,9 @@ func (api *KeyAPI) Remove(ctx context.Context, name string) (coreiface.Key, erro } func (api *KeyAPI) Self(ctx context.Context) (coreiface.Key, error) { + if api.node.Identity == "" { + return nil, errors.New("identity not loaded") + } + return &key{"self", api.node.Identity}, nil } From e8b137f885eb6508b0ff6439acf734e38b54d36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 22:11:17 +0200 Subject: [PATCH 61/85] coreapi name: add some missing options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/name.go | 24 ++++++++++++++++++++++++ core/coreapi/name.go | 7 +++++++ 2 files changed, 31 insertions(+) diff --git a/core/coreapi/interface/options/name.go b/core/coreapi/interface/options/name.go index ba3691b03cd..c614db3abc3 100644 --- a/core/coreapi/interface/options/name.go +++ b/core/coreapi/interface/options/name.go @@ -13,6 +13,10 @@ const ( type NamePublishSettings struct { ValidTime time.Duration Key string + + TTL *time.Duration + + AllowOffline bool } type NameResolveSettings struct { @@ -29,6 +33,8 @@ func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) options := &NamePublishSettings{ ValidTime: DefaultNameValidTime, Key: "self", + + AllowOffline: false, } for _, opt := range opts { @@ -82,6 +88,24 @@ func (nameOpts) Key(key string) NamePublishOption { } } +// AllowOffline is an option for Name.Publish which specifies whether to allow +// publishing when the node is offline. Default value is false +func (nameOpts) AllowOffline(allow bool) NamePublishOption { + return func(settings *NamePublishSettings) error { + settings.AllowOffline = allow + return nil + } +} + +// TTL is an option for Name.Publish which specifies the time duration the +// published record should be cached for (caution: experimental). +func (nameOpts) TTL(ttl time.Duration) NamePublishOption { + return func(settings *NamePublishSettings) error { + settings.TTL = &ttl + return nil + } +} + // Local is an option for Name.Resolve which specifies if the lookup should be // offline. Default value is false func (nameOpts) Local(local bool) NameResolveOption { diff --git a/core/coreapi/name.go b/core/coreapi/name.go index cb7fc9b7d18..ddd339c8ad7 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -45,6 +45,9 @@ func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopt n := api.node if !n.OnlineMode() { + if !options.AllowOffline { + return nil, coreiface.ErrOffline + } err := n.SetupOfflineRouting() if err != nil { return nil, err @@ -65,6 +68,10 @@ func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopt return nil, err } + if options.TTL != nil { + ctx = context.WithValue(ctx, "ipns-publish-ttl", *options.TTL) + } + eol := time.Now().Add(options.ValidTime) err = n.Namesys.PublishWithEOL(ctx, k, pth, eol) if err != nil { From 58c9de9e638e470e387ab35815154efa18c53c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 22:11:38 +0200 Subject: [PATCH 62/85] coreapi name: switch publish/resolve to coreapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/name/ipns.go | 53 ++++--------- core/commands/name/publish.go | 139 +++++++--------------------------- 2 files changed, 42 insertions(+), 150 deletions(-) diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index ff78948e7bb..388aa07069f 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -9,11 +9,10 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - namesys "github.com/ipfs/go-ipfs/namesys" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" nsopts "github.com/ipfs/go-ipfs/namesys/opts" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - offline "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" @@ -80,44 +79,21 @@ Resolve the value of a dnslink: cmdkit.StringOption(dhtTimeoutOptionName, "dhtt", "Max time to collect values during DHT resolution eg \"30s\". Pass 0 for no timeout."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - if !n.OnlineMode() { - err := n.SetupOfflineRouting() - if err != nil { - return err - } - } - nocache, _ := req.Options["nocache"].(bool) local, _ := req.Options["local"].(bool) - // default to nodes namesys resolver - var resolver namesys.Resolver = n.Namesys - - if local && nocache { - return errors.New("cannot specify both local and nocache") - } - - if local { - offroute := offline.NewOfflineRouter(n.Repo.Datastore(), n.RecordValidator) - resolver = namesys.NewIpnsResolver(offroute) - } - - if nocache { - resolver = namesys.NewNameSystem(n.Routing, n.Repo.Datastore(), 0) - } - var name string if len(req.Arguments) == 0 { - if n.Identity == "" { - return errors.New("identity not loaded") + self, err := api.Key().Self(req.Context) + if err != nil { + return err } - name = n.Identity.Pretty() - + name = self.ID().Pretty() } else { name = req.Arguments[0] } @@ -126,12 +102,16 @@ Resolve the value of a dnslink: rc, rcok := req.Options[dhtRecordCountOptionName].(int) dhtt, dhttok := req.Options[dhtTimeoutOptionName].(string) - var ropts []nsopts.ResolveOpt + opts := []options.NameResolveOption{ + options.Name.Local(local), + options.Name.Cache(!nocache), + } + if !recursive { - ropts = append(ropts, nsopts.Depth(1)) + opts = append(opts, options.Name.ResolveOption(nsopts.Depth(1))) } if rcok { - ropts = append(ropts, nsopts.DhtRecordCount(uint(rc))) + opts = append(opts, options.Name.ResolveOption(nsopts.DhtRecordCount(uint(rc)))) } if dhttok { d, err := time.ParseDuration(dhtt) @@ -141,20 +121,19 @@ Resolve the value of a dnslink: if d < 0 { return errors.New("DHT timeout value must be >= 0") } - ropts = append(ropts, nsopts.DhtTimeout(d)) + opts = append(opts, options.Name.ResolveOption(nsopts.DhtTimeout(d))) } if !strings.HasPrefix(name, "/ipns/") { name = "/ipns/" + name } - output, err := resolver.Resolve(req.Context, name, ropts...) + output, err := api.Name().Resolve(req.Context, name, opts...) if err != nil { return err } - // TODO: better errors (in the case of not finding the name, we get "failed to find any peer in table") - return cmds.EmitOnce(res, &ResolvedPath{output}) + return cmds.EmitOnce(res, &ResolvedPath{path.FromString(output.String())}) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { diff --git a/core/commands/name/publish.go b/core/commands/name/publish.go index f34bbbbc34e..1d068837305 100644 --- a/core/commands/name/publish.go +++ b/core/commands/name/publish.go @@ -1,28 +1,22 @@ package name import ( - "context" "errors" "fmt" "io" "time" - core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - keystore "github.com/ipfs/go-ipfs/keystore" + iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - crypto "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" ) var ( errAllowOffline = errors.New("can't publish while offline: pass `--allow-offline` to override") - errIpnsMount = errors.New("cannot manually publish while IPNS is mounted") - errIdentityLoad = errors.New("identity not loaded") ) const ( @@ -90,71 +84,59 @@ Alternatively, publish an using a valid PeerID (as listed by cmdkit.BoolOption(quieterOptionName, "Q", "Write only final hash."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } allowOffline, _ := req.Options[allowOfflineOptionName].(bool) - if !n.OnlineMode() { - if !allowOffline { - return errAllowOffline - } - err := n.SetupOfflineRouting() - if err != nil { - return err - } - } - - if n.Mounts.Ipns != nil && n.Mounts.Ipns.IsActive() { - return errIpnsMount - } - - pstr := req.Arguments[0] - - if n.Identity == "" { - return errIdentityLoad - } - - popts := new(publishOpts) - - popts.verifyExists, _ = req.Options[resolveOptionName].(bool) + kname, _ := req.Options[keyOptionName].(string) - validtime, _ := req.Options[lifeTimeOptionName].(string) - d, err := time.ParseDuration(validtime) + validTimeOpt, _ := req.Options[lifeTimeOptionName].(string) + validTime, err := time.ParseDuration(validTimeOpt) if err != nil { return fmt.Errorf("error parsing lifetime option: %s", err) } - popts.pubValidTime = d + opts := []options.NamePublishOption{ + options.Name.AllowOffline(allowOffline), + options.Name.Key(kname), + options.Name.ValidTime(validTime), + } - ctx := req.Context if ttl, found := req.Options[ttlOptionName].(string); found { d, err := time.ParseDuration(ttl) if err != nil { return err } - ctx = context.WithValue(ctx, "ipns-publish-ttl", d) + opts = append(opts, options.Name.TTL(d)) } - kname, _ := req.Options[keyOptionName].(string) - k, err := keylookup(n, kname) + p, err := iface.ParsePath(req.Arguments[0]) if err != nil { return err } - pth, err := path.ParsePath(pstr) - if err != nil { - return err + if verifyExists, _ := req.Options[resolveOptionName].(bool); verifyExists { + _, err := api.ResolveNode(req.Context, p) + if err != nil { + return err + } } - output, err := publish(ctx, n, k, pth, popts) + out, err := api.Name().Publish(req.Context, p, opts...) if err != nil { + if err == iface.ErrOffline { + err = errAllowOffline + } return err } - return cmds.EmitOnce(res, output) + return cmds.EmitOnce(res, &IpnsEntry{ + Name: out.Name(), + Value: out.Value().String(), + }) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { @@ -175,72 +157,3 @@ Alternatively, publish an using a valid PeerID (as listed by }, Type: IpnsEntry{}, } - -type publishOpts struct { - verifyExists bool - pubValidTime time.Duration -} - -func publish(ctx context.Context, n *core.IpfsNode, k crypto.PrivKey, ref path.Path, opts *publishOpts) (*IpnsEntry, error) { - - if opts.verifyExists { - // verify the path exists - _, err := core.Resolve(ctx, n.Namesys, n.Resolver, ref) - if err != nil { - return nil, err - } - } - - eol := time.Now().Add(opts.pubValidTime) - err := n.Namesys.PublishWithEOL(ctx, k, ref, eol) - if err != nil { - return nil, err - } - - pid, err := peer.IDFromPrivateKey(k) - if err != nil { - return nil, err - } - - return &IpnsEntry{ - Name: pid.Pretty(), - Value: ref.String(), - }, nil -} - -func keylookup(n *core.IpfsNode, k string) (crypto.PrivKey, error) { - - res, err := n.GetKey(k) - if res != nil { - return res, nil - } - - if err != nil && err != keystore.ErrNoSuchKey { - return nil, err - } - - keys, err := n.Repo.Keystore().List() - if err != nil { - return nil, err - } - - for _, key := range keys { - privKey, err := n.Repo.Keystore().Get(key) - if err != nil { - return nil, err - } - - pubKey := privKey.GetPublic() - - pid, err := peer.IDFromPublicKey(pubKey) - if err != nil { - return nil, err - } - - if pid.Pretty() == k { - return privKey, nil - } - } - - return nil, fmt.Errorf("no key by the given name or PeerID was found") -} From 2c3ed7efb04bd0b0ffddb8fbeb0a5237ef0db579 Mon Sep 17 00:00:00 2001 From: Lars Gierth Date: Wed, 3 Oct 2018 07:35:57 +0200 Subject: [PATCH 63/85] gx: update go-datastore, go-libp2p-swarm License: MIT Signed-off-by: Lars Gierth --- assets/assets.go | 2 +- blocks/blockstoreutil/remove.go | 4 +- cmd/ipfs/init.go | 2 +- cmd/ipfs/main.go | 2 +- cmd/ipfswatch/main.go | 2 +- cmd/seccat/seccat.go | 6 +- commands/request.go | 2 +- core/bootstrap.go | 8 +- core/bootstrap_test.go | 4 +- core/builder.go | 30 ++--- core/commands/add.go | 14 +- core/commands/bitswap.go | 4 +- core/commands/bootstrap.go | 2 +- core/commands/cmdenv/env.go | 2 +- core/commands/config.go | 2 +- core/commands/dag/dag.go | 2 +- core/commands/dht.go | 10 +- core/commands/dht_test.go | 2 +- core/commands/files.go | 10 +- core/commands/get.go | 6 +- core/commands/id.go | 6 +- core/commands/ls.go | 12 +- core/commands/mount_unix.go | 2 +- core/commands/name/ipns.go | 3 +- core/commands/name/publish.go | 1 + core/commands/object/object.go | 2 +- core/commands/p2p.go | 4 +- core/commands/pin.go | 6 +- core/commands/ping.go | 2 +- core/commands/pubsub.go | 4 +- core/commands/refs.go | 2 +- core/commands/repo.go | 4 +- core/commands/resolve.go | 2 +- core/commands/swarm.go | 10 +- core/commands/tar.go | 4 +- core/commands/unixfs/ls.go | 4 +- core/commands/urlstore.go | 6 +- core/core.go | 60 ++++----- core/core_test.go | 6 +- core/coreapi/dht.go | 12 +- core/coreapi/interface/dht.go | 2 +- core/coreapi/interface/path.go | 2 +- core/coreapi/interface/swarm.go | 4 +- core/coreapi/key.go | 2 +- core/coreapi/name.go | 4 +- core/coreapi/name_test.go | 2 +- core/coreapi/object.go | 4 +- core/coreapi/path.go | 6 +- core/coreapi/pin.go | 6 +- core/coreapi/swarm.go | 10 +- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 14 +- core/coredag/dagpb.go | 2 +- core/coredag/raw.go | 2 +- core/corehttp/commands.go | 4 +- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_handler.go | 14 +- core/corehttp/gateway_test.go | 12 +- core/corehttp/metrics_test.go | 6 +- core/corerepo/gc.go | 2 +- core/coreunix/add.go | 14 +- core/coreunix/add_test.go | 12 +- core/coreunix/metadata.go | 4 +- core/coreunix/metadata_test.go | 18 +-- core/mock/mock.go | 14 +- core/pathresolver.go | 4 +- core/pathresolver_test.go | 2 +- dagutils/diff.go | 2 +- dagutils/diffenum.go | 2 +- dagutils/diffenum_test.go | 4 +- dagutils/utils.go | 14 +- dagutils/utils_test.go | 6 +- exchange/reprovide/providers.go | 4 +- exchange/reprovide/reprovide.go | 2 +- exchange/reprovide/reprovide_test.go | 10 +- filestore/filestore.go | 4 +- filestore/filestore_test.go | 6 +- filestore/fsrefstore.go | 10 +- filestore/util.go | 8 +- fuse/ipns/common.go | 4 +- fuse/ipns/ipns_test.go | 2 +- fuse/ipns/ipns_unix.go | 8 +- fuse/node/mount_test.go | 2 +- fuse/readonly/ipfs_test.go | 6 +- fuse/readonly/readonly_unix.go | 8 +- namesys/base.go | 2 +- namesys/cache.go | 2 +- namesys/dns.go | 2 +- namesys/interface.go | 2 +- namesys/ipns_resolver_validation_test.go | 20 +-- namesys/namesys.go | 6 +- namesys/namesys_test.go | 14 +- namesys/proquint.go | 2 +- namesys/publisher.go | 14 +- namesys/publisher_test.go | 10 +- namesys/republisher/repub.go | 6 +- namesys/republisher/repub_test.go | 6 +- namesys/resolve_test.go | 10 +- namesys/routing.go | 10 +- p2p/listener.go | 4 +- p2p/local.go | 2 +- p2p/p2p.go | 4 +- p2p/remote.go | 2 +- p2p/stream.go | 4 +- package.json | 140 ++++++++++---------- pin/gc/gc.go | 10 +- pin/pin.go | 4 +- pin/pin_test.go | 12 +- pin/set.go | 2 +- pin/set_test.go | 12 +- repo/fsrepo/config_test.go | 2 +- repo/fsrepo/datastores.go | 12 +- repo/fsrepo/fsrepo.go | 8 +- repo/fsrepo/fsrepo_test.go | 4 +- repo/fsrepo/misc.go | 2 +- repo/mock.go | 2 +- repo/repo.go | 4 +- tar/format.go | 8 +- test/bench/bench_cli_ipfs_add/main.go | 2 +- test/bench/offline_add/main.go | 2 +- test/integration/addcat_test.go | 4 +- test/integration/bench_cat_test.go | 4 +- test/integration/bitswap_wo_routing_test.go | 2 +- test/integration/three_legged_cat_test.go | 4 +- thirdparty/cidv0v1/blockstore.go | 2 +- thirdparty/verifbs/verifbs.go | 2 +- 126 files changed, 454 insertions(+), 452 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index 923d83a42f7..908f26e4e3b 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" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmdZ4PvPHFQVLLEve7DgoKDcSY19wwpGBB1GKjjKi2rEL1/dir-index-html" diff --git a/blocks/blockstoreutil/remove.go b/blocks/blockstoreutil/remove.go index 70e02d7d7ac..876c2df7e52 100644 --- a/blocks/blockstoreutil/remove.go +++ b/blocks/blockstoreutil/remove.go @@ -8,8 +8,8 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - bs "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + bs "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // RemovedBlock is used to respresent the result of removing a block. diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 34364b90e05..950786f0936 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -17,8 +17,8 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) const ( diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 9b97caad998..c4116f9c4dc 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -27,11 +27,11 @@ import ( loggables "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" - "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/cli" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper" + "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" madns "gx/ipfs/QmfXU2MhWoegxHoeMd3A2ytL2P6CY4FfqGWc23LTNWBwZt/go-multiaddr-dns" diff --git a/cmd/ipfswatch/main.go b/cmd/ipfswatch/main.go index 5c8643703da..9e7b0584692 100644 --- a/cmd/ipfswatch/main.go +++ b/cmd/ipfswatch/main.go @@ -16,7 +16,7 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" fsnotify "gx/ipfs/QmfNjggF4Pt6erqg3NDafD3MdvDHk1qqCVr8pL5hnPucS8/fsnotify" ) diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index 5fc265c4d4a..d3c882df732 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -19,12 +19,12 @@ import ( "os/signal" "syscall" - secio "gx/ipfs/QmPJ6U14u5D2abGVkF3dopCeM1JqigVTUJ7jbAHjTnGZrt/go-libp2p-secio" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" + secio "gx/ipfs/QmUdVuLDQCQD4WPBpgDsbBAaqui3GW4d7exBHK2PUKRQpv/go-libp2p-secio" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore/pstoremem" ) var verbose = false diff --git a/commands/request.go b/commands/request.go index 765b81bb500..954d072139b 100644 --- a/commands/request.go +++ b/commands/request.go @@ -12,8 +12,8 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) type Context struct { diff --git a/core/bootstrap.go b/core/bootstrap.go index b899827451f..89845a0f5e1 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -12,14 +12,14 @@ import ( math2 "github.com/ipfs/go-ipfs/thirdparty/math2" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" + inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" periodicproc "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/periodic" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - host "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) // ErrNotEnoughBootstrapPeers signals that we do not have enough bootstrap diff --git a/core/bootstrap_test.go b/core/bootstrap_test.go index 88d0530e4ec..39253b17f28 100644 --- a/core/bootstrap_test.go +++ b/core/bootstrap_test.go @@ -5,8 +5,8 @@ import ( "testing" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { diff --git a/core/builder.go b/core/builder.go index ff39db7fa4b..ebc466dbf45 100644 --- a/core/builder.go +++ b/core/builder.go @@ -14,27 +14,27 @@ import ( repo "github.com/ipfs/go-ipfs/repo" cidv0v1 "github.com/ipfs/go-ipfs/thirdparty/cidv0v1" "github.com/ipfs/go-ipfs/thirdparty/verifbs" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - retry "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/retrystore" - dsync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - cfg "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - libp2p "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + cfg "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" - p2phost "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + retry "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/retrystore" + dsync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" metrics "gx/ipfs/QmekzFM3hPZjTjUFGTABdQkEnQ3PTiMstY198PwSFr5w1Q/go-metrics-interface" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore/pstoremem" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type BuildCfg struct { diff --git a/core/commands/add.go b/core/commands/add.go index 40e170cdb71..02d2e7cafe9 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -10,20 +10,20 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" "github.com/ipfs/go-ipfs/core/coreunix" filestore "github.com/ipfs/go-ipfs/filestore" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - dagtest "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag/test" - blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + dagtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" pb "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // ErrDepthLimitExceeded indicates that the max depth has been exceeded. diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 336b933d631..2d880335e95 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -9,8 +9,8 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - bitswap "gx/ipfs/QmUdtRsAr9RYxqNwUzeHDhv5bnVppiHLixP1SU4YysVj2S/go-bitswap" - decision "gx/ipfs/QmUdtRsAr9RYxqNwUzeHDhv5bnVppiHLixP1SU4YysVj2S/go-bitswap/decision" + bitswap "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap" + decision "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index 52c51c71bcf..fd3fb284bfc 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) type BootstrapOutput struct { diff --git a/core/commands/cmdenv/env.go b/core/commands/cmdenv/env.go index 757c2c962aa..1c6a0e161c1 100644 --- a/core/commands/cmdenv/env.go +++ b/core/commands/cmdenv/env.go @@ -7,8 +7,8 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) // GetNode extracts the node from the environment. diff --git a/core/commands/config.go b/core/commands/config.go index 0230d112cb1..d5c9d503bee 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -17,7 +17,7 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) type ConfigField struct { diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index 0191a8c1f47..aab2389f9fb 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -11,7 +11,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" coredag "github.com/ipfs/go-ipfs/core/coredag" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/commands/dht.go b/core/commands/dht.go index c8aac231c1f..7e139a53417 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -10,17 +10,17 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" e "github.com/ipfs/go-ipfs/core/commands/e" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + notif "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing/notifications" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" - notif "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing/notifications" b58 "gx/ipfs/QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY/go-base58-fast/base58" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" ) 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 e4f582ff0e7..20ae174890b 100644 --- a/core/commands/dht_test.go +++ b/core/commands/dht_test.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/go-ipfs/namesys" tu "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" ) func TestKeyTranslation(t *testing.T) { diff --git a/core/commands/files.go b/core/commands/files.go index bf6b06b5e9b..aa3f7078931 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -20,15 +20,15 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" + bservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/get.go b/core/commands/get.go index d82229585c9..4c1074f516f 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -15,11 +15,11 @@ import ( "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" tar "gx/ipfs/QmQine7gvHncNevKtG9QXxf3nXcwSj6aDDmMm52mHofEEp/tar-utils" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - uarchive "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/archive" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + uarchive "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/archive" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") diff --git a/core/commands/id.go b/core/commands/id.go index b0ae95c0381..4676f4f1967 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -13,11 +13,11 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - kb "gx/ipfs/QmRtUtF42geEhpRg9z45ZfBqRMC6xyeNW7i1iqha3nRMFe/go-libp2p-kbucket" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - identify "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/protocol/identify" + kb "gx/ipfs/QmWKgrs6cyhTNUaTmAKs86K1FpYmkQLYVj83GqUvmuT3TY/go-libp2p-kbucket" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + identify "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ) const offlineIdErrorMessage = `'ipfs id' currently cannot query information on remote diff --git a/core/commands/ls.go b/core/commands/ls.go index 6e503d843c8..be643a6cad2 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -11,13 +11,13 @@ import ( iface "github.com/ipfs/go-ipfs/core/coreapi/interface" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - unixfspb "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/pb" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + unixfspb "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/pb" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/mount_unix.go b/core/commands/mount_unix.go index 72d300f5b21..532aadaaf72 100644 --- a/core/commands/mount_unix.go +++ b/core/commands/mount_unix.go @@ -12,7 +12,7 @@ import ( nodeMount "github.com/ipfs/go-ipfs/fuse/node" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) var MountCmd = &cmds.Command{ diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 388aa07069f..11f7b24de4d 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -14,8 +14,9 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + offline "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var log = logging.Logger("core/commands/ipns") diff --git a/core/commands/name/publish.go b/core/commands/name/publish.go index 1d068837305..dcae7d7f1b7 100644 --- a/core/commands/name/publish.go +++ b/core/commands/name/publish.go @@ -13,6 +13,7 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var ( diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 16690cdbf4d..534df2854ca 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -17,9 +17,9 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index 0877bd44b63..fc96973659c 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -14,11 +14,11 @@ import ( core "github.com/ipfs/go-ipfs/core" p2p "github.com/ipfs/go-ipfs/p2p" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) // P2PProtoPrefix is the default required prefix for protocol names diff --git a/core/commands/pin.go b/core/commands/pin.go index ce0903465e5..e167be9c4d4 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -16,11 +16,11 @@ import ( pin "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/ping.go b/core/commands/ping.go index e745525f464..5bb328dcea4 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -13,10 +13,10 @@ import ( "github.com/ipfs/go-ipfs/core" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" ) const kPingTimeout = 10 * time.Second diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index c9a723a8554..75efde3f0e8 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -16,11 +16,11 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - floodsub "gx/ipfs/QmPbYVFhKxamZAN9MyrQMDeoGYa6zkQkhAPguwFfzxPM1J/go-libp2p-floodsub" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + floodsub "gx/ipfs/QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY/go-libp2p-floodsub" ) var PubsubCmd = &cmds.Command{ diff --git a/core/commands/refs.go b/core/commands/refs.go index c28af531719..2c2a6e3a763 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -13,7 +13,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/repo.go b/core/commands/repo.go index 2e4480df8ef..e149c78239e 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -19,9 +19,9 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type RepoVersion struct { diff --git a/core/commands/resolve.go b/core/commands/resolve.go index 39963b6da95..c6a24c53fae 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -14,7 +14,7 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" ns "github.com/ipfs/go-ipfs/namesys" nsopts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 295f955f430..91d0d91b7d2 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -14,16 +14,16 @@ import ( "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/fsrepo" - "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" + inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - iaddr "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" - "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" + "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm" + iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) type stringList struct { diff --git a/core/commands/tar.go b/core/commands/tar.go index a2fa3da20cc..8ff67d2600f 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -9,8 +9,8 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "github.com/ipfs/go-ipfs/core/coreunix" tar "github.com/ipfs/go-ipfs/tar" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index ae92514e67d..f4165c01e5f 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -11,9 +11,9 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" ) type LsLink struct { diff --git a/core/commands/urlstore.go b/core/commands/urlstore.go index 8769130c3ff..a93fd0e53fb 100644 --- a/core/commands/urlstore.go +++ b/core/commands/urlstore.go @@ -11,11 +11,11 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - balanced "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/trickle" chunk "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + balanced "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/trickle" ) var urlStoreCmd = &cmds.Command{ diff --git a/core/core.go b/core/core.go index dc58a48338a..9ca11a00a69 100644 --- a/core/core.go +++ b/core/core.go @@ -30,53 +30,53 @@ import ( pin "github.com/ipfs/go-ipfs/pin" repo "github.com/ipfs/go-ipfs/repo" + quic "gx/ipfs/QmNiPUdQMsgnqfMAdBmRZPndL8sfo2s8NMGEqJ2Uv7BcKR/go-libp2p-quic-transport" metrics "gx/ipfs/QmNn6gcjBXpg8kccr9zEV7UVBpqAw8FZEiQ6DksvzyTQ5K/go-libp2p-metrics" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - quic "gx/ipfs/QmPWMfcxNC7txnUvT21xdivgRJfJ9e7YuC5nCn6JEALFQv/go-libp2p-quic-transport" - floodsub "gx/ipfs/QmPbYVFhKxamZAN9MyrQMDeoGYa6zkQkhAPguwFfzxPM1J/go-libp2p-floodsub" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" exchange "gx/ipfs/QmR1nncPsZR14A4hWr39mq8Lm7BGgS68bHVT9nop8NpWEM/go-ipfs-exchange-interface" - circuit "gx/ipfs/QmS5X31wA86RSjQqCUHG2CLPoFNnBZ3UMy1ikfBHQ3G6LG/go-libp2p-circuit" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" mafilter "gx/ipfs/QmSW4uNHbvQia8iZDXzbwjiyHQtnyo9aFqfQAMasj3TJ6Y/go-maddr-filter" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" - nilrouting "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/none" - offroute "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" - connmgr "gx/ipfs/QmSw6zWpuKvcHne7AjNS3LdmcPm1iUq5qd1z1KgVib7QnM/go-libp2p-connmgr" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - bitswap "gx/ipfs/QmUdtRsAr9RYxqNwUzeHDhv5bnVppiHLixP1SU4YysVj2S/go-bitswap" - bsnet "gx/ipfs/QmUdtRsAr9RYxqNwUzeHDhv5bnVppiHLixP1SU4YysVj2S/go-bitswap/network" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - ifconnmgr "gx/ipfs/QmV9T3rTezwJhMJQBzVrGj2tncJwv23dTKdxzXrUxAvWFi/go-libp2p-interface-connmgr" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" - libp2p "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p" - discovery "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/discovery" - p2pbhost "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/host/routed" - identify "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/protocol/identify" - ping "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/protocol/ping" + psrouter "gx/ipfs/QmSff5Y3UNsj4x8HfCT7iRte3TPW7jVRbFh7JEJK9L9dzo/go-libp2p-pubsub-router" + connmgr "gx/ipfs/QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs/go-libp2p-connmgr" + rhelpers "gx/ipfs/QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4/go-libp2p-routing-helpers" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + bitswap "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap" + bsnet "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap/network" + p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + dht "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht" + dhtopts "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht/opts" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + nilrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/none" + offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" + ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" mplex "gx/ipfs/QmYsbnP57nNUKWijs8o2q3ZFrSUcAGTdKoQPuSJC3Uxt1Y/go-smux-multiplex" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - dht "gx/ipfs/QmZVakpN44VAUxs9eXAuUGLFYTCGmSyqSy6hyEKfMv68ME/go-libp2p-kad-dht" - dhtopts "gx/ipfs/QmZVakpN44VAUxs9eXAuUGLFYTCGmSyqSy6hyEKfMv68ME/go-libp2p-kad-dht/opts" pnet "gx/ipfs/QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET/go-libp2p-pnet" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" + "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + floodsub "gx/ipfs/QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY/go-libp2p-floodsub" yamux "gx/ipfs/QmcsgrV3nCAKjiHKZhKVXWc4oY3WBECJCqahXEMpHeMrev/go-smux-yamux" - psrouter "gx/ipfs/Qmd547Rr4cZUEG5ETGHHNgx6xHBY4ee7hB6NAEBw2UWnea/go-libp2p-pubsub-router" + libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" + discovery "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/discovery" + p2pbhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/routed" + identify "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" + ping "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/ping" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - rhelpers "gx/ipfs/QmdELF3gxpecwBauFtZBib2fcnEEAbXiTVA1NSWZjf95Tp/go-libp2p-routing-helpers" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" - p2phost "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + circuit "gx/ipfs/QmeBpq5pAf2yaVdbpaKVcijEXu1QVjnDqPqYq4MACaEHLo/go-libp2p-circuit" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) const IpnsValidatorTag = "ipns" diff --git a/core/core_test.go b/core/core_test.go index 2d0a592c60b..9f047c24bda 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/repo" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) func TestInitialization(t *testing.T) { diff --git a/core/coreapi/dht.go b/core/coreapi/dht.go index 388b33b852d..925c0f4713d 100644 --- a/core/coreapi/dht.go +++ b/core/coreapi/dht.go @@ -9,14 +9,14 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" + blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - blockservice "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type DhtAPI CoreAPI diff --git a/core/coreapi/interface/dht.go b/core/coreapi/interface/dht.go index 2309ceb905b..4a76f4d3927 100644 --- a/core/coreapi/interface/dht.go +++ b/core/coreapi/interface/dht.go @@ -5,8 +5,8 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" ) // DhtAPI specifies the interface to the DHT diff --git a/core/coreapi/interface/path.go b/core/coreapi/interface/path.go index 0beab066395..0f06e8cc23e 100644 --- a/core/coreapi/interface/path.go +++ b/core/coreapi/interface/path.go @@ -1,7 +1,7 @@ package iface import ( - ipfspath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ) diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 8b464e5c1f0..58caf6759fe 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -5,11 +5,11 @@ import ( "errors" "time" + net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) var ( diff --git a/core/coreapi/key.go b/core/coreapi/key.go index d7de4647685..91d113e84ce 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -11,8 +11,8 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" crypto "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ipfspath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" ) type KeyAPI CoreAPI diff --git a/core/coreapi/name.go b/core/coreapi/name.go index ddd339c8ad7..43453e9884d 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -12,10 +12,10 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/namesys" - ipath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + ipath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" + "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index d226664842d..c372a33950b 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - ipath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + ipath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 7b9ba771921..2d03e78cd73 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/coreapi/path.go b/core/coreapi/path.go index 989e4d75beb..aa125defa58 100644 --- a/core/coreapi/path.go +++ b/core/coreapi/path.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - ipfspath "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index ad6dfe92270..626f782cdb4 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -7,11 +7,11 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" corerepo "github.com/ipfs/go-ipfs/core/corerepo" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ) type PinAPI CoreAPI diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 72e7706006d..a7405a8a43f 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -8,14 +8,14 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - swarm "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm" - iaddr "gx/ipfs/QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk/go-ipfs-addr" + inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" - net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" + swarm "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm" + iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) type SwarmAPI CoreAPI diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 1a2479ab995..d6d625da095 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -6,7 +6,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index bc78448f551..3c06715d74b 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -20,15 +20,15 @@ import ( repo "github.com/ipfs/go-ipfs/repo" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" - unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" + unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - mdag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index f91fe640680..d08a2e9c77d 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/coredag/raw.go b/core/coredag/raw.go index cd6a62f1a0a..f15bedacdc7 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 5cd6670e29f..c55928cc75b 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -14,10 +14,10 @@ import ( "github.com/ipfs/go-ipfs/core" corecommands "github.com/ipfs/go-ipfs/core/commands" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" cmdsHttp "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var ( diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index eaba8fc3f11..99c948a1b37 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreapi "github.com/ipfs/go-ipfs/core/coreapi" - id "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ) type GatewayConfig struct { diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 9e0b8e1ec86..cffb846b3b8 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -16,17 +16,17 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/dagutils" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" multibase "gx/ipfs/QmekxXDhCxCJRNuzmHreuaT3BsuJcsjcXWNrtV9C8DRHtd/go-multibase" ) diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 83e2ea5e8dd..59f1a5a878e 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -19,12 +19,12 @@ import ( repo "github.com/ipfs/go-ipfs/repo" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - id "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/protocol/identify" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + id "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ) // `ipfs object new unixfs-dir` diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 09bcf61405a..128e941f6d5 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" - swarmt "gx/ipfs/QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe/go-libp2p-swarm/testing" - bhost "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/host/basic" - inet "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" + inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + swarmt "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm/testing" + bhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/basic" ) // This test is based on go-libp2p/p2p/net/swarm.TestConnectednessCorrect diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 032557a5f36..e6b9787b000 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -12,8 +12,8 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" ) var log = logging.Logger("corerepo") diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 3792db9430a..51f96c1f633 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -12,20 +12,20 @@ import ( core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/pin" - unixfs "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - balanced "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer/trickle" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + balanced "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/trickle" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var log = logging.Logger("coreunix") diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index bba5d7ce8e7..9a65f39a0e9 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -16,14 +16,14 @@ import ( pi "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index b38ccabe156..643d452fb7d 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -3,8 +3,8 @@ package coreunix import ( core "github.com/ipfs/go-ipfs/core" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" ) 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 e66eda5b649..7798b6afeba 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -7,20 +7,20 @@ import ( "testing" core "github.com/ipfs/go-ipfs/core" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - importer "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) func getDagserv(t *testing.T) ipld.DAGService { diff --git a/core/mock/mock.go b/core/mock/mock.go index 0dd17ec9e5b..433235a2cb5 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -8,14 +8,14 @@ import ( "github.com/ipfs/go-ipfs/repo" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - libp2p "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - host "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) // NewMockNode constructs an IpfsNode for use in tests. diff --git a/core/pathresolver.go b/core/pathresolver.go index 65c45a77dd0..720b2451b01 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -8,8 +8,8 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" - resolver "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path/resolver" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/pathresolver_test.go b/core/pathresolver_test.go index 8ff6c84dba7..a9e9493fc0c 100644 --- a/core/pathresolver_test.go +++ b/core/pathresolver_test.go @@ -5,7 +5,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coremock "github.com/ipfs/go-ipfs/core/mock" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) func TestResolveNoComponents(t *testing.T) { diff --git a/dagutils/diff.go b/dagutils/diff.go index 0f08aa559c8..17bf26ad9f3 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -8,7 +8,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/dagutils/diffenum.go b/dagutils/diffenum.go index ee1a6ab046f..9e665426580 100644 --- a/dagutils/diffenum.go +++ b/dagutils/diffenum.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - mdag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/diffenum_test.go b/dagutils/diffenum_test.go index 23f1c438f41..f583501f9ed 100644 --- a/dagutils/diffenum_test.go +++ b/dagutils/diffenum_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - mdtest "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag/test" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + mdtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/utils.go b/dagutils/utils.go index 32c57fa1c22..03537652395 100644 --- a/dagutils/utils.go +++ b/dagutils/utils.go @@ -4,15 +4,15 @@ import ( "context" "errors" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - syncds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // Editor represents a ProtoNode tree editor and provides methods to diff --git a/dagutils/utils_test.go b/dagutils/utils_test.go index bd951511b19..80ffa1ea39e 100644 --- a/dagutils/utils_test.go +++ b/dagutils/utils_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - mdtest "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag/test" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + mdtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index c579d0357ce..da020739afe 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -7,9 +7,9 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - merkledag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - blocks "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + blocks "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // NewBlockstoreProvider returns key provider using bstore.AllKeysChan diff --git a/exchange/reprovide/reprovide.go b/exchange/reprovide/reprovide.go index 27628b35a00..006d20eb8ab 100644 --- a/exchange/reprovide/reprovide.go +++ b/exchange/reprovide/reprovide.go @@ -7,7 +7,7 @@ import ( backoff "gx/ipfs/QmPJUtEJsm5YLUWhF6imvyCH8KZXRJa9Wup7FDMwTy5Ufz/backoff" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/exchange/reprovide/reprovide_test.go b/exchange/reprovide/reprovide_test.go index c53a490232f..8d0730d2c7f 100644 --- a/exchange/reprovide/reprovide_test.go +++ b/exchange/reprovide/reprovide_test.go @@ -6,11 +6,11 @@ import ( testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - mock "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/mock" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mock "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" . "github.com/ipfs/go-ipfs/exchange/reprovide" ) diff --git a/filestore/filestore.go b/filestore/filestore.go index b7dad3c5572..d1e9ee9bfd4 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -14,9 +14,9 @@ import ( posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - dsq "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/query" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var log = logging.Logger("filestore") diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 42681c64af3..e65bbf31042 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,12 +7,12 @@ import ( "math/rand" "testing" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) func newTestFilestore(t *testing.T) (string, *Filestore) { diff --git a/filestore/fsrefstore.go b/filestore/fsrefstore.go index 5e8bf6396ed..1f5baf24e7a 100644 --- a/filestore/fsrefstore.go +++ b/filestore/fsrefstore.go @@ -13,12 +13,12 @@ import ( posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - dshelp "gx/ipfs/QmUDTSi6zJ6ACyQaKtxscCUxrg5DaXs9r4RQUPFQXGPHpo/go-ipfs-ds-help" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dsns "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/namespace" - dsq "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/query" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dsns "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/namespace" + dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // FilestorePrefix identifies the key prefix for FileManager blocks. diff --git a/filestore/util.go b/filestore/util.go index 6213b0f1044..ddc3c225e15 100644 --- a/filestore/util.go +++ b/filestore/util.go @@ -7,10 +7,10 @@ import ( pb "github.com/ipfs/go-ipfs/filestore/pb" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dshelp "gx/ipfs/QmUDTSi6zJ6ACyQaKtxscCUxrg5DaXs9r4RQUPFQXGPHpo/go-ipfs-ds-help" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dsq "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/query" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // Status is used to identify the state of the block data referenced diff --git a/fuse/ipns/common.go b/fuse/ipns/common.go index 0b1e09a9084..08e7c37d59d 100644 --- a/fuse/ipns/common.go +++ b/fuse/ipns/common.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-ipfs/core" nsys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) // InitializeKeyspace sets the ipns record for the given key to diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 1e2e596e4ee..ed2cfef2935 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -18,7 +18,7 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" - offroute "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" + offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" racedet "gx/ipfs/Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF/go-detect-race" ) diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 61d94c593df..a616d0f7bea 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -13,16 +13,16 @@ import ( core "github.com/ipfs/go-ipfs/core" namesys "github.com/ipfs/go-ipfs/namesys" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" fs "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs" + mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - mfs "gx/ipfs/QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2/go-mfs" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/fuse/node/mount_test.go b/fuse/node/mount_test.go index 8bab1e2ef75..dac0e78e5a4 100644 --- a/fuse/node/mount_test.go +++ b/fuse/node/mount_test.go @@ -16,7 +16,7 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" - offroute "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" + offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 9740be58508..131afc09c5b 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -20,11 +20,11 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" - importer "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index d52a71fc965..c254ec6e6f6 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -11,10 +11,10 @@ import ( "syscall" core "github.com/ipfs/go-ipfs/core" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - mdag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" diff --git a/namesys/base.go b/namesys/base.go index afdc0a468d8..20e03565061 100644 --- a/namesys/base.go +++ b/namesys/base.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) type resolver interface { diff --git a/namesys/cache.go b/namesys/cache.go index f18c6e8aa81..bc34266efe4 100644 --- a/namesys/cache.go +++ b/namesys/cache.go @@ -3,7 +3,7 @@ package namesys import ( "time" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) func (ns *mpns) cacheGet(name string) (path.Path, bool) { diff --git a/namesys/dns.go b/namesys/dns.go index 5ca7323a960..29d90497b35 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -9,7 +9,7 @@ import ( opts "github.com/ipfs/go-ipfs/namesys/opts" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) type LookupTXTFunc func(name string) (txt []string, err error) diff --git a/namesys/interface.go b/namesys/interface.go index fcc956cb142..d3a2bf980f0 100644 --- a/namesys/interface.go +++ b/namesys/interface.go @@ -36,7 +36,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" ) diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go index cc99bf1d7b6..58f0fd21a30 100644 --- a/namesys/ipns_resolver_validation_test.go +++ b/namesys/ipns_resolver_validation_test.go @@ -6,22 +6,22 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + ropts "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing/options" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" - mockrouting "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/mock" - offline "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" - ropts "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing/options" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" + offline "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore/pstoremem" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) func TestResolverValidation(t *testing.T) { diff --git a/namesys/namesys.go b/namesys/namesys.go index 054a51bbd4b..c7a37f850fd 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -6,15 +6,15 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" lru "gx/ipfs/QmQjMHF8ptRgx4E57UFMiT4YM6kqaJeYxZ1MCDX23aw4rK/golang-lru" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) // mpns (a multi-protocol NameSystem) implements generic IPFS naming. diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index c2a530c26c1..3584ae0a5b6 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -7,16 +7,16 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - offroute "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/offline" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" + offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - pstoremem "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore/pstoremem" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) type mockResolver struct { diff --git a/namesys/proquint.go b/namesys/proquint.go index 4ba505dc88a..7519770983e 100644 --- a/namesys/proquint.go +++ b/namesys/proquint.go @@ -8,7 +8,7 @@ import ( opts "github.com/ipfs/go-ipfs/namesys/opts" proquint "gx/ipfs/QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM/proquint" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) type ProquintResolver struct{} diff --git a/namesys/publisher.go b/namesys/publisher.go index b8542067546..9519745153c 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -7,16 +7,16 @@ import ( "time" pin "github.com/ipfs/go-ipfs/pin" - ft "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dsquery "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/query" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" - pb "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns/pb" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dsquery "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" base32 "gx/ipfs/QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6/base32" ) diff --git a/namesys/publisher_test.go b/namesys/publisher_test.go index 3f6e6f02e8a..a95867d8ced 100644 --- a/namesys/publisher_test.go +++ b/namesys/publisher_test.go @@ -8,13 +8,13 @@ import ( testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - mockrouting "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/mock" - dshelp "gx/ipfs/QmUDTSi6zJ6ACyQaKtxscCUxrg5DaXs9r4RQUPFQXGPHpo/go-ipfs-ds-help" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" + mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) type identity struct { diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index ebe17c7761f..ae1e3ef59f0 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -7,15 +7,15 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" gpctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" + pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - pb "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns/pb" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" ) diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index dd8693965c4..4cd43e710cc 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -10,11 +10,11 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" namesys "github.com/ipfs/go-ipfs/namesys" . "github.com/ipfs/go-ipfs/namesys/republisher" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestRepublish(t *testing.T) { diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 82e3f06da2e..32728128f16 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mockrouting "gx/ipfs/QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ/go-ipfs-routing/mock" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" + mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) func TestRoutingResolve(t *testing.T) { diff --git a/namesys/routing.go b/namesys/routing.go index dc53868ad7f..4d12c2713b1 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -6,15 +6,15 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - routing "gx/ipfs/QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG/go-libp2p-routing" + routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + dht "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht" + ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - dht "gx/ipfs/QmZVakpN44VAUxs9eXAuUGLFYTCGmSyqSy6hyEKfMv68ME/go-libp2p-kad-dht" - ipns "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns" - pb "gx/ipfs/QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb/go-ipns/pb" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" ) diff --git a/p2p/listener.go b/p2p/listener.go index c0dce1bd46c..14ac3956faa 100644 --- a/p2p/listener.go +++ b/p2p/listener.go @@ -4,10 +4,10 @@ import ( "errors" "sync" + net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" - p2phost "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" - net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) // Listener listens for connections and proxies them to a target diff --git a/p2p/local.go b/p2p/local.go index 38115669137..0a51b55e93f 100644 --- a/p2p/local.go +++ b/p2p/local.go @@ -4,12 +4,12 @@ import ( "context" "time" + "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" tec "gx/ipfs/QmWHgLqrghM9zw77nF6gdvT9ExQ2RB9pLxkd8sDHZf1rWb/go-temp-err-catcher" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) // localListener manet streams and proxies them to libp2p services diff --git a/p2p/p2p.go b/p2p/p2p.go index 237c891e0ea..9d9531d1255 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -1,10 +1,10 @@ package p2p import ( + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - p2phost "gx/ipfs/QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2/go-libp2p-host" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" ) var log = logging.Logger("p2p-mount") diff --git a/p2p/remote.go b/p2p/remote.go index 13ae4d8edb5..351ac7d8e57 100644 --- a/p2p/remote.go +++ b/p2p/remote.go @@ -3,10 +3,10 @@ package p2p import ( "context" + net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" - net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) var maPrefix = "/" + ma.ProtocolWithCode(ma.P_IPFS).Name + "/" diff --git a/p2p/stream.go b/p2p/stream.go index 6d49614e92c..54d8d04b4f2 100644 --- a/p2p/stream.go +++ b/p2p/stream.go @@ -4,12 +4,12 @@ import ( "io" "sync" + net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" - ifconnmgr "gx/ipfs/QmV9T3rTezwJhMJQBzVrGj2tncJwv23dTKdxzXrUxAvWFi/go-libp2p-interface-connmgr" + ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - net "gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net" ) const cmgrTag = "stream-fwd" diff --git a/package.json b/package.json index e5d03e70e4a..b55f05ba3dd 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ }, { "author": "whyrusleeping", - "hash": "QmPJ6U14u5D2abGVkF3dopCeM1JqigVTUJ7jbAHjTnGZrt", + "hash": "QmUdVuLDQCQD4WPBpgDsbBAaqui3GW4d7exBHK2PUKRQpv", "name": "go-libp2p-secio", - "version": "2.0.10" + "version": "2.0.11" }, { "author": "whyrusleeping", @@ -47,9 +47,9 @@ "version": "0.1.3" }, { - "hash": "QmQkqNJobSLRcrjWT1L8vWFvEpndtoCG5iMRcd9DKdDMKR", + "hash": "QmdosTyJqDPbmp2F7vgdyynERbE1hZxfSXroq5MmGyQWkF", "name": "iptb", - "version": "1.3.13" + "version": "99.3.8" }, { "hash": "QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8", @@ -94,9 +94,9 @@ }, { "author": "jbenet", - "hash": "QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV", + "hash": "QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP", "name": "go-datastore", - "version": "3.2.0" + "version": "3.3.0" }, { "author": "hashicorp", @@ -106,9 +106,9 @@ }, { "author": "whyrusleeping", - "hash": "QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st", + "hash": "QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv", "name": "go-libp2p-peerstore", - "version": "2.0.1" + "version": "2.0.2" }, { "author": "whyrusleeping", @@ -124,9 +124,9 @@ }, { "author": "whyrusleeping", - "hash": "QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW", + "hash": "Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB", "name": "go-libp2p", - "version": "6.0.13" + "version": "6.0.14" }, { "author": "whyrusleeping", @@ -136,21 +136,21 @@ }, { "author": "whyrusleeping", - "hash": "QmY8toEWLh1zpSCeQTP8kZDRm1dik3cck9p2miCK1QgaAi", + "hash": "QmVeCKovBuuNK28FyADuRzpJMnQ8LtCKaaaXF5XYSLAjg8", "name": "go-ds-flatfs", - "version": "1.3.2" + "version": "1.3.3" }, { "author": "whyrusleeping", - "hash": "QmYY98HGLuMUm7cLM8Afmvzzw6G5Md6s7pVW78Hd7hJAiA", + "hash": "Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo", "name": "go-ds-measure", - "version": "1.4.2" + "version": "1.4.3" }, { "author": "whyrusleeping", - "hash": "QmPnXsHj9W8WpDDwj2iogRcnVL6d5ANtK9SAJLgKpeBMq8", + "hash": "QmcxDvw8NnJsfdEcfrypwHkLeVxZY2rT8iiWsUuBnw93gb", "name": "go-ds-leveldb", - "version": "1.1.2" + "version": "1.2.0" }, { "author": "whyrusleeping", @@ -171,9 +171,9 @@ "version": "0.2.0" }, { - "hash": "QmZVakpN44VAUxs9eXAuUGLFYTCGmSyqSy6hyEKfMv68ME", + "hash": "QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK", "name": "go-libp2p-kad-dht", - "version": "4.4.2" + "version": "4.4.3" }, { "author": "whyrusleeping", @@ -183,9 +183,9 @@ }, { "author": "whyrusleeping", - "hash": "QmPbYVFhKxamZAN9MyrQMDeoGYa6zkQkhAPguwFfzxPM1J", + "hash": "QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY", "name": "go-libp2p-floodsub", - "version": "0.9.29" + "version": "0.9.30" }, { "author": "whyrusleeping", @@ -235,9 +235,9 @@ "version": "0.2.3" }, { - "hash": "QmRtUtF42geEhpRg9z45ZfBqRMC6xyeNW7i1iqha3nRMFe", + "hash": "QmWKgrs6cyhTNUaTmAKs86K1FpYmkQLYVj83GqUvmuT3TY", "name": "go-libp2p-kbucket", - "version": "2.2.8" + "version": "2.2.9" }, { "author": "whyrusleeping", @@ -277,9 +277,9 @@ }, { "author": "whyrusleeping", - "hash": "QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq", + "hash": "QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z", "name": "go-libp2p-net", - "version": "3.0.10" + "version": "3.0.11" }, { "author": "whyrusleeping", @@ -289,15 +289,15 @@ }, { "author": "whyrusleeping", - "hash": "QmeA5hsqgLryvkeyqeQdvGDqurLkYi3XEPLZP3pzuBJXh2", + "hash": "QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x", "name": "go-libp2p-host", - "version": "3.0.10" + "version": "3.0.11" }, { "author": "whyrusleeping", - "hash": "QmPQoCVRHaGD25VffyB7DFV5qP65hFSQJdSDy75P1vYBKe", + "hash": "QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX", "name": "go-libp2p-swarm", - "version": "3.0.12" + "version": "3.0.14" }, { "hash": "QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz", @@ -333,9 +333,9 @@ "version": "0.2.0" }, { - "hash": "QmVBnJDKhtFXTRVjXKinqpwGu8t1DyNqPKan2iGX8PR8xG", + "hash": "QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD", "name": "go-libp2p-routing", - "version": "2.6.2" + "version": "2.6.3" }, { "author": "whyrusleeping", @@ -350,15 +350,15 @@ }, { "author": "vyzo", - "hash": "QmS5X31wA86RSjQqCUHG2CLPoFNnBZ3UMy1ikfBHQ3G6LG", + "hash": "QmeBpq5pAf2yaVdbpaKVcijEXu1QVjnDqPqYq4MACaEHLo", "name": "go-libp2p-circuit", - "version": "2.2.2" + "version": "2.2.3" }, { "author": "magik6k", - "hash": "QmaUU1Hu8pbR2NiTJ1NHVBcNTQR499AJVMkkAoRqhdxbgz", + "hash": "Qmd1Zxnuj9puWCPS7DV1YVw1RM478NqyZmf1X5nsgjp6fQ", "name": "go-ds-badger", - "version": "1.8.0" + "version": "1.9.0" }, { "author": "whyrusleeping", @@ -368,21 +368,21 @@ }, { "author": "whyrusleeping", - "hash": "QmSw6zWpuKvcHne7AjNS3LdmcPm1iUq5qd1z1KgVib7QnM", + "hash": "QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs", "name": "go-libp2p-connmgr", - "version": "0.3.19" + "version": "0.3.20" }, { "author": "why", - "hash": "QmV9T3rTezwJhMJQBzVrGj2tncJwv23dTKdxzXrUxAvWFi", + "hash": "QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY", "name": "go-libp2p-interface-connmgr", - "version": "0.0.16" + "version": "0.0.17" }, { "author": "why", - "hash": "QmSzdvo9aPzLj4HXWTcgGAp8N84tZc8LbLmFZFwUb1dpWk", + "hash": "QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j", "name": "go-ipfs-addr", - "version": "0.1.23" + "version": "0.1.24" }, { "author": "The Go Authors", @@ -416,21 +416,21 @@ }, { "author": "hsanjuan", - "hash": "QmUDTSi6zJ6ACyQaKtxscCUxrg5DaXs9r4RQUPFQXGPHpo", + "hash": "QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f", "name": "go-ipfs-ds-help", - "version": "0.1.2" + "version": "0.1.3" }, { "author": "hsanjuan", - "hash": "QmScZySgru9jaoDa12sSfvh21sWbqF5eXkieTmJzAHJXkQ", + "hash": "QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA", "name": "go-ipfs-routing", - "version": "0.1.3" + "version": "0.1.4" }, { "author": "hsanjuan", - "hash": "QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC", + "hash": "QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa", "name": "go-ipfs-blockstore", - "version": "0.1.2" + "version": "0.1.3" }, { "author": "whyrusleeping", @@ -458,21 +458,21 @@ }, { "author": "hsanjuan", - "hash": "QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw", + "hash": "QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3", "name": "go-ipfs-exchange-offline", - "version": "0.1.2" + "version": "0.1.3" }, { "author": "stebalien", - "hash": "Qmd547Rr4cZUEG5ETGHHNgx6xHBY4ee7hB6NAEBw2UWnea", + "hash": "QmSff5Y3UNsj4x8HfCT7iRte3TPW7jVRbFh7JEJK9L9dzo", "name": "go-libp2p-pubsub-router", - "version": "0.4.3" + "version": "0.4.6" }, { "author": "Stebalien", - "hash": "QmdELF3gxpecwBauFtZBib2fcnEEAbXiTVA1NSWZjf95Tp", + "hash": "QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4", "name": "go-libp2p-routing-helpers", - "version": "0.3.2" + "version": "0.3.5" }, { "author": "fsnotify", @@ -482,9 +482,9 @@ }, { "author": "stebalien", - "hash": "QmZrmn2BPZbSviQAWeyY2iXkCukmJHv9n7zrLgWU5KgbTb", + "hash": "QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s", "name": "go-ipns", - "version": "0.1.9" + "version": "0.1.10" }, { "author": "whyrusleeping", @@ -494,39 +494,39 @@ }, { "author": "why", - "hash": "QmUdtRsAr9RYxqNwUzeHDhv5bnVppiHLixP1SU4YysVj2S", + "hash": "QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc", "name": "go-bitswap", - "version": "1.1.3" + "version": "1.1.4" }, { "author": "why", - "hash": "QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe", + "hash": "QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF", "name": "go-blockservice", - "version": "1.1.3" + "version": "1.1.4" }, { "author": "why", - "hash": "QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV", + "hash": "QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm", "name": "go-merkledag", - "version": "1.1.3" + "version": "1.1.4" }, { "author": "why", - "hash": "QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2", + "hash": "QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t", "name": "go-path", - "version": "1.1.3" + "version": "1.1.4" }, { "author": "why", - "hash": "QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46", + "hash": "QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q", "name": "go-unixfs", - "version": "1.1.3" + "version": "1.1.4" }, { "author": "magik6k", - "hash": "QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk", + "hash": "QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1", "name": "go-ipfs-config", - "version": "0.2.9" + "version": "0.2.12" }, { "author": "why", @@ -536,9 +536,9 @@ }, { "author": "hsanjuan", - "hash": "QmahrY1adY4wvtYEtoGjpZ2GUohTyukrkMkwUR9ytRjTG2", + "hash": "QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy", "name": "go-mfs", - "version": "0.1.3" + "version": "0.1.4" }, { "author": "kevina", @@ -554,9 +554,9 @@ }, { "author": "marten-seemann", - "hash": "QmPWMfcxNC7txnUvT21xdivgRJfJ9e7YuC5nCn6JEALFQv", + "hash": "QmNiPUdQMsgnqfMAdBmRZPndL8sfo2s8NMGEqJ2Uv7BcKR", "name": "go-libp2p-quic-transport", - "version": "0.2.5" + "version": "0.2.6" }, { "author": "mitchellh", diff --git a/pin/gc/gc.go b/pin/gc/gc.go index f5ca7254751..bb55de95cb6 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -8,16 +8,16 @@ import ( "strings" pin "github.com/ipfs/go-ipfs/pin" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - dstore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + dstore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var log = logging.Logger("gc") diff --git a/pin/pin.go b/pin/pin.go index f6100749ffa..033f4698981 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -10,11 +10,11 @@ import ( "time" "github.com/ipfs/go-ipfs/dagutils" - mdag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/pin/pin_test.go b/pin/pin_test.go index 2549084f5e6..9917d35cabc 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -5,15 +5,15 @@ import ( "testing" "time" - mdag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bs "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + bs "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dssync "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/sync" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var rand = util.NewTimeSeededRand() diff --git a/pin/set.go b/pin/set.go index 9b4446e3783..1e5bcfe4273 100644 --- a/pin/set.go +++ b/pin/set.go @@ -10,7 +10,7 @@ import ( "sort" "github.com/ipfs/go-ipfs/pin/internal/pb" - "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" + "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/pin/set_test.go b/pin/set_test.go index e366eac703b..a1dc36f3be0 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -5,14 +5,14 @@ import ( "encoding/binary" "testing" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - bserv "gx/ipfs/QmcRecCZWM2NZfCQrCe97Ch3Givv8KKEP82tGUDntzdLFe/go-blockservice" + bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmR5miWuikPxWyUrzMYJVmFUcD44pGdtc98h9Qsbp4YcJw/go-ipfs-exchange-offline" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - dsq "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/query" - blockstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" + blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) func ignoreCids(_ cid.Cid) {} diff --git a/repo/fsrepo/config_test.go b/repo/fsrepo/config_test.go index e25ecfa8b5f..e7b53177f68 100644 --- a/repo/fsrepo/config_test.go +++ b/repo/fsrepo/config_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) // note: to test sorting of the mountpoints in the disk spec they are diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index 10d97efb8f9..67bded0df4d 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -11,13 +11,13 @@ import ( repo "github.com/ipfs/go-ipfs/repo" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - levelds "gx/ipfs/QmPnXsHj9W8WpDDwj2iogRcnVL6d5ANtK9SAJLgKpeBMq8/go-ds-leveldb" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - mount "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore/mount" - flatfs "gx/ipfs/QmY8toEWLh1zpSCeQTP8kZDRm1dik3cck9p2miCK1QgaAi/go-ds-flatfs" - measure "gx/ipfs/QmYY98HGLuMUm7cLM8Afmvzzw6G5Md6s7pVW78Hd7hJAiA/go-ds-measure" - badgerds "gx/ipfs/QmaUU1Hu8pbR2NiTJ1NHVBcNTQR499AJVMkkAoRqhdxbgz/go-ds-badger" + flatfs "gx/ipfs/QmVeCKovBuuNK28FyADuRzpJMnQ8LtCKaaaXF5XYSLAjg8/go-ds-flatfs" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + mount "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/mount" + levelds "gx/ipfs/QmcxDvw8NnJsfdEcfrypwHkLeVxZY2rT8iiWsUuBnw93gb/go-ds-leveldb" + badgerds "gx/ipfs/Qmd1Zxnuj9puWCPS7DV1YVw1RM478NqyZmf1X5nsgjp6fQ/go-ds-badger" + measure "gx/ipfs/Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo/go-ds-measure" ) // ConfigFromMap creates a new datastore config from a map diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 2c1833f8f04..e95711656f3 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -19,14 +19,14 @@ import ( dir "github.com/ipfs/go-ipfs/thirdparty/dir" util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" - serialize "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config/serialize" - measure "gx/ipfs/QmYY98HGLuMUm7cLM8Afmvzzw6G5Md6s7pVW78Hd7hJAiA/go-ds-measure" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + serialize "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config/serialize" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" lockfile "gx/ipfs/Qmc4w3gm2TqoEbTYjpPs5FXP8DEB6cuvZWPy6bUTKiht7a/go-fs-lock" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" + measure "gx/ipfs/Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo/go-ds-measure" ) // LockFile is the filename of the repo lock, relative to config dir diff --git a/repo/fsrepo/fsrepo_test.go b/repo/fsrepo/fsrepo_test.go index af30fa6460a..96fb25710f2 100644 --- a/repo/fsrepo/fsrepo_test.go +++ b/repo/fsrepo/fsrepo_test.go @@ -9,8 +9,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/assert" - datastore "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) // swap arg order diff --git a/repo/fsrepo/misc.go b/repo/fsrepo/misc.go index cd4b3a8bb4e..c49d42de8f3 100644 --- a/repo/fsrepo/misc.go +++ b/repo/fsrepo/misc.go @@ -3,7 +3,7 @@ package fsrepo import ( "os" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" ) diff --git a/repo/mock.go b/repo/mock.go index 782dc53368d..c27d3724111 100644 --- a/repo/mock.go +++ b/repo/mock.go @@ -6,7 +6,7 @@ import ( filestore "github.com/ipfs/go-ipfs/filestore" keystore "github.com/ipfs/go-ipfs/keystore" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" ) diff --git a/repo/repo.go b/repo/repo.go index abe945c47de..9d1fdc5b85f 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -7,9 +7,9 @@ import ( filestore "github.com/ipfs/go-ipfs/filestore" keystore "github.com/ipfs/go-ipfs/keystore" - ds "gx/ipfs/QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV/go-datastore" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" + ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) var ( diff --git a/tar/format.go b/tar/format.go index 2bf7b6416e7..8663e2c3e10 100644 --- a/tar/format.go +++ b/tar/format.go @@ -9,10 +9,10 @@ import ( "strings" "github.com/ipfs/go-ipfs/dagutils" - importer "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/importer" - uio "gx/ipfs/QmU4x3742bvgfxJsByEDpBnifJqjJdV6x528co4hwKCn46/go-unixfs/io" - dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag" - path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path" + dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" + uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/test/bench/bench_cli_ipfs_add/main.go b/test/bench/bench_cli_ipfs_add/main.go index de034bdeda9..e7b9e8c5951 100644 --- a/test/bench/bench_cli_ipfs_add/main.go +++ b/test/bench/bench_cli_ipfs_add/main.go @@ -13,7 +13,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) var ( diff --git a/test/bench/offline_add/main.go b/test/bench/offline_add/main.go index ede1114e145..38677a9c5f2 100644 --- a/test/bench/offline_add/main.go +++ b/test/bench/offline_add/main.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" - config "gx/ipfs/QmVBUpxsHh53rNcufqxMpLAmz37eGyLJUaexDy1W9YkiNk/go-ipfs-config" + config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) func main() { diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 0bdea0bd96e..e0ca53c4c8e 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -19,10 +19,10 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) var log = logging.Logger("epictest") diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index 7eb86055710..d48f9c378b1 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -16,8 +16,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func BenchmarkCat1MB(b *testing.B) { benchmarkVarCat(b, unit.MB*1) } diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 492101f1acf..244b7237e7a 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -10,7 +10,7 @@ import ( "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestBitswapWithoutRouting(t *testing.T) { diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index a8d9fbbf0ec..d61d4b2ec58 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mocknet "gx/ipfs/QmVsVARb86uSe1qYouewFMNd2p2sp2NGWm1JGPReVDWchW/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestThreeLeggedCatTransfer(t *testing.T) { diff --git a/thirdparty/cidv0v1/blockstore.go b/thirdparty/cidv0v1/blockstore.go index 2cb19a4f9a0..82c567a3e55 100644 --- a/thirdparty/cidv0v1/blockstore.go +++ b/thirdparty/cidv0v1/blockstore.go @@ -4,7 +4,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - bs "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bs "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type blockstore struct { diff --git a/thirdparty/verifbs/verifbs.go b/thirdparty/verifbs/verifbs.go index 4ef906c39aa..44758a8d63c 100644 --- a/thirdparty/verifbs/verifbs.go +++ b/thirdparty/verifbs/verifbs.go @@ -4,7 +4,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" - bstore "gx/ipfs/QmdriVJgKx4JADRgh3cYPXqXmsa1A45SvFki1nDWHhQNtC/go-ipfs-blockstore" + bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type VerifBSGC struct { From 686dcdd9a4d6103fe011df8715274285f22076e0 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Thu, 4 Oct 2018 01:25:28 -0400 Subject: [PATCH 64/85] Build fixes. License: MIT Signed-off-by: Kevin Atkinson --- cmd/ipfs/daemon.go | 4 ++-- core/commands/name/ipns.go | 1 - core/commands/name/publish.go | 1 - core/core.go | 12 +++++++----- core/core_test.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 01c111935ce..0b3aca9e6fb 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -414,7 +414,7 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error apiAddr, _ := req.Options[commands.ApiOption].(string) if apiAddr == "" { - apiAddr = cfg.Addresses.API + apiAddr = cfg.Addresses.API[0] } apiMaddr, err := ma.NewMultiaddr(apiAddr) if err != nil { @@ -512,7 +512,7 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e return nil, fmt.Errorf("serveHTTPGateway: GetConfig() failed: %s", err) } - gatewayMaddr, err := ma.NewMultiaddr(cfg.Addresses.Gateway) + gatewayMaddr, err := ma.NewMultiaddr(cfg.Addresses.Gateway[0]) if err != nil { return nil, fmt.Errorf("serveHTTPGateway: invalid gateway address: %q (err: %s)", cfg.Addresses.Gateway, err) } diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 11f7b24de4d..f5dd60de96a 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -14,7 +14,6 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - offline "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) diff --git a/core/commands/name/publish.go b/core/commands/name/publish.go index dcae7d7f1b7..1d068837305 100644 --- a/core/commands/name/publish.go +++ b/core/commands/name/publish.go @@ -13,7 +13,6 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var ( diff --git a/core/core.go b/core/core.go index 9ca11a00a69..484f147de22 100644 --- a/core/core.go +++ b/core/core.go @@ -524,13 +524,15 @@ func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, host p2phost ) n.Routing = rhelpers.Tiered{ // Always check pubsub first. - &rhelpers.Compose{ - ValueStore: &rhelpers.LimitedValueStore{ - ValueStore: n.PSRouter, - Namespaces: []string{"ipns"}, + Routers: []routing.IpfsRouting{ + &rhelpers.Compose{ + ValueStore: &rhelpers.LimitedValueStore{ + ValueStore: n.PSRouter, + Namespaces: []string{"ipns"}, + }, }, + n.Routing, }, - n.Routing, } } diff --git a/core/core_test.go b/core/core_test.go index 9f047c24bda..e79da5d5ecb 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -21,7 +21,7 @@ func TestInitialization(t *testing.T) { Identity: id, Addresses: config.Addresses{ Swarm: []string{"/ip4/0.0.0.0/tcp/4001"}, - API: "/ip4/127.0.0.1/tcp/8000", + API: []string{"/ip4/127.0.0.1/tcp/8000"}, }, }, @@ -29,7 +29,7 @@ func TestInitialization(t *testing.T) { Identity: id, Addresses: config.Addresses{ Swarm: []string{"/ip4/0.0.0.0/tcp/4001"}, - API: "/ip4/127.0.0.1/tcp/8000", + API: []string{"/ip4/127.0.0.1/tcp/8000"}, }, }, } From fc2575740e279bdffc88ae5475ffd396c2218d6b Mon Sep 17 00:00:00 2001 From: Lars Gierth Date: Wed, 3 Oct 2018 08:16:06 +0200 Subject: [PATCH 65/85] gx: update go-ipfs-config, iptb License: MIT Signed-off-by: Lars Gierth --- cmd/ipfs/init.go | 2 +- cmd/ipfs/main.go | 2 +- cmd/ipfswatch/main.go | 2 +- commands/request.go | 2 +- core/bootstrap.go | 2 +- core/bootstrap_test.go | 2 +- core/builder.go | 2 +- core/commands/bootstrap.go | 2 +- core/commands/cmdenv/env.go | 2 +- core/commands/config.go | 2 +- core/commands/mount_unix.go | 2 +- core/commands/repo.go | 2 +- core/commands/swarm.go | 2 +- core/core.go | 2 +- core/core_test.go | 2 +- core/coreapi/unixfs_test.go | 2 +- core/corehttp/commands.go | 2 +- core/corehttp/gateway_test.go | 2 +- core/coreunix/add_test.go | 2 +- core/mock/mock.go | 2 +- package.json | 8 ++++---- repo/fsrepo/config_test.go | 2 +- repo/fsrepo/fsrepo.go | 4 ++-- repo/fsrepo/fsrepo_test.go | 2 +- repo/fsrepo/misc.go | 2 +- repo/mock.go | 2 +- repo/repo.go | 2 +- test/bench/bench_cli_ipfs_add/main.go | 2 +- test/bench/offline_add/main.go | 2 +- 29 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 950786f0936..87b4aed711a 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -17,8 +17,8 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) const ( diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index c4116f9c4dc..98571908e2b 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -26,12 +26,12 @@ import ( loggables "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/cli" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper" - "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" madns "gx/ipfs/QmfXU2MhWoegxHoeMd3A2ytL2P6CY4FfqGWc23LTNWBwZt/go-multiaddr-dns" diff --git a/cmd/ipfswatch/main.go b/cmd/ipfswatch/main.go index 9e7b0584692..9e706cc5ac6 100644 --- a/cmd/ipfswatch/main.go +++ b/cmd/ipfswatch/main.go @@ -16,7 +16,7 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" fsnotify "gx/ipfs/QmfNjggF4Pt6erqg3NDafD3MdvDHk1qqCVr8pL5hnPucS8/fsnotify" ) diff --git a/commands/request.go b/commands/request.go index 954d072139b..4197dbaf26d 100644 --- a/commands/request.go +++ b/commands/request.go @@ -12,8 +12,8 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) type Context struct { diff --git a/core/bootstrap.go b/core/bootstrap.go index 89845a0f5e1..fea1b73da28 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -17,8 +17,8 @@ import ( procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" periodicproc "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/periodic" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/bootstrap_test.go b/core/bootstrap_test.go index 39253b17f28..b05da9b3b2a 100644 --- a/core/bootstrap_test.go +++ b/core/bootstrap_test.go @@ -6,7 +6,7 @@ import ( testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { diff --git a/core/builder.go b/core/builder.go index ebc466dbf45..d4484ae0b6d 100644 --- a/core/builder.go +++ b/core/builder.go @@ -25,8 +25,8 @@ import ( pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" + cfg "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - cfg "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index fd3fb284bfc..bf915c4eab0 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) type BootstrapOutput struct { diff --git a/core/commands/cmdenv/env.go b/core/commands/cmdenv/env.go index 1c6a0e161c1..4da7b1e7a00 100644 --- a/core/commands/cmdenv/env.go +++ b/core/commands/cmdenv/env.go @@ -7,8 +7,8 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ) // GetNode extracts the node from the environment. diff --git a/core/commands/config.go b/core/commands/config.go index d5c9d503bee..e0c8534ad44 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -17,7 +17,7 @@ import ( fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) type ConfigField struct { diff --git a/core/commands/mount_unix.go b/core/commands/mount_unix.go index 532aadaaf72..2101fb87bb8 100644 --- a/core/commands/mount_unix.go +++ b/core/commands/mount_unix.go @@ -12,7 +12,7 @@ import ( nodeMount "github.com/ipfs/go-ipfs/fuse/node" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) var MountCmd = &cmds.Command{ diff --git a/core/commands/repo.go b/core/commands/repo.go index e149c78239e..656b280ebfd 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -19,8 +19,8 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 91d0d91b7d2..72f1cbd8ec5 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -18,8 +18,8 @@ import ( pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm" diff --git a/core/core.go b/core/core.go index 484f147de22..2db5fdddcdc 100644 --- a/core/core.go +++ b/core/core.go @@ -45,6 +45,7 @@ import ( mafilter "gx/ipfs/QmSW4uNHbvQia8iZDXzbwjiyHQtnyo9aFqfQAMasj3TJ6Y/go-maddr-filter" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" psrouter "gx/ipfs/QmSff5Y3UNsj4x8HfCT7iRte3TPW7jVRbFh7JEJK9L9dzo/go-libp2p-pubsub-router" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" connmgr "gx/ipfs/QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs/go-libp2p-connmgr" rhelpers "gx/ipfs/QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4/go-libp2p-routing-helpers" mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" @@ -55,7 +56,6 @@ import ( dhtopts "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht/opts" ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" nilrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/none" offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" diff --git a/core/core_test.go b/core/core_test.go index e79da5d5ecb..4c87a0bb115 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -7,7 +7,7 @@ import ( "github.com/ipfs/go-ipfs/repo" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index 3c06715d74b..fe341c05d37 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -22,9 +22,9 @@ import ( ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index c55928cc75b..5df2612f1bf 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -14,9 +14,9 @@ import ( "github.com/ipfs/go-ipfs/core" corecommands "github.com/ipfs/go-ipfs/core/commands" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" cmdsHttp "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 59f1a5a878e..c79107e5b99 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -20,7 +20,7 @@ import ( ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index 9a65f39a0e9..c60f7fe4242 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -20,7 +20,7 @@ import ( blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" diff --git a/core/mock/mock.go b/core/mock/mock.go index 433235a2cb5..95b5bf6121d 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -9,8 +9,8 @@ import ( testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" diff --git a/package.json b/package.json index b55f05ba3dd..07e1e8c56a8 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,9 @@ "version": "0.1.3" }, { - "hash": "QmdosTyJqDPbmp2F7vgdyynERbE1hZxfSXroq5MmGyQWkF", + "hash": "QmZ7Kqf9pbNvopSpC6L1UbV3ZbphShuv4554QdYGjKY2rM", "name": "iptb", - "version": "99.3.8" + "version": "99.3.9" }, { "hash": "QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8", @@ -524,9 +524,9 @@ }, { "author": "magik6k", - "hash": "QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1", + "hash": "QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u", "name": "go-ipfs-config", - "version": "0.2.12" + "version": "0.2.13" }, { "author": "why", diff --git a/repo/fsrepo/config_test.go b/repo/fsrepo/config_test.go index e7b53177f68..c514b697510 100644 --- a/repo/fsrepo/config_test.go +++ b/repo/fsrepo/config_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) // note: to test sorting of the mountpoints in the disk spec they are diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index e95711656f3..5babbb6a277 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -19,8 +19,8 @@ import ( dir "github.com/ipfs/go-ipfs/thirdparty/dir" util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" - serialize "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config/serialize" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" + serialize "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config/serialize" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" diff --git a/repo/fsrepo/fsrepo_test.go b/repo/fsrepo/fsrepo_test.go index 96fb25710f2..8167bbcf825 100644 --- a/repo/fsrepo/fsrepo_test.go +++ b/repo/fsrepo/fsrepo_test.go @@ -9,7 +9,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/assert" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) diff --git a/repo/fsrepo/misc.go b/repo/fsrepo/misc.go index c49d42de8f3..f2ca5f828d1 100644 --- a/repo/fsrepo/misc.go +++ b/repo/fsrepo/misc.go @@ -3,7 +3,7 @@ package fsrepo import ( "os" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" ) diff --git a/repo/mock.go b/repo/mock.go index c27d3724111..cf7986acb73 100644 --- a/repo/mock.go +++ b/repo/mock.go @@ -6,7 +6,7 @@ import ( filestore "github.com/ipfs/go-ipfs/filestore" keystore "github.com/ipfs/go-ipfs/keystore" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" ) diff --git a/repo/repo.go b/repo/repo.go index 9d1fdc5b85f..ab067b027a8 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -7,7 +7,7 @@ import ( filestore "github.com/ipfs/go-ipfs/filestore" keystore "github.com/ipfs/go-ipfs/keystore" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) diff --git a/test/bench/bench_cli_ipfs_add/main.go b/test/bench/bench_cli_ipfs_add/main.go index e7b9e8c5951..fa3ca5d5bdf 100644 --- a/test/bench/bench_cli_ipfs_add/main.go +++ b/test/bench/bench_cli_ipfs_add/main.go @@ -13,7 +13,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) var ( diff --git a/test/bench/offline_add/main.go b/test/bench/offline_add/main.go index 38677a9c5f2..21da737dfec 100644 --- a/test/bench/offline_add/main.go +++ b/test/bench/offline_add/main.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" - config "gx/ipfs/QmYJi32193V4FBJa4pXXwVNh4puvY7Qn3X5e1r3xQVWgY1/go-ipfs-config" + config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ) func main() { From 4d5da710c2458e7935503c0dbc71d7d15c58512e Mon Sep 17 00:00:00 2001 From: Overbool Date: Thu, 27 Sep 2018 16:25:22 +0800 Subject: [PATCH 66/85] feat(api): allow multiple API/Gateway addresses License: MIT Signed-off-by: Overbool --- cmd/ipfs/daemon.go | 94 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 29 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 0b3aca9e6fb..afcef28f326 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -412,22 +412,32 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error return nil, fmt.Errorf("serveHTTPApi: GetConfig() failed: %s", err) } + apiAddrs := make([]string, 0, 2) apiAddr, _ := req.Options[commands.ApiOption].(string) if apiAddr == "" { - apiAddr = cfg.Addresses.API[0] - } - apiMaddr, err := ma.NewMultiaddr(apiAddr) - if err != nil { - return nil, fmt.Errorf("serveHTTPApi: invalid API address: %q (err: %s)", apiAddr, err) + apiAddrs = cfg.Addresses.API + } else { + apiAddrs = append(apiAddrs, apiAddr) } - apiLis, err := manet.Listen(apiMaddr) - if err != nil { - return nil, fmt.Errorf("serveHTTPApi: manet.Listen(%s) failed: %s", apiMaddr, err) + listeners := make([]manet.Listener, 0, len(apiAddrs)) + for _, addr := range apiAddrs { + apiMaddr, err := ma.NewMultiaddr(addr) + if err != nil { + return nil, fmt.Errorf("serveHTTPApi: invalid API address: %q (err: %s)", apiAddr, err) + } + + apiLis, err := manet.Listen(apiMaddr) + if err != nil { + return nil, fmt.Errorf("serveHTTPApi: manet.Listen(%s) failed: %s", apiMaddr, err) + } + + // we might have listened to /tcp/0 - lets see what we are listing on + apiMaddr = apiLis.Multiaddr() + fmt.Printf("API server listening on %s\n", apiMaddr) + + listeners = append(listeners, apiLis) } - // we might have listened to /tcp/0 - lets see what we are listing on - apiMaddr = apiLis.Multiaddr() - fmt.Printf("API server listening on %s\n", apiMaddr) // by default, we don't let you load arbitrary ipfs objects through the api, // because this would open up the api to scripting vulnerabilities. @@ -462,15 +472,25 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error return nil, fmt.Errorf("serveHTTPApi: ConstructNode() failed: %s", err) } - if err := node.Repo.SetAPIAddr(apiMaddr); err != nil { + if err := node.Repo.SetAPIAddr(listeners[0].Multiaddr()); err != nil { return nil, fmt.Errorf("serveHTTPApi: SetAPIAddr() failed: %s", err) } errc := make(chan error) + var wg sync.WaitGroup + for _, apiLis := range listeners { + wg.Add(1) + go func(lis manet.Listener) { + defer wg.Done() + errc <- corehttp.Serve(node, manet.NetListener(lis), opts...) + }(apiLis) + } + go func() { - errc <- corehttp.Serve(node, manet.NetListener(apiLis), opts...) + wg.Wait() close(errc) }() + return errc, nil } @@ -512,27 +532,33 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e return nil, fmt.Errorf("serveHTTPGateway: GetConfig() failed: %s", err) } - gatewayMaddr, err := ma.NewMultiaddr(cfg.Addresses.Gateway[0]) - if err != nil { - return nil, fmt.Errorf("serveHTTPGateway: invalid gateway address: %q (err: %s)", cfg.Addresses.Gateway, err) - } - writable, writableOptionFound := req.Options[writableKwd].(bool) if !writableOptionFound { writable = cfg.Gateway.Writable } - gwLis, err := manet.Listen(gatewayMaddr) - if err != nil { - return nil, fmt.Errorf("serveHTTPGateway: manet.Listen(%s) failed: %s", gatewayMaddr, err) - } - // we might have listened to /tcp/0 - lets see what we are listing on - gatewayMaddr = gwLis.Multiaddr() + gatewayAddrs := cfg.Addresses.Gateway + listeners := make([]manet.Listener, 0, len(gatewayAddrs)) + for _, addr := range gatewayAddrs { + gatewayMaddr, err := ma.NewMultiaddr(addr) + if err != nil { + return nil, fmt.Errorf("serveHTTPGateway: invalid gateway address: %q (err: %s)", addr, err) + } - if writable { - fmt.Printf("Gateway (writable) server listening on %s\n", gatewayMaddr) - } else { - fmt.Printf("Gateway (readonly) server listening on %s\n", gatewayMaddr) + gwLis, err := manet.Listen(gatewayMaddr) + if err != nil { + return nil, fmt.Errorf("serveHTTPGateway: manet.Listen(%s) failed: %s", gatewayMaddr, err) + } + // we might have listened to /tcp/0 - lets see what we are listing on + gatewayMaddr = gwLis.Multiaddr() + + if writable { + fmt.Printf("Gateway (writable) server listening on %s\n", gatewayMaddr) + } else { + fmt.Printf("Gateway (readonly) server listening on %s\n", gatewayMaddr) + } + + listeners = append(listeners, gwLis) } var opts = []corehttp.ServeOption{ @@ -554,10 +580,20 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e } errc := make(chan error) + var wg sync.WaitGroup + for _, lis := range listeners { + wg.Add(1) + go func(lis manet.Listener) { + defer wg.Done() + errc <- corehttp.Serve(node, manet.NetListener(lis), opts...) + }(lis) + } + go func() { - errc <- corehttp.Serve(node, manet.NetListener(gwLis), opts...) + wg.Wait() close(errc) }() + return errc, nil } From 2e975add22593ec5a993a0e8b392579e47b57ca4 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Thu, 4 Oct 2018 19:11:27 -0400 Subject: [PATCH 67/85] gx update go-libp2p-peerstore License: MIT Signed-off-by: Kevin Atkinson --- assets/assets.go | 2 +- core/builder.go | 8 ++++---- core/commands/add.go | 10 +++++----- core/commands/bitswap.go | 4 ++-- core/commands/dag/dag.go | 2 +- core/commands/dht.go | 4 ++-- core/commands/files.go | 8 ++++---- core/commands/get.go | 6 +++--- core/commands/ls.go | 10 +++++----- core/commands/name/ipns.go | 2 +- core/commands/object/object.go | 2 +- core/commands/pin.go | 4 ++-- core/commands/pubsub.go | 2 +- core/commands/refs.go | 2 +- core/commands/resolve.go | 2 +- core/commands/tar.go | 4 ++-- core/commands/unixfs/ls.go | 4 ++-- core/commands/urlstore.go | 6 +++--- core/core.go | 18 +++++++++--------- core/coreapi/dht.go | 4 ++-- core/coreapi/interface/path.go | 2 +- core/coreapi/key.go | 2 +- core/coreapi/name.go | 2 +- core/coreapi/name_test.go | 2 +- core/coreapi/object.go | 4 ++-- core/coreapi/path.go | 6 +++--- core/coreapi/pin.go | 4 ++-- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 4 ++-- core/coredag/dagpb.go | 2 +- core/coredag/raw.go | 2 +- core/corehttp/commands.go | 2 +- core/corehttp/gateway_handler.go | 12 ++++++------ core/corehttp/gateway_test.go | 4 ++-- core/corerepo/gc.go | 2 +- core/coreunix/add.go | 12 ++++++------ core/coreunix/add_test.go | 4 ++-- core/coreunix/metadata.go | 4 ++-- core/coreunix/metadata_test.go | 10 +++++----- core/pathresolver.go | 4 ++-- core/pathresolver_test.go | 2 +- dagutils/diff.go | 2 +- dagutils/diffenum.go | 2 +- dagutils/diffenum_test.go | 4 ++-- dagutils/utils.go | 6 +++--- dagutils/utils_test.go | 6 +++--- exchange/reprovide/providers.go | 2 +- filestore/filestore_test.go | 2 +- fuse/ipns/common.go | 4 ++-- fuse/ipns/ipns_unix.go | 8 ++++---- fuse/readonly/ipfs_test.go | 6 +++--- fuse/readonly/readonly_unix.go | 8 ++++---- namesys/base.go | 2 +- namesys/cache.go | 2 +- namesys/dns.go | 2 +- namesys/interface.go | 2 +- namesys/ipns_resolver_validation_test.go | 2 +- namesys/namesys.go | 2 +- namesys/namesys_test.go | 4 ++-- namesys/proquint.go | 2 +- namesys/publisher.go | 4 ++-- namesys/republisher/repub.go | 2 +- namesys/republisher/repub_test.go | 2 +- namesys/resolve_test.go | 2 +- namesys/routing.go | 2 +- package.json | 16 ++++++++-------- pin/gc/gc.go | 4 ++-- pin/pin.go | 2 +- pin/pin_test.go | 4 ++-- pin/set.go | 2 +- pin/set_test.go | 4 ++-- tar/format.go | 8 ++++---- 72 files changed, 156 insertions(+), 156 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index 908f26e4e3b..54b229ec101 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" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmdZ4PvPHFQVLLEve7DgoKDcSY19wwpGBB1GKjjKi2rEL1/dir-index-html" diff --git a/core/builder.go b/core/builder.go index d4484ae0b6d..28b0a0a6013 100644 --- a/core/builder.go +++ b/core/builder.go @@ -14,10 +14,10 @@ import ( repo "github.com/ipfs/go-ipfs/repo" cidv0v1 "github.com/ipfs/go-ipfs/thirdparty/cidv0v1" "github.com/ipfs/go-ipfs/thirdparty/verifbs" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" + resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" diff --git a/core/commands/add.go b/core/commands/add.go index 02d2e7cafe9..c30e1761dd2 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -10,10 +10,10 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" "github.com/ipfs/go-ipfs/core/coreunix" filestore "github.com/ipfs/go-ipfs/filestore" - blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - dagtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dagtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" @@ -21,7 +21,7 @@ import ( cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 2d880335e95..94f0d2c9114 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -9,8 +9,8 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - bitswap "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap" - decision "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap/decision" + bitswap "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap" + decision "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index aab2389f9fb..562c5eefe38 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -11,7 +11,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" coredag "github.com/ipfs/go-ipfs/core/coredag" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/commands/dht.go b/core/commands/dht.go index 7e139a53417..a7a1e6f10dd 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -10,8 +10,8 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" e "github.com/ipfs/go-ipfs/core/commands/e" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" diff --git a/core/commands/files.go b/core/commands/files.go index aa3f7078931..f58edc533b4 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -22,14 +22,14 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - bservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + bservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) var flog = logging.Logger("cmds/files") diff --git a/core/commands/get.go b/core/commands/get.go index 4c1074f516f..b2e6c00151f 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -15,11 +15,11 @@ import ( "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" tar "gx/ipfs/QmQine7gvHncNevKtG9QXxf3nXcwSj6aDDmMm52mHofEEp/tar-utils" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - uarchive "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/archive" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + uarchive "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/archive" ) var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") diff --git a/core/commands/ls.go b/core/commands/ls.go index be643a6cad2..360d7b482db 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -12,13 +12,13 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" - blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - unixfspb "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/pb" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + unixfspb "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/pb" + blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) type LsLink struct { diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index f5dd60de96a..c17f27c5561 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -14,8 +14,8 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) var log = logging.Logger("core/commands/ipns") diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 534df2854ca..0fd3293d400 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -17,9 +17,9 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/pin.go b/core/commands/pin.go index e167be9c4d4..1ff98dbd97b 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -17,10 +17,10 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 75efde3f0e8..da251bafd97 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -20,7 +20,7 @@ import ( pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - floodsub "gx/ipfs/QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY/go-libp2p-floodsub" + floodsub "gx/ipfs/Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ/go-libp2p-floodsub" ) var PubsubCmd = &cmds.Command{ diff --git a/core/commands/refs.go b/core/commands/refs.go index 2c2a6e3a763..7f2d9151a16 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -13,7 +13,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/resolve.go b/core/commands/resolve.go index c6a24c53fae..4fd7e0f6efc 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -14,7 +14,7 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" ns "github.com/ipfs/go-ipfs/namesys" nsopts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" diff --git a/core/commands/tar.go b/core/commands/tar.go index 8ff67d2600f..315e4f35040 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -9,8 +9,8 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "github.com/ipfs/go-ipfs/core/coreunix" tar "github.com/ipfs/go-ipfs/tar" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index f4165c01e5f..5e0a972fa8f 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -11,9 +11,9 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" iface "github.com/ipfs/go-ipfs/core/coreapi/interface" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) type LsLink struct { diff --git a/core/commands/urlstore.go b/core/commands/urlstore.go index a93fd0e53fb..0c79f11c301 100644 --- a/core/commands/urlstore.go +++ b/core/commands/urlstore.go @@ -13,9 +13,9 @@ import ( cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" chunk "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - balanced "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/trickle" + balanced "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/trickle" ) var urlStoreCmd = &cmds.Command{ diff --git a/core/core.go b/core/core.go index 2db5fdddcdc..ad8e70ed84d 100644 --- a/core/core.go +++ b/core/core.go @@ -35,38 +35,35 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" exchange "gx/ipfs/QmR1nncPsZR14A4hWr39mq8Lm7BGgS68bHVT9nop8NpWEM/go-ipfs-exchange-interface" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" mafilter "gx/ipfs/QmSW4uNHbvQia8iZDXzbwjiyHQtnyo9aFqfQAMasj3TJ6Y/go-maddr-filter" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" - psrouter "gx/ipfs/QmSff5Y3UNsj4x8HfCT7iRte3TPW7jVRbFh7JEJK9L9dzo/go-libp2p-pubsub-router" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" connmgr "gx/ipfs/QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs/go-libp2p-connmgr" + bitswap "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap" + bsnet "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap/network" rhelpers "gx/ipfs/QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4/go-libp2p-routing-helpers" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" - bitswap "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap" - bsnet "gx/ipfs/QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc/go-bitswap/network" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" dht "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht" dhtopts "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht/opts" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" nilrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/none" offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" + "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" mplex "gx/ipfs/QmYsbnP57nNUKWijs8o2q3ZFrSUcAGTdKoQPuSJC3Uxt1Y/go-smux-multiplex" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" pnet "gx/ipfs/QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET/go-libp2p-pnet" - "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - floodsub "gx/ipfs/QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY/go-libp2p-floodsub" + floodsub "gx/ipfs/Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ/go-libp2p-floodsub" yamux "gx/ipfs/QmcsgrV3nCAKjiHKZhKVXWc4oY3WBECJCqahXEMpHeMrev/go-smux-yamux" libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" discovery "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/discovery" @@ -75,7 +72,10 @@ import ( identify "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ping "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/ping" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" circuit "gx/ipfs/QmeBpq5pAf2yaVdbpaKVcijEXu1QVjnDqPqYq4MACaEHLo/go-libp2p-circuit" + psrouter "gx/ipfs/QmeP3DqDr8CzjNUC9nX8S3mSjjtGW55RYn4Bhksvs72rL2/go-libp2p-pubsub-router" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreapi/dht.go b/core/coreapi/dht.go index 925c0f4713d..5fccf0ed886 100644 --- a/core/coreapi/dht.go +++ b/core/coreapi/dht.go @@ -11,11 +11,11 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - blockservice "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreapi/interface/path.go b/core/coreapi/interface/path.go index 0f06e8cc23e..5748bf4653a 100644 --- a/core/coreapi/interface/path.go +++ b/core/coreapi/interface/path.go @@ -1,7 +1,7 @@ package iface import ( - ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ) diff --git a/core/coreapi/key.go b/core/coreapi/key.go index 91d113e84ce..005c3ab1909 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -11,7 +11,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" crypto "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/name.go b/core/coreapi/name.go index 43453e9884d..c096ac25bea 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -12,7 +12,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/namesys" - ipath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + ipath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index c372a33950b..da4a1bbfe81 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - ipath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + ipath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 2d03e78cd73..7dfdbaedd6f 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -17,9 +17,9 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) const inputLimit = 2 << 20 diff --git a/core/coreapi/path.go b/core/coreapi/path.go index aa125defa58..29f5cc3136c 100644 --- a/core/coreapi/path.go +++ b/core/coreapi/path.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - ipfspath "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" - "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" + ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 626f782cdb4..92ff0da94c3 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -7,8 +7,8 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" corerepo "github.com/ipfs/go-ipfs/core/corerepo" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index d6d625da095..1a13bbad3fe 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -6,7 +6,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index fe341c05d37..fb9b61917ae 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -20,15 +20,15 @@ import ( repo "github.com/ipfs/go-ipfs/repo" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" - unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" + unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index d08a2e9c77d..c2174888594 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/coredag/raw.go b/core/coredag/raw.go index f15bedacdc7..e6315d9606b 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 5df2612f1bf..371d083f667 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -17,7 +17,7 @@ import ( config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" cmdsHttp "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ) var ( diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index cffb846b3b8..1ee91e72d41 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -16,12 +16,12 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/dagutils" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" - resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index c79107e5b99..46f505631db 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -19,9 +19,9 @@ import ( repo "github.com/ipfs/go-ipfs/repo" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" id "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index e6b9787b000..30d6013a425 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -12,7 +12,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 51f96c1f633..543787648a2 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -12,17 +12,17 @@ import ( core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/pin" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - unixfs "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - balanced "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer/trickle" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + balanced "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/trickle" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index c60f7fe4242..75f769b1533 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -16,13 +16,13 @@ import ( pi "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index 643d452fb7d..c9d44fbf44c 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -3,8 +3,8 @@ package coreunix import ( core "github.com/ipfs/go-ipfs/core" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) 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 7798b6afeba..975bcf930c0 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -7,11 +7,11 @@ import ( "testing" core "github.com/ipfs/go-ipfs/core" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/core/pathresolver.go b/core/pathresolver.go index 720b2451b01..e17afad9e47 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -7,9 +7,9 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" - resolver "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path/resolver" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/pathresolver_test.go b/core/pathresolver_test.go index a9e9493fc0c..e67ae0e2445 100644 --- a/core/pathresolver_test.go +++ b/core/pathresolver_test.go @@ -5,7 +5,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coremock "github.com/ipfs/go-ipfs/core/mock" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ) func TestResolveNoComponents(t *testing.T) { diff --git a/dagutils/diff.go b/dagutils/diff.go index 17bf26ad9f3..3e04347d921 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -8,7 +8,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/dagutils/diffenum.go b/dagutils/diffenum.go index 9e665426580..fd08c911c51 100644 --- a/dagutils/diffenum.go +++ b/dagutils/diffenum.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/diffenum_test.go b/dagutils/diffenum_test.go index f583501f9ed..dac8161fb58 100644 --- a/dagutils/diffenum_test.go +++ b/dagutils/diffenum_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - mdtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + mdtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/utils.go b/dagutils/utils.go index 03537652395..9581dbaaf11 100644 --- a/dagutils/utils.go +++ b/dagutils/utils.go @@ -4,9 +4,9 @@ import ( "context" "errors" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" diff --git a/dagutils/utils_test.go b/dagutils/utils_test.go index 80ffa1ea39e..a3e89548d3e 100644 --- a/dagutils/utils_test.go +++ b/dagutils/utils_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - mdtest "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag/test" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + mdtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index da020739afe..711dc747031 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -7,7 +7,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - merkledag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" blocks "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index e65bbf31042..e9d017a4dff 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,7 +7,7 @@ import ( "math/rand" "testing" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" diff --git a/fuse/ipns/common.go b/fuse/ipns/common.go index 08e7c37d59d..91e91083152 100644 --- a/fuse/ipns/common.go +++ b/fuse/ipns/common.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-ipfs/core" nsys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) // InitializeKeyspace sets the ipns record for the given key to diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index a616d0f7bea..061726c7ef4 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -13,15 +13,15 @@ import ( core "github.com/ipfs/go-ipfs/core" namesys "github.com/ipfs/go-ipfs/namesys" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" fs "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs" - mfs "gx/ipfs/QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy/go-mfs" + mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 131afc09c5b..13a7e44e89f 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -20,12 +20,12 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" + importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index c254ec6e6f6..2c7ac583493 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -11,10 +11,10 @@ import ( "syscall" core "github.com/ipfs/go-ipfs/core" - mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" diff --git a/namesys/base.go b/namesys/base.go index 20e03565061..d77ca168d8c 100644 --- a/namesys/base.go +++ b/namesys/base.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ) type resolver interface { diff --git a/namesys/cache.go b/namesys/cache.go index bc34266efe4..85784238a89 100644 --- a/namesys/cache.go +++ b/namesys/cache.go @@ -3,7 +3,7 @@ package namesys import ( "time" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ) func (ns *mpns) cacheGet(name string) (path.Path, bool) { diff --git a/namesys/dns.go b/namesys/dns.go index 29d90497b35..b4e3111d40d 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -8,8 +8,8 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) type LookupTXTFunc func(name string) (txt []string, err error) diff --git a/namesys/interface.go b/namesys/interface.go index d3a2bf980f0..eb82f1860fe 100644 --- a/namesys/interface.go +++ b/namesys/interface.go @@ -36,7 +36,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" ) diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go index 58f0fd21a30..9c3bf722727 100644 --- a/namesys/ipns_resolver_validation_test.go +++ b/namesys/ipns_resolver_validation_test.go @@ -6,7 +6,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" diff --git a/namesys/namesys.go b/namesys/namesys.go index c7a37f850fd..1d38ac6dae6 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -6,7 +6,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index 3584ae0a5b6..7bb60170efb 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -7,8 +7,8 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" diff --git a/namesys/proquint.go b/namesys/proquint.go index 7519770983e..051f616e1e9 100644 --- a/namesys/proquint.go +++ b/namesys/proquint.go @@ -7,8 +7,8 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" proquint "gx/ipfs/QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM/proquint" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" ) type ProquintResolver struct{} diff --git a/namesys/publisher.go b/namesys/publisher.go index 9519745153c..39ba878a591 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -7,8 +7,8 @@ import ( "time" pin "github.com/ipfs/go-ipfs/pin" - ft "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index ae1e3ef59f0..4cb5830f0f6 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -7,7 +7,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 4cd43e710cc..399aadea8f4 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -10,7 +10,7 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" namesys "github.com/ipfs/go-ipfs/namesys" . "github.com/ipfs/go-ipfs/namesys/republisher" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 32728128f16..9983bb8e57b 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" diff --git a/namesys/routing.go b/namesys/routing.go index 4d12c2713b1..788bbc60e40 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -6,7 +6,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/package.json b/package.json index 07e1e8c56a8..296f66ec91b 100644 --- a/package.json +++ b/package.json @@ -183,7 +183,7 @@ }, { "author": "whyrusleeping", - "hash": "QmcdMfj1jwvWWcQB1549ebeFkyj8iadzKrXaHqaEpUyQKY", + "hash": "Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ", "name": "go-libp2p-floodsub", "version": "0.9.30" }, @@ -464,7 +464,7 @@ }, { "author": "stebalien", - "hash": "QmSff5Y3UNsj4x8HfCT7iRte3TPW7jVRbFh7JEJK9L9dzo", + "hash": "QmeP3DqDr8CzjNUC9nX8S3mSjjtGW55RYn4Bhksvs72rL2", "name": "go-libp2p-pubsub-router", "version": "0.4.6" }, @@ -494,31 +494,31 @@ }, { "author": "why", - "hash": "QmVTXcrDPd4m8dSvaHc96E3dQjhe5rS8ekpZLXjsEmzSQc", + "hash": "QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj", "name": "go-bitswap", "version": "1.1.4" }, { "author": "why", - "hash": "QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF", + "hash": "QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi", "name": "go-blockservice", "version": "1.1.4" }, { "author": "why", - "hash": "QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm", + "hash": "Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf", "name": "go-merkledag", "version": "1.1.4" }, { "author": "why", - "hash": "QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t", + "hash": "QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk", "name": "go-path", "version": "1.1.4" }, { "author": "why", - "hash": "QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q", + "hash": "QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx", "name": "go-unixfs", "version": "1.1.4" }, @@ -536,7 +536,7 @@ }, { "author": "hsanjuan", - "hash": "QmV2muJXEefGRmwHv8CcbymoSyP5vrAz9zkwHE8RsvYwdy", + "hash": "QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH", "name": "go-mfs", "version": "0.1.4" }, diff --git a/pin/gc/gc.go b/pin/gc/gc.go index bb55de95cb6..e396d407402 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -8,8 +8,8 @@ import ( "strings" pin "github.com/ipfs/go-ipfs/pin" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/pin/pin.go b/pin/pin.go index 033f4698981..a466c788d5b 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -10,7 +10,7 @@ import ( "time" "github.com/ipfs/go-ipfs/dagutils" - mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/pin/pin_test.go b/pin/pin_test.go index 9917d35cabc..8014958b2a0 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - bs "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - mdag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bs "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/pin/set.go b/pin/set.go index 1e5bcfe4273..c71c284f06c 100644 --- a/pin/set.go +++ b/pin/set.go @@ -10,7 +10,7 @@ import ( "sort" "github.com/ipfs/go-ipfs/pin/internal/pb" - "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/pin/set_test.go b/pin/set_test.go index a1dc36f3be0..6d33a5cbb2c 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "testing" - bserv "gx/ipfs/QmQPHB5JqEtHV819eBL8dX2uDfxpCz27oEEEsfUnFpfEdF/go-blockservice" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/tar/format.go b/tar/format.go index 8663e2c3e10..3f6e590288a 100644 --- a/tar/format.go +++ b/tar/format.go @@ -9,10 +9,10 @@ import ( "strings" "github.com/ipfs/go-ipfs/dagutils" - dag "gx/ipfs/QmRfWhkc5eHLzZ1FActaXNeThijM2CY6JWc2qynQExFFJm/go-merkledag" - importer "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/importer" - uio "gx/ipfs/QmXYXeWXMa6XaqLthwc9gYzBdobRGBemWNv228XnAwqW9q/go-unixfs/io" - path "gx/ipfs/QmbE9gr6c2FomTgc2pRZRTooHpchJ1uaZKremypyWJMV4t/go-path" + path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" + uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" From d127f1be98f0d8d4816efb584f4f8eb7a39b4fef Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Thu, 4 Oct 2018 19:32:33 -0400 Subject: [PATCH 68/85] gx update libp2p/go-buffer-pool License: MIT Signed-off-by: Kevin Atkinson --- assets/assets.go | 2 +- cmd/seccat/seccat.go | 2 +- core/builder.go | 10 ++-- core/commands/add.go | 10 ++-- core/commands/bitswap.go | 4 +- core/commands/dag/dag.go | 2 +- core/commands/dht.go | 4 +- core/commands/files.go | 8 ++-- core/commands/get.go | 6 +-- core/commands/id.go | 2 +- core/commands/ls.go | 10 ++-- core/commands/name/ipns.go | 2 +- core/commands/object/object.go | 2 +- core/commands/pin.go | 4 +- core/commands/pubsub.go | 2 +- core/commands/refs.go | 2 +- core/commands/resolve.go | 2 +- core/commands/swarm.go | 2 +- core/commands/tar.go | 4 +- core/commands/unixfs/ls.go | 4 +- core/commands/urlstore.go | 6 +-- core/core.go | 36 +++++++------- core/coreapi/dht.go | 4 +- core/coreapi/interface/path.go | 2 +- core/coreapi/key.go | 2 +- core/coreapi/name.go | 2 +- core/coreapi/name_test.go | 2 +- core/coreapi/object.go | 4 +- core/coreapi/path.go | 6 +-- core/coreapi/pin.go | 4 +- core/coreapi/swarm.go | 2 +- core/coreapi/unixfs.go | 2 +- core/coreapi/unixfs_test.go | 6 +-- core/coredag/dagpb.go | 2 +- core/coredag/raw.go | 2 +- core/corehttp/commands.go | 2 +- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_handler.go | 12 ++--- core/corehttp/gateway_test.go | 6 +-- core/corehttp/metrics_test.go | 4 +- core/corerepo/gc.go | 2 +- core/coreunix/add.go | 12 ++--- core/coreunix/add_test.go | 4 +- core/coreunix/metadata.go | 4 +- core/coreunix/metadata_test.go | 10 ++-- core/mock/mock.go | 4 +- core/pathresolver.go | 4 +- core/pathresolver_test.go | 2 +- dagutils/diff.go | 2 +- dagutils/diffenum.go | 2 +- dagutils/diffenum_test.go | 4 +- dagutils/utils.go | 6 +-- dagutils/utils_test.go | 6 +-- exchange/reprovide/providers.go | 2 +- filestore/filestore_test.go | 2 +- fuse/ipns/common.go | 4 +- fuse/ipns/ipns_unix.go | 8 ++-- fuse/readonly/ipfs_test.go | 6 +-- fuse/readonly/readonly_unix.go | 8 ++-- namesys/base.go | 2 +- namesys/cache.go | 2 +- namesys/dns.go | 2 +- namesys/interface.go | 2 +- namesys/ipns_resolver_validation_test.go | 2 +- namesys/namesys.go | 2 +- namesys/namesys_test.go | 4 +- namesys/proquint.go | 2 +- namesys/publisher.go | 4 +- namesys/republisher/repub.go | 2 +- namesys/republisher/repub_test.go | 4 +- namesys/resolve_test.go | 2 +- namesys/routing.go | 4 +- package.json | 52 ++++++++++----------- pin/gc/gc.go | 4 +- pin/pin.go | 2 +- pin/pin_test.go | 4 +- pin/set.go | 2 +- pin/set_test.go | 4 +- tar/format.go | 8 ++-- 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 +- 83 files changed, 201 insertions(+), 201 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index 54b229ec101..5532ce0e16e 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" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmdZ4PvPHFQVLLEve7DgoKDcSY19wwpGBB1GKjjKi2rEL1/dir-index-html" diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index d3c882df732..eac22f5d726 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -19,10 +19,10 @@ import ( "os/signal" "syscall" + secio "gx/ipfs/QmNkxudvyUjdKw5ComDSCbJTHCjrjNGYjEAUdhoEUUjFsX/go-libp2p-secio" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" - secio "gx/ipfs/QmUdVuLDQCQD4WPBpgDsbBAaqui3GW4d7exBHK2PUKRQpv/go-libp2p-secio" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/builder.go b/core/builder.go index 28b0a0a6013..1aa786c39e5 100644 --- a/core/builder.go +++ b/core/builder.go @@ -14,11 +14,12 @@ import ( repo "github.com/ipfs/go-ipfs/repo" cidv0v1 "github.com/ipfs/go-ipfs/thirdparty/cidv0v1" "github.com/ipfs/go-ipfs/thirdparty/verifbs" - resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" @@ -32,7 +33,6 @@ import ( ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" retry "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/retrystore" dsync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" metrics "gx/ipfs/QmekzFM3hPZjTjUFGTABdQkEnQ3PTiMstY198PwSFr5w1Q/go-metrics-interface" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/commands/add.go b/core/commands/add.go index c30e1761dd2..08395ac2120 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -10,18 +10,18 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" "github.com/ipfs/go-ipfs/core/coreunix" filestore "github.com/ipfs/go-ipfs/filestore" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - dagtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dagtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" pb "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 94f0d2c9114..4b36641b98f 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -9,8 +9,8 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - bitswap "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap" - decision "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap/decision" + bitswap "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap" + decision "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index 562c5eefe38..a2407c5aadd 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -11,7 +11,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" coredag "github.com/ipfs/go-ipfs/core/coredag" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/commands/dht.go b/core/commands/dht.go index a7a1e6f10dd..60ad2501b2a 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -10,8 +10,8 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" e "github.com/ipfs/go-ipfs/core/commands/e" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" diff --git a/core/commands/files.go b/core/commands/files.go index f58edc533b4..f85ae83a234 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -18,18 +18,18 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "github.com/ipfs/go-ipfs/core/coreapi/interface" + bservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - bservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) var flog = logging.Logger("cmds/files") diff --git a/core/commands/get.go b/core/commands/get.go index b2e6c00151f..cd82591b901 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -16,10 +16,10 @@ import ( "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" tar "gx/ipfs/QmQine7gvHncNevKtG9QXxf3nXcwSj6aDDmMm52mHofEEp/tar-utils" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - uarchive "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/archive" + uarchive "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/archive" ) var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") diff --git a/core/commands/id.go b/core/commands/id.go index 4676f4f1967..1d6417a4ee3 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -12,12 +12,12 @@ import ( core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" + identify "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" kb "gx/ipfs/QmWKgrs6cyhTNUaTmAKs86K1FpYmkQLYVj83GqUvmuT3TY/go-libp2p-kbucket" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - identify "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ) const offlineIdErrorMessage = `'ipfs id' currently cannot query information on remote diff --git a/core/commands/ls.go b/core/commands/ls.go index 360d7b482db..1d72474bb35 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -10,15 +10,15 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + unixfspb "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/pb" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" - unixfspb "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/pb" - blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) type LsLink struct { diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index c17f27c5561..47ffc5ec48e 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -13,8 +13,8 @@ import ( nsopts "github.com/ipfs/go-ipfs/namesys/opts" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 0fd3293d400..765f5d76423 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -18,8 +18,8 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/pin.go b/core/commands/pin.go index 1ff98dbd97b..667722d2403 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -15,12 +15,12 @@ import ( corerepo "github.com/ipfs/go-ipfs/core/corerepo" pin "github.com/ipfs/go-ipfs/pin" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index da251bafd97..446e85d5350 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -19,8 +19,8 @@ import ( blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - floodsub "gx/ipfs/Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ/go-libp2p-floodsub" ) var PubsubCmd = &cmds.Command{ diff --git a/core/commands/refs.go b/core/commands/refs.go index 7f2d9151a16..1d1218b3f80 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -13,7 +13,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/resolve.go b/core/commands/resolve.go index 4fd7e0f6efc..f9a43180724 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -14,7 +14,7 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" ns "github.com/ipfs/go-ipfs/namesys" nsopts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 72f1cbd8ec5..d49157c5aaa 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -22,7 +22,7 @@ import ( "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm" + "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm" iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) diff --git a/core/commands/tar.go b/core/commands/tar.go index 315e4f35040..84472e0a543 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -9,8 +9,8 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "github.com/ipfs/go-ipfs/core/coreunix" tar "github.com/ipfs/go-ipfs/tar" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index 5e0a972fa8f..d0b93cd6708 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -12,8 +12,8 @@ import ( iface "github.com/ipfs/go-ipfs/core/coreapi/interface" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ) type LsLink struct { diff --git a/core/commands/urlstore.go b/core/commands/urlstore.go index 0c79f11c301..1448d969bbb 100644 --- a/core/commands/urlstore.go +++ b/core/commands/urlstore.go @@ -13,9 +13,9 @@ import ( cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" chunk "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - balanced "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/trickle" + balanced "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/trickle" ) var urlStoreCmd = &cmds.Command{ diff --git a/core/core.go b/core/core.go index ad8e70ed84d..f50c3f62206 100644 --- a/core/core.go +++ b/core/core.go @@ -30,12 +30,22 @@ import ( pin "github.com/ipfs/go-ipfs/pin" repo "github.com/ipfs/go-ipfs/repo" + psrouter "gx/ipfs/QmNPwLVhPRALSGyDnuwBS2WvL9bfx247aSyFJpToTh98wQ/go-libp2p-pubsub-router" quic "gx/ipfs/QmNiPUdQMsgnqfMAdBmRZPndL8sfo2s8NMGEqJ2Uv7BcKR/go-libp2p-quic-transport" + libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" + discovery "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/discovery" + p2pbhost "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/routed" + identify "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" + ping "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/ping" metrics "gx/ipfs/QmNn6gcjBXpg8kccr9zEV7UVBpqAw8FZEiQ6DksvzyTQ5K/go-libp2p-metrics" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + circuit "gx/ipfs/QmPq6vgdtDmuui5FU9qskJE7ijpmJKZ9rfmtdMW2jPvaos/go-libp2p-circuit" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" exchange "gx/ipfs/QmR1nncPsZR14A4hWr39mq8Lm7BGgS68bHVT9nop8NpWEM/go-ipfs-exchange-interface" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" @@ -44,38 +54,28 @@ import ( record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" connmgr "gx/ipfs/QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs/go-libp2p-connmgr" - bitswap "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap" - bsnet "gx/ipfs/QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj/go-bitswap/network" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" rhelpers "gx/ipfs/QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4/go-libp2p-routing-helpers" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" + "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - dht "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht" - dhtopts "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht/opts" + dht "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht" + dhtopts "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht/opts" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" nilrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/none" offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" - "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" mplex "gx/ipfs/QmYsbnP57nNUKWijs8o2q3ZFrSUcAGTdKoQPuSJC3Uxt1Y/go-smux-multiplex" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" pnet "gx/ipfs/QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET/go-libp2p-pnet" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - floodsub "gx/ipfs/Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ/go-libp2p-floodsub" yamux "gx/ipfs/QmcsgrV3nCAKjiHKZhKVXWc4oY3WBECJCqahXEMpHeMrev/go-smux-yamux" - libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" - discovery "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/discovery" - p2pbhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/routed" - identify "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" - ping "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/ping" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - circuit "gx/ipfs/QmeBpq5pAf2yaVdbpaKVcijEXu1QVjnDqPqYq4MACaEHLo/go-libp2p-circuit" - psrouter "gx/ipfs/QmeP3DqDr8CzjNUC9nX8S3mSjjtGW55RYn4Bhksvs72rL2/go-libp2p-pubsub-router" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bitswap "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap" + bsnet "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap/network" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreapi/dht.go b/core/coreapi/dht.go index 5fccf0ed886..486e77b8ba4 100644 --- a/core/coreapi/dht.go +++ b/core/coreapi/dht.go @@ -8,14 +8,14 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - blockservice "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreapi/interface/path.go b/core/coreapi/interface/path.go index 5748bf4653a..63b15fb501d 100644 --- a/core/coreapi/interface/path.go +++ b/core/coreapi/interface/path.go @@ -1,7 +1,7 @@ package iface import ( - ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ) diff --git a/core/coreapi/key.go b/core/coreapi/key.go index 005c3ab1909..63094cb4fd2 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -11,7 +11,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" crypto "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/name.go b/core/coreapi/name.go index c096ac25bea..f59a1d19967 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -12,7 +12,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/namesys" - ipath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ipath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index da4a1bbfe81..419a16781be 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - ipath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + ipath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 7dfdbaedd6f..2162b71f64c 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -17,9 +17,9 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) const inputLimit = 2 << 20 diff --git a/core/coreapi/path.go b/core/coreapi/path.go index 29f5cc3136c..27626955c07 100644 --- a/core/coreapi/path.go +++ b/core/coreapi/path.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - ipfspath "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 92ff0da94c3..63a25a19fc9 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -7,8 +7,8 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" corerepo "github.com/ipfs/go-ipfs/core/corerepo" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index a7405a8a43f..2247a693935 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -14,7 +14,7 @@ import ( ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - swarm "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm" + swarm "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm" iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 1a13bbad3fe..be80b11dae9 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -6,7 +6,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index fb9b61917ae..6281c385619 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -19,16 +19,16 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" repo "github.com/ipfs/go-ipfs/repo" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" - mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" - unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index c2174888594..732c75936d9 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/coredag/raw.go b/core/coredag/raw.go index e6315d9606b..1df81fcfb06 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 371d083f667..e07422b6169 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -15,9 +15,9 @@ import ( corecommands "github.com/ipfs/go-ipfs/core/commands" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" cmdsHttp "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" ) var ( diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index 99c948a1b37..a0c607df82a 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreapi "github.com/ipfs/go-ipfs/core/coreapi" - id "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" ) type GatewayConfig struct { diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 1ee91e72d41..779a64da42f 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -16,12 +16,12 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/dagutils" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 46f505631db..a1afff08a11 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -18,13 +18,13 @@ import ( nsopts "github.com/ipfs/go-ipfs/namesys/opts" repo "github.com/ipfs/go-ipfs/repo" + id "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - id "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/protocol/identify" ) // `ipfs object new unixfs-dir` diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 128e941f6d5..10dff2ccfc0 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/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/basic" inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - swarmt "gx/ipfs/QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX/go-libp2p-swarm/testing" - bhost "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/host/basic" + swarmt "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm/testing" ) // This test is based on go-libp2p/p2p/net/swarm.TestConnectednessCorrect diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 30d6013a425..689c3817315 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -12,7 +12,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 543787648a2..4cf54704264 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -12,17 +12,17 @@ import ( core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/pin" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - unixfs "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - balanced "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer/trickle" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + balanced "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/trickle" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index 75f769b1533..bfcf4f5ca2b 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -14,15 +14,15 @@ import ( "github.com/ipfs/go-ipfs/pin/gc" "github.com/ipfs/go-ipfs/repo" + "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" pi "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index c9d44fbf44c..4c933c176e1 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -3,8 +3,8 @@ package coreunix import ( core "github.com/ipfs/go-ipfs/core" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ) 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 975bcf930c0..da0849d8b6a 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -7,11 +7,11 @@ import ( "testing" core "github.com/ipfs/go-ipfs/core" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/core/mock/mock.go b/core/mock/mock.go index 95b5bf6121d..6b2223c00f9 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -8,14 +8,14 @@ import ( "github.com/ipfs/go-ipfs/repo" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - libp2p "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) // NewMockNode constructs an IpfsNode for use in tests. diff --git a/core/pathresolver.go b/core/pathresolver.go index e17afad9e47..be27fc152cd 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -7,8 +7,8 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - resolver "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path/resolver" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/pathresolver_test.go b/core/pathresolver_test.go index e67ae0e2445..bb4e470d0b6 100644 --- a/core/pathresolver_test.go +++ b/core/pathresolver_test.go @@ -5,7 +5,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coremock "github.com/ipfs/go-ipfs/core/mock" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ) func TestResolveNoComponents(t *testing.T) { diff --git a/dagutils/diff.go b/dagutils/diff.go index 3e04347d921..4e890a96263 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -8,7 +8,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/dagutils/diffenum.go b/dagutils/diffenum.go index fd08c911c51..bcbdd8f99fa 100644 --- a/dagutils/diffenum.go +++ b/dagutils/diffenum.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/diffenum_test.go b/dagutils/diffenum_test.go index dac8161fb58..e9c57a7bb61 100644 --- a/dagutils/diffenum_test.go +++ b/dagutils/diffenum_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - mdtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + mdtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/utils.go b/dagutils/utils.go index 9581dbaaf11..ba27d05c939 100644 --- a/dagutils/utils.go +++ b/dagutils/utils.go @@ -4,9 +4,9 @@ import ( "context" "errors" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" diff --git a/dagutils/utils_test.go b/dagutils/utils_test.go index a3e89548d3e..f94264221b8 100644 --- a/dagutils/utils_test.go +++ b/dagutils/utils_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - mdtest "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag/test" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + mdtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index 711dc747031..ad25e988b59 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -7,7 +7,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - merkledag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" blocks "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index e9d017a4dff..72f159fc980 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,7 +7,7 @@ import ( "math/rand" "testing" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" diff --git a/fuse/ipns/common.go b/fuse/ipns/common.go index 91e91083152..a58ff6e8b63 100644 --- a/fuse/ipns/common.go +++ b/fuse/ipns/common.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-ipfs/core" nsys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ) // InitializeKeyspace sets the ipns record for the given key to diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 061726c7ef4..6528f32e92b 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -13,15 +13,15 @@ import ( core "github.com/ipfs/go-ipfs/core" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" fs "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs" - mfs "gx/ipfs/QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 13a7e44e89f..29c4092d4f8 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -21,11 +21,11 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 2c7ac583493..7579fb60e4b 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -11,10 +11,10 @@ import ( "syscall" core "github.com/ipfs/go-ipfs/core" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" diff --git a/namesys/base.go b/namesys/base.go index d77ca168d8c..5db5948aeba 100644 --- a/namesys/base.go +++ b/namesys/base.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ) type resolver interface { diff --git a/namesys/cache.go b/namesys/cache.go index 85784238a89..6e234587655 100644 --- a/namesys/cache.go +++ b/namesys/cache.go @@ -3,7 +3,7 @@ package namesys import ( "time" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ) func (ns *mpns) cacheGet(name string) (path.Path, bool) { diff --git a/namesys/dns.go b/namesys/dns.go index b4e3111d40d..9696136d2f4 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -8,7 +8,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" ) diff --git a/namesys/interface.go b/namesys/interface.go index eb82f1860fe..aad69952c9b 100644 --- a/namesys/interface.go +++ b/namesys/interface.go @@ -36,7 +36,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" ) diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go index 9c3bf722727..eddd64da98a 100644 --- a/namesys/ipns_resolver_validation_test.go +++ b/namesys/ipns_resolver_validation_test.go @@ -6,7 +6,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" diff --git a/namesys/namesys.go b/namesys/namesys.go index 1d38ac6dae6..0371174fede 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -6,7 +6,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index 7bb60170efb..a77306a401a 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -7,8 +7,8 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" diff --git a/namesys/proquint.go b/namesys/proquint.go index 051f616e1e9..cd29bff254e 100644 --- a/namesys/proquint.go +++ b/namesys/proquint.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" proquint "gx/ipfs/QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM/proquint" ) diff --git a/namesys/publisher.go b/namesys/publisher.go index 39ba878a591..412b65dbb35 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -7,8 +7,8 @@ import ( "time" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - ft "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index 4cb5830f0f6..8124ec3ad4d 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -7,7 +7,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 399aadea8f4..54ec416fcf9 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -10,11 +10,11 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" namesys "github.com/ipfs/go-ipfs/namesys" . "github.com/ipfs/go-ipfs/namesys/republisher" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestRepublish(t *testing.T) { diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 9983bb8e57b..5e7feb9edff 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" diff --git a/namesys/routing.go b/namesys/routing.go index 788bbc60e40..f7b7c9e9a60 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -6,12 +6,12 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - dht "gx/ipfs/QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK/go-libp2p-kad-dht" + dht "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht" ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/package.json b/package.json index 296f66ec91b..29750d28cd1 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ }, { "author": "whyrusleeping", - "hash": "QmUdVuLDQCQD4WPBpgDsbBAaqui3GW4d7exBHK2PUKRQpv", + "hash": "QmNkxudvyUjdKw5ComDSCbJTHCjrjNGYjEAUdhoEUUjFsX", "name": "go-libp2p-secio", - "version": "2.0.11" + "version": "2.0.12" }, { "author": "whyrusleeping", @@ -124,9 +124,9 @@ }, { "author": "whyrusleeping", - "hash": "Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB", + "hash": "QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY", "name": "go-libp2p", - "version": "6.0.14" + "version": "6.0.15" }, { "author": "whyrusleeping", @@ -171,9 +171,9 @@ "version": "0.2.0" }, { - "hash": "QmXBVGodwBx38Pvx6x8nt9mtCWbiDcNv7XWDGuvkajELvK", + "hash": "QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P", "name": "go-libp2p-kad-dht", - "version": "4.4.3" + "version": "4.4.4" }, { "author": "whyrusleeping", @@ -183,9 +183,9 @@ }, { "author": "whyrusleeping", - "hash": "Qmch44z24hut8iN2snohMNLiX63E3QfZLMQKoe14iZ3FhQ", + "hash": "QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH", "name": "go-libp2p-floodsub", - "version": "0.9.30" + "version": "0.9.31" }, { "author": "whyrusleeping", @@ -295,9 +295,9 @@ }, { "author": "whyrusleeping", - "hash": "QmcyQj1V6Ht8uSrRqj865UXGUo5Sc8GxNA4U8bLQxCSmfX", + "hash": "QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY", "name": "go-libp2p-swarm", - "version": "3.0.14" + "version": "3.0.15" }, { "hash": "QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz", @@ -350,9 +350,9 @@ }, { "author": "vyzo", - "hash": "QmeBpq5pAf2yaVdbpaKVcijEXu1QVjnDqPqYq4MACaEHLo", + "hash": "QmPq6vgdtDmuui5FU9qskJE7ijpmJKZ9rfmtdMW2jPvaos", "name": "go-libp2p-circuit", - "version": "2.2.3" + "version": "2.2.4" }, { "author": "magik6k", @@ -464,9 +464,9 @@ }, { "author": "stebalien", - "hash": "QmeP3DqDr8CzjNUC9nX8S3mSjjtGW55RYn4Bhksvs72rL2", + "hash": "QmNPwLVhPRALSGyDnuwBS2WvL9bfx247aSyFJpToTh98wQ", "name": "go-libp2p-pubsub-router", - "version": "0.4.6" + "version": "0.4.7" }, { "author": "Stebalien", @@ -494,33 +494,33 @@ }, { "author": "why", - "hash": "QmT2omZ67nPcHn2Bm41iFcuJv2Trgi8Tan19QLNaRdbPLj", + "hash": "QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp", "name": "go-bitswap", - "version": "1.1.4" + "version": "1.1.5" }, { "author": "why", - "hash": "QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi", + "hash": "QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX", "name": "go-blockservice", - "version": "1.1.4" + "version": "1.1.5" }, { "author": "why", - "hash": "Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf", + "hash": "QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm", "name": "go-merkledag", - "version": "1.1.4" + "version": "1.1.5" }, { "author": "why", - "hash": "QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk", + "hash": "QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ", "name": "go-path", - "version": "1.1.4" + "version": "1.1.5" }, { "author": "why", - "hash": "QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx", + "hash": "QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices", "name": "go-unixfs", - "version": "1.1.4" + "version": "1.1.5" }, { "author": "magik6k", @@ -536,9 +536,9 @@ }, { "author": "hsanjuan", - "hash": "QmV4wemm3VGkMHR4CmWa89J9wznnx62sqW2ahEBQwqAjCH", + "hash": "QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U", "name": "go-mfs", - "version": "0.1.4" + "version": "0.1.5" }, { "author": "kevina", diff --git a/pin/gc/gc.go b/pin/gc/gc.go index e396d407402..2be1333d5d2 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -8,8 +8,8 @@ import ( "strings" pin "github.com/ipfs/go-ipfs/pin" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/pin/pin.go b/pin/pin.go index a466c788d5b..2ed476414c1 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -10,7 +10,7 @@ import ( "time" "github.com/ipfs/go-ipfs/dagutils" - mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/pin/pin_test.go b/pin/pin_test.go index 8014958b2a0..4890872abe1 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - mdag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bs "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bs "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/pin/set.go b/pin/set.go index c71c284f06c..8bccc850347 100644 --- a/pin/set.go +++ b/pin/set.go @@ -10,7 +10,7 @@ import ( "sort" "github.com/ipfs/go-ipfs/pin/internal/pb" - "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" + "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/pin/set_test.go b/pin/set_test.go index 6d33a5cbb2c..0502880ff89 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "testing" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - bserv "gx/ipfs/QmewCqLsNJ2j7xrbEk8nYoCCMtBMSK3Eq6pdNdNPogdehi/go-blockservice" + bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" diff --git a/tar/format.go b/tar/format.go index 3f6e590288a..6f2aa648204 100644 --- a/tar/format.go +++ b/tar/format.go @@ -9,10 +9,10 @@ import ( "strings" "github.com/ipfs/go-ipfs/dagutils" - path "gx/ipfs/QmYh33CFYYEgQNSZ9PEP7ZN57dhErRZ7NfLS1BUA9GBBRk/go-path" - dag "gx/ipfs/Qmb5kvkvMyuaJ9e58vLh3TdRWgH9CCQPLJD4BgvNQvQFwf/go-merkledag" - importer "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/importer" - uio "gx/ipfs/QmdF8ovKr2zNMWi2hiDMqQAQeNw35xwytb1W7Ydwsf1ufx/go-unixfs/io" + dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" + uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index e0ca53c4c8e..2950bc99729 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -19,10 +19,10 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) var log = logging.Logger("epictest") diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index d48f9c378b1..ba8c3be6736 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -16,8 +16,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func BenchmarkCat1MB(b *testing.B) { benchmarkVarCat(b, unit.MB*1) } diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 244b7237e7a..7530f122f47 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -9,8 +9,8 @@ import ( "github.com/ipfs/go-ipfs/core/mock" "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestBitswapWithoutRouting(t *testing.T) { diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index d61d4b2ec58..6baba0dfd7a 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - mocknet "gx/ipfs/Qmd9zWxAeeDJoLdxqvaDXAGtoafX5cc9Tp25DNm9W7fVnB/go-libp2p/p2p/net/mock" ) func TestThreeLeggedCatTransfer(t *testing.T) { From 47e7f693ebc22f9f7b5e1876fd16b31c46a83307 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 4 Oct 2018 15:36:29 -0700 Subject: [PATCH 69/85] don't use the domain name as a filename in /ipns/a.com fixes #5369 License: MIT Signed-off-by: Steven Allen --- core/corehttp/gateway_handler.go | 10 +++++++++- core/corehttp/gateway_test.go | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 9e0b8e1ec86..bba9dde90d5 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -266,7 +266,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr w.Header().Set("Content-Disposition", fmt.Sprintf("inline; filename*=UTF-8''%s", url.PathEscape(urlFilename))) name = urlFilename } else { - name = gopath.Base(urlPath) + name = getFilename(urlPath) } i.serveFile(w, r, name, modtime, dr) return @@ -624,3 +624,11 @@ func webErrorWithCode(w http.ResponseWriter, message string, err error, code int func internalWebError(w http.ResponseWriter, err error) { webErrorWithCode(w, "internalWebError", err, http.StatusInternalServerError) } + +func getFilename(s string) string { + if (strings.HasPrefix(s, ipfsPathPrefix) || strings.HasPrefix(s, ipnsPathPrefix)) && strings.Count(gopath.Clean(s), "/") <= 2 { + // Don't want to treat ipfs.io in /ipns/ipfs.io as a filename. + return "" + } + return gopath.Base(s) +} diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 83e2ea5e8dd..106f4c214bc 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -153,6 +153,7 @@ func TestGatewayGet(t *testing.T) { ns["/ipns/double.example.com"] = path.FromString("/ipns/working.example.com") ns["/ipns/triple.example.com"] = path.FromString("/ipns/double.example.com") ns["/ipns/broken.example.com"] = path.FromString("/ipns/" + k) + ns["/ipns/example.man"] = path.FromString("/ipfs/" + k) t.Log(ts.URL) for _, test := range []struct { @@ -175,6 +176,7 @@ func TestGatewayGet(t *testing.T) { {"working.example.com", "/ipfs/" + k, http.StatusNotFound, "ipfs resolve -r /ipns/working.example.com/ipfs/" + k + ": no link by that name\n"}, {"broken.example.com", "/", http.StatusNotFound, "ipfs resolve -r /ipns/broken.example.com/: " + namesys.ErrResolveFailed.Error() + "\n"}, {"broken.example.com", "/ipfs/" + k, http.StatusNotFound, "ipfs resolve -r /ipns/broken.example.com/ipfs/" + k + ": " + namesys.ErrResolveFailed.Error() + "\n"}, + {"example.man", "/", http.StatusOK, "fnord"}, } { var c http.Client r, err := http.NewRequest("GET", ts.URL+test.path, nil) @@ -190,6 +192,10 @@ func TestGatewayGet(t *testing.T) { continue } defer resp.Body.Close() + contentType := resp.Header.Get("Content-Type") + if contentType != "text/plain; charset=utf-8" { + t.Errorf("expected content type to be text/plain, got %s", contentType) + } if resp.StatusCode != test.status { t.Errorf("got %d, expected %d from %s", resp.StatusCode, test.status, urlstr) continue From 43d93cb01bbff95fabbaa2582649256f42ffe328 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Thu, 27 Sep 2018 19:53:16 +0800 Subject: [PATCH 70/85] refactor p2p command code License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/p2p.go | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index fc96973659c..0ed0d16165d 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -49,6 +49,14 @@ type P2PStreamsOutput struct { Streams []P2PStreamInfoOutput } +var ( + allowCustomProtocolOptionName = "allow-custom-protocol" + allOptionName = "all" + protocolOptionName = "protocol" + listenAddressOptionName = "listen-address" + targetAddressOptionName = "target-address" +) + // P2PCmd is the 'ipfs p2p' command var P2PCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ @@ -91,7 +99,7 @@ Example: cmdkit.StringArg("target-address", true, false, "Target endpoint."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("allow-custom-protocol", "Don't require /x/ prefix"), + cmdkit.BoolOption(allowCustomProtocolOptionName, "Don't require /x/ prefix"), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -118,7 +126,7 @@ Example: return } - allowCustom, _, err := req.Option("allow-custom-protocol").Bool() + allowCustom, _, err := req.Option(allowCustomProtocolOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -156,7 +164,7 @@ Example: cmdkit.StringArg("target-address", true, false, "Target endpoint."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("allow-custom-protocol", "Don't require /x/ prefix"), + cmdkit.BoolOption(allowCustomProtocolOptionName, "Don't require /x/ prefix"), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -176,7 +184,7 @@ Example: return } - allowCustom, _, err := req.Option("allow-custom-protocol").Bool() + allowCustom, _, err := req.Option(allowCustomProtocolOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -283,10 +291,10 @@ var p2pCloseCmd = &cmds.Command{ Tagline: "Stop listening for new connections to forward.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("all", "a", "Close all listeners."), - cmdkit.StringOption("protocol", "p", "Match protocol name"), - cmdkit.StringOption("listen-address", "l", "Match listen address"), - cmdkit.StringOption("target-address", "t", "Match target address"), + cmdkit.BoolOption(allOptionName, "a", "Close all listeners."), + cmdkit.StringOption(protocolOptionName, "p", "Match protocol name"), + cmdkit.StringOption(listenAddressOptionName, "l", "Match listen address"), + cmdkit.StringOption(targetAddressOptionName, "t", "Match target address"), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -295,10 +303,10 @@ var p2pCloseCmd = &cmds.Command{ return } - closeAll, _, _ := req.Option("all").Bool() - protoOpt, p, _ := req.Option("protocol").String() - listenOpt, l, _ := req.Option("listen-address").String() - targetOpt, t, _ := req.Option("target-address").String() + closeAll, _, _ := req.Option(allOptionName).Bool() + protoOpt, p, _ := req.Option(protocolOptionName).String() + listenOpt, l, _ := req.Option(listenAddressOptionName).String() + targetOpt, t, _ := req.Option(targetAddressOptionName).String() proto := protocol.ID(protoOpt) From 51fa159e4ad43b4049178ac2f79df4a375561003 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Sun, 30 Sep 2018 13:54:54 +0800 Subject: [PATCH 71/85] add dns support in p2p forward connect License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/p2p.go | 50 ++++++++++++++++++++++++++++++++------ test/sharness/t0180-p2p.sh | 22 +++++++++++++++-- 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index 0ed0d16165d..38521eeab9f 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -9,6 +9,7 @@ import ( "strconv" "strings" "text/tabwriter" + "time" cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" @@ -19,6 +20,7 @@ import ( ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" + madns "gx/ipfs/QmfXU2MhWoegxHoeMd3A2ytL2P6CY4FfqGWc23LTNWBwZt/go-multiaddr-dns" ) // P2PProtoPrefix is the default required prefix for protocol names @@ -49,7 +51,7 @@ type P2PStreamsOutput struct { Streams []P2PStreamInfoOutput } -var ( +const ( allowCustomProtocolOptionName = "allow-custom-protocol" allOptionName = "all" protocolOptionName = "protocol" @@ -57,6 +59,8 @@ var ( targetAddressOptionName = "target-address" ) +var resolveTimeout = 10 * time.Second + // P2PCmd is the 'ipfs p2p' command var P2PCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ @@ -120,7 +124,7 @@ Example: return } - target, err := ipfsaddr.ParseString(targetOpt) + targets, err := parseIpfsAddr(targetOpt) if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -137,7 +141,7 @@ Example: return } - if err := forwardLocal(n.Context(), n.P2P, n.Peerstore, proto, listen, target); err != nil { + if err := forwardLocal(n.Context(), n.P2P, n.Peerstore, proto, listen, targets); err != nil { res.SetError(err, cmdkit.ErrNormal) return } @@ -145,6 +149,37 @@ Example: }, } +// parseIpfsAddr is a function that takes in addr string and return ipfsAddrs +func parseIpfsAddr(addr string) ([]ipfsaddr.IPFSAddr, error) { + mutiladdr, err := ma.NewMultiaddr(addr) + if err != nil { + return nil, err + } + if _, err := mutiladdr.ValueForProtocol(ma.P_IPFS); err == nil { + iaddrs := make([]ipfsaddr.IPFSAddr, 1) + iaddrs[0], err = ipfsaddr.ParseMultiaddr(mutiladdr) + if err != nil { + return nil, err + } + return iaddrs, nil + } + // resolve mutiladdr whose protocol is not ma.P_IPFS + ctx, cancel := context.WithTimeout(context.Background(), resolveTimeout) + addrs, err := madns.Resolve(ctx, mutiladdr) + cancel() + if len(addrs) == 0 { + return nil, errors.New("fail to resolve the multiaddr:" + mutiladdr.String()) + } + iaddrs := make([]ipfsaddr.IPFSAddr, len(addrs)) + for i, addr := range addrs { + iaddrs[i], err = ipfsaddr.ParseMultiaddr(addr) + if err != nil { + return nil, err + } + } + return iaddrs, nil +} + var p2pListenCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Create libp2p service", @@ -212,13 +247,14 @@ func forwardRemote(ctx context.Context, p *p2p.P2P, proto protocol.ID, target ma } // forwardLocal forwards local connections to a libp2p service -func forwardLocal(ctx context.Context, p *p2p.P2P, ps pstore.Peerstore, proto protocol.ID, bindAddr ma.Multiaddr, addr ipfsaddr.IPFSAddr) error { - if addr != nil { +func forwardLocal(ctx context.Context, p *p2p.P2P, ps pstore.Peerstore, proto protocol.ID, bindAddr ma.Multiaddr, addrs []ipfsaddr.IPFSAddr) error { + for _, addr := range addrs { ps.AddAddr(addr.ID(), addr.Multiaddr(), pstore.TempAddrTTL) } - // TODO: return some info - _, err := p.ForwardLocal(ctx, addr.ID(), proto, bindAddr) + // the length of the addrs must large than 0 + // peerIDs in addr must be the same and choose addr[0] to connect + _, err := p.ForwardLocal(ctx, addrs[0].ID(), proto, bindAddr) return err } diff --git a/test/sharness/t0180-p2p.sh b/test/sharness/t0180-p2p.sh index 544cd1f6f6a..0d676746c5f 100755 --- a/test/sharness/t0180-p2p.sh +++ b/test/sharness/t0180-p2p.sh @@ -24,7 +24,8 @@ check_test_ports() { test_expect_success "test ports are closed" ' (! (netstat -lnp | grep "LISTEN" | grep ":10101 ")) && (! (netstat -lnp | grep "LISTEN" | grep ":10102 "))&& - (! (netstat -lnp | grep "LISTEN" | grep ":10103 ")) + (! (netstat -lnp | grep "LISTEN" | grep ":10103 ")) && + (! (netstat -lnp | grep "LISTEN" | grep ":10104 ")) ' } check_test_ports @@ -73,10 +74,27 @@ test_server_to_client() { spawn_sending_server -test_expect_success 'S->C Setup client side' ' +test_expect_success 'S->C(/ipfs/peerID) Setup client side' ' ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log ' +test_expect_success 'S->C Setup(dnsaddr/addr/ipfs/peerID) client side' ' + ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10103 /dnsaddr/bootstrap.libp2p.io/ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log +' + +test_expect_success 'S->C Setup(dnsaddr/addr) client side' ' + ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10104 /dnsaddr/bootstrap.libp2p.io/ 2>&1 > dialer-stdouterr.log +' + + +test_expect_success 'S->C Output is empty' ' + test_must_be_empty dialer-stdouterr.log +' + +test_expect_success "'ipfs p2p ls | grep' succeeds" ' + ipfsi 1 p2p ls | grep "/x/p2p-test /ip4/127.0.0.1/tcp/10104" +' + test_server_to_client test_expect_success 'S->C Connect with dead server' ' From 3dc0ce7fa19eef6dd8528fb968e67e409988f0a4 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Thu, 4 Oct 2018 22:14:53 +0800 Subject: [PATCH 72/85] refactor all command code License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/active.go | 8 ++- core/commands/bitswap.go | 8 ++- core/commands/block.go | 31 +++++++---- core/commands/bootstrap.go | 16 ++++-- core/commands/cat.go | 14 +++-- core/commands/cid.go | 39 +++++++++---- core/commands/config.go | 13 +++-- core/commands/dht.go | 44 +++++++++------ core/commands/dns.go | 8 ++- core/commands/files.go | 110 +++++++++++++++++++++++-------------- core/commands/filestore.go | 12 ++-- core/commands/get.go | 25 ++++++--- core/commands/id.go | 8 ++- core/commands/keystore.go | 21 +++++-- core/commands/ls.go | 15 +++-- core/commands/p2p.go | 43 +++++++++------ core/commands/pin.go | 52 ++++++++++++------ core/commands/ping.go | 8 ++- core/commands/pubsub.go | 8 ++- core/commands/refs.go | 28 ++++++---- core/commands/repo.go | 30 ++++++---- core/commands/resolve.go | 18 ++++-- core/commands/stat.go | 23 +++++--- core/commands/swarm.go | 23 +++++--- core/commands/version.go | 23 +++++--- 25 files changed, 415 insertions(+), 213 deletions(-) diff --git a/core/commands/active.go b/core/commands/active.go index 83f6b0807c5..e9a9b47e098 100644 --- a/core/commands/active.go +++ b/core/commands/active.go @@ -14,6 +14,10 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) +const ( + verboseOptionName = "v" +) + var ActiveReqsCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List commands run on this IPFS node.", @@ -25,7 +29,7 @@ Lists running and recently run commands. res.SetOutput(req.InvocContext().ReqLog.Report()) }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), + cmdkit.BoolOption("verbose", verboseOptionName, "Print extra information."), }, Subcommands: map[string]*cmds.Command{ "clear": clearInactiveCmd, @@ -44,7 +48,7 @@ Lists running and recently run commands. } buf := new(bytes.Buffer) - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(verboseOptionName).Bool() w := tabwriter.NewWriter(buf, 4, 4, 2, ' ', 0) if verbose { diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 4b36641b98f..f0ffaa1acde 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -32,6 +32,10 @@ var BitswapCmd = &cmds.Command{ }, } +const ( + peerOptionName = "peer" +) + var showWantlistCmd = &oldcmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Show blocks currently on the wantlist.", @@ -39,7 +43,7 @@ var showWantlistCmd = &oldcmds.Command{ Print out all blocks currently on the bitswap wantlist for the local peer.`, }, Options: []cmdkit.Option{ - cmdkit.StringOption("peer", "p", "Specify which peer to show wantlist for. Default: self."), + cmdkit.StringOption(peerOptionName, "p", "Specify which peer to show wantlist for. Default: self."), }, Type: KeyList{}, Run: func(req oldcmds.Request, res oldcmds.Response) { @@ -60,7 +64,7 @@ Print out all blocks currently on the bitswap wantlist for the local peer.`, return } - pstr, found, err := req.Option("peer").String() + pstr, found, err := req.Option(peerOptionName).String() if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/block.go b/core/commands/block.go index 05cc661320d..1ac1f677749 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -126,6 +126,12 @@ It outputs to stdout, and is a base58 encoded multihash. }, } +const ( + blockFormatOptionName = "format" + mhtypeOptionName = "mhtype" + mhlenOptionName = "mhlen" +) + var blockPutCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Store input as an IPFS block.", @@ -142,9 +148,9 @@ than 'sha2-256' or format to anything other than 'v0' will result in CIDv1. cmdkit.FileArg("data", true, false, "The data to be stored as an IPFS block.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.StringOption("format", "f", "cid format for blocks to be created with."), - cmdkit.StringOption("mhtype", "multihash hash function").WithDefault("sha2-256"), - cmdkit.IntOption("mhlen", "multihash hash length").WithDefault(-1), + cmdkit.StringOption(blockFormatOptionName, "f", "cid format for blocks to be created with."), + cmdkit.StringOption(mhtypeOptionName, "multihash hash function").WithDefault("sha2-256"), + cmdkit.IntOption(mhlenOptionName, "multihash hash length").WithDefault(-1), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) @@ -157,18 +163,18 @@ than 'sha2-256' or format to anything other than 'v0' will result in CIDv1. return err } - mhtype, _ := req.Options["mhtype"].(string) + mhtype, _ := req.Options[mhtypeOptionName].(string) mhtval, ok := mh.Names[mhtype] if !ok { return fmt.Errorf("unrecognized multihash function: %s", mhtype) } - mhlen, ok := req.Options["mhlen"].(int) + mhlen, ok := req.Options[mhlenOptionName].(int) if !ok { return errors.New("missing option \"mhlen\"") } - format, formatSet := req.Options["format"].(string) + format, formatSet := req.Options[blockFormatOptionName].(string) if !formatSet { if mhtval != mh.SHA2_256 || (mhlen != -1 && mhlen != 32) { format = "protobuf" @@ -200,6 +206,11 @@ than 'sha2-256' or format to anything other than 'v0' will result in CIDv1. Type: BlockStat{}, } +const ( + forceOptionName = "force" + blockQuietOptionName = "quiet" +) + var blockRmCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Remove IPFS block(s).", @@ -212,8 +223,8 @@ It takes a list of base58 encoded multihashes to remove. cmdkit.StringArg("hash", true, true, "Bash58 encoded multihash of block(s) to remove."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("force", "f", "Ignore nonexistent blocks."), - cmdkit.BoolOption("quiet", "q", "Write minimal output."), + cmdkit.BoolOption(forceOptionName, "f", "Ignore nonexistent blocks."), + cmdkit.BoolOption(blockQuietOptionName, "q", "Write minimal output."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) @@ -221,8 +232,8 @@ It takes a list of base58 encoded multihashes to remove. return err } - force, _ := req.Options["force"].(bool) - quiet, _ := req.Options["quiet"].(bool) + force, _ := req.Options[forceOptionName].(bool) + quiet, _ := req.Options[blockQuietOptionName].(bool) // TODO: use batching coreapi when done for _, b := range req.Arguments { diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index bf915c4eab0..adc0333a4ab 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -40,6 +40,10 @@ Running 'ipfs bootstrap' with no arguments will run 'ipfs bootstrap list'. }, } +const ( + defaultOptionName = "default" +) + var bootstrapAddCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Add peers to the bootstrap list.", @@ -53,14 +57,14 @@ in the bootstrap list). }, Options: []cmdkit.Option{ - cmdkit.BoolOption("default", "Add default bootstrap nodes. (Deprecated, use 'default' subcommand instead)"), + cmdkit.BoolOption(defaultOptionName, "Add default bootstrap nodes. (Deprecated, use 'default' subcommand instead)"), }, Subcommands: map[string]*cmds.Command{ "default": bootstrapAddDefaultCmd, }, Run: func(req cmds.Request, res cmds.Response) { - deflt, _, err := req.Option("default").Bool() + deflt, _, err := req.Option(defaultOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -191,6 +195,10 @@ in the bootstrap list).`, }, } +const ( + bootstrapAllOptionName = "all" +) + var bootstrapRemoveCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Remove peers from the bootstrap list.", @@ -202,13 +210,13 @@ var bootstrapRemoveCmd = &cmds.Command{ cmdkit.StringArg("peer", false, true, peerOptionDesc).EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("all", "Remove all bootstrap peers. (Deprecated, use 'all' subcommand)"), + cmdkit.BoolOption(bootstrapAllOptionName, "Remove all bootstrap peers. (Deprecated, use 'all' subcommand)"), }, Subcommands: map[string]*cmds.Command{ "all": bootstrapRemoveAllCmd, }, Run: func(req cmds.Request, res cmds.Response) { - all, _, err := req.Option("all").Bool() + all, _, err := req.Option(bootstrapAllOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/cat.go b/core/commands/cat.go index 0ade25daa59..3c9bb97f322 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -13,7 +13,11 @@ import ( cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ) -const progressBarMinSize = 1024 * 1024 * 8 // show progress bar for outputs > 8MiB +const ( + progressBarMinSize = 1024 * 1024 * 8 // show progress bar for outputs > 8MiB + offsetOptionName = "offset" + lengthOptionName = "length" +) var CatCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ @@ -25,8 +29,8 @@ var CatCmd = &cmds.Command{ cmdkit.StringArg("ipfs-path", true, true, "The path to the IPFS object(s) to be outputted.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.IntOption("offset", "o", "Byte offset to begin reading from."), - cmdkit.IntOption("length", "l", "Maximum number of bytes to read."), + cmdkit.IntOption(offsetOptionName, "o", "Byte offset to begin reading from."), + cmdkit.IntOption(lengthOptionName, "l", "Maximum number of bytes to read."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { node, err := cmdenv.GetNode(env) @@ -45,12 +49,12 @@ var CatCmd = &cmds.Command{ } } - offset, _ := req.Options["offset"].(int) + offset, _ := req.Options[offsetOptionName].(int) if offset < 0 { return fmt.Errorf("cannot specify negative offset") } - max, found := req.Options["length"].(int) + max, found := req.Options[lengthOptionName].(int) if err != nil { return err } diff --git a/core/commands/cid.go b/core/commands/cid.go index aa44e3d685e..7af002fb889 100644 --- a/core/commands/cid.go +++ b/core/commands/cid.go @@ -31,6 +31,12 @@ var CidCmd = &cmds.Command{ }, } +const ( + cidFormatOptionName = "f" + cidVerisonOptionName = "v" + cidMultibaseOptionName = "b" +) + var cidFmtCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Format and convert a CID in various useful ways.", @@ -44,14 +50,14 @@ The optional format string is a printf style format string: cmdkit.StringArg("cid", true, true, "Cids to format.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.StringOption("f", "Printf style format string.").WithDefault("%s"), - cmdkit.StringOption("v", "CID version to convert to."), - cmdkit.StringOption("b", "Multibase to display CID in."), + cmdkit.StringOption(cidFormatOptionName, "Printf style format string.").WithDefault("%s"), + cmdkit.StringOption(cidVerisonOptionName, "CID version to convert to."), + cmdkit.StringOption(cidMultibaseOptionName, "Multibase to display CID in."), }, Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { - fmtStr, _ := req.Options["f"].(string) - verStr, _ := req.Options["v"].(string) - baseStr, _ := req.Options["b"].(string) + fmtStr, _ := req.Options[cidFormatOptionName].(string) + verStr, _ := req.Options[cidVerisonOptionName].(string) + baseStr, _ := req.Options[cidMultibaseOptionName].(string) opts := cidFormatOpts{} @@ -216,13 +222,18 @@ type CodeAndName struct { Name string } +const ( + prefixOptionName = "prefix" + numericOptionName = "numeric" +) + var basesCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List available multibase encodings.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("prefix", "also include the single leter prefixes in addition to the code"), - cmdkit.BoolOption("numeric", "also include numeric codes"), + cmdkit.BoolOption(prefixOptionName, "also include the single leter prefixes in addition to the code"), + cmdkit.BoolOption(numericOptionName, "also include numeric codes"), }, Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { var res []CodeAndName @@ -235,8 +246,8 @@ var basesCmd = &cmds.Command{ }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { - prefixes, _ := req.Options["prefix"].(bool) - numeric, _ := req.Options["numeric"].(bool) + prefixes, _ := req.Options[prefixOptionName].(bool) + numeric, _ := req.Options[numericOptionName].(bool) val, ok := val0.([]CodeAndName) if !ok { return e.TypeErr(val, val0) @@ -265,12 +276,16 @@ var basesCmd = &cmds.Command{ Type: []CodeAndName{}, } +const ( + codecsNumericOptionName = "numeric" +) + var codecsCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List available CID codecs.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("numeric", "also include numeric codes"), + cmdkit.BoolOption(codecsNumericOptionName, "also include numeric codes"), }, Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error { var res []CodeAndName @@ -283,7 +298,7 @@ var codecsCmd = &cmds.Command{ }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, val0 interface{}) error { - numeric, _ := req.Options["numeric"].(bool) + numeric, _ := req.Options[codecsNumericOptionName].(bool) val, ok := val0.([]CodeAndName) if !ok { return e.TypeErr(val, val0) diff --git a/core/commands/config.go b/core/commands/config.go index e0c8534ad44..9d847634495 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -25,6 +25,11 @@ type ConfigField struct { Value interface{} } +const ( + configBoolOptionName = "bool" + configJsonOptionName = "json" +) + var ConfigCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Get and set ipfs config values.", @@ -54,8 +59,8 @@ Set the value of the 'Datastore.Path' key: cmdkit.StringArg("value", false, false, "The value to set the config entry to."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("bool", "Set a boolean value."), - cmdkit.BoolOption("json", "Parse stringified JSON."), + cmdkit.BoolOption(configBoolOptionName, "Set a boolean value."), + cmdkit.BoolOption(configJsonOptionName, "Parse stringified JSON."), }, Run: func(req cmds.Request, res cmds.Response) { args := req.Arguments() @@ -87,7 +92,7 @@ Set the value of the 'Datastore.Path' key: if len(args) == 2 { value := args[1] - if parseJson, _, _ := req.Option("json").Bool(); parseJson { + if parseJson, _, _ := req.Option(configJsonOptionName).Bool(); parseJson { var jsonVal interface{} if err := json.Unmarshal([]byte(value), &jsonVal); err != nil { err = fmt.Errorf("failed to unmarshal json. %s", err) @@ -96,7 +101,7 @@ Set the value of the 'Datastore.Path' key: } output, err = setConfig(r, key, jsonVal) - } else if isbool, _, _ := req.Option("bool").Bool(); isbool { + } else if isbool, _, _ := req.Option(configBoolOptionName).Bool(); isbool { output, err = setConfig(r, key, value == "true") } else { output, err = setConfig(r, key, value) diff --git a/core/commands/dht.go b/core/commands/dht.go index 60ad2501b2a..e1e6bf08c87 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -44,6 +44,10 @@ var DhtCmd = &cmds.Command{ }, } +const ( + dhtVerboseOptionName = "v" +) + var queryDhtCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Find the closest Peer IDs to a given Peer ID by querying the DHT.", @@ -54,7 +58,7 @@ var queryDhtCmd = &cmds.Command{ cmdkit.StringArg("peerID", true, true, "The peerID to run the query against."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -128,7 +132,7 @@ var queryDhtCmd = &cmds.Command{ return nil, e.TypeErr(obj, v) } - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() buf := new(bytes.Buffer) printEvent(obj, buf, verbose, pfm) @@ -139,6 +143,10 @@ var queryDhtCmd = &cmds.Command{ Type: notif.QueryEvent{}, } +const ( + numProvidersOptionName = "num-providers" +) + var findProvidersDhtCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Find peers that can provide a specific value, given a key.", @@ -149,8 +157,8 @@ var findProvidersDhtCmd = &cmds.Command{ cmdkit.StringArg("key", true, true, "The key to find providers for."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), - cmdkit.IntOption("num-providers", "n", "The number of providers to find.").WithDefault(20), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), + cmdkit.IntOption(numProvidersOptionName, "n", "The number of providers to find.").WithDefault(20), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -164,7 +172,7 @@ var findProvidersDhtCmd = &cmds.Command{ return } - numProviders, _, err := res.Request().Option("num-providers").Int() + numProviders, _, err := res.Request().Option(numProvidersOptionName).Int() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -232,7 +240,7 @@ var findProvidersDhtCmd = &cmds.Command{ } return func(res cmds.Response) (io.Reader, error) { - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() v, err := unwrapOutput(res.Output()) if err != nil { return nil, err @@ -252,6 +260,10 @@ var findProvidersDhtCmd = &cmds.Command{ Type: notif.QueryEvent{}, } +const ( + recursiveOptionName = "recursive" +) + var provideRefDhtCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Announce to the network that you are providing given values.", @@ -261,8 +273,8 @@ var provideRefDhtCmd = &cmds.Command{ cmdkit.StringArg("key", true, true, "The key[s] to send provide records for.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), - cmdkit.BoolOption("recursive", "r", "Recursively provide entire graph."), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), + cmdkit.BoolOption(recursiveOptionName, "r", "Recursively provide entire graph."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -281,7 +293,7 @@ var provideRefDhtCmd = &cmds.Command{ return } - rec, _, _ := req.Option("recursive").Bool() + rec, _, _ := req.Option(recursiveOptionName).Bool() var cids []cid.Cid for _, arg := range req.Arguments() { @@ -349,7 +361,7 @@ var provideRefDhtCmd = &cmds.Command{ } return func(res cmds.Response) (io.Reader, error) { - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() v, err := unwrapOutput(res.Output()) if err != nil { return nil, err @@ -414,7 +426,7 @@ var findPeerDhtCmd = &cmds.Command{ cmdkit.StringArg("peerID", true, true, "The ID of the peer to search for."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -480,7 +492,7 @@ var findPeerDhtCmd = &cmds.Command{ } return func(res cmds.Response) (io.Reader, error) { - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() v, err := unwrapOutput(res.Output()) if err != nil { return nil, err @@ -519,7 +531,7 @@ Different key types can specify other 'best' rules. cmdkit.StringArg("key", true, true, "The key to find a value for."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -584,7 +596,7 @@ Different key types can specify other 'best' rules. } return func(res cmds.Response) (io.Reader, error) { - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() v, err := unwrapOutput(res.Output()) if err != nil { return nil, err @@ -633,7 +645,7 @@ NOTE: A value may not exceed 2048 bytes. cmdkit.StringArg("value", true, false, "The value to store.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "Print extra information."), + cmdkit.BoolOption("verbose", dhtVerboseOptionName, "Print extra information."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -697,7 +709,7 @@ NOTE: A value may not exceed 2048 bytes. } return func(res cmds.Response) (io.Reader, error) { - verbose, _, _ := res.Request().Option("v").Bool() + verbose, _, _ := res.Request().Option(dhtVerboseOptionName).Bool() v, err := unwrapOutput(res.Output()) if err != nil { return nil, err diff --git a/core/commands/dns.go b/core/commands/dns.go index 2353ee7ec65..236630813c4 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -13,6 +13,10 @@ import ( "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) +const ( + dnsRecursiveOptionName = "recursive" +) + var DNSCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Resolve DNS links.", @@ -51,11 +55,11 @@ The resolver can recursively resolve: cmdkit.StringArg("domain-name", true, false, "The domain-name name to resolve.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("recursive", "r", "Resolve until the result is not a DNS link."), + cmdkit.BoolOption(dnsRecursiveOptionName, "r", "Resolve until the result is not a DNS link."), }, Run: func(req cmds.Request, res cmds.Response) { - recursive, _, _ := req.Option("recursive").Bool() + recursive, _, _ := req.Option(dnsRecursiveOptionName).Bool() name := req.Arguments()[0] resolver := namesys.NewDNSResolver() diff --git a/core/commands/files.go b/core/commands/files.go index f0804c5d5a8..fb90df32ce7 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -69,8 +69,13 @@ operations. }, } -var cidVersionOption = cmdkit.IntOption("cid-version", "cid-ver", "Cid version to use. (experimental)") -var hashOption = cmdkit.StringOption("hash", "Hash function to use. Will set Cid version to 1 if used. (experimental)") +const ( + filesCidVersionOptionName = "cid-version" + filesHashOptionName = "hash" +) + +var cidVersionOption = cmdkit.IntOption(filesCidVersionOptionName, "cid-ver", "Cid version to use. (experimental)") +var hashOption = cmdkit.StringOption(filesHashOptionName, "Hash function to use. Will set Cid version to 1 if used. (experimental)") var errFormat = errors.New("format was set by multiple options. Only one format option is allowed") @@ -85,11 +90,16 @@ type statOutput struct { SizeLocal uint64 `json:",omitempty"` } -const defaultStatFormat = ` +const ( + defaultStatFormat = ` Size: CumulativeSize: ChildBlocks: Type: ` + filesFormatOptionName = "format" + filesSizeOptionName = "size" + filesWithLocalOptionName = "with-local" +) var filesStatCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ @@ -100,11 +110,11 @@ var filesStatCmd = &cmds.Command{ cmdkit.StringArg("path", true, false, "Path to node to stat."), }, Options: []cmdkit.Option{ - cmdkit.StringOption("format", "Print statistics in given format. Allowed tokens: "+ + cmdkit.StringOption(filesFormatOptionName, "Print statistics in given format. Allowed tokens: "+ " . Conflicts with other format options.").WithDefault(defaultStatFormat), - cmdkit.BoolOption("hash", "Print only hash. Implies '--format='. Conflicts with other format options."), - cmdkit.BoolOption("size", "Print only size. Implies '--format='. Conflicts with other format options."), - cmdkit.BoolOption("with-local", "Compute the amount of the dag that is local, and if possible the total size"), + cmdkit.BoolOption(filesHashOptionName, "Print only hash. Implies '--format='. Conflicts with other format options."), + cmdkit.BoolOption(filesSizeOptionName, "Print only size. Implies '--format='. Conflicts with other format options."), + cmdkit.BoolOption(filesWithLocalOptionName, "Compute the amount of the dag that is local, and if possible the total size"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { @@ -128,7 +138,7 @@ var filesStatCmd = &cmds.Command{ return err } - withLocal, _ := req.Options["with-local"].(bool) + withLocal, _ := req.Options[filesWithLocalOptionName].(bool) var dagserv ipld.DAGService if withLocal { @@ -199,9 +209,9 @@ func moreThanOne(a, b, c bool) bool { func statGetFormatOptions(req *cmds.Request) (string, error) { - hash, _ := req.Options["hash"].(bool) - size, _ := req.Options["size"].(bool) - format, _ := req.Options["format"].(string) + hash, _ := req.Options[filesHashOptionName].(bool) + size, _ := req.Options[filesSizeOptionName].(bool) + format, _ := req.Options[filesFormatOptionName].(string) if moreThanOne(hash, size, format != defaultStatFormat) { return "", errFormat @@ -380,6 +390,11 @@ type filesLsOutput struct { Entries []mfs.NodeListing } +const ( + longOptionName = "l" + dontSortOptionName = "U" +) + var filesLsCmd = &oldcmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List directories in the local mutable namespace.", @@ -405,8 +420,8 @@ Examples: cmdkit.StringArg("path", false, false, "Path to show listing for. Defaults to '/'."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("l", "Use long listing format."), - cmdkit.BoolOption("U", "Do not sort; list entries in directory order."), + cmdkit.BoolOption(longOptionName, "Use long listing format."), + cmdkit.BoolOption(dontSortOptionName, "Do not sort; list entries in directory order."), }, Run: func(req oldcmds.Request, res oldcmds.Response) { var arg string @@ -435,7 +450,7 @@ Examples: return } - long, _, _ := req.Option("l").Bool() + long, _, _ := req.Option(longOptionName).Bool() switch fsn := fsn.(type) { case *mfs.Directory: @@ -502,14 +517,14 @@ Examples: buf := new(bytes.Buffer) - noSort, _, _ := res.Request().Option("U").Bool() + noSort, _, _ := res.Request().Option(dontSortOptionName).Bool() if !noSort { sort.Slice(out.Entries, func(i, j int) bool { return strings.Compare(out.Entries[i].Name, out.Entries[j].Name) < 0 }) } - long, _, _ := res.Request().Option("l").Bool() + long, _, _ := res.Request().Option(longOptionName).Bool() for _, o := range out.Entries { if long { fmt.Fprintf(buf, "%s\t%s\t%d\n", o.Name, o.Hash, o.Size) @@ -523,6 +538,11 @@ Examples: Type: filesLsOutput{}, } +const ( + filesOffsetOptionName = "offset" + filesCountOptionName = "count" +) + var filesReadCmd = &oldcmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Read a file in a given mfs.", @@ -541,8 +561,8 @@ Examples: cmdkit.StringArg("path", true, false, "Path to file to be read."), }, Options: []cmdkit.Option{ - cmdkit.IntOption("offset", "o", "Byte offset to begin reading from."), - cmdkit.IntOption("count", "n", "Maximum number of bytes to read."), + cmdkit.IntOption(filesOffsetOptionName, "o", "Byte offset to begin reading from."), + cmdkit.IntOption(filesCountOptionName, "n", "Maximum number of bytes to read."), }, Run: func(req oldcmds.Request, res oldcmds.Response) { n, err := req.InvocContext().GetNode() @@ -577,7 +597,7 @@ Examples: defer rfd.Close() - offset, _, err := req.Option("offset").Int() + offset, _, err := req.Option(offsetOptionName).Int() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -605,7 +625,7 @@ Examples: } var r io.Reader = &contextReaderWrapper{R: rfd, ctx: req.Context()} - count, found, err := req.Option("count").Int() + count, found, err := req.Option(filesCountOptionName).Int() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -680,6 +700,14 @@ Example: }, } +const ( + filesCreateOptionName = "create" + filesParentsOptionName = "parents" + filesTruncateOptionName = "truncate" + filesRawLeavesOptionName = "raw-leaves" + filesFlushOptionName = "flush" +) + var filesWriteCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Write to a mutable file in a given filesystem.", @@ -719,12 +747,12 @@ stat' on the file or any of its ancestors. cmdkit.FileArg("data", true, false, "Data to write.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.IntOption("offset", "o", "Byte offset to begin writing at."), - cmdkit.BoolOption("create", "e", "Create the file if it does not exist."), - cmdkit.BoolOption("parents", "p", "Make parent directories as needed."), - cmdkit.BoolOption("truncate", "t", "Truncate the file to size zero before writing."), - cmdkit.IntOption("count", "n", "Maximum number of bytes to read."), - cmdkit.BoolOption("raw-leaves", "Use raw blocks for newly created leaf nodes. (experimental)"), + cmdkit.IntOption(filesOffsetOptionName, "o", "Byte offset to begin writing at."), + cmdkit.BoolOption(filesCreateOptionName, "e", "Create the file if it does not exist."), + cmdkit.BoolOption(filesParentsOptionName, "p", "Make parent directories as needed."), + cmdkit.BoolOption(filesTruncateOptionName, "t", "Truncate the file to size zero before writing."), + cmdkit.IntOption(filesCountOptionName, "n", "Maximum number of bytes to read."), + cmdkit.BoolOption(filesRawLeavesOptionName, "Use raw blocks for newly created leaf nodes. (experimental)"), cidVersionOption, hashOption, }, @@ -734,11 +762,11 @@ stat' on the file or any of its ancestors. return err } - create, _ := req.Options["create"].(bool) - mkParents, _ := req.Options["parents"].(bool) - trunc, _ := req.Options["truncate"].(bool) - flush, _ := req.Options["flush"].(bool) - rawLeaves, rawLeavesDef := req.Options["raw-leaves"].(bool) + create, _ := req.Options[filesCreateOptionName].(bool) + mkParents, _ := req.Options[filesParentsOptionName].(bool) + trunc, _ := req.Options[filesTruncateOptionName].(bool) + flush, _ := req.Options[filesFlushOptionName].(bool) + rawLeaves, rawLeavesDef := req.Options[filesRawLeavesOptionName].(bool) prefix, err := getPrefixNew(req) if err != nil { @@ -750,7 +778,7 @@ stat' on the file or any of its ancestors. return err } - offset, _ := req.Options["offset"].(int) + offset, _ := req.Options[filesOffsetOptionName].(int) if offset < 0 { return fmt.Errorf("cannot have negative write offset") } @@ -792,7 +820,7 @@ stat' on the file or any of its ancestors. } } - count, countfound := req.Options["count"].(int) + count, countfound := req.Options[filesCountOptionName].(int) if countfound && count < 0 { return fmt.Errorf("cannot have negative byte count") } @@ -840,7 +868,7 @@ Examples: cmdkit.StringArg("path", true, false, "Path to dir to make."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("parents", "p", "No error if existing, make parent directories as needed."), + cmdkit.BoolOption(filesParentsOptionName, "p", "No error if existing, make parent directories as needed."), cidVersionOption, hashOption, }, @@ -851,14 +879,14 @@ Examples: return } - dashp, _, _ := req.Option("parents").Bool() + dashp, _, _ := req.Option(filesParentsOptionName).Bool() dirtomake, err := checkPath(req.Arguments()[0]) if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - flush, _, _ := req.Option("flush").Bool() + flush, _, _ := req.Option(filesFlushOptionName).Bool() prefix, err := getPrefix(req) if err != nil { @@ -940,7 +968,7 @@ Change the cid version or hash function of the root node of a given path. path = req.Arguments()[0] } - flush, _, _ := req.Option("flush").Bool() + flush, _, _ := req.Option(filesFlushOptionName).Bool() prefix, err := getPrefix(req) if err != nil { @@ -1096,8 +1124,8 @@ Remove files or directories. } func getPrefixNew(req *cmds.Request) (cid.Builder, error) { - cidVer, cidVerSet := req.Options["cid-version"].(int) - hashFunStr, hashFunSet := req.Options["hash"].(string) + cidVer, cidVerSet := req.Options[filesCidVersionOptionName].(int) + hashFunStr, hashFunSet := req.Options[filesHashOptionName].(string) if !cidVerSet && !hashFunSet { return nil, nil @@ -1125,8 +1153,8 @@ func getPrefixNew(req *cmds.Request) (cid.Builder, error) { } func getPrefix(req oldcmds.Request) (cid.Builder, error) { - cidVer, cidVerSet, _ := req.Option("cid-version").Int() - hashFunStr, hashFunSet, _ := req.Option("hash").String() + cidVer, cidVerSet, _ := req.Option(filesCidVersionOptionName).Int() + hashFunStr, hashFunSet, _ := req.Option(filesHashOptionName).String() if !cidVerSet && !hashFunSet { return nil, nil diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 1a78dd761f1..0376c8ead8a 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -28,6 +28,10 @@ var FileStoreCmd = &cmds.Command{ }, } +const ( + fileOrderOptionName = "file-order" +) + var lsFileStore = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List objects in filestore.", @@ -46,7 +50,7 @@ The output is: cmdkit.StringArg("obj", false, true, "Cid of objects to list."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("file-order", "sort the results based on the path of the backing file"), + cmdkit.BoolOption(fileOrderOptionName, "sort the results based on the path of the backing file"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { _, fs, err := getFilestore(env) @@ -62,7 +66,7 @@ The output is: return res.Emit(out) } - fileOrder, _ := req.Options["file-order"].(bool) + fileOrder, _ := req.Options[fileOrderOptionName].(bool) next, err := filestore.ListAll(fs, fileOrder) if err != nil { return err @@ -112,7 +116,7 @@ For ERROR entries the error will also be printed to stderr. cmdkit.StringArg("obj", false, true, "Cid of objects to verify."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("file-order", "verify the objects based on the order of the backing file"), + cmdkit.BoolOption(fileOrderOptionName, "verify the objects based on the order of the backing file"), }, Run: func(req oldCmds.Request, res oldCmds.Response) { _, fs, err := getFilestore(req.InvocContext()) @@ -127,7 +131,7 @@ For ERROR entries the error will also be printed to stderr. }) res.SetOutput(out) } else { - fileOrder, _, _ := req.Option("file-order").Bool() + fileOrder, _, _ := req.Option(fileOrderOptionName).Bool() next, err := filestore.VerifyAll(fs, fileOrder) if err != nil { res.SetError(err, cmdkit.ErrNormal) diff --git a/core/commands/get.go b/core/commands/get.go index cd82591b901..7dcce0eeec5 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -24,6 +24,13 @@ import ( var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") +const ( + outputOptionName = "output" + archiveOptionName = "archive" + compressOptionName = "compress" + compressionLevelOptionName = "compression-level" +) + var GetCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Download IPFS objects.", @@ -44,10 +51,10 @@ may also specify the level of compression by specifying '-l=<1-9>'. cmdkit.StringArg("ipfs-path", true, false, "The path to the IPFS object(s) to be outputted.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.StringOption("output", "o", "The path where the output should be stored."), - cmdkit.BoolOption("archive", "a", "Output a TAR archive."), - cmdkit.BoolOption("compress", "C", "Compress the output with GZIP compression."), - cmdkit.IntOption("compression-level", "l", "The level of compression (1-9)."), + cmdkit.StringOption(outputOptionName, "o", "The path where the output should be stored."), + cmdkit.BoolOption(archiveOptionName, "a", "Output a TAR archive."), + cmdkit.BoolOption(compressOptionName, "C", "Compress the output with GZIP compression."), + cmdkit.IntOption(compressionLevelOptionName, "l", "The level of compression (1-9)."), }, PreRun: func(req *cmds.Request, env cmds.Environment) error { _, err := getCompressOptions(req) @@ -84,7 +91,7 @@ may also specify the level of compression by specifying '-l=<1-9>'. return err } - archive, _ := req.Options["archive"].(bool) + archive, _ := req.Options[archiveOptionName].(bool) reader, err := uarchive.DagArchive(ctx, dn, p.String(), node.DAG, archive, cmplvl) if err != nil { return err @@ -113,7 +120,7 @@ may also specify the level of compression by specifying '-l=<1-9>'. return err } - archive, _ := req.Options["archive"].(bool) + archive, _ := req.Options[archiveOptionName].(bool) gw := getWriter{ Out: os.Stdout, @@ -165,7 +172,7 @@ func makeProgressBar(out io.Writer, l int64) *pb.ProgressBar { } func getOutPath(req *cmds.Request) string { - outPath, _ := req.Options["output"].(string) + outPath, _ := req.Options[outputOptionName].(string) if outPath == "" { trimmed := strings.TrimRight(req.Arguments[0], "/") _, outPath = filepath.Split(trimmed) @@ -233,8 +240,8 @@ func (gw *getWriter) writeExtracted(r io.Reader, fpath string) error { } func getCompressOptions(req *cmds.Request) (int, error) { - cmprs, _ := req.Options["compress"].(bool) - cmplvl, cmplvlFound := req.Options["compression-level"].(int) + cmprs, _ := req.Options[compressOptionName].(bool) + cmplvl, cmplvlFound := req.Options[compressionLevelOptionName].(int) switch { case !cmprs: return gzip.NoCompression, nil diff --git a/core/commands/id.go b/core/commands/id.go index 1d6417a4ee3..1e5ee52fc93 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -37,6 +37,10 @@ type IdOutput struct { ProtocolVersion string } +const ( + formatOptionName = "format" +) + var IDCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Show ipfs node id info.", @@ -60,7 +64,7 @@ EXAMPLE: cmdkit.StringArg("peerid", false, false, "Peer.ID of node to look up."), }, Options: []cmdkit.Option{ - cmdkit.StringOption("format", "f", "Optional output format."), + cmdkit.StringOption(formatOptionName, "f", "Optional output format."), }, Run: func(req cmds.Request, res cmds.Response) { node, err := req.InvocContext().GetNode() @@ -126,7 +130,7 @@ EXAMPLE: return nil, e.TypeErr(val, v) } - format, found, err := res.Request().Option("format").String() + format, found, err := res.Request().Option(formatOptionName).String() if err != nil { return nil, err } diff --git a/core/commands/keystore.go b/core/commands/keystore.go index e163a2a93f2..f900f619503 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -55,13 +55,18 @@ type KeyRenameOutput struct { Overwrite bool } +const ( + keyStoreTypeOptionName = "type" + keyStoreSizeOptionName = "size" +) + var keyGenCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Create a new keypair", }, Options: []cmdkit.Option{ - cmdkit.StringOption("type", "t", "type of the key to create [rsa, ed25519]"), - cmdkit.IntOption("size", "s", "size of the key to generate"), + cmdkit.StringOption(keyStoreTypeOptionName, "t", "type of the key to create [rsa, ed25519]"), + cmdkit.IntOption(keyStoreSizeOptionName, "s", "size of the key to generate"), }, Arguments: []cmdkit.Argument{ cmdkit.StringArg("name", true, false, "name of key to create"), @@ -72,7 +77,7 @@ var keyGenCmd = &cmds.Command{ return err } - typ, f := req.Options["type"].(string) + typ, f := req.Options[keyStoreTypeOptionName].(string) if !f { return fmt.Errorf("please specify a key type with --type") } @@ -84,7 +89,7 @@ var keyGenCmd = &cmds.Command{ opts := []options.KeyGenerateOption{options.Key.Type(typ)} - size, sizefound := req.Options["size"].(int) + size, sizefound := req.Options[keyStoreSizeOptionName].(int) if sizefound { opts = append(opts, options.Key.Size(size)) } @@ -146,6 +151,10 @@ var keyListCmd = &cmds.Command{ Type: KeyOutputList{}, } +const ( + keyStoreForceOptionName = "force" +) + var keyRenameCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Rename a keypair", @@ -155,7 +164,7 @@ var keyRenameCmd = &cmds.Command{ cmdkit.StringArg("newName", true, false, "new name of the key"), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("force", "f", "Allow to overwrite an existing key."), + cmdkit.BoolOption(keyStoreForceOptionName, "f", "Allow to overwrite an existing key."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) @@ -165,7 +174,7 @@ var keyRenameCmd = &cmds.Command{ name := req.Arguments[0] newName := req.Arguments[1] - force, _ := req.Options["force"].(bool) + force, _ := req.Options[keyStoreForceOptionName].(bool) key, overwritten, err := api.Key().Rename(req.Context, name, newName, options.Key.Force(force)) if err != nil { diff --git a/core/commands/ls.go b/core/commands/ls.go index 1d72474bb35..9add52d5a04 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -36,6 +36,11 @@ type LsOutput struct { Objects []LsObject } +const ( + lsHeadersOptionNameTime = "headers" + lsResolveTypeOptionName = "resolve-type" +) + var LsCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List directory contents for Unix filesystem objects.", @@ -53,8 +58,8 @@ The JSON output contains type information. cmdkit.StringArg("ipfs-path", true, true, "The path to the IPFS object(s) to list links from.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("headers", "v", "Print table headers (Hash, Size, Name)."), - cmdkit.BoolOption("resolve-type", "Resolve linked objects to find out their types.").WithDefault(true), + cmdkit.BoolOption(lsHeadersOptionNameTime, "v", "Print table headers (Hash, Size, Name)."), + cmdkit.BoolOption(lsResolveTypeOptionName, "Resolve linked objects to find out their types.").WithDefault(true), }, Run: func(req cmds.Request, res cmds.Response) { nd, err := req.InvocContext().GetNode() @@ -70,12 +75,12 @@ The JSON output contains type information. } // get options early -> exit early in case of error - if _, _, err := req.Option("headers").Bool(); err != nil { + if _, _, err := req.Option(lsHeadersOptionNameTime).Bool(); err != nil { res.SetError(err, cmdkit.ErrNormal) return } - resolve, _, err := req.Option("resolve-type").Bool() + resolve, _, err := req.Option(lsResolveTypeOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -178,7 +183,7 @@ The JSON output contains type information. return nil, err } - headers, _, _ := res.Request().Option("headers").Bool() + headers, _, _ := res.Request().Option(lsHeadersOptionNameTime).Bool() output, ok := v.(*LsOutput) if !ok { return nil, e.TypeErr(output, v) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index 38521eeab9f..543fe5d558c 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -53,10 +53,6 @@ type P2PStreamsOutput struct { const ( allowCustomProtocolOptionName = "allow-custom-protocol" - allOptionName = "all" - protocolOptionName = "protocol" - listenAddressOptionName = "listen-address" - targetAddressOptionName = "target-address" ) var resolveTimeout = 10 * time.Second @@ -258,12 +254,16 @@ func forwardLocal(ctx context.Context, p *p2p.P2P, ps pstore.Peerstore, proto pr return err } +const ( + p2pHeadersOptionName = "headers" +) + var p2pLsCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List active p2p listeners.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("headers", "v", "Print table headers (Protocol, Listen, Target)."), + cmdkit.BoolOption(p2pHeadersOptionName, "v", "Print table headers (Protocol, Listen, Target)."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -304,7 +304,7 @@ var p2pLsCmd = &cmds.Command{ return nil, err } - headers, _, _ := res.Request().Option("headers").Bool() + headers, _, _ := res.Request().Option(p2pHeadersOptionName).Bool() list := v.(*P2PLsOutput) buf := new(bytes.Buffer) w := tabwriter.NewWriter(buf, 1, 2, 1, ' ', 0) @@ -322,15 +322,22 @@ var p2pLsCmd = &cmds.Command{ }, } +const ( + p2pAllOptionName = "all" + p2pProtocolOptionName = "protocol" + p2pListenAddressOptionName = "listen-address" + p2pTargetAddressOptionName = "target-address" +) + var p2pCloseCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Stop listening for new connections to forward.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption(allOptionName, "a", "Close all listeners."), - cmdkit.StringOption(protocolOptionName, "p", "Match protocol name"), - cmdkit.StringOption(listenAddressOptionName, "l", "Match listen address"), - cmdkit.StringOption(targetAddressOptionName, "t", "Match target address"), + cmdkit.BoolOption(p2pAllOptionName, "a", "Close all listeners."), + cmdkit.StringOption(p2pProtocolOptionName, "p", "Match protocol name"), + cmdkit.StringOption(p2pListenAddressOptionName, "l", "Match listen address"), + cmdkit.StringOption(p2pTargetAddressOptionName, "t", "Match target address"), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -339,10 +346,10 @@ var p2pCloseCmd = &cmds.Command{ return } - closeAll, _, _ := req.Option(allOptionName).Bool() - protoOpt, p, _ := req.Option(protocolOptionName).String() - listenOpt, l, _ := req.Option(listenAddressOptionName).String() - targetOpt, t, _ := req.Option(targetAddressOptionName).String() + closeAll, _, _ := req.Option(p2pAllOptionName).Bool() + protoOpt, p, _ := req.Option(p2pProtocolOptionName).String() + listenOpt, l, _ := req.Option(p2pListenAddressOptionName).String() + targetOpt, t, _ := req.Option(p2pTargetAddressOptionName).String() proto := protocol.ID(protoOpt) @@ -428,7 +435,7 @@ var p2pStreamLsCmd = &cmds.Command{ Tagline: "List active p2p streams.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("headers", "v", "Print table headers (ID, Protocol, Local, Remote)."), + cmdkit.BoolOption(p2pHeadersOptionName, "v", "Print table headers (ID, Protocol, Local, Remote)."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := p2pGetNode(req) @@ -462,7 +469,7 @@ var p2pStreamLsCmd = &cmds.Command{ return nil, err } - headers, _, _ := res.Request().Option("headers").Bool() + headers, _, _ := res.Request().Option(p2pHeadersOptionName).Bool() list := v.(*P2PStreamsOutput) buf := new(bytes.Buffer) w := tabwriter.NewWriter(buf, 1, 2, 1, ' ', 0) @@ -488,7 +495,7 @@ var p2pStreamCloseCmd = &cmds.Command{ cmdkit.StringArg("id", false, false, "Stream identifier"), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("all", "a", "Close all streams."), + cmdkit.BoolOption(p2pAllOptionName, "a", "Close all streams."), }, Run: func(req cmds.Request, res cmds.Response) { res.SetOutput(nil) @@ -499,7 +506,7 @@ var p2pStreamCloseCmd = &cmds.Command{ return } - closeAll, _, _ := req.Option("all").Bool() + closeAll, _, _ := req.Option(p2pAllOptionName).Bool() var handlerID uint64 if !closeAll { diff --git a/core/commands/pin.go b/core/commands/pin.go index 667722d2403..ffe7633a469 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -46,6 +46,11 @@ type AddPinOutput struct { Progress int `json:",omitempty"` } +const ( + pinRecursiveOptionName = "recursive" + pinProgressOptionName = "progress" +) + var addPinCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Pin objects to local storage.", @@ -56,8 +61,8 @@ var addPinCmd = &cmds.Command{ cmdkit.StringArg("ipfs-path", true, true, "Path to object(s) to be pinned.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("recursive", "r", "Recursively pin the object linked to by the specified object(s).").WithDefault(true), - cmdkit.BoolOption("progress", "Show progress"), + cmdkit.BoolOption(pinRecursiveOptionName, "r", "Recursively pin the object linked to by the specified object(s).").WithDefault(true), + cmdkit.BoolOption(pinProgressOptionName, "Show progress"), }, Type: AddPinOutput{}, Run: func(req cmds.Request, res cmds.Response) { @@ -76,12 +81,12 @@ var addPinCmd = &cmds.Command{ defer n.Blockstore.PinLock().Unlock() // set recursive flag - recursive, _, err := req.Option("recursive").Bool() + recursive, _, err := req.Option(pinRecursiveOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - showProgress, _, _ := req.Option("progress").Bool() + showProgress, _, _ := req.Option(pinProgressOptionName).Bool() if !showProgress { added, err := corerepo.Pin(n, api, req.Context(), req.Arguments(), recursive) @@ -188,7 +193,7 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) cmdkit.StringArg("ipfs-path", true, true, "Path to object(s) to be unpinned.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("recursive", "r", "Recursively unpin the object linked to by the specified object(s).").WithDefault(true), + cmdkit.BoolOption(pinRecursiveOptionName, "r", "Recursively unpin the object linked to by the specified object(s).").WithDefault(true), }, Type: PinOutput{}, Run: func(req cmds.Request, res cmds.Response) { @@ -205,7 +210,7 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) } // set recursive flag - recursive, _, err := req.Option("recursive").Bool() + recursive, _, err := req.Option(pinRecursiveOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -240,6 +245,11 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) }, } +const ( + pinTypeOptionName = "type" + pinQuietOptionName = "quiet" +) + var listPinCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List objects pinned to local storage.", @@ -288,8 +298,8 @@ Example: cmdkit.StringArg("ipfs-path", false, true, "Path to object(s) to be listed."), }, Options: []cmdkit.Option{ - cmdkit.StringOption("type", "t", "The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\".").WithDefault("all"), - cmdkit.BoolOption("quiet", "q", "Write just hashes of objects."), + cmdkit.StringOption(pinTypeOptionName, "t", "The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\".").WithDefault("all"), + cmdkit.BoolOption(pinQuietOptionName, "q", "Write just hashes of objects."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -304,7 +314,7 @@ Example: return } - typeStr, _, err := req.Option("type").String() + typeStr, _, err := req.Option(pinTypeOptionName).String() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -340,7 +350,7 @@ Example: return nil, err } - quiet, _, err := res.Request().Option("quiet").Bool() + quiet, _, err := res.Request().Option(pinQuietOptionName).Bool() if err != nil { return nil, err } @@ -362,6 +372,10 @@ Example: }, } +const ( + pinUnpinOptionName = "unpin" +) + var updatePinCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Update a recursive pin", @@ -377,7 +391,7 @@ new pin and removing the old one. cmdkit.StringArg("to-path", true, false, "Path to new object to be pinned."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("unpin", "Remove the old pin.").WithDefault(true), + cmdkit.BoolOption(pinUnpinOptionName, "Remove the old pin.").WithDefault(true), }, Type: PinOutput{}, Run: func(req cmds.Request, res cmds.Response) { @@ -387,7 +401,7 @@ new pin and removing the old one. return } - unpin, _, err := req.Option("unpin").Bool() + unpin, _, err := req.Option(pinUnpinOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -431,13 +445,17 @@ new pin and removing the old one. }, } +const ( + pinVerboseOptionName = "verbose" +) + var verifyPinCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Verify that recursive pins are complete.", }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "Also write the hashes of non-broken pins."), - cmdkit.BoolOption("quiet", "q", "Write just hashes of broken pins."), + cmdkit.BoolOption(pinVerboseOptionName, "Also write the hashes of non-broken pins."), + cmdkit.BoolOption(pinQuietOptionName, "q", "Write just hashes of broken pins."), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -446,8 +464,8 @@ var verifyPinCmd = &cmds.Command{ return } - verbose, _, _ := res.Request().Option("verbose").Bool() - quiet, _, _ := res.Request().Option("quiet").Bool() + verbose, _, _ := res.Request().Option(pinVerboseOptionName).Bool() + quiet, _, _ := res.Request().Option(pinQuietOptionName).Bool() if verbose && quiet { res.SetError(fmt.Errorf("the --verbose and --quiet options can not be used at the same time"), cmdkit.ErrNormal) @@ -464,7 +482,7 @@ var verifyPinCmd = &cmds.Command{ Type: PinVerifyRes{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { - quiet, _, _ := res.Request().Option("quiet").Bool() + quiet, _, _ := res.Request().Option(pinQuietOptionName).Bool() out, err := unwrapOutput(res.Output()) if err != nil { diff --git a/core/commands/ping.go b/core/commands/ping.go index 5bb328dcea4..e3b5bb08771 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -27,6 +27,10 @@ type PingResult struct { Text string } +const ( + pingCountOptionName = "count" +) + // ErrPingSelf is returned when the user attempts to ping themself. var ErrPingSelf = errors.New("error: can't ping self") @@ -43,7 +47,7 @@ trip latency information. cmdkit.StringArg("peer ID", true, true, "ID of peer to be pinged.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.IntOption("count", "n", "Number of ping messages to send.").WithDefault(10), + cmdkit.IntOption(pingCountOptionName, "n", "Number of ping messages to send.").WithDefault(10), }, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { @@ -97,7 +101,7 @@ trip latency information. n.Peerstore.AddAddr(peerID, addr, pstore.TempAddrTTL) // temporary } - numPings, _, err := req.Option("count").Int() + numPings, _, err := req.Option(pingCountOptionName).Int() if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 446e85d5350..8b633062b1a 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -44,6 +44,10 @@ To use, the daemon must be run with '--enable-pubsub-experiment'. }, } +const ( + pubsubDiscoverOptionName = "discover" +) + var PubsubSubCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Subscribe to messages on a given topic.", @@ -72,7 +76,7 @@ This command outputs data in the following encodings: cmdkit.StringArg("topic", true, false, "String name of topic to subscribe to."), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("discover", "try to discover other peers subscribed to the same topic"), + cmdkit.BoolOption(pubsubDiscoverOptionName, "try to discover other peers subscribed to the same topic"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { n, err := cmdenv.GetNode(env) @@ -96,7 +100,7 @@ This command outputs data in the following encodings: } defer sub.Cancel() - discover, _ := req.Options["discover"].(bool) + discover, _ := req.Options[pubsubDiscoverOptionName].(bool) if discover { go func() { blk := blocks.NewBlock([]byte("floodsub:" + topic)) diff --git a/core/commands/refs.go b/core/commands/refs.go index 1d1218b3f80..b6030972415 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -22,6 +22,14 @@ type KeyList struct { Keys []cid.Cid } +const ( + refsFormatOptionName = "format" + refsEdgesOptionName = "edges" + refsUniqueOptionName = "unique" + refsRecursiveOptionName = "recursive" + refsMaxDepthOptionName = "max-depth" +) + // KeyListTextMarshaler outputs a KeyList as plaintext, one key per line func KeyListTextMarshaler(res cmds.Response) (io.Reader, error) { out, err := unwrapOutput(res.Output()) @@ -60,11 +68,11 @@ NOTE: List all references recursively by using the flag '-r'. cmdkit.StringArg("ipfs-path", true, true, "Path to the object(s) to list refs from.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.StringOption("format", "Emit edges with given format. Available tokens: .").WithDefault(""), - cmdkit.BoolOption("edges", "e", "Emit edge format: ` -> `."), - cmdkit.BoolOption("unique", "u", "Omit duplicate refs from output."), - cmdkit.BoolOption("recursive", "r", "Recursively list links of child nodes."), - cmdkit.IntOption("max-depth", "Only for recursive refs, limits fetch and listing to the given depth").WithDefault(-1), + cmdkit.StringOption(refsFormatOptionName, "Emit edges with given format. Available tokens: .").WithDefault(""), + cmdkit.BoolOption(refsEdgesOptionName, "e", "Emit edge format: ` -> `."), + cmdkit.BoolOption(refsUniqueOptionName, "u", "Omit duplicate refs from output."), + cmdkit.BoolOption(refsRecursiveOptionName, "r", "Recursively list links of child nodes."), + cmdkit.IntOption(refsMaxDepthOptionName, "Only for recursive refs, limits fetch and listing to the given depth").WithDefault(-1), }, Run: func(req cmds.Request, res cmds.Response) { ctx := req.Context() @@ -74,19 +82,19 @@ NOTE: List all references recursively by using the flag '-r'. return } - unique, _, err := req.Option("unique").Bool() + unique, _, err := req.Option(refsUniqueOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - recursive, _, err := req.Option("recursive").Bool() + recursive, _, err := req.Option(refsRecursiveOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - maxDepth, _, err := req.Option("max-depth").Int() + maxDepth, _, err := req.Option(refsMaxDepthOptionName).Int() if err != nil { res.SetError(err, cmdkit.ErrNormal) return @@ -96,13 +104,13 @@ NOTE: List all references recursively by using the flag '-r'. maxDepth = 1 // write only direct refs } - format, _, err := req.Option("format").String() + format, _, err := req.Option(refsFormatOptionName).String() if err != nil { res.SetError(err, cmdkit.ErrNormal) return } - edges, _, err := req.Option("edges").Bool() + edges, _, err := req.Option(refsEdgesOptionName).Bool() if err != nil { res.SetError(err, cmdkit.ErrNormal) return diff --git a/core/commands/repo.go b/core/commands/repo.go index 656b280ebfd..5e2b524f941 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -51,6 +51,11 @@ type GcResult struct { Error string `json:",omitempty"` } +const ( + repoStreamErrorsOptionName = "stream-errors" + repoQuietOptionName = "quiet" +) + var repoGcCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Perform a garbage collection sweep on the repo.", @@ -61,8 +66,8 @@ order to reclaim hard disk space. `, }, Options: []cmdkit.Option{ - cmdkit.BoolOption("stream-errors", "Stream errors."), - cmdkit.BoolOption("quiet", "q", "Write minimal output."), + cmdkit.BoolOption(repoStreamErrorsOptionName, "Stream errors."), + cmdkit.BoolOption(repoQuietOptionName, "q", "Write minimal output."), }, Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error { n, err := cmdenv.GetNode(env) @@ -70,7 +75,7 @@ order to reclaim hard disk space. return err } - streamErrors, _ := req.Options["stream-errors"].(bool) + streamErrors, _ := req.Options[repoStreamErrorsOptionName].(bool) gcOutChan := corerepo.GarbageCollectAsync(n, req.Context) @@ -101,7 +106,7 @@ order to reclaim hard disk space. Type: GcResult{}, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { - quiet, _ := req.Options["quiet"].(bool) + quiet, _ := req.Options[repoQuietOptionName].(bool) obj, ok := v.(*GcResult) if !ok { @@ -124,6 +129,11 @@ order to reclaim hard disk space. }, } +const ( + repoSizeOnlyOptionName = "size-only" + repoHumanOptionName = "human" +) + var repoStatCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Get stats for the currently used repo.", @@ -139,8 +149,8 @@ Version string The repo version. `, }, Options: []cmdkit.Option{ - cmdkit.BoolOption("size-only", "Only report RepoSize and StorageMax."), - cmdkit.BoolOption("human", "Output sizes in MiB."), + cmdkit.BoolOption(repoSizeOnlyOptionName, "Only report RepoSize and StorageMax."), + cmdkit.BoolOption(repoHumanOptionName, "Output sizes in MiB."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { n, err := cmdenv.GetNode(env) @@ -148,7 +158,7 @@ Version string The repo version. return err } - sizeOnly, _ := req.Options["size-only"].(bool) + sizeOnly, _ := req.Options[repoSizeOnlyOptionName].(bool) if sizeOnly { sizeStat, err := corerepo.RepoSize(req.Context, n) if err != nil { @@ -178,8 +188,8 @@ Version string The repo version. wtr := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) defer wtr.Flush() - human, _ := req.Options["human"].(bool) - sizeOnly, _ := req.Options["size-only"].(bool) + human, _ := req.Options[repoHumanOptionName].(bool) + sizeOnly, _ := req.Options[repoSizeOnlyOptionName].(bool) printSize := func(name string, size uint64) { sizeInMiB := size / (1024 * 1024) @@ -360,7 +370,7 @@ var repoVersionCmd = &oldcmds.Command{ }, Options: []cmdkit.Option{ - cmdkit.BoolOption("quiet", "q", "Write minimal output."), + cmdkit.BoolOption(repoQuietOptionName, "q", "Write minimal output."), }, Run: func(req oldcmds.Request, res oldcmds.Response) { res.SetOutput(&RepoVersion{ diff --git a/core/commands/resolve.go b/core/commands/resolve.go index f9a43180724..227136c7b4b 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -20,6 +20,12 @@ import ( "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ) +const ( + resolveRecursiveOptionName = "recursive" + resolveDhtRecordCountOptionName = "dht-record-count" + resolveDhtTimeoutOptionName = "dht-timeout" +) + var ResolveCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Resolve the value of names to IPFS.", @@ -64,9 +70,9 @@ Resolve the value of an IPFS DAG path: cmdkit.StringArg("name", true, false, "The name to resolve.").EnableStdin(), }, Options: []cmdkit.Option{ - cmdkit.BoolOption("recursive", "r", "Resolve until the result is an IPFS name."), - cmdkit.IntOption("dht-record-count", "dhtrc", "Number of records to request for DHT resolution."), - cmdkit.StringOption("dht-timeout", "dhtt", "Max time to collect values during DHT resolution eg \"30s\". Pass 0 for no timeout."), + cmdkit.BoolOption(resolveRecursiveOptionName, "r", "Resolve until the result is an IPFS name."), + cmdkit.IntOption(resolveDhtRecordCountOptionName, "dhtrc", "Number of records to request for DHT resolution."), + cmdkit.StringOption(resolveDhtTimeoutOptionName, "dhtt", "Max time to collect values during DHT resolution eg \"30s\". Pass 0 for no timeout."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) @@ -87,12 +93,12 @@ Resolve the value of an IPFS DAG path: } name := req.Arguments[0] - recursive, _ := req.Options["recursive"].(bool) + recursive, _ := req.Options[resolveRecursiveOptionName].(bool) // the case when ipns is resolved step by step if strings.HasPrefix(name, "/ipns/") && !recursive { - rc, rcok := req.Options["dht-record-count"].(uint) - dhtt, dhttok := req.Options["dht-timeout"].(string) + rc, rcok := req.Options[resolveDhtRecordCountOptionName].(uint) + dhtt, dhttok := req.Options[resolveDhtTimeoutOptionName].(string) ropts := []options.NameResolveOption{ options.Name.ResolveOption(nsopts.Depth(1)), } diff --git a/core/commands/stat.go b/core/commands/stat.go index 7e44af35f2b..a1081bd54ce 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -33,6 +33,13 @@ for your IPFS node.`, }, } +const ( + statPeerOptionName = "peer" + statProtoOptionName = "proto" + statPollOptionName = "poll" + statIntervalOptionName = "interval" +) + var statBwCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Print ipfs bandwidth information.", @@ -71,10 +78,10 @@ Example: `, }, Options: []cmdkit.Option{ - cmdkit.StringOption("peer", "p", "Specify a peer to print bandwidth for."), - cmdkit.StringOption("proto", "t", "Specify a protocol to print bandwidth for."), - cmdkit.BoolOption("poll", "Print bandwidth at an interval."), - cmdkit.StringOption("interval", "i", `Time interval to wait between updating output, if 'poll' is true. + cmdkit.StringOption(statPeerOptionName, "p", "Specify a peer to print bandwidth for."), + cmdkit.StringOption(statProtoOptionName, "t", "Specify a protocol to print bandwidth for."), + cmdkit.BoolOption(statPollOptionName, "Print bandwidth at an interval."), + cmdkit.StringOption(statIntervalOptionName, "i", `Time interval to wait between updating output, if 'poll' is true. This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are: "ns", "us" (or "µs"), "ms", "s", "m", "h".`).WithDefault("1s"), @@ -95,7 +102,7 @@ Example: return fmt.Errorf("bandwidth reporter disabled in config") } - pstr, pfound := req.Options["peer"].(string) + pstr, pfound := req.Options[statPeerOptionName].(string) tstr, tfound := req.Options["proto"].(string) if pfound && tfound { return cmdkit.Errorf(cmdkit.ErrClient, "please only specify peer OR protocol") @@ -110,13 +117,13 @@ Example: pid = checkpid } - timeS, _ := req.Options["interval"].(string) + timeS, _ := req.Options[statIntervalOptionName].(string) interval, err := time.ParseDuration(timeS) if err != nil { return err } - doPoll, _ := req.Options["poll"].(bool) + doPoll, _ := req.Options[statPollOptionName].(bool) for { if pfound { stats := nd.Reporter.GetBandwidthForPeer(pid) @@ -142,7 +149,7 @@ Example: Type: metrics.Stats{}, PostRun: cmds.PostRunMap{ cmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error { - polling, _ := res.Request().Options["poll"].(bool) + polling, _ := res.Request().Options[statPollOptionName].(bool) if polling { fmt.Fprintln(os.Stdout, "Total Up Total Down Rate Up Rate Down") diff --git a/core/commands/swarm.go b/core/commands/swarm.go index d49157c5aaa..4f9c738f5ee 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -52,6 +52,13 @@ ipfs peers in the internet. }, } +const ( + swarmVerboseOptionName = "verbose" + swarmStreamsOptionName = "streams" + swarmLatencyOptionName = "latency" + swarmDirectionOptionName = "direction" +) + var swarmPeersCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "List peers with open connections.", @@ -60,10 +67,10 @@ var swarmPeersCmd = &cmds.Command{ `, }, Options: []cmdkit.Option{ - cmdkit.BoolOption("verbose", "v", "display all extra information"), - cmdkit.BoolOption("streams", "Also list information about open streams for each peer"), - cmdkit.BoolOption("latency", "Also list information about latency to each peer"), - cmdkit.BoolOption("direction", "Also list information about the direction of connection"), + cmdkit.BoolOption(swarmVerboseOptionName, "v", "display all extra information"), + cmdkit.BoolOption(swarmStreamsOptionName, "Also list information about open streams for each peer"), + cmdkit.BoolOption(swarmLatencyOptionName, "Also list information about latency to each peer"), + cmdkit.BoolOption(swarmDirectionOptionName, "Also list information about the direction of connection"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) @@ -71,10 +78,10 @@ var swarmPeersCmd = &cmds.Command{ return err } - verbose, _ := req.Options["verbose"].(bool) - latency, _ := req.Options["latency"].(bool) - streams, _ := req.Options["streams"].(bool) - direction, _ := req.Options["direction"].(bool) + verbose, _ := req.Options[swarmVerboseOptionName].(bool) + latency, _ := req.Options[swarmLatencyOptionName].(bool) + streams, _ := req.Options[swarmStreamsOptionName].(bool) + direction, _ := req.Options[swarmDirectionOptionName].(bool) conns, err := api.Swarm().Peers(req.Context) if err != nil { diff --git a/core/commands/version.go b/core/commands/version.go index 434eec7151a..9886cfe1a6c 100644 --- a/core/commands/version.go +++ b/core/commands/version.go @@ -22,6 +22,13 @@ type VersionOutput struct { Golang string } +const ( + versionNumberOptionName = "number" + versionCommitOptionName = "commit" + versionRepoOptionName = "repo" + versionAllOptionName = "all" +) + var VersionCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Show ipfs version information.", @@ -29,10 +36,10 @@ var VersionCmd = &cmds.Command{ }, Options: []cmdkit.Option{ - cmdkit.BoolOption("number", "n", "Only show the version number."), - cmdkit.BoolOption("commit", "Show the commit hash."), - cmdkit.BoolOption("repo", "Show repo version."), - cmdkit.BoolOption("all", "Show all version information"), + cmdkit.BoolOption(versionNumberOptionName, "n", "Only show the version number."), + cmdkit.BoolOption(versionCommitOptionName, "Show the commit hash."), + cmdkit.BoolOption(versionRepoOptionName, "Show repo version."), + cmdkit.BoolOption(versionAllOptionName, "Show all version information"), }, Run: func(req cmds.Request, res cmds.Response) { res.SetOutput(&VersionOutput{ @@ -55,7 +62,7 @@ var VersionCmd = &cmds.Command{ return nil, e.TypeErr(version, v) } - repo, _, err := res.Request().Option("repo").Bool() + repo, _, err := res.Request().Option(versionRepoOptionName).Bool() if err != nil { return nil, err } @@ -64,7 +71,7 @@ var VersionCmd = &cmds.Command{ return strings.NewReader(version.Repo + "\n"), nil } - commit, _, err := res.Request().Option("commit").Bool() + commit, _, err := res.Request().Option(versionCommitOptionName).Bool() commitTxt := "" if err != nil { return nil, err @@ -73,7 +80,7 @@ var VersionCmd = &cmds.Command{ commitTxt = "-" + version.Commit } - number, _, err := res.Request().Option("number").Bool() + number, _, err := res.Request().Option(versionNumberOptionName).Bool() if err != nil { return nil, err } @@ -81,7 +88,7 @@ var VersionCmd = &cmds.Command{ return strings.NewReader(fmt.Sprintln(version.Version + commitTxt)), nil } - all, _, err := res.Request().Option("all").Bool() + all, _, err := res.Request().Option(versionAllOptionName).Bool() if err != nil { return nil, err } From dee54b36d92a4e773cffa96385d572ff1f34cfab Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Thu, 4 Oct 2018 22:29:27 +0800 Subject: [PATCH 73/85] add test about issue #4978 License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- .../t0600-issues-and-regressions-online.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/sharness/t0600-issues-and-regressions-online.sh b/test/sharness/t0600-issues-and-regressions-online.sh index 6227968de51..7cc66019c1c 100755 --- a/test/sharness/t0600-issues-and-regressions-online.sh +++ b/test/sharness/t0600-issues-and-regressions-online.sh @@ -59,5 +59,29 @@ test_expect_success "ipfs daemon --offline --mount fails - #2995" ' test_fsh cat daemon_err ' +test_launch_ipfs_daemon --offline + +test_expect_success "'ipfs name resolve' succeeds after ipfs id when daemon offline" ' + PEERID=`ipfs id --format=""` && + test_check_peerid "${PEERID}" && + ipfs name publish --allow-offline -Q "/ipfs/$HASH_WELCOME_DOCS" >publish_out +' + +test_expect_success "pubrmlish --quieter output looks good" ' + echo "${PEERID}" >expected1 && + test_cmp expected1 publish_out +' + +test_expect_success "'ipfs name resolve' succeeds" ' + ipfs name resolve "$PEERID" >output +' + +test_expect_success "resolve output looks good" ' + printf "/ipfs/%s\n" "$HASH_WELCOME_DOCS" >expected2 && + test_cmp expected2 output +' + +test_kill_ipfs_daemon + test_done From 371bf9310ec55adb8f2619d5dc0d10f0767160d6 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Fri, 5 Oct 2018 10:59:01 +0800 Subject: [PATCH 74/85] uodate json option name License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/config.go b/core/commands/config.go index 9d847634495..b451b3d09e4 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -27,7 +27,7 @@ type ConfigField struct { const ( configBoolOptionName = "bool" - configJsonOptionName = "json" + configJSONOptionName = "json" ) var ConfigCmd = &cmds.Command{ @@ -60,7 +60,7 @@ Set the value of the 'Datastore.Path' key: }, Options: []cmdkit.Option{ cmdkit.BoolOption(configBoolOptionName, "Set a boolean value."), - cmdkit.BoolOption(configJsonOptionName, "Parse stringified JSON."), + cmdkit.BoolOption(configJSONOptionName, "Parse stringified JSON."), }, Run: func(req cmds.Request, res cmds.Response) { args := req.Arguments() @@ -92,7 +92,7 @@ Set the value of the 'Datastore.Path' key: if len(args) == 2 { value := args[1] - if parseJson, _, _ := req.Option(configJsonOptionName).Bool(); parseJson { + if parseJSON, _, _ := req.Option(configJSONOptionName).Bool(); parseJSON { var jsonVal interface{} if err := json.Unmarshal([]byte(value), &jsonVal); err != nil { err = fmt.Errorf("failed to unmarshal json. %s", err) From 35e8d6fba1f20a38cb7b04069f7d140bdc4daa81 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 4 Oct 2018 21:12:53 -0700 Subject: [PATCH 75/85] update unixfs inline option comment to give us room to change things (addressing CR) License: MIT Signed-off-by: Steven Allen --- core/coreapi/interface/options/unixfs.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 9249af89539..d486981c3a6 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -171,9 +171,8 @@ func (unixfsOpts) Inline(enable bool) UnixfsAddOption { // option. Default: 32 bytes // // Note that while there is no hard limit on the number of bytes, it should be -// kept at a reasonably low value, such as 64 and no more than 1k. Setting this -// value too high may cause various problems, such as render some -// blocks unfetchable. +// kept at a reasonably low value, such as 64; implementations may choose to +// reject anything larger. func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption { return func(settings *UnixfsAddSettings) error { settings.InlineLimit = limit From afd81fd5dd973a065b7002fb4176f507a2c728df Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 4 Oct 2018 21:42:07 -0700 Subject: [PATCH 76/85] gateway test: document why .man License: MIT Signed-off-by: Steven Allen --- core/corehttp/gateway_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index 106f4c214bc..bfd7b506b66 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -153,6 +153,11 @@ func TestGatewayGet(t *testing.T) { ns["/ipns/double.example.com"] = path.FromString("/ipns/working.example.com") ns["/ipns/triple.example.com"] = path.FromString("/ipns/double.example.com") ns["/ipns/broken.example.com"] = path.FromString("/ipns/" + k) + // We picked .man because: + // 1. It's a valid TLD. + // 2. Go treats it as the file extension for "man" files (even though + // nobody actually *uses* this extension, AFAIK). + // 3. Go accepts "fnord" (the test value) as a valid man file. ns["/ipns/example.man"] = path.FromString("/ipfs/" + k) t.Log(ts.URL) @@ -176,6 +181,7 @@ func TestGatewayGet(t *testing.T) { {"working.example.com", "/ipfs/" + k, http.StatusNotFound, "ipfs resolve -r /ipns/working.example.com/ipfs/" + k + ": no link by that name\n"}, {"broken.example.com", "/", http.StatusNotFound, "ipfs resolve -r /ipns/broken.example.com/: " + namesys.ErrResolveFailed.Error() + "\n"}, {"broken.example.com", "/ipfs/" + k, http.StatusNotFound, "ipfs resolve -r /ipns/broken.example.com/ipfs/" + k + ": " + namesys.ErrResolveFailed.Error() + "\n"}, + // This test case ensures we don't treat the TLD as a file extension. {"example.man", "/", http.StatusOK, "fnord"}, } { var c http.Client From f498459ad2934a46578e97f4d96bd92d68eed5a2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 5 Oct 2018 11:24:36 -0700 Subject: [PATCH 77/85] gateway_test: comment on platform dependence License: MIT Signed-off-by: Steven Allen --- core/corehttp/gateway_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index bfd7b506b66..ce178ffed63 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -157,7 +157,9 @@ func TestGatewayGet(t *testing.T) { // 1. It's a valid TLD. // 2. Go treats it as the file extension for "man" files (even though // nobody actually *uses* this extension, AFAIK). - // 3. Go accepts "fnord" (the test value) as a valid man file. + // + // Unfortunately, this may not work on all platforms as file type + // detection is platform dependent. ns["/ipns/example.man"] = path.FromString("/ipfs/" + k) t.Log(ts.URL) From 3d3bedcf41728616639f1872b409ebe5642533a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 10 Mar 2018 19:23:38 +0100 Subject: [PATCH 78/85] coreapi: pubsub interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/pubsub.go | 56 ++++++++++++++++++++++++ core/coreapi/interface/pubsub.go | 51 +++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 core/coreapi/interface/options/pubsub.go create mode 100644 core/coreapi/interface/pubsub.go diff --git a/core/coreapi/interface/options/pubsub.go b/core/coreapi/interface/options/pubsub.go new file mode 100644 index 00000000000..e276d7e4a19 --- /dev/null +++ b/core/coreapi/interface/options/pubsub.go @@ -0,0 +1,56 @@ +package options + +type PubSubPeersSettings struct { + Topic string +} + +type PubSubSubscribeSettings struct { + Discover bool +} + +type PubSubPeersOption func(*PubSubPeersSettings) error +type PubSubSubscribeOption func(*PubSubSubscribeSettings) error + +func PubSubPeersOptions(opts ...PubSubPeersOption) (*PubSubPeersSettings, error) { + options := &PubSubPeersSettings{ + Topic: "", + } + + for _, opt := range opts { + err := opt(options) + if err != nil { + return nil, err + } + } + return options, nil +} + +func PubSubSubscribeOptions(opts ...PubSubSubscribeOption) (*PubSubSubscribeSettings, error) { + options := &PubSubSubscribeSettings{ + Discover: false, + } + + for _, opt := range opts { + err := opt(options) + if err != nil { + return nil, err + } + } + return options, nil +} + +type PubSubOptions struct{} + +func (api *PubSubOptions) WithTopic(topic string) PubSubPeersOption { + return func(settings *PubSubPeersSettings) error { + settings.Topic = topic + return nil + } +} + +func (api *PubSubOptions) WithDiscover(discover bool) PubSubSubscribeOption { + return func(settings *PubSubSubscribeSettings) error { + settings.Discover = discover + return nil + } +} diff --git a/core/coreapi/interface/pubsub.go b/core/coreapi/interface/pubsub.go new file mode 100644 index 00000000000..f78734a090e --- /dev/null +++ b/core/coreapi/interface/pubsub.go @@ -0,0 +1,51 @@ +package iface + +import ( + "context" + "io" + + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + + peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" +) + +// PubSubSubscription is an active PubSub subscription +type PubSubSubscription interface { + io.Closer + + // Chan return incoming message channel + Chan(context.Context) <-chan PubSubMessage +} + +// PubSubMessage is a single PubSub message +type PubSubMessage interface { + // From returns id of a peer from which the message has arrived + From() peer.ID + + // Data returns the message body + Data() []byte +} + +// PubSubAPI specifies the interface to PubSub +type PubSubAPI interface { + // Ls lists subscribed topics by name + Ls(context.Context) ([]string, error) + + // Peers list peers we are currently pubsubbing with + // TODO: WithTopic + Peers(context.Context, ...options.PubSubPeersOption) ([]peer.ID, error) + + // WithTopic is an option for peers which specifies a topic filter for the + // function + WithTopic(topic string) options.PubSubPeersOption + + // Publish a message to a given pubsub topic + Publish(context.Context, string, []byte) error + + // Subscribe to messages on a given topic + Subscribe(context.Context, string) (PubSubSubscription, error) + + // WithDiscover is an option for Subscribe which specifies whether to try to + // discover other peers subscribed to the same topic + WithDiscover(discover bool) options.PubSubSubscribeOption +} From 51bb9d6843f12507db23d809caab163862ad2cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 10 Mar 2018 19:28:22 +0100 Subject: [PATCH 79/85] coreapi: implement pubsub api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/coreapi.go | 5 ++ core/coreapi/interface/coreapi.go | 3 + core/coreapi/interface/errors.go | 2 +- core/coreapi/interface/options/pubsub.go | 8 +- core/coreapi/interface/pubsub.go | 16 +--- core/coreapi/pubsub.go | 105 +++++++++++++++++++++++ 6 files changed, 123 insertions(+), 16 deletions(-) create mode 100644 core/coreapi/pubsub.go diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 29a8b78fb63..449d8440f82 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -72,3 +72,8 @@ func (api *CoreAPI) Dht() coreiface.DhtAPI { func (api *CoreAPI) Swarm() coreiface.SwarmAPI { return (*SwarmAPI)(api) } + +// PubSub returns the PubSubAPI interface implementation backed by the go-ipfs node +func (api *CoreAPI) PubSub() coreiface.PubSubAPI { + return (*PubSubAPI)(api) +} diff --git a/core/coreapi/interface/coreapi.go b/core/coreapi/interface/coreapi.go index 0b153b6f9a1..bc889237b3e 100644 --- a/core/coreapi/interface/coreapi.go +++ b/core/coreapi/interface/coreapi.go @@ -37,6 +37,9 @@ type CoreAPI interface { // Swarm returns an implementation of Swarm API Swarm() SwarmAPI + // PubSub returns an implementation of PubSub API + PubSub() PubSubAPI + // ResolvePath resolves the path using Unixfs resolver ResolvePath(context.Context, Path) (ResolvedPath, error) diff --git a/core/coreapi/interface/errors.go b/core/coreapi/interface/errors.go index 81f978971d7..072275409e0 100644 --- a/core/coreapi/interface/errors.go +++ b/core/coreapi/interface/errors.go @@ -4,5 +4,5 @@ import "errors" var ( ErrIsDir = errors.New("object is a directory") - ErrOffline = errors.New("can't resolve, ipfs node is offline") + ErrOffline = errors.New("this action must be run in online mode, try running 'ipfs daemon' first") ) diff --git a/core/coreapi/interface/options/pubsub.go b/core/coreapi/interface/options/pubsub.go index e276d7e4a19..f0a614d5802 100644 --- a/core/coreapi/interface/options/pubsub.go +++ b/core/coreapi/interface/options/pubsub.go @@ -39,16 +39,18 @@ func PubSubSubscribeOptions(opts ...PubSubSubscribeOption) (*PubSubSubscribeSett return options, nil } -type PubSubOptions struct{} +type pubsubOpts struct{} -func (api *PubSubOptions) WithTopic(topic string) PubSubPeersOption { +var PubBub nameOpts + +func (pubsubOpts) Topic(topic string) PubSubPeersOption { return func(settings *PubSubPeersSettings) error { settings.Topic = topic return nil } } -func (api *PubSubOptions) WithDiscover(discover bool) PubSubSubscribeOption { +func (pubsubOpts) Discover(discover bool) PubSubSubscribeOption { return func(settings *PubSubSubscribeSettings) error { settings.Discover = discover return nil diff --git a/core/coreapi/interface/pubsub.go b/core/coreapi/interface/pubsub.go index f78734a090e..4b52ed6d644 100644 --- a/core/coreapi/interface/pubsub.go +++ b/core/coreapi/interface/pubsub.go @@ -6,15 +6,15 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" + peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" ) // PubSubSubscription is an active PubSub subscription type PubSubSubscription interface { io.Closer - // Chan return incoming message channel - Chan(context.Context) <-chan PubSubMessage + // Next return the next incoming message + Next(context.Context) (PubSubMessage, error) } // PubSubMessage is a single PubSub message @@ -35,17 +35,9 @@ type PubSubAPI interface { // TODO: WithTopic Peers(context.Context, ...options.PubSubPeersOption) ([]peer.ID, error) - // WithTopic is an option for peers which specifies a topic filter for the - // function - WithTopic(topic string) options.PubSubPeersOption - // Publish a message to a given pubsub topic Publish(context.Context, string, []byte) error // Subscribe to messages on a given topic - Subscribe(context.Context, string) (PubSubSubscription, error) - - // WithDiscover is an option for Subscribe which specifies whether to try to - // discover other peers subscribed to the same topic - WithDiscover(discover bool) options.PubSubSubscribeOption + Subscribe(context.Context, string, ...options.PubSubSubscribeOption) (PubSubSubscription, error) } diff --git a/core/coreapi/pubsub.go b/core/coreapi/pubsub.go new file mode 100644 index 00000000000..66edd6907dd --- /dev/null +++ b/core/coreapi/pubsub.go @@ -0,0 +1,105 @@ +package coreapi + +import ( + "context" + "errors" + + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + + peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" + floodsub "gx/ipfs/QmY1L5krVk8dv8d74uESmJTXGpoigVYqBVxXXz1aS8aFSb/go-libp2p-floodsub" +) + +type PubSubAPI CoreAPI + +type pubSubSubscription struct { + subscription *floodsub.Subscription +} + +type pubSubMessage struct { + msg *floodsub.Message +} + +func (api *PubSubAPI) Ls(ctx context.Context) ([]string, error) { + if err := api.checkNode(); err != nil { + return nil, err + } + + return api.node.Floodsub.GetTopics(), nil +} + +func (api *PubSubAPI) Peers(ctx context.Context, opts ...caopts.PubSubPeersOption) ([]peer.ID, error) { + if err := api.checkNode(); err != nil { + return nil, err + } + + settings, err := caopts.PubSubPeersOptions(opts...) + if err != nil { + return nil, err + } + + peers := api.node.Floodsub.ListPeers(settings.Topic) + out := make([]peer.ID, len(peers)) + + for i, peer := range peers { + out[i] = peer + } + + return out, nil +} + +func (api *PubSubAPI) Publish(ctx context.Context, topic string, data []byte) error { + if err := api.checkNode(); err != nil { + return err + } + + return api.node.Floodsub.Publish(topic, data) +} + +func (api *PubSubAPI) Subscribe(ctx context.Context, topic string, opts ...caopts.PubSubSubscribeOption) (coreiface.PubSubSubscription, error) { + if err := api.checkNode(); err != nil { + return nil, err + } + + sub, err := api.node.Floodsub.Subscribe(topic) + if err != nil { + return nil, err + } + + return &pubSubSubscription{sub}, nil +} + +func (api *PubSubAPI) checkNode() error { + if !api.node.OnlineMode() { + return coreiface.ErrOffline + } + + if api.node.Floodsub == nil { + return errors.New("experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use.") + } + + return nil +} + +func (sub *pubSubSubscription) Close() error { + sub.subscription.Cancel() + return nil +} + +func (sub *pubSubSubscription) Next(ctx context.Context) (coreiface.PubSubMessage, error) { + msg, err := sub.subscription.Next(ctx) + if err != nil { + return nil, err + } + + return &pubSubMessage{msg}, nil +} + +func (msg *pubSubMessage) From() peer.ID { + return peer.ID(msg.msg.From) +} + +func (msg *pubSubMessage) Data() []byte { + return msg.msg.Data +} From d3f3afa5de36bf90e940ceb9aa832cf735097bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 11 Sep 2018 05:43:54 +0200 Subject: [PATCH 80/85] coreapi pubsub: add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/options/pubsub.go | 2 +- core/coreapi/pubsub_test.go | 96 ++++++++++++++++++++++++ core/coreapi/unixfs_test.go | 3 + 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 core/coreapi/pubsub_test.go diff --git a/core/coreapi/interface/options/pubsub.go b/core/coreapi/interface/options/pubsub.go index f0a614d5802..c387d613db4 100644 --- a/core/coreapi/interface/options/pubsub.go +++ b/core/coreapi/interface/options/pubsub.go @@ -41,7 +41,7 @@ func PubSubSubscribeOptions(opts ...PubSubSubscribeOption) (*PubSubSubscribeSett type pubsubOpts struct{} -var PubBub nameOpts +var PubSub pubsubOpts func (pubsubOpts) Topic(topic string) PubSubPeersOption { return func(settings *PubSubPeersSettings) error { diff --git a/core/coreapi/pubsub_test.go b/core/coreapi/pubsub_test.go new file mode 100644 index 00000000000..11a8c68a5af --- /dev/null +++ b/core/coreapi/pubsub_test.go @@ -0,0 +1,96 @@ +package coreapi_test + +import ( + "context" + "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + "testing" + "time" +) + +func TestBasicPubSub(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + nds, apis, err := makeAPISwarm(ctx, true, 2) + if err != nil { + t.Fatal(err) + } + + sub, err := apis[0].PubSub().Subscribe(ctx, "testch") + if err != nil { + t.Fatal(err) + } + + go func() { + tick := time.Tick(100 * time.Millisecond) + + for { + err = apis[1].PubSub().Publish(ctx, "testch", []byte("hello world")) + if err != nil { + t.Fatal(err) + } + select { + case <-tick: + case <-ctx.Done(): + return + } + } + }() + + m, err := sub.Next(ctx) + if err != nil { + t.Fatal(err) + } + + if string(m.Data()) != "hello world" { + t.Errorf("got invalid data: %s", string(m.Data())) + } + + if m.From() != nds[1].Identity { + t.Errorf("m.From didn't match") + } + + peers, err := apis[1].PubSub().Peers(ctx, options.PubSub.Topic("testch")) + if err != nil { + t.Fatal(err) + } + + if len(peers) != 1 { + t.Fatalf("got incorrect number of peers: %d", len(peers)) + } + + if peers[0] != nds[0].Identity { + t.Errorf("peer didn't match") + } + + peers, err = apis[1].PubSub().Peers(ctx, options.PubSub.Topic("nottestch")) + if err != nil { + t.Fatal(err) + } + + if len(peers) != 0 { + t.Fatalf("got incorrect number of peers: %d", len(peers)) + } + + topics, err := apis[0].PubSub().Ls(ctx) + if err != nil { + t.Fatal(err) + } + + if len(topics) != 1 { + t.Fatalf("got incorrect number of topics: %d", len(peers)) + } + + if topics[0] != "testch" { + t.Errorf("topic didn't match") + } + + topics, err = apis[1].PubSub().Ls(ctx) + if err != nil { + t.Fatal(err) + } + + if len(topics) != 0 { + t.Fatalf("got incorrect number of topics: %d", len(peers)) + } +} diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index cabd6775a20..e113c50c278 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -94,6 +94,9 @@ func makeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]*core.IpfsNo Repo: r, Host: mock.MockHostOption(mn), Online: fullIdentity, + ExtraOpts: map[string]bool{ + "pubsub": true, + }, }) if err != nil { return nil, nil, err From d6aa9527f2b101055df63fe887b8e3c21e8f28f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 11 Sep 2018 12:52:40 +0200 Subject: [PATCH 81/85] pubsub cmd: switch to coreapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/pubsub.go | 134 ++++++++----------------------- core/coreapi/coreapi.go | 4 + core/coreapi/interface/pubsub.go | 8 +- core/coreapi/pubsub.go | 60 +++++++++++++- 4 files changed, 104 insertions(+), 102 deletions(-) diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 8b633062b1a..2ae210d947e 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -3,23 +3,16 @@ package commands import ( "context" "encoding/binary" - "errors" "fmt" "io" "net/http" "sort" - "sync" - "time" - core "github.com/ipfs/go-ipfs/core" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" + options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ) @@ -48,6 +41,13 @@ const ( pubsubDiscoverOptionName = "discover" ) +type pubsubMessage struct { + From []byte `json:"from,omitempty"` + Data []byte `json:"data,omitempty"` + Seqno []byte `json:"seqno,omitempty"` + TopicIDs []string `json:"topicIDs,omitempty"` +} + var PubsubSubCmd = &cmds.Command{ Helptext: cmdkit.HelpText{ Tagline: "Subscribe to messages on a given topic.", @@ -79,40 +79,16 @@ This command outputs data in the following encodings: cmdkit.BoolOption(pubsubDiscoverOptionName, "try to discover other peers subscribed to the same topic"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - // Must be online! - if !n.OnlineMode() { - return cmdkit.Errorf(cmdkit.ErrClient, ErrNotOnline.Error()) - } - - if n.Floodsub == nil { - return fmt.Errorf("experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use") - } - topic := req.Arguments[0] - sub, err := n.Floodsub.Subscribe(topic) - if err != nil { - return err - } - defer sub.Cancel() - discover, _ := req.Options[pubsubDiscoverOptionName].(bool) - if discover { - go func() { - blk := blocks.NewBlock([]byte("floodsub:" + topic)) - err := n.Blocks.AddBlock(blk) - if err != nil { - log.Error("pubsub discovery: ", err) - return - } - - connectToPubSubPeers(req.Context, n, blk.Cid()) - }() - } + + sub, err := api.PubSub().Subscribe(req.Context, topic, options.PubSub.Discover(discover)) + defer sub.Close() if f, ok := res.(http.Flusher); ok { f.Flush() @@ -126,15 +102,17 @@ This command outputs data in the following encodings: return err } - err = res.Emit(msg) - if err != nil { - return err - } + res.Emit(&pubsubMessage{ + Data: msg.Data(), + From: []byte(msg.From()), + Seqno: msg.Seq(), + TopicIDs: msg.Topics(), + }) } }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { - m, ok := v.(*floodsub.Message) + m, ok := v.(*pubsubMessage) if !ok { return fmt.Errorf("unexpected type: %T", v) } @@ -143,7 +121,7 @@ This command outputs data in the following encodings: return err }), "ndpayload": cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { - m, ok := v.(*floodsub.Message) + m, ok := v.(*pubsubMessage) if !ok { return fmt.Errorf("unexpected type: %T", v) } @@ -153,7 +131,7 @@ This command outputs data in the following encodings: return err }), "lenpayload": cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error { - m, ok := v.(*floodsub.Message) + m, ok := v.(*pubsubMessage) if !ok { return fmt.Errorf("unexpected type: %T", v) } @@ -166,31 +144,7 @@ This command outputs data in the following encodings: return err }), }, - Type: floodsub.Message{}, -} - -func connectToPubSubPeers(ctx context.Context, n *core.IpfsNode, cid cid.Cid) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - provs := n.Routing.FindProvidersAsync(ctx, cid, 10) - wg := &sync.WaitGroup{} - for p := range provs { - wg.Add(1) - go func(pi pstore.PeerInfo) { - defer wg.Done() - ctx, cancel := context.WithTimeout(ctx, time.Second*10) - defer cancel() - err := n.PeerHost.Connect(ctx, pi) - if err != nil { - log.Info("pubsub discover: ", err) - return - } - log.Info("connected to pubsub peer:", pi.ID) - }(p) - } - - wg.Wait() + Type: pubsubMessage{}, } var PubsubPubCmd = &cmds.Command{ @@ -210,20 +164,11 @@ To use, the daemon must be run with '--enable-pubsub-experiment'. cmdkit.StringArg("data", true, true, "Payload of message to publish.").EnableStdin(), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - // Must be online! - if !n.OnlineMode() { - return cmdkit.Errorf(cmdkit.ErrClient, ErrNotOnline.Error()) - } - - if n.Floodsub == nil { - return errors.New("experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use.") - } - topic := req.Arguments[0] err = req.ParseBodyArgs() @@ -232,7 +177,7 @@ To use, the daemon must be run with '--enable-pubsub-experiment'. } for _, data := range req.Arguments[1:] { - if err := n.Floodsub.Publish(topic, []byte(data)); err != nil { + if err := api.PubSub().Publish(req.Context, topic, []byte(data)); err != nil { return err } } @@ -254,21 +199,17 @@ To use, the daemon must be run with '--enable-pubsub-experiment'. `, }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - // Must be online! - if !n.OnlineMode() { - return cmdkit.Errorf(cmdkit.ErrClient, ErrNotOnline.Error()) - } - - if n.Floodsub == nil { - return errors.New("experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use.") + l, err := api.PubSub().Ls(req.Context) + if err != nil { + return err } - return cmds.EmitOnce(res, stringList{n.Floodsub.GetTopics()}) + return cmds.EmitOnce(res, stringList{l}) }, Type: stringList{}, Encoders: cmds.EncoderMap{ @@ -308,26 +249,21 @@ To use, the daemon must be run with '--enable-pubsub-experiment'. cmdkit.StringArg("topic", false, false, "topic to list connected peers of"), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - n, err := cmdenv.GetNode(env) + api, err := cmdenv.GetApi(env) if err != nil { return err } - // Must be online! - if !n.OnlineMode() { - return cmdkit.Errorf(cmdkit.ErrClient, ErrNotOnline.Error()) - } - - if n.Floodsub == nil { - return errors.New("experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use") - } - var topic string if len(req.Arguments) == 1 { topic = req.Arguments[0] } - peers := n.Floodsub.ListPeers(topic) + peers, err := api.PubSub().Peers(req.Context, options.PubSub.Topic(topic)) + if err != nil { + return err + } + list := &stringList{make([]string, 0, len(peers))} for _, peer := range peers { diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 449d8440f82..ba608262622 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -16,8 +16,12 @@ package coreapi import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" + + logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) +var log = logging.Logger("core/coreapi") + type CoreAPI struct { node *core.IpfsNode } diff --git a/core/coreapi/interface/pubsub.go b/core/coreapi/interface/pubsub.go index 4b52ed6d644..4c9a1d73e5b 100644 --- a/core/coreapi/interface/pubsub.go +++ b/core/coreapi/interface/pubsub.go @@ -6,7 +6,7 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" + peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) // PubSubSubscription is an active PubSub subscription @@ -24,6 +24,12 @@ type PubSubMessage interface { // Data returns the message body Data() []byte + + // Seq returns message identifier + Seq() []byte + + // Topics returns list of topics this message was set to + Topics() []string } // PubSubAPI specifies the interface to PubSub diff --git a/core/coreapi/pubsub.go b/core/coreapi/pubsub.go index 66edd6907dd..f1184540c07 100644 --- a/core/coreapi/pubsub.go +++ b/core/coreapi/pubsub.go @@ -3,12 +3,18 @@ package coreapi import ( "context" "errors" + "strings" + "sync" + "time" + core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer" - floodsub "gx/ipfs/QmY1L5krVk8dv8d74uESmJTXGpoigVYqBVxXXz1aS8aFSb/go-libp2p-floodsub" + cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" + peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) type PubSubAPI CoreAPI @@ -58,6 +64,8 @@ func (api *PubSubAPI) Publish(ctx context.Context, topic string, data []byte) er } func (api *PubSubAPI) Subscribe(ctx context.Context, topic string, opts ...caopts.PubSubSubscribeOption) (coreiface.PubSubSubscription, error) { + options, err := caopts.PubSubSubscribeOptions(opts...) + if err := api.checkNode(); err != nil { return nil, err } @@ -67,9 +75,45 @@ func (api *PubSubAPI) Subscribe(ctx context.Context, topic string, opts ...caopt return nil, err } + if options.Discover { + go func() { + blk, err := api.core().Block().Put(ctx, strings.NewReader("floodsub:"+topic)) + if err != nil { + log.Error("pubsub discovery: ", err) + return + } + + connectToPubSubPeers(ctx, api.node, blk.Path().Cid()) + }() + } + return &pubSubSubscription{sub}, nil } +func connectToPubSubPeers(ctx context.Context, n *core.IpfsNode, cid cid.Cid) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + provs := n.Routing.FindProvidersAsync(ctx, cid, 10) + wg := &sync.WaitGroup{} + for p := range provs { + wg.Add(1) + go func(pi pstore.PeerInfo) { + defer wg.Done() + ctx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + err := n.PeerHost.Connect(ctx, pi) + if err != nil { + log.Info("pubsub discover: ", err) + return + } + log.Info("connected to pubsub peer:", pi.ID) + }(p) + } + + wg.Wait() +} + func (api *PubSubAPI) checkNode() error { if !api.node.OnlineMode() { return coreiface.ErrOffline @@ -103,3 +147,15 @@ func (msg *pubSubMessage) From() peer.ID { func (msg *pubSubMessage) Data() []byte { return msg.msg.Data } + +func (msg *pubSubMessage) Seq() []byte { + return msg.msg.Seqno +} + +func (msg *pubSubMessage) Topics() []string { + return msg.msg.TopicIDs +} + +func (api *PubSubAPI) core() coreiface.CoreAPI { + return (*CoreAPI)(api) +} From 18d5999ebc8fadabf53be0794da3f945a4b8e1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 26 Sep 2018 18:24:35 +0200 Subject: [PATCH 82/85] coreapi pubsub: fix review nits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/pubsub.go | 3 +++ core/coreapi/interface/pubsub.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index 2ae210d947e..e125a693bc2 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -88,6 +88,9 @@ This command outputs data in the following encodings: discover, _ := req.Options[pubsubDiscoverOptionName].(bool) sub, err := api.PubSub().Subscribe(req.Context, topic, options.PubSub.Discover(discover)) + if err != nil { + return err + } defer sub.Close() if f, ok := res.(http.Flusher); ok { diff --git a/core/coreapi/interface/pubsub.go b/core/coreapi/interface/pubsub.go index 4c9a1d73e5b..d7a21e02f1a 100644 --- a/core/coreapi/interface/pubsub.go +++ b/core/coreapi/interface/pubsub.go @@ -38,7 +38,6 @@ type PubSubAPI interface { Ls(context.Context) ([]string, error) // Peers list peers we are currently pubsubbing with - // TODO: WithTopic Peers(context.Context, ...options.PubSubPeersOption) ([]peer.ID, error) // Publish a message to a given pubsub topic From 5618fed0d2adcb994123a588711ee4aab94e0aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 2 Oct 2018 12:51:17 +0200 Subject: [PATCH 83/85] coreapi pubsub: better ctx for connectToPubSubPeers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/pubsub.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/coreapi/pubsub.go b/core/coreapi/pubsub.go index f1184540c07..da30dc748a6 100644 --- a/core/coreapi/pubsub.go +++ b/core/coreapi/pubsub.go @@ -20,6 +20,7 @@ import ( type PubSubAPI CoreAPI type pubSubSubscription struct { + cancel context.CancelFunc subscription *floodsub.Subscription } @@ -75,19 +76,21 @@ func (api *PubSubAPI) Subscribe(ctx context.Context, topic string, opts ...caopt return nil, err } + pubctx, cancel := context.WithCancel(api.node.Context()) + if options.Discover { go func() { - blk, err := api.core().Block().Put(ctx, strings.NewReader("floodsub:"+topic)) + blk, err := api.core().Block().Put(pubctx, strings.NewReader("floodsub:"+topic)) if err != nil { log.Error("pubsub discovery: ", err) return } - connectToPubSubPeers(ctx, api.node, blk.Path().Cid()) + connectToPubSubPeers(pubctx, api.node, blk.Path().Cid()) }() } - return &pubSubSubscription{sub}, nil + return &pubSubSubscription{cancel, sub}, nil } func connectToPubSubPeers(ctx context.Context, n *core.IpfsNode, cid cid.Cid) { @@ -95,7 +98,7 @@ func connectToPubSubPeers(ctx context.Context, n *core.IpfsNode, cid cid.Cid) { defer cancel() provs := n.Routing.FindProvidersAsync(ctx, cid, 10) - wg := &sync.WaitGroup{} + var wg sync.WaitGroup for p := range provs { wg.Add(1) go func(pi pstore.PeerInfo) { @@ -127,6 +130,7 @@ func (api *PubSubAPI) checkNode() error { } func (sub *pubSubSubscription) Close() error { + sub.cancel() sub.subscription.Cancel() return nil } From 098933ade48a28806370757a861f4c6eb2244cfb Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 5 Oct 2018 14:11:56 -0700 Subject: [PATCH 84/85] gx: update stuff * go-datastore and friends: GetSize * badger: new release, fewer allocations * go-mplex: send fewer packets * go-bitswap: pack multiple blocks in a single message, fewer allocations * go-buffer-pool: replace the buffer pool from go-msgio * yamux: fixed data race and uses go-buffer-pool for stream read-buffers to reduce memory and allocations. * go-libp2p-secio: get rid of a hot-spot allocation * go-libp2p-peerstore: reduced allocations (at the cost of some memory) More? License: MIT Signed-off-by: Steven Allen --- assets/assets.go | 2 +- blocks/blockstoreutil/remove.go | 4 +- cmd/seccat/seccat.go | 6 +- core/bootstrap.go | 6 +- core/bootstrap_test.go | 2 +- core/builder.go | 28 ++-- core/commands/bitswap.go | 4 +- core/commands/dag/dag.go | 2 +- core/commands/dht.go | 10 +- core/commands/dht_test.go | 2 +- core/commands/files.go | 10 +- core/commands/get.go | 6 +- core/commands/id.go | 6 +- core/commands/ls.go | 12 +- core/commands/name/ipns.go | 2 +- core/commands/object/object.go | 2 +- core/commands/p2p.go | 2 +- core/commands/pin.go | 6 +- core/commands/ping.go | 2 +- core/commands/refs.go | 2 +- core/commands/repo.go | 2 +- core/commands/resolve.go | 2 +- core/commands/swarm.go | 6 +- core/commands/tar.go | 4 +- core/commands/unixfs/ls.go | 4 +- core/commands/urlstore.go | 8 +- core/core.go | 64 ++++----- core/core_test.go | 4 +- core/coreapi/dht.go | 12 +- core/coreapi/interface/dht.go | 2 +- core/coreapi/interface/options/unixfs.go | 2 +- core/coreapi/interface/path.go | 2 +- core/coreapi/interface/swarm.go | 4 +- core/coreapi/key.go | 2 +- core/coreapi/name.go | 4 +- core/coreapi/name_test.go | 2 +- core/coreapi/object.go | 4 +- core/coreapi/path.go | 6 +- core/coreapi/pin.go | 6 +- core/coreapi/pubsub.go | 4 +- core/coreapi/swarm.go | 8 +- core/coreapi/unixfile.go | 6 +- core/coreapi/unixfs.go | 16 +-- core/coreapi/unixfs_test.go | 12 +- core/coredag/dagpb.go | 2 +- core/coredag/raw.go | 2 +- core/corehttp/commands.go | 2 +- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_handler.go | 16 +-- core/corehttp/gateway_test.go | 10 +- core/corehttp/metrics_test.go | 6 +- core/corerepo/gc.go | 2 +- core/coreunix/add.go | 16 +-- core/coreunix/add_test.go | 10 +- core/coreunix/metadata.go | 4 +- core/coreunix/metadata_test.go | 20 +-- core/mock/mock.go | 12 +- core/pathresolver.go | 4 +- core/pathresolver_test.go | 2 +- dagutils/diff.go | 2 +- dagutils/diffenum.go | 2 +- dagutils/diffenum_test.go | 4 +- dagutils/utils.go | 16 +-- dagutils/utils_test.go | 6 +- exchange/reprovide/providers.go | 4 +- exchange/reprovide/reprovide.go | 2 +- exchange/reprovide/reprovide_test.go | 10 +- filestore/filestore.go | 4 +- filestore/filestore_test.go | 6 +- filestore/fsrefstore.go | 10 +- filestore/util.go | 8 +- fuse/ipns/common.go | 4 +- fuse/ipns/ipns_test.go | 2 +- fuse/ipns/ipns_unix.go | 8 +- fuse/node/mount_test.go | 2 +- fuse/readonly/ipfs_test.go | 8 +- fuse/readonly/readonly_unix.go | 8 +- namesys/base.go | 2 +- namesys/cache.go | 2 +- namesys/dns.go | 2 +- namesys/interface.go | 2 +- namesys/ipns_resolver_validation_test.go | 20 +-- namesys/namesys.go | 6 +- namesys/namesys_test.go | 14 +- namesys/proquint.go | 2 +- namesys/publisher.go | 14 +- namesys/publisher_test.go | 10 +- namesys/republisher/repub.go | 6 +- namesys/republisher/repub_test.go | 6 +- namesys/resolve_test.go | 10 +- namesys/routing.go | 10 +- p2p/listener.go | 4 +- p2p/local.go | 2 +- p2p/p2p.go | 4 +- p2p/remote.go | 2 +- p2p/stream.go | 4 +- package.json | 136 ++++++++++---------- pin/gc/gc.go | 10 +- pin/pin.go | 4 +- pin/pin_test.go | 12 +- pin/set.go | 2 +- pin/set_test.go | 12 +- repo/fsrepo/datastores.go | 12 +- repo/fsrepo/fsrepo.go | 4 +- repo/fsrepo/fsrepo_test.go | 2 +- repo/repo.go | 2 +- tar/format.go | 10 +- test/integration/addcat_test.go | 4 +- test/integration/bench_cat_test.go | 4 +- test/integration/bitswap_wo_routing_test.go | 2 +- test/integration/three_legged_cat_test.go | 4 +- thirdparty/cidv0v1/blockstore.go | 2 +- thirdparty/verifbs/verifbs.go | 2 +- 113 files changed, 432 insertions(+), 432 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index 5532ce0e16e..bcb7816189c 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" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmdZ4PvPHFQVLLEve7DgoKDcSY19wwpGBB1GKjjKi2rEL1/dir-index-html" diff --git a/blocks/blockstoreutil/remove.go b/blocks/blockstoreutil/remove.go index 876c2df7e52..f4ae8733b3a 100644 --- a/blocks/blockstoreutil/remove.go +++ b/blocks/blockstoreutil/remove.go @@ -8,8 +8,8 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - bs "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + bs "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) // RemovedBlock is used to respresent the result of removing a block. diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index eac22f5d726..2a74ae5c554 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -19,11 +19,11 @@ import ( "os/signal" "syscall" - secio "gx/ipfs/QmNkxudvyUjdKw5ComDSCbJTHCjrjNGYjEAUdhoEUUjFsX/go-libp2p-secio" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore/pstoremem" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + secio "gx/ipfs/QmZSHe9kqEcqUG6DSBrKYULk8EeZLDd1skpHNoSaK6rW4M/go-libp2p-secio" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/bootstrap.go b/core/bootstrap.go index fea1b73da28..ff4b27b8d6e 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -12,13 +12,13 @@ import ( math2 "github.com/ipfs/go-ipfs/thirdparty/math2" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" - inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" + host "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" periodicproc "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/periodic" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + inet "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/bootstrap_test.go b/core/bootstrap_test.go index b05da9b3b2a..775ee31e8c2 100644 --- a/core/bootstrap_test.go +++ b/core/bootstrap_test.go @@ -5,8 +5,8 @@ import ( "testing" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ) func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { diff --git a/core/builder.go b/core/builder.go index 1aa786c39e5..29e6e0edde1 100644 --- a/core/builder.go +++ b/core/builder.go @@ -14,27 +14,27 @@ import ( repo "github.com/ipfs/go-ipfs/repo" cidv0v1 "github.com/ipfs/go-ipfs/thirdparty/cidv0v1" "github.com/ipfs/go-ipfs/thirdparty/verifbs" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + resolver "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path/resolver" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" - libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + p2phost "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" cfg "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + libp2p "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore/pstoremem" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + retry "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/retrystore" + dsync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - retry "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/retrystore" - dsync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" metrics "gx/ipfs/QmekzFM3hPZjTjUFGTABdQkEnQ3PTiMstY198PwSFr5w1Q/go-metrics-interface" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type BuildCfg struct { diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index f0ffaa1acde..4959ea6060d 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -9,8 +9,8 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" e "github.com/ipfs/go-ipfs/core/commands/e" - bitswap "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap" - decision "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap/decision" + bitswap "gx/ipfs/QmQHbKeMWRNT8koMhh2DrTXZWepYVoGPNXni6JG1L3BhGq/go-bitswap" + decision "gx/ipfs/QmQHbKeMWRNT8koMhh2DrTXZWepYVoGPNXni6JG1L3BhGq/go-bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index a2407c5aadd..f206edef37d 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -11,7 +11,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" coredag "github.com/ipfs/go-ipfs/core/coredag" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/commands/dht.go b/core/commands/dht.go index e1e6bf08c87..dbf2cac054a 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -10,15 +10,15 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" e "github.com/ipfs/go-ipfs/core/commands/e" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - notif "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing/notifications" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + notif "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing/notifications" b58 "gx/ipfs/QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY/go-base58-fast/base58" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/dht_test.go b/core/commands/dht_test.go index 20ae174890b..c47f09e6ddc 100644 --- a/core/commands/dht_test.go +++ b/core/commands/dht_test.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/go-ipfs/namesys" tu "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" ) func TestKeyTranslation(t *testing.T) { diff --git a/core/commands/files.go b/core/commands/files.go index fb90df32ce7..356a16cf40c 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -18,17 +18,17 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "github.com/ipfs/go-ipfs/core/coreapi/interface" - bservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bservice "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/get.go b/core/commands/get.go index 7dcce0eeec5..b2e28f21d47 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -14,12 +14,12 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" "gx/ipfs/QmPtj12fdwuAqj9sBSTNUxBNu8kCGNp8b3o8yUzMm5GHpq/pb" + uarchive "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/archive" tar "gx/ipfs/QmQine7gvHncNevKtG9QXxf3nXcwSj6aDDmMm52mHofEEp/tar-utils" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - uarchive "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/archive" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ) var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") diff --git a/core/commands/id.go b/core/commands/id.go index 1e5ee52fc93..92acaa98a62 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -12,11 +12,11 @@ import ( core "github.com/ipfs/go-ipfs/core" e "github.com/ipfs/go-ipfs/core/commands/e" - identify "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - kb "gx/ipfs/QmWKgrs6cyhTNUaTmAKs86K1FpYmkQLYVj83GqUvmuT3TY/go-libp2p-kbucket" + identify "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/protocol/identify" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + kb "gx/ipfs/Qmb4AZNKg9yQVKkQqejEcg86AaT6EqGemGV8mBjkfJBeGf/go-libp2p-kbucket" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/commands/ls.go b/core/commands/ls.go index 9add52d5a04..5981d036022 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -10,14 +10,14 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" iface "github.com/ipfs/go-ipfs/core/coreapi/interface" - blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + unixfs "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + unixfspb "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/pb" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" - unixfspb "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/pb" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + blockservice "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 47ffc5ec48e..72d9d093c36 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -12,8 +12,8 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" nsopts "github.com/ipfs/go-ipfs/namesys/opts" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 765f5d76423..bb416c7ea3b 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -18,8 +18,8 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index 543fe5d558c..5856e441acc 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -15,8 +15,8 @@ import ( core "github.com/ipfs/go-ipfs/core" p2p "github.com/ipfs/go-ipfs/p2p" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" diff --git a/core/commands/pin.go b/core/commands/pin.go index ffe7633a469..f4a3a110ecf 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -15,12 +15,12 @@ import ( corerepo "github.com/ipfs/go-ipfs/core/corerepo" pin "github.com/ipfs/go-ipfs/pin" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/ping.go b/core/commands/ping.go index e3b5bb08771..7807f35c798 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -13,8 +13,8 @@ import ( "github.com/ipfs/go-ipfs/core" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/commands/refs.go b/core/commands/refs.go index b6030972415..2ef9a517ff5 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -12,8 +12,8 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/commands/repo.go b/core/commands/repo.go index 5e2b524f941..0f13f560656 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -21,7 +21,7 @@ import ( cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) type RepoVersion struct { diff --git a/core/commands/resolve.go b/core/commands/resolve.go index 227136c7b4b..0ea7676ec92 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -14,7 +14,7 @@ import ( options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" ns "github.com/ipfs/go-ipfs/namesys" nsopts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 4f9c738f5ee..83b6648937a 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -14,15 +14,15 @@ import ( "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/fsrepo" - inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mafilter "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" + inet "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" + "gx/ipfs/Qmb55o5PuhvqwjdVLvc4VV3ouLziYc6TfwM9LC6GwBQokn/go-libp2p-swarm" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm" iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) diff --git a/core/commands/tar.go b/core/commands/tar.go index ddf3b2ff39d..ad65bff3e8d 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -9,8 +9,8 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" tar "github.com/ipfs/go-ipfs/tar" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" ) diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index d0b93cd6708..556bc2bd1e6 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -11,9 +11,9 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" iface "github.com/ipfs/go-ipfs/core/coreapi/interface" + unixfs "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ) type LsLink struct { diff --git a/core/commands/urlstore.go b/core/commands/urlstore.go index 1448d969bbb..d29f4e6fbf1 100644 --- a/core/commands/urlstore.go +++ b/core/commands/urlstore.go @@ -10,12 +10,12 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" + balanced "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/trickle" cmdkit "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit" - chunk "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" - balanced "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/trickle" + chunk "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" ) var urlStoreCmd = &cmds.Command{ diff --git a/core/core.go b/core/core.go index f50c3f62206..da4c60ed772 100644 --- a/core/core.go +++ b/core/core.go @@ -30,53 +30,53 @@ import ( pin "github.com/ipfs/go-ipfs/pin" repo "github.com/ipfs/go-ipfs/repo" - psrouter "gx/ipfs/QmNPwLVhPRALSGyDnuwBS2WvL9bfx247aSyFJpToTh98wQ/go-libp2p-pubsub-router" - quic "gx/ipfs/QmNiPUdQMsgnqfMAdBmRZPndL8sfo2s8NMGEqJ2Uv7BcKR/go-libp2p-quic-transport" - libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" - discovery "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/discovery" - p2pbhost "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/routed" - identify "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" - ping "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/ping" + pnet "gx/ipfs/QmNmyLmysLFuSRjNTW8XrbovrNYFbZoMknTcpYR2AvvDc3/go-libp2p-pnet" metrics "gx/ipfs/QmNn6gcjBXpg8kccr9zEV7UVBpqAw8FZEiQ6DksvzyTQ5K/go-libp2p-metrics" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - circuit "gx/ipfs/QmPq6vgdtDmuui5FU9qskJE7ijpmJKZ9rfmtdMW2jPvaos/go-libp2p-circuit" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + bitswap "gx/ipfs/QmQHbKeMWRNT8koMhh2DrTXZWepYVoGPNXni6JG1L3BhGq/go-bitswap" + bsnet "gx/ipfs/QmQHbKeMWRNT8koMhh2DrTXZWepYVoGPNXni6JG1L3BhGq/go-bitswap/network" + p2phost "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" + "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path/resolver" + nilrouting "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/none" + offroute "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" + mplex "gx/ipfs/QmQvMxiavoMJzuLPuqrzVX4nXZpMks29hqpv13d81aJNEF/go-smux-multiplex" exchange "gx/ipfs/QmR1nncPsZR14A4hWr39mq8Lm7BGgS68bHVT9nop8NpWEM/go-ipfs-exchange-interface" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" mafilter "gx/ipfs/QmSW4uNHbvQia8iZDXzbwjiyHQtnyo9aFqfQAMasj3TJ6Y/go-maddr-filter" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - connmgr "gx/ipfs/QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs/go-libp2p-connmgr" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" - rhelpers "gx/ipfs/QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4/go-libp2p-routing-helpers" - "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" - p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" - dht "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht" - dhtopts "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht/opts" + dht "gx/ipfs/QmTdMq4uYZXmGW3u6KgnpCRWjo1Y7dWjRuAaGPw7Qxqr1s/go-libp2p-kad-dht" + dhtopts "gx/ipfs/QmTdMq4uYZXmGW3u6KgnpCRWjo1Y7dWjRuAaGPw7Qxqr1s/go-libp2p-kad-dht/opts" + libp2p "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p" + discovery "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/discovery" + p2pbhost "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/host/routed" + identify "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/protocol/identify" + ping "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/protocol/ping" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + ifconnmgr "gx/ipfs/QmXPqoktJEKkWPT6rSdhCM2G3E1yR7uUBdjnJrhJYeBgHU/go-libp2p-interface-connmgr" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" - nilrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/none" - offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" - ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - mplex "gx/ipfs/QmYsbnP57nNUKWijs8o2q3ZFrSUcAGTdKoQPuSJC3Uxt1Y/go-smux-multiplex" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - pnet "gx/ipfs/QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET/go-libp2p-pnet" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + connmgr "gx/ipfs/QmZygFpFQfDwTNeU8AYTfEgAXfb7yfuQh9L4wYG7GgtcMH/go-libp2p-connmgr" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - yamux "gx/ipfs/QmcsgrV3nCAKjiHKZhKVXWc4oY3WBECJCqahXEMpHeMrev/go-smux-yamux" + floodsub "gx/ipfs/Qmbi2MdNz6bdqWJg9Fud3WCqTdzP4DXKBwYD16EJVkjzKX/go-libp2p-floodsub" + quic "gx/ipfs/QmbxTJyyqtyYYM7wLHWv529e2dwzt9a9o8FfVQALvPpadC/go-libp2p-quic-transport" + psrouter "gx/ipfs/QmbyoYqzgpaKt97AEoAx4zJCuHdQ71GNkpVZwhJ1wUtzba/go-libp2p-pubsub-router" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bitswap "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap" - bsnet "gx/ipfs/QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp/go-bitswap/network" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + yamux "gx/ipfs/QmejxafYByb7s4rEMoKjmThZm6HfQ1seASNejVNKde6LBZ/go-smux-yamux" + circuit "gx/ipfs/Qmf5M8FECT1H1NGZ9kM6Ri4G4LfQGJcyMpfMPEA1herPuH/go-libp2p-circuit" + rhelpers "gx/ipfs/QmfGNszPuruiURVbgyvoj7eoVe9bkj2uHugMZVteX9zxD1/go-libp2p-routing-helpers" ) const IpnsValidatorTag = "ipns" diff --git a/core/core_test.go b/core/core_test.go index 4c87a0bb115..fc920ce5323 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -8,8 +8,8 @@ import ( "github.com/ipfs/go-ipfs/repo" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" ) func TestInitialization(t *testing.T) { diff --git a/core/coreapi/dht.go b/core/coreapi/dht.go index 486e77b8ba4..39a29644464 100644 --- a/core/coreapi/dht.go +++ b/core/coreapi/dht.go @@ -8,15 +8,15 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + blockservice "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) type DhtAPI CoreAPI diff --git a/core/coreapi/interface/dht.go b/core/coreapi/interface/dht.go index 4a76f4d3927..3096c8fb7e0 100644 --- a/core/coreapi/interface/dht.go +++ b/core/coreapi/interface/dht.go @@ -5,7 +5,7 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/interface/options/unixfs.go b/core/coreapi/interface/options/unixfs.go index 6a54b2d399d..b4661b793f4 100644 --- a/core/coreapi/interface/options/unixfs.go +++ b/core/coreapi/interface/options/unixfs.go @@ -6,7 +6,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ) type Layout int diff --git a/core/coreapi/interface/path.go b/core/coreapi/interface/path.go index 63b15fb501d..9bb46b4b47d 100644 --- a/core/coreapi/interface/path.go +++ b/core/coreapi/interface/path.go @@ -1,7 +1,7 @@ package iface import ( - ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ipfspath "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ) diff --git a/core/coreapi/interface/swarm.go b/core/coreapi/interface/swarm.go index 58caf6759fe..d8bca395c3e 100644 --- a/core/coreapi/interface/swarm.go +++ b/core/coreapi/interface/swarm.go @@ -5,8 +5,8 @@ import ( "errors" "time" - net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + net "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" diff --git a/core/coreapi/key.go b/core/coreapi/key.go index 63094cb4fd2..9e0460b7f86 100644 --- a/core/coreapi/key.go +++ b/core/coreapi/key.go @@ -11,7 +11,7 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" crypto "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ipfspath "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/name.go b/core/coreapi/name.go index f59a1d19967..d8f0a743a41 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -12,10 +12,10 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/namesys" - ipath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + ipath "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" + "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/core/coreapi/name_test.go b/core/coreapi/name_test.go index 41d286ef888..dd4c2cb3ddb 100644 --- a/core/coreapi/name_test.go +++ b/core/coreapi/name_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" + ipath "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - ipath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" diff --git a/core/coreapi/object.go b/core/coreapi/object.go index 2162b71f64c..b98427cb97e 100644 --- a/core/coreapi/object.go +++ b/core/coreapi/object.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-ipfs/pin" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/coreapi/path.go b/core/coreapi/path.go index 27626955c07..7d72b6d32bd 100644 --- a/core/coreapi/path.go +++ b/core/coreapi/path.go @@ -7,9 +7,9 @@ import ( "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - ipfspath "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + ipfspath "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path/resolver" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 63a25a19fc9..d3513e41e55 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -7,11 +7,11 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" corerepo "github.com/ipfs/go-ipfs/core/corerepo" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" ) type PinAPI CoreAPI diff --git a/core/coreapi/pubsub.go b/core/coreapi/pubsub.go index da30dc748a6..2a8a4c5f099 100644 --- a/core/coreapi/pubsub.go +++ b/core/coreapi/pubsub.go @@ -12,9 +12,9 @@ import ( caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - floodsub "gx/ipfs/QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH/go-libp2p-floodsub" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" + floodsub "gx/ipfs/Qmbi2MdNz6bdqWJg9Fud3WCqTdzP4DXKBwYD16EJVkjzKX/go-libp2p-floodsub" ) type PubSubAPI CoreAPI diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 2247a693935..1c67bc34e34 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -8,13 +8,13 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + inet "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + net "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" + swarm "gx/ipfs/Qmb55o5PuhvqwjdVLvc4VV3ouLziYc6TfwM9LC6GwBQokn/go-libp2p-swarm" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - swarm "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm" iaddr "gx/ipfs/QmesXvbRGyKQn1XbPHx1Mr5E6RTJYR9c8zwFVuGZq9Aa1j/go-ipfs-addr" ) diff --git a/core/coreapi/unixfile.go b/core/coreapi/unixfile.go index 85935221e14..00fe0ed02d0 100644 --- a/core/coreapi/unixfile.go +++ b/core/coreapi/unixfile.go @@ -8,10 +8,10 @@ import ( gopath "path" "time" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 51646e1fcfe..f023bb15171 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -10,17 +10,17 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface/options" "github.com/ipfs/go-ipfs/core/coreunix" - blockservice "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - dagtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + dagtest "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag/test" + blockservice "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) type UnixfsAPI CoreAPI diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index e113c50c278..caf59834008 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -23,18 +23,18 @@ import ( "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/repo" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + unixfs "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" cbor "gx/ipfs/QmSywXfm2v4Qkp4DcFqo8eehj49dJK3bdUnaLVxrdFLMQn/go-ipld-cbor" - mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + mdag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coredag/dagpb.go b/core/coredag/dagpb.go index 732c75936d9..62b3ea3327a 100644 --- a/core/coredag/dagpb.go +++ b/core/coredag/dagpb.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/coredag/raw.go b/core/coredag/raw.go index 1df81fcfb06..033f0d44dab 100644 --- a/core/coredag/raw.go +++ b/core/coredag/raw.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "math" - "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index e07422b6169..d98469ee3d5 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -14,8 +14,8 @@ import ( "github.com/ipfs/go-ipfs/core" corecommands "github.com/ipfs/go-ipfs/core/commands" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" cmds "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds" cmdsHttp "gx/ipfs/QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz/go-ipfs-cmds/http" ) diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index a0c607df82a..3ab6dcde35b 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreapi "github.com/ipfs/go-ipfs/core/coreapi" - id "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/protocol/identify" ) type GatewayConfig struct { diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 1f2466accc6..00631df4116 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -17,18 +17,18 @@ import ( core "github.com/ipfs/go-ipfs/core" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/dagutils" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + resolver "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path/resolver" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + chunker "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" multibase "gx/ipfs/QmekxXDhCxCJRNuzmHreuaT3BsuJcsjcXWNrtV9C8DRHtd/go-multibase" ) diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index a3f299bb63b..8b5b143b327 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -18,13 +18,13 @@ import ( nsopts "github.com/ipfs/go-ipfs/namesys/opts" repo "github.com/ipfs/go-ipfs/repo" - id "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/protocol/identify" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + id "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/protocol/identify" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" ) // `ipfs object new unixfs-dir` diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 10dff2ccfc0..5a08b81f967 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/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/host/basic" - inet "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - swarmt "gx/ipfs/QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY/go-libp2p-swarm/testing" + bhost "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/host/basic" + inet "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + swarmt "gx/ipfs/Qmb55o5PuhvqwjdVLvc4VV3ouLziYc6TfwM9LC6GwBQokn/go-libp2p-swarm/testing" ) // This test is based on go-libp2p/p2p/net/swarm.TestConnectednessCorrect diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 689c3817315..40c5e890cce 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -12,7 +12,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 1e3827bc60a..9e3625a4402 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -16,17 +16,17 @@ import ( posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" + unixfs "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + balanced "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/balanced" + ihelper "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/helpers" + trickle "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer/trickle" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - unixfs "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - balanced "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/balanced" - ihelper "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/helpers" - trickle "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer/trickle" + chunker "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var log = logging.Logger("coreunix") diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index de03a601237..f37b42dad80 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -15,16 +15,16 @@ import ( "github.com/ipfs/go-ipfs/pin/gc" "github.com/ipfs/go-ipfs/repo" - "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" pi "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" files "gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit/files" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index 4c933c176e1..0ebd922a3e9 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -3,8 +3,8 @@ package coreunix import ( core "github.com/ipfs/go-ipfs/core" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ) 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 da0849d8b6a..54fa7dc5a15 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -7,20 +7,20 @@ import ( "testing" core "github.com/ipfs/go-ipfs/core" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + importer "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" + chunker "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) func getDagserv(t *testing.T) ipld.DAGService { diff --git a/core/mock/mock.go b/core/mock/mock.go index 6b2223c00f9..c0010210b89 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -8,14 +8,14 @@ import ( "github.com/ipfs/go-ipfs/repo" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - libp2p "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + host "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - host "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + libp2p "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) // NewMockNode constructs an IpfsNode for use in tests. diff --git a/core/pathresolver.go b/core/pathresolver.go index be27fc152cd..ff96d634c19 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -7,8 +7,8 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - resolver "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path/resolver" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + resolver "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path/resolver" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/core/pathresolver_test.go b/core/pathresolver_test.go index bb4e470d0b6..9df97406808 100644 --- a/core/pathresolver_test.go +++ b/core/pathresolver_test.go @@ -5,7 +5,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coremock "github.com/ipfs/go-ipfs/core/mock" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ) func TestResolveNoComponents(t *testing.T) { diff --git a/dagutils/diff.go b/dagutils/diff.go index 4e890a96263..830e5fff5ab 100644 --- a/dagutils/diff.go +++ b/dagutils/diff.go @@ -8,7 +8,7 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/dagutils/diffenum.go b/dagutils/diffenum.go index bcbdd8f99fa..b62a9c5f1bb 100644 --- a/dagutils/diffenum.go +++ b/dagutils/diffenum.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + mdag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/diffenum_test.go b/dagutils/diffenum_test.go index e9c57a7bb61..d02bf526a68 100644 --- a/dagutils/diffenum_test.go +++ b/dagutils/diffenum_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - mdtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + mdtest "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/dagutils/utils.go b/dagutils/utils.go index ba27d05c939..e9cd33248f1 100644 --- a/dagutils/utils.go +++ b/dagutils/utils.go @@ -4,15 +4,15 @@ import ( "context" "errors" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - syncds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" + + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + syncds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // Editor represents a ProtoNode tree editor and provides methods to diff --git a/dagutils/utils_test.go b/dagutils/utils_test.go index f94264221b8..7fb6c78067c 100644 --- a/dagutils/utils_test.go +++ b/dagutils/utils_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - mdtest "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag/test" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + mdtest "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag/test" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/exchange/reprovide/providers.go b/exchange/reprovide/providers.go index ad25e988b59..c8b12213da7 100644 --- a/exchange/reprovide/providers.go +++ b/exchange/reprovide/providers.go @@ -7,9 +7,9 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" cidutil "gx/ipfs/QmQJSeE3CX4zos9qeaG8EhecEK9zvrTEfTG84J8C5NVRwt/go-cidutil" - merkledag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + merkledag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + blocks "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - blocks "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // NewBlockstoreProvider returns key provider using bstore.AllKeysChan diff --git a/exchange/reprovide/reprovide.go b/exchange/reprovide/reprovide.go index 006d20eb8ab..f21633905a4 100644 --- a/exchange/reprovide/reprovide.go +++ b/exchange/reprovide/reprovide.go @@ -7,7 +7,7 @@ import ( backoff "gx/ipfs/QmPJUtEJsm5YLUWhF6imvyCH8KZXRJa9Wup7FDMwTy5Ufz/backoff" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/exchange/reprovide/reprovide_test.go b/exchange/reprovide/reprovide_test.go index 8d0730d2c7f..f3615b85d54 100644 --- a/exchange/reprovide/reprovide_test.go +++ b/exchange/reprovide/reprovide_test.go @@ -5,12 +5,12 @@ import ( "testing" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" + mock "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/mock" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - mock "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" . "github.com/ipfs/go-ipfs/exchange/reprovide" ) diff --git a/filestore/filestore.go b/filestore/filestore.go index d1e9ee9bfd4..1ad7471fbce 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -15,8 +15,8 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + dsq "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/query" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) var log = logging.Logger("filestore") diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 72f159fc980..98861cf3fc6 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,12 +7,12 @@ import ( "math/rand" "testing" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) func newTestFilestore(t *testing.T) (string, *Filestore) { diff --git a/filestore/fsrefstore.go b/filestore/fsrefstore.go index 1f5baf24e7a..7ecfaae8c5c 100644 --- a/filestore/fsrefstore.go +++ b/filestore/fsrefstore.go @@ -13,12 +13,12 @@ import ( posinfo "gx/ipfs/QmPG32VXR5jmpo9q8R9FNdR4Ae97Ky9CiZE6SctJLUB79H/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dsns "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/namespace" - dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" + dshelp "gx/ipfs/QmS73grfbWgWrNztd8Lns9GCG3jjRNDfcPYg2VYQzKDZSt/go-ipfs-ds-help" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dsns "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/namespace" + dsq "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/query" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) // FilestorePrefix identifies the key prefix for FileManager blocks. diff --git a/filestore/util.go b/filestore/util.go index ddc3c225e15..39df78c6f39 100644 --- a/filestore/util.go +++ b/filestore/util.go @@ -7,10 +7,10 @@ import ( pb "github.com/ipfs/go-ipfs/filestore/pb" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + dshelp "gx/ipfs/QmS73grfbWgWrNztd8Lns9GCG3jjRNDfcPYg2VYQzKDZSt/go-ipfs-ds-help" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dsq "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/query" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) // Status is used to identify the state of the block data referenced diff --git a/fuse/ipns/common.go b/fuse/ipns/common.go index a58ff6e8b63..2da8014cc04 100644 --- a/fuse/ipns/common.go +++ b/fuse/ipns/common.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-ipfs/core" nsys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ) // InitializeKeyspace sets the ipns record for the given key to diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index ed2cfef2935..f9b967bf4c4 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -17,8 +17,8 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + offroute "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" - offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" racedet "gx/ipfs/Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF/go-detect-race" ) diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 6528f32e92b..31ea71f5a7a 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -13,13 +13,13 @@ import ( core "github.com/ipfs/go-ipfs/core" namesys "github.com/ipfs/go-ipfs/namesys" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mfs "gx/ipfs/QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ/go-mfs" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - mfs "gx/ipfs/QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U/go-mfs" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" fs "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" diff --git a/fuse/node/mount_test.go b/fuse/node/mount_test.go index dac0e78e5a4..cd4fc592c6d 100644 --- a/fuse/node/mount_test.go +++ b/fuse/node/mount_test.go @@ -16,7 +16,7 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" - offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" + offroute "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 29c4092d4f8..d300068cbfd 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -20,11 +20,11 @@ import ( ci "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil/ci" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + importer "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" fstest "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse/fs/fstestutil" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" - importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + chunker "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 7579fb60e4b..2f12c56936b 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -11,10 +11,10 @@ import ( "syscall" core "github.com/ipfs/go-ipfs/core" - mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + mdag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" lgbl "gx/ipfs/QmNLzS18jsmwTxXewTm3YnZVLftWCeegNZEBFjMrnvnBrH/go-libp2p-loggables" fuse "gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F/fuse" diff --git a/namesys/base.go b/namesys/base.go index 5db5948aeba..705cf9fae54 100644 --- a/namesys/base.go +++ b/namesys/base.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ) type resolver interface { diff --git a/namesys/cache.go b/namesys/cache.go index 6e234587655..8272c2bdbfb 100644 --- a/namesys/cache.go +++ b/namesys/cache.go @@ -3,7 +3,7 @@ package namesys import ( "time" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ) func (ns *mpns) cacheGet(name string) (path.Path, bool) { diff --git a/namesys/dns.go b/namesys/dns.go index 9696136d2f4..247ea97b12a 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -8,7 +8,7 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" ) diff --git a/namesys/interface.go b/namesys/interface.go index aad69952c9b..142dfea9c1d 100644 --- a/namesys/interface.go +++ b/namesys/interface.go @@ -36,7 +36,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" ) diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go index eddd64da98a..23a069569e5 100644 --- a/namesys/ipns_resolver_validation_test.go +++ b/namesys/ipns_resolver_validation_test.go @@ -6,22 +6,22 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" u "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - ropts "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing/options" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" + mockrouting "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/mock" + offline "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" record "gx/ipfs/QmSb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb/go-libp2p-record" - mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" - offline "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + ropts "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing/options" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" + pstoremem "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore/pstoremem" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) func TestResolverValidation(t *testing.T) { diff --git a/namesys/namesys.go b/namesys/namesys.go index 0371174fede..7da1f4c7127 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -6,15 +6,15 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" lru "gx/ipfs/QmQjMHF8ptRgx4E57UFMiT4YM6kqaJeYxZ1MCDX23aw4rK/golang-lru" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" ) // mpns (a multi-protocol NameSystem) implements generic IPFS naming. diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index a77306a401a..5ee9ebeb667 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -7,16 +7,16 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - pstoremem "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore/pstoremem" - offroute "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/offline" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + offroute "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/offline" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + pstoremem "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore/pstoremem" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) type mockResolver struct { diff --git a/namesys/proquint.go b/namesys/proquint.go index cd29bff254e..9647f8152e6 100644 --- a/namesys/proquint.go +++ b/namesys/proquint.go @@ -7,7 +7,7 @@ import ( context "context" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" proquint "gx/ipfs/QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM/proquint" ) diff --git a/namesys/publisher.go b/namesys/publisher.go index 412b65dbb35..a5e2eae7e75 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -7,16 +7,16 @@ import ( "time" pin "github.com/ipfs/go-ipfs/pin" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - ft "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs" + ft "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" - pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + pb "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns/pb" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dsquery "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/query" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dsquery "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" base32 "gx/ipfs/QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6/base32" ) diff --git a/namesys/publisher_test.go b/namesys/publisher_test.go index a95867d8ced..b55742e14e7 100644 --- a/namesys/publisher_test.go +++ b/namesys/publisher_test.go @@ -8,13 +8,13 @@ import ( testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" ci "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" - mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + mockrouting "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/mock" + dshelp "gx/ipfs/QmS73grfbWgWrNztd8Lns9GCG3jjRNDfcPYg2VYQzKDZSt/go-ipfs-ds-help" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - dshelp "gx/ipfs/QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f/go-ipfs-ds-help" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) type identity struct { diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index 8124ec3ad4d..e2e650c46b7 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -7,15 +7,15 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" namesys "github.com/ipfs/go-ipfs/namesys" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" ic "gx/ipfs/QmPvyPwuCgJ7pDmrKDxRtsScJgBaM5h4EpRL2qQJsmXf4n/go-libp2p-crypto" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" gpctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" - pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" + pb "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns/pb" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" ) diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 54ec416fcf9..0a3afbf0bb5 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -10,11 +10,11 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" namesys "github.com/ipfs/go-ipfs/namesys" . "github.com/ipfs/go-ipfs/namesys/republisher" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ) func TestRepublish(t *testing.T) { diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 5e7feb9edff..18abb6897eb 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mockrouting "gx/ipfs/QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA/go-ipfs-routing/mock" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" + mockrouting "gx/ipfs/QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW/go-ipfs-routing/mock" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" ) func TestRoutingResolve(t *testing.T) { diff --git a/namesys/routing.go b/namesys/routing.go index f7b7c9e9a60..b65c0fa5935 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -6,14 +6,14 @@ import ( "time" opts "github.com/ipfs/go-ipfs/namesys/opts" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" - routing "gx/ipfs/QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD/go-libp2p-routing" - dht "gx/ipfs/QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P/go-libp2p-kad-dht" - ipns "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns" - pb "gx/ipfs/QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s/go-ipns/pb" + dht "gx/ipfs/QmTdMq4uYZXmGW3u6KgnpCRWjo1Y7dWjRuAaGPw7Qxqr1s/go-libp2p-kad-dht" + routing "gx/ipfs/QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU/go-libp2p-routing" + ipns "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns" + pb "gx/ipfs/QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o/go-ipns/pb" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto" diff --git a/p2p/listener.go b/p2p/listener.go index 14ac3956faa..f03130a899a 100644 --- a/p2p/listener.go +++ b/p2p/listener.go @@ -4,8 +4,8 @@ import ( "errors" "sync" - net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" - p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + p2phost "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" + net "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" ) diff --git a/p2p/local.go b/p2p/local.go index 0a51b55e93f..6773527e8ef 100644 --- a/p2p/local.go +++ b/p2p/local.go @@ -4,9 +4,9 @@ import ( "context" "time" - "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" tec "gx/ipfs/QmWHgLqrghM9zw77nF6gdvT9ExQ2RB9pLxkd8sDHZf1rWb/go-temp-err-catcher" + "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" diff --git a/p2p/p2p.go b/p2p/p2p.go index 9d9531d1255..8dc3c29fb88 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -1,8 +1,8 @@ package p2p import ( - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" - p2phost "gx/ipfs/QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x/go-libp2p-host" + p2phost "gx/ipfs/QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2/go-libp2p-host" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" ) diff --git a/p2p/remote.go b/p2p/remote.go index 351ac7d8e57..3a3f0937e8d 100644 --- a/p2p/remote.go +++ b/p2p/remote.go @@ -3,8 +3,8 @@ package p2p import ( "context" - net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" + net "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" ) diff --git a/p2p/stream.go b/p2p/stream.go index 54d8d04b4f2..f322cf1aabd 100644 --- a/p2p/stream.go +++ b/p2p/stream.go @@ -4,9 +4,9 @@ import ( "io" "sync" - net "gx/ipfs/QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z/go-libp2p-net" manet "gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net" - ifconnmgr "gx/ipfs/QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY/go-libp2p-interface-connmgr" + net "gx/ipfs/QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa/go-libp2p-net" + ifconnmgr "gx/ipfs/QmXPqoktJEKkWPT6rSdhCM2G3E1yR7uUBdjnJrhJYeBgHU/go-libp2p-interface-connmgr" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer" diff --git a/package.json b/package.json index 29750d28cd1..c1979994f70 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ }, { "author": "whyrusleeping", - "hash": "QmNkxudvyUjdKw5ComDSCbJTHCjrjNGYjEAUdhoEUUjFsX", + "hash": "QmZSHe9kqEcqUG6DSBrKYULk8EeZLDd1skpHNoSaK6rW4M", "name": "go-libp2p-secio", - "version": "2.0.12" + "version": "2.0.14" }, { "author": "whyrusleeping", @@ -94,9 +94,9 @@ }, { "author": "jbenet", - "hash": "QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP", + "hash": "QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D", "name": "go-datastore", - "version": "3.3.0" + "version": "3.4.0" }, { "author": "hashicorp", @@ -106,9 +106,9 @@ }, { "author": "whyrusleeping", - "hash": "QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv", + "hash": "QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX", "name": "go-libp2p-peerstore", - "version": "2.0.2" + "version": "2.0.3" }, { "author": "whyrusleeping", @@ -124,9 +124,9 @@ }, { "author": "whyrusleeping", - "hash": "QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY", + "hash": "QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8", "name": "go-libp2p", - "version": "6.0.15" + "version": "6.0.17" }, { "author": "whyrusleeping", @@ -136,21 +136,21 @@ }, { "author": "whyrusleeping", - "hash": "QmVeCKovBuuNK28FyADuRzpJMnQ8LtCKaaaXF5XYSLAjg8", + "hash": "QmbYQHTSz4Sg4Y2Vyd7hftGgM1yXwSUBKb47VpoPRuP5Nc", "name": "go-ds-flatfs", "version": "1.3.3" }, { "author": "whyrusleeping", - "hash": "Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo", + "hash": "QmQS6UXi1R87y9nEgnCNmG6YfMzvBSLir7xUheMNFP3hoe", "name": "go-ds-measure", "version": "1.4.3" }, { "author": "whyrusleeping", - "hash": "QmcxDvw8NnJsfdEcfrypwHkLeVxZY2rT8iiWsUuBnw93gb", + "hash": "QmccqjKZUTqp4ikWNyAbjBuP5HEdqSqRuAr9mcEhYab54a", "name": "go-ds-leveldb", - "version": "1.2.0" + "version": "1.2.1" }, { "author": "whyrusleeping", @@ -171,9 +171,9 @@ "version": "0.2.0" }, { - "hash": "QmXKSnQHAihkcGgk8ZXz7FgZgHboXeRduuEz9FkAddJK6P", + "hash": "QmTdMq4uYZXmGW3u6KgnpCRWjo1Y7dWjRuAaGPw7Qxqr1s", "name": "go-libp2p-kad-dht", - "version": "4.4.4" + "version": "4.4.6" }, { "author": "whyrusleeping", @@ -183,9 +183,9 @@ }, { "author": "whyrusleeping", - "hash": "QmUK4h113Hh7bR2gPpsMcbUEbbzc7hspocmPi91Bmi69nH", + "hash": "Qmbi2MdNz6bdqWJg9Fud3WCqTdzP4DXKBwYD16EJVkjzKX", "name": "go-libp2p-floodsub", - "version": "0.9.31" + "version": "0.9.33" }, { "author": "whyrusleeping", @@ -212,9 +212,9 @@ }, { "author": "whyrusleeping", - "hash": "QmYsbnP57nNUKWijs8o2q3ZFrSUcAGTdKoQPuSJC3Uxt1Y", + "hash": "QmQvMxiavoMJzuLPuqrzVX4nXZpMks29hqpv13d81aJNEF", "name": "go-smux-multiplex", - "version": "3.0.13" + "version": "3.0.15" }, { "author": "blang", @@ -224,9 +224,9 @@ }, { "author": "libp2p", - "hash": "QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET", + "hash": "QmNmyLmysLFuSRjNTW8XrbovrNYFbZoMknTcpYR2AvvDc3", "name": "go-libp2p-pnet", - "version": "3.0.2" + "version": "3.0.3" }, { "author": "kubuxu", @@ -235,15 +235,15 @@ "version": "0.2.3" }, { - "hash": "QmWKgrs6cyhTNUaTmAKs86K1FpYmkQLYVj83GqUvmuT3TY", + "hash": "Qmb4AZNKg9yQVKkQqejEcg86AaT6EqGemGV8mBjkfJBeGf", "name": "go-libp2p-kbucket", - "version": "2.2.9" + "version": "2.2.10" }, { "author": "whyrusleeping", - "hash": "QmcsgrV3nCAKjiHKZhKVXWc4oY3WBECJCqahXEMpHeMrev", + "hash": "QmejxafYByb7s4rEMoKjmThZm6HfQ1seASNejVNKde6LBZ", "name": "go-smux-yamux", - "version": "2.0.3" + "version": "2.0.4" }, { "author": "whyrusleeping", @@ -277,9 +277,9 @@ }, { "author": "whyrusleeping", - "hash": "QmQdLcvoy3JuSqhV6iwQ9T6Cv7hWLAdzob4jUZRPqFL67Z", + "hash": "QmWUPYHpNv4YahaBYXovuEJttgfqcNcN9Gg4arhQYcRoqa", "name": "go-libp2p-net", - "version": "3.0.11" + "version": "3.0.12" }, { "author": "whyrusleeping", @@ -289,15 +289,15 @@ }, { "author": "whyrusleeping", - "hash": "QmX9pw5dSUZ2FozbppcSDJiS7eEh1RFwJNwrbmyLoUMS9x", + "hash": "QmQKod7iLxQK6X3aFYvhDDnFdXo3QjxKeL2F7UrPtdKQR2", "name": "go-libp2p-host", - "version": "3.0.11" + "version": "3.0.12" }, { "author": "whyrusleeping", - "hash": "QmcALnLPFXgLLaZkXzGv99yt8xPfiWqFTumiXpWBJbU9cY", + "hash": "Qmb55o5PuhvqwjdVLvc4VV3ouLziYc6TfwM9LC6GwBQokn", "name": "go-libp2p-swarm", - "version": "3.0.15" + "version": "3.0.17" }, { "hash": "QmXTmUCBtDUrzDYVzASogLiNph7EBuYqEgPL7QoHNMzUnz", @@ -333,9 +333,9 @@ "version": "0.2.0" }, { - "hash": "QmQRfifvvbJ8xTKj4KX1VvGWK26hnPiy8eQvW1hmjc82nD", + "hash": "QmVQPj6rHdqz6dDQrjcdP36zDYLaoB7xwqRg39kx2PqqKU", "name": "go-libp2p-routing", - "version": "2.6.3" + "version": "2.6.4" }, { "author": "whyrusleeping", @@ -350,15 +350,15 @@ }, { "author": "vyzo", - "hash": "QmPq6vgdtDmuui5FU9qskJE7ijpmJKZ9rfmtdMW2jPvaos", + "hash": "Qmf5M8FECT1H1NGZ9kM6Ri4G4LfQGJcyMpfMPEA1herPuH", "name": "go-libp2p-circuit", - "version": "2.2.4" + "version": "2.2.6" }, { "author": "magik6k", - "hash": "Qmd1Zxnuj9puWCPS7DV1YVw1RM478NqyZmf1X5nsgjp6fQ", + "hash": "QmaixNkKwtinV3umL5VD1VDD5CQjnZhXY31awM2YHTzbui", "name": "go-ds-badger", - "version": "1.9.0" + "version": "1.10.0" }, { "author": "whyrusleeping", @@ -368,15 +368,15 @@ }, { "author": "whyrusleeping", - "hash": "QmSv3pHjpLUCB7hLgaz9SQGCi7cKmtSvxUK9FzaN7DjTYs", + "hash": "QmZygFpFQfDwTNeU8AYTfEgAXfb7yfuQh9L4wYG7GgtcMH", "name": "go-libp2p-connmgr", - "version": "0.3.20" + "version": "0.3.21" }, { "author": "why", - "hash": "QmYbLGD41kmPZfgGs5B8DMMwxtY61Wz4KPeGFZ2qoetsPY", + "hash": "QmXPqoktJEKkWPT6rSdhCM2G3E1yR7uUBdjnJrhJYeBgHU", "name": "go-libp2p-interface-connmgr", - "version": "0.0.17" + "version": "0.0.18" }, { "author": "why", @@ -404,9 +404,9 @@ }, { "author": "hsanjuan", - "hash": "QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p", + "hash": "QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f", "name": "go-ipfs-chunker", - "version": "0.1.1" + "version": "0.1.2" }, { "author": "jbenet", @@ -416,21 +416,21 @@ }, { "author": "hsanjuan", - "hash": "QmafbjCxKZEU87RYYCHX2pFP9Q6uLSLAScLr2VUErNTH1f", + "hash": "QmS73grfbWgWrNztd8Lns9GCG3jjRNDfcPYg2VYQzKDZSt", "name": "go-ipfs-ds-help", "version": "0.1.3" }, { "author": "hsanjuan", - "hash": "QmYKPBQpSSWwmgNTvVE3vQdPoeqxwudPQnXJ4hU383RsSA", + "hash": "QmQqPdGQfsfQTpRUUzgD3d2RzWHJffZsSqwopnZ2BkiezW", "name": "go-ipfs-routing", - "version": "0.1.4" + "version": "0.1.5" }, { "author": "hsanjuan", - "hash": "QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa", + "hash": "QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR", "name": "go-ipfs-blockstore", - "version": "0.1.3" + "version": "0.1.4" }, { "author": "whyrusleeping", @@ -458,21 +458,21 @@ }, { "author": "hsanjuan", - "hash": "QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3", + "hash": "QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb", "name": "go-ipfs-exchange-offline", "version": "0.1.3" }, { "author": "stebalien", - "hash": "QmNPwLVhPRALSGyDnuwBS2WvL9bfx247aSyFJpToTh98wQ", + "hash": "QmbyoYqzgpaKt97AEoAx4zJCuHdQ71GNkpVZwhJ1wUtzba", "name": "go-libp2p-pubsub-router", - "version": "0.4.7" + "version": "0.4.9" }, { "author": "Stebalien", - "hash": "QmUgBkA88adfXZ337UWNXpAhTK1xSFaWVJhMsDKm8gFXw4", + "hash": "QmfGNszPuruiURVbgyvoj7eoVe9bkj2uHugMZVteX9zxD1", "name": "go-libp2p-routing-helpers", - "version": "0.3.5" + "version": "0.3.6" }, { "author": "fsnotify", @@ -482,9 +482,9 @@ }, { "author": "stebalien", - "hash": "QmYZdD9dRfHtoYt4qAFgtKoiPBAoXntmM3ZcktZVvAgB4s", + "hash": "QmWhm9qS3NZdvTgAsB1cX4q9UbNu8yFybCcAMchCN88w7o", "name": "go-ipns", - "version": "0.1.10" + "version": "0.1.11" }, { "author": "whyrusleeping", @@ -494,33 +494,33 @@ }, { "author": "why", - "hash": "QmfRLvsYxBWuRT7QAHxnLnufTa84HG6GYf65Yrhsw6Pvhp", + "hash": "QmQHbKeMWRNT8koMhh2DrTXZWepYVoGPNXni6JG1L3BhGq", "name": "go-bitswap", - "version": "1.1.5" + "version": "1.1.7" }, { "author": "why", - "hash": "QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX", + "hash": "QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ", "name": "go-blockservice", - "version": "1.1.5" + "version": "1.1.7" }, { "author": "why", - "hash": "QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm", + "hash": "QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd", "name": "go-merkledag", - "version": "1.1.5" + "version": "1.1.7" }, { "author": "why", - "hash": "QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ", + "hash": "QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx", "name": "go-path", - "version": "1.1.5" + "version": "1.1.7" }, { "author": "why", - "hash": "QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices", + "hash": "QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf", "name": "go-unixfs", - "version": "1.1.5" + "version": "1.1.7" }, { "author": "magik6k", @@ -536,9 +536,9 @@ }, { "author": "hsanjuan", - "hash": "QmQUjAGdPuNA9tpzrx5osWnPMhht7B5YzJNddjB45DUq2U", + "hash": "QmPbuswDwcPT4WquGqGoeBBDuuBaUmbZJFYiaes6vkgXYJ", "name": "go-mfs", - "version": "0.1.5" + "version": "0.1.7" }, { "author": "kevina", @@ -554,9 +554,9 @@ }, { "author": "marten-seemann", - "hash": "QmNiPUdQMsgnqfMAdBmRZPndL8sfo2s8NMGEqJ2Uv7BcKR", + "hash": "QmbxTJyyqtyYYM7wLHWv529e2dwzt9a9o8FfVQALvPpadC", "name": "go-libp2p-quic-transport", - "version": "0.2.6" + "version": "0.2.7" }, { "author": "mitchellh", diff --git a/pin/gc/gc.go b/pin/gc/gc.go index 2be1333d5d2..c392eee9d77 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -8,16 +8,16 @@ import ( "strings" pin "github.com/ipfs/go-ipfs/pin" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - dstore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + dstore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" ) var log = logging.Logger("gc") diff --git a/pin/pin.go b/pin/pin.go index 2ed476414c1..4b91fa4072e 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -10,11 +10,11 @@ import ( "time" "github.com/ipfs/go-ipfs/dagutils" - mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + mdag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/pin/pin_test.go b/pin/pin_test.go index 4890872abe1..91efc24b661 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -5,15 +5,15 @@ import ( "testing" "time" - bs "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - mdag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + mdag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bs "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dssync "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/sync" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dssync "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/sync" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) var rand = util.NewTimeSeededRand() diff --git a/pin/set.go b/pin/set.go index 8bccc850347..0b50c23a066 100644 --- a/pin/set.go +++ b/pin/set.go @@ -10,7 +10,7 @@ import ( "sort" "github.com/ipfs/go-ipfs/pin/internal/pb" - "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" diff --git a/pin/set_test.go b/pin/set_test.go index 0502880ff89..1fcfb1ad12b 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -5,14 +5,14 @@ import ( "encoding/binary" "testing" - bserv "gx/ipfs/QmNozJswSuwiZspexEHcQo5GMqpzM5exUGjNW6s4AAipUX/go-blockservice" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" + bserv "gx/ipfs/QmY1fUNoXjC8sH86kyaK8BWFGaU6MmH4AJfF1w4sKjmtRZ/go-blockservice" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" - offline "gx/ipfs/QmPXcrGQQEEPswwg6YiE2WLk8qkmvncZ7zphMKKP8bXqY3/go-ipfs-exchange-offline" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - dsq "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/query" - blockstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + offline "gx/ipfs/QmT6dHGp3UYd3vUMpy7rzX2CXQv7HLcj42Vtq8qwwjgASb/go-ipfs-exchange-offline" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + dsq "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/query" + blockstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) func ignoreCids(_ cid.Cid) {} diff --git a/repo/fsrepo/datastores.go b/repo/fsrepo/datastores.go index eb4c34d9ade..d162c22b444 100644 --- a/repo/fsrepo/datastores.go +++ b/repo/fsrepo/datastores.go @@ -11,13 +11,13 @@ import ( repo "github.com/ipfs/go-ipfs/repo" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - flatfs "gx/ipfs/QmVeCKovBuuNK28FyADuRzpJMnQ8LtCKaaaXF5XYSLAjg8/go-ds-flatfs" + measure "gx/ipfs/QmQS6UXi1R87y9nEgnCNmG6YfMzvBSLir7xUheMNFP3hoe/go-ds-measure" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" + mount "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore/mount" + badgerds "gx/ipfs/QmaixNkKwtinV3umL5VD1VDD5CQjnZhXY31awM2YHTzbui/go-ds-badger" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" - mount "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore/mount" - levelds "gx/ipfs/QmcxDvw8NnJsfdEcfrypwHkLeVxZY2rT8iiWsUuBnw93gb/go-ds-leveldb" - badgerds "gx/ipfs/Qmd1Zxnuj9puWCPS7DV1YVw1RM478NqyZmf1X5nsgjp6fQ/go-ds-badger" - measure "gx/ipfs/Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo/go-ds-measure" + flatfs "gx/ipfs/QmbYQHTSz4Sg4Y2Vyd7hftGgM1yXwSUBKb47VpoPRuP5Nc/go-ds-flatfs" + levelds "gx/ipfs/QmccqjKZUTqp4ikWNyAbjBuP5HEdqSqRuAr9mcEhYab54a/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 5babbb6a277..ad2555d66dd 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -19,14 +19,14 @@ import ( dir "github.com/ipfs/go-ipfs/thirdparty/dir" util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util" + measure "gx/ipfs/QmQS6UXi1R87y9nEgnCNmG6YfMzvBSLir7xUheMNFP3hoe/go-ds-measure" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" serialize "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config/serialize" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" lockfile "gx/ipfs/Qmc4w3gm2TqoEbTYjpPs5FXP8DEB6cuvZWPy6bUTKiht7a/go-fs-lock" homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir" - measure "gx/ipfs/Qme1Nn7zgqePeiHs94KxbrWWSxPdgZFGY8xP6YU6SvXepo/go-ds-measure" ) // LockFile is the filename of the repo lock, relative to config dir diff --git a/repo/fsrepo/fsrepo_test.go b/repo/fsrepo/fsrepo_test.go index 8167bbcf825..c27a0950308 100644 --- a/repo/fsrepo/fsrepo_test.go +++ b/repo/fsrepo/fsrepo_test.go @@ -10,7 +10,7 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/assert" config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" - datastore "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + datastore "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" ) // swap arg order diff --git a/repo/repo.go b/repo/repo.go index ab067b027a8..50948965b6c 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -9,7 +9,7 @@ import ( config "gx/ipfs/QmSoYrBMibm2T3LupaLuez7LPGnyrJwdRxvTfPUyCp691u/go-ipfs-config" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" - ds "gx/ipfs/QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP/go-datastore" + ds "gx/ipfs/QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D/go-datastore" ) var ( diff --git a/tar/format.go b/tar/format.go index 6f2aa648204..a2413636935 100644 --- a/tar/format.go +++ b/tar/format.go @@ -9,13 +9,13 @@ import ( "strings" "github.com/ipfs/go-ipfs/dagutils" - dag "gx/ipfs/QmTGpm48qm4fUZ9E5hMXy4ZngJUYCMKu15rTMVR3BSEnPm/go-merkledag" - path "gx/ipfs/QmV4QxScV9Y7LbaWhHazFfRd8uyeUd4pAH8a7fFFbi5odJ/go-path" - importer "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/importer" - uio "gx/ipfs/QmavvHwEZTkNShKWK1jRejv2Y8oF6ZYxdGxytL3Mwvices/go-unixfs/io" + importer "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/importer" + uio "gx/ipfs/QmQDcPcBH8nfz3JB4K4oEvxhRmBwCrMgvG966XpExEWexf/go-unixfs/io" + path "gx/ipfs/QmQmMu1vsgsjxyB8tzrA6ZTCTCLDLVaXMb4Q57r2v886Sx/go-path" + dag "gx/ipfs/QmXTw4By9FMZAt7qJm4JoJuNBrBgqMMzkS4AjKc4zqTUVd/go-merkledag" - chunker "gx/ipfs/QmULKgr55cSWR8Kiwy3cVRcAiGVnR6EVSaB7hJcWS4138p/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" + chunker "gx/ipfs/QmbrQ27wGQeE8spxjbw9mk5Ef7as4tRFSnWLkEGg4xeg2f/go-ipfs-chunker" ipld "gx/ipfs/QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL/go-ipld-format" ) diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 2950bc99729..d8de70d1e3a 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -19,9 +19,9 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" ) diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index ba8c3be6736..47620497e23 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -16,8 +16,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ) func BenchmarkCat1MB(b *testing.B) { benchmarkVarCat(b, unit.MB*1) } diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 7530f122f47..73723ca1134 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -9,8 +9,8 @@ import ( "github.com/ipfs/go-ipfs/core/mock" "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" ) func TestBitswapWithoutRouting(t *testing.T) { diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index 6baba0dfd7a..d478e635771 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "gx/ipfs/QmNfQbgBfARAtrYsBguChX6VJ5nbjeoYy1KdC36aaYWqG8/go-testutil" - mocknet "gx/ipfs/QmNmj2AeM46ZQqHARnWidb5qqHoZJFeYWzmG65jviJDRQY/go-libp2p/p2p/net/mock" - pstore "gx/ipfs/QmSJ36wcYQyEViJUWUEhJU81tw1KdakTKqLLHbvYbA9zDv/go-libp2p-peerstore" + mocknet "gx/ipfs/QmU9Cf9q5TBCAC3kg74Fqr6K7DQTwa41C44YypYqB2GfR8/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmXEyLwySuDMXejWBu8XwdkX2WuGKk8x9jFwz8js7j72UX/go-libp2p-peerstore" ) func TestThreeLeggedCatTransfer(t *testing.T) { diff --git a/thirdparty/cidv0v1/blockstore.go b/thirdparty/cidv0v1/blockstore.go index 82c567a3e55..e6fc9169fcb 100644 --- a/thirdparty/cidv0v1/blockstore.go +++ b/thirdparty/cidv0v1/blockstore.go @@ -4,7 +4,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" - bs "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + bs "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) type blockstore struct { diff --git a/thirdparty/verifbs/verifbs.go b/thirdparty/verifbs/verifbs.go index 44758a8d63c..cc2f3472668 100644 --- a/thirdparty/verifbs/verifbs.go +++ b/thirdparty/verifbs/verifbs.go @@ -4,7 +4,7 @@ import ( cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" blocks "gx/ipfs/QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM/go-block-format" "gx/ipfs/QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT/go-verifcid" - bstore "gx/ipfs/QmfUhZX9KpvJiuiziUzP2cjhRAyqHJURsPgRKn1cdDZMKa/go-ipfs-blockstore" + bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" ) type VerifBSGC struct { From f90ee061d38fa4ff1b560d0cc47a99751df1a960 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Mon, 8 Oct 2018 14:15:56 +0800 Subject: [PATCH 85/85] update `add --chunker` test License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- test/sharness/t0040-add-and-cat.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 0ee4477cdcd..ee3663ad321 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -156,15 +156,34 @@ test_add_cat_file() { test_cmp expected actual ' + test_expect_success "ipfs add --chunker size-64 succeeds" ' + ipfs add --chunker=size-64 mountdir/hello.txt >actual + ' + + test_expect_success "ipfs add --chunker size-64 output looks good" ' + HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" && + echo "added $HASH hello.txt" >expected && + test_cmp expected actual + ' + + test_expect_success "ipfs add --chunker=size-0 failed" ' + test_expect_code 1 ipfs add -Q --chunker=size-0 mountdir/hello.txt + ' + test_expect_success "ipfs add --chunker rabin-36-512-1024 succeeds" ' - ipfs add -Q --chunker rabin-36-512-1024 mountdir/hello.txt + ipfs add --chunker rabin-36-512-1024 mountdir/hello.txt >actual + ' + + test_expect_success "ipfs add --chunker rabin-36-512-1024 output looks good" ' + HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" && + echo "added $HASH hello.txt" >expected && + test_cmp expected actual ' test_expect_success "ipfs add --chunker rabin-12-512-1024 failed" ' test_expect_code 1 ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt ' - test_expect_success "ipfs add on hidden file succeeds" ' echo "Hello Worlds!" >mountdir/.hello.txt && ipfs add mountdir/.hello.txt >actual