diff --git a/.gx/lastpubver b/.gx/lastpubver index 7afbdf417..67a79c15c 100644 --- a/.gx/lastpubver +++ b/.gx/lastpubver @@ -1 +1 @@ -0.4.9: QmQuvzi7p2qv9oduQ8o6fhPXDBCns9ryjjxqumyNvE5gZs +0.4.10: QmXmrMgvGsobiWUEfvtS87oeQwRviCp2g9JD6uKea3Fo5m diff --git a/.travis.yml b/.travis.yml index 602ba01d4..c2dc0b4c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ os: language: go go: - - 1.7 + - 1.8 env: - TEST_NO_FUSE=1 TEST_VERBOSE=1 TEST_SUITE=test_go_expensive diff --git a/CHANGELOG.md b/CHANGELOG.md index ee3172a29..ef1c13ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,79 @@ # go-ipfs changelog +### 0.4.10 - 2017-06-27 + +Ipfs 0.4.10 is a patch release that contains several exciting new features, +bugfixes and general improvements. Including new commands, easier corruption +recovery, and a generally cleaner codebase. + +The `ipfs pin` command has two new subcommands, `verify` and `update`. `ipfs +pin verify` is used to scan the repo for pinned object graphs and check their +integrity. Any issues are reported back with helpful error text to make error +recovery simpler. This subcommand was added to help recover from datastore +corruptions, particularly if using the experimental filestore and accidentally +deleting tracked files. +`ipfs pin update` was added to make the task of keeping a large, frequently +changing object graph pinned. Previously users had to call `ipfs pin rm` on the +old pin, and `ipfs pin add` on the new one. The 'new' `ipfs pin add` call would +be very expensive as it would need to verify the entirety of the graph again. +The `ipfs pin update` command takes shortcuts, portions of the graph that were +covered under the old pin are assumed to be fine, and the command skips +checking them. + +Next up, we have finally implemented an `ipfs shutdown` command so users can +shut down their ipfs daemons via the API. This is especially useful on +platforms that make it difficult to control processes (Android, for example), +and is also useful when needing to shut down a node remotely and you do not +have access to the machine itself. + +`ipfs add` has gained a new flag; the `--hash` flag allows you to select which +hash function to use and we have given it the ability to select `blake2b-256`. +This pushes us one step closer to shifting over to using blake2b as the +default. Blake2b is significantly faster than sha2-256, and also is conjectured +to provide superior security. + +We have also finally implemented a very early (and experimental) `ipfs p2p`. +This command and its subcommands will allow you to open up arbitrary streams to +other ipfs peers through libp2p. The interfaces are a little bit clunky right +now, but shouldn't get in the way of anyone wanting to try building a fully +peer to peer application on top of ipfs and libp2p. For more info on this +command, to ask questions, or to provide feedback, head over to the [feedback +issue](https://github.com/ipfs/go-ipfs/issues/3994) for the command. + +A few other subcommands and flags were added around the API, as well as many +other requested improvements. See below for the full list of changes. + + +- Features + - Add support for specifying the hash function in `ipfs add` ([ipfs/go-ipfs#3919](https://github.com/ipfs/go-ipfs/pull/3919)) + - Implement `ipfs key {rm, rename}` ([ipfs/go-ipfs#3892](https://github.com/ipfs/go-ipfs/pull/3892)) + - Implement `ipfs shutdown` command ([ipfs/go-ipfs#3884](https://github.com/ipfs/go-ipfs/pull/3884)) + - Implement `ipfs pin update` ([ipfs/go-ipfs#3846](https://github.com/ipfs/go-ipfs/pull/3846)) + - Implement `ipfs pin verify` ([ipfs/go-ipfs#3843](https://github.com/ipfs/go-ipfs/pull/3843)) + - Implemented experimental p2p commands ([ipfs/go-ipfs#3943](https://github.com/ipfs/go-ipfs/pull/3943)) +- Improvements + - Add MaxStorage field to output of "repo stat" ([ipfs/go-ipfs#3915](https://github.com/ipfs/go-ipfs/pull/3915)) + - Add Suborigin header to gateway responses ([ipfs/go-ipfs#3914](https://github.com/ipfs/go-ipfs/pull/3914)) + - Add "--file-order" option to "filestore ls" and "verify" ([ipfs/go-ipfs#3938](https://github.com/ipfs/go-ipfs/pull/3938)) + - Allow selecting ipns keys by Peer ID ([ipfs/go-ipfs#3882](https://github.com/ipfs/go-ipfs/pull/3882)) + - Don't redirect to trailing slash in gateway for `go get` ([ipfs/go-ipfs#3963](https://github.com/ipfs/go-ipfs/pull/3963)) + - Add 'ipfs dht findprovs --num-providers' to allow choosing number of providers to find ([ipfs/go-ipfs#3966](https://github.com/ipfs/go-ipfs/pull/3966)) + - Make sure all keystore keys get republished ([ipfs/go-ipfs#3951](https://github.com/ipfs/go-ipfs/pull/3951)) +- Documentation + - Adding documentation on PubSub encodedings ([ipfs/go-ipfs#3909](https://github.com/ipfs/go-ipfs/pull/3909)) + - Change 'neccessary' to 'necessary' ([ipfs/go-ipfs#3941](https://github.com/ipfs/go-ipfs/pull/3941)) + - README.md: add Nix to the linux package managers ([ipfs/go-ipfs#3939](https://github.com/ipfs/go-ipfs/pull/3939)) + - More verbose errors in filestore ([ipfs/go-ipfs#3964](https://github.com/ipfs/go-ipfs/pull/3964)) +- Bugfixes + - Fix typo in message when file size check fails ([ipfs/go-ipfs#3895](https://github.com/ipfs/go-ipfs/pull/3895)) + - Clean up bitswap ledgers when disconnecting ([ipfs/go-ipfs#3437](https://github.com/ipfs/go-ipfs/pull/3437)) + - Make odds of 'process added after close' panic less likely ([ipfs/go-ipfs#3940](https://github.com/ipfs/go-ipfs/pull/3940)) +- General Changes and Refactorings + - Remove 'ipfs diag net' from codebase ([ipfs/go-ipfs#3916](https://github.com/ipfs/go-ipfs/pull/3916)) + - Update to dht code with provide announce option ([ipfs/go-ipfs#3928](https://github.com/ipfs/go-ipfs/pull/3928)) + - Apply the megacheck code vetting tool ([ipfs/go-ipfs#3949](https://github.com/ipfs/go-ipfs/pull/3949)) + - Expose port 8081 in docker container for /ws listener ([ipfs/go-ipfs#3954](https://github.com/ipfs/go-ipfs/pull/3954)) + ### 0.4.9 - 2017-04-30 Ipfs 0.4.9 is a maintenance release that contains several useful bugfixes and diff --git a/assets/assets.go b/assets/assets.go index 6507bd42c..19ff9016c 100644 --- a/assets/assets.go +++ b/assets/assets.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/coreunix" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" // this import keeps gx from thinking the dep isn't used _ "gx/ipfs/QmQfeKxQtBN721pekQh6Jq24adFUjnU65YdY3GNczfuG2T/dir-index-html" diff --git a/blocks/blocks.go b/blocks/blocks.go deleted file mode 100644 index 1f6abe655..000000000 --- a/blocks/blocks.go +++ /dev/null @@ -1,82 +0,0 @@ -// Package blocks contains the lowest level of IPFS data structures. -// A block is raw data accompanied by a CID. The CID contains the multihash -// corresponding to the block. -package blocks - -import ( - "errors" - "fmt" - - mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" - u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" -) - -// ErrWrongHash is returned when the Cid of a block is not the expected -// according to the contents. It is currently used only when debugging. -var ErrWrongHash = errors.New("data did not match given hash") - -// Block provides abstraction for blocks implementations. -type Block interface { - RawData() []byte - Cid() *cid.Cid - String() string - Loggable() map[string]interface{} -} - -// A BasicBlock is a singular block of data in ipfs. It implements the Block -// interface. -type BasicBlock struct { - cid *cid.Cid - data []byte -} - -// NewBlock creates a Block object from opaque data. It will hash the data. -func NewBlock(data []byte) *BasicBlock { - // TODO: fix assumptions - return &BasicBlock{data: data, cid: cid.NewCidV0(u.Hash(data))} -} - -// NewBlockWithCid creates a new block when the hash of the data -// is already known, this is used to save time in situations where -// we are able to be confident that the data is correct. -func NewBlockWithCid(data []byte, c *cid.Cid) (*BasicBlock, error) { - if u.Debug { - chkc, err := c.Prefix().Sum(data) - if err != nil { - return nil, err - } - - if !chkc.Equals(c) { - return nil, ErrWrongHash - } - } - return &BasicBlock{data: data, cid: c}, nil -} - -// Multihash returns the hash contained in the block CID. -func (b *BasicBlock) Multihash() mh.Multihash { - return b.cid.Hash() -} - -// RawData returns the block raw contents as a byte slice. -func (b *BasicBlock) RawData() []byte { - return b.data -} - -// Cid returns the content identifier of the block. -func (b *BasicBlock) Cid() *cid.Cid { - return b.cid -} - -// String provides a human-readable representation of the block CID. -func (b *BasicBlock) String() string { - return fmt.Sprintf("[Block %s]", b.Cid()) -} - -// Loggable returns a go-log loggable item. -func (b *BasicBlock) Loggable() map[string]interface{} { - return map[string]interface{}{ - "block": b.Cid().String(), - } -} diff --git a/blocks/blocks_test.go b/blocks/blocks_test.go deleted file mode 100644 index e984a1772..000000000 --- a/blocks/blocks_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package blocks - -import ( - "bytes" - "testing" - - mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" - u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" -) - -func TestBlocksBasic(t *testing.T) { - - // Test empty data - empty := []byte{} - NewBlock(empty) - - // Test nil case - NewBlock(nil) - - // Test some data - NewBlock([]byte("Hello world!")) -} - -func TestData(t *testing.T) { - data := []byte("some data") - block := NewBlock(data) - - if !bytes.Equal(block.RawData(), data) { - t.Error("data is wrong") - } -} - -func TestHash(t *testing.T) { - data := []byte("some other data") - block := NewBlock(data) - - hash, err := mh.Sum(data, mh.SHA2_256, -1) - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(block.Multihash(), hash) { - t.Error("wrong multihash") - } -} - -func TestCid(t *testing.T) { - data := []byte("yet another data") - block := NewBlock(data) - c := block.Cid() - - if !bytes.Equal(block.Multihash(), c.Hash()) { - t.Error("key contains wrong data") - } -} - -func TestManualHash(t *testing.T) { - oldDebugState := u.Debug - defer (func() { - u.Debug = oldDebugState - })() - - data := []byte("I can't figure out more names .. data") - hash, err := mh.Sum(data, mh.SHA2_256, -1) - if err != nil { - t.Fatal(err) - } - - c := cid.NewCidV0(hash) - - u.Debug = false - block, err := NewBlockWithCid(data, c) - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(block.Multihash(), hash) { - t.Error("wrong multihash") - } - - data[5] = byte((uint32(data[5]) + 5) % 256) // Transfrom hash to be different - block, err = NewBlockWithCid(data, c) - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(block.Multihash(), hash) { - t.Error("wrong multihash") - } - - u.Debug = true - - _, err = NewBlockWithCid(data, c) - if err != ErrWrongHash { - t.Fatal(err) - } -} diff --git a/blocks/blockstore/arc_cache.go b/blocks/blockstore/arc_cache.go index 75c7ee489..1e9d46464 100644 --- a/blocks/blockstore/arc_cache.go +++ b/blocks/blockstore/arc_cache.go @@ -3,12 +3,12 @@ package blockstore import ( "context" - "github.com/ipfs/go-ipfs/blocks" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // arccache wraps a BlockStore with an Adaptive Replacement Cache (ARC) for diff --git a/blocks/blockstore/arc_cache_test.go b/blocks/blockstore/arc_cache_test.go index e6f35144d..c1868814b 100644 --- a/blocks/blockstore/arc_cache_test.go +++ b/blocks/blockstore/arc_cache_test.go @@ -4,11 +4,11 @@ import ( "context" "testing" - "github.com/ipfs/go-ipfs/blocks" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var exampleBlock = blocks.NewBlock([]byte("foo")) diff --git a/blocks/blockstore/blockstore.go b/blocks/blockstore/blockstore.go index e1c7dcf35..905fcf029 100644 --- a/blocks/blockstore/blockstore.go +++ b/blocks/blockstore/blockstore.go @@ -8,14 +8,14 @@ import ( "sync" "sync/atomic" - blocks "github.com/ipfs/go-ipfs/blocks" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsns "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/namespace" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsns "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/namespace" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("blockstore") @@ -193,8 +193,6 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error) // KeysOnly, because that would be _a lot_ of data. q := dsq.Query{KeysOnly: true} - // datastore/namespace does *NOT* fix up Query.Prefix - q.Prefix = BlockPrefix.String() res, err := bs.datastore.Query(q) if err != nil { return nil, err diff --git a/blocks/blockstore/blockstore_test.go b/blocks/blockstore/blockstore_test.go index 93705997e..866fd40cd 100644 --- a/blocks/blockstore/blockstore_test.go +++ b/blocks/blockstore/blockstore_test.go @@ -6,14 +6,14 @@ import ( "fmt" "testing" - blocks "github.com/ipfs/go-ipfs/blocks" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" - ds_sync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + ds_sync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestGetWhenKeyNotPresent(t *testing.T) { diff --git a/blocks/blockstore/bloom_cache.go b/blocks/blockstore/bloom_cache.go index 8bcf962fe..1467ad31f 100644 --- a/blocks/blockstore/bloom_cache.go +++ b/blocks/blockstore/bloom_cache.go @@ -5,10 +5,10 @@ import ( "sync/atomic" "time" - "github.com/ipfs/go-ipfs/blocks" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" bloom "gx/ipfs/QmeiMCBkYHxkDkDfnDadzz4YxY5ruL5Pj499essE4vRsGM/bbloom" ) diff --git a/blocks/blockstore/bloom_cache_test.go b/blocks/blockstore/bloom_cache_test.go index 85046e270..85ed29dc9 100644 --- a/blocks/blockstore/bloom_cache_test.go +++ b/blocks/blockstore/bloom_cache_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/ipfs/go-ipfs/blocks" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" context "context" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) func testBloomCached(ctx context.Context, bs Blockstore) (*bloomcache, error) { diff --git a/blocks/blockstore/util/remove.go b/blocks/blockstore/util/remove.go index 57c6741ca..defe9347d 100644 --- a/blocks/blockstore/util/remove.go +++ b/blocks/blockstore/util/remove.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" bs "github.com/ipfs/go-ipfs/blocks/blockstore" "github.com/ipfs/go-ipfs/pin" diff --git a/blocks/blocksutil/block_generator.go b/blocks/blocksutil/block_generator.go index cff2213b2..324da54a7 100644 --- a/blocks/blocksutil/block_generator.go +++ b/blocks/blocksutil/block_generator.go @@ -2,7 +2,7 @@ // with Blocks. package blocksutil -import "github.com/ipfs/go-ipfs/blocks" +import "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" // NewBlockGenerator returns an object capable of // producing blocks. diff --git a/blocks/set/set.go b/blocks/set/set.go index d71712dcc..df9de4f0f 100644 --- a/blocks/set/set.go +++ b/blocks/set/set.go @@ -4,7 +4,7 @@ package set import ( - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" "github.com/ipfs/go-ipfs/blocks/bloom" ) diff --git a/blocks/set/set_test.go b/blocks/set/set_test.go index ecb291637..a141935cb 100644 --- a/blocks/set/set_test.go +++ b/blocks/set/set_test.go @@ -5,7 +5,7 @@ import ( bu "github.com/ipfs/go-ipfs/blocks/blocksutil" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) const ( diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 66701bc9d..98afac842 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -8,12 +8,12 @@ import ( "errors" "fmt" - blocks "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" exchange "github.com/ipfs/go-ipfs/exchange" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("blockservice") diff --git a/blockservice/blockservice_test.go b/blockservice/blockservice_test.go index bd3b0c665..db3b78ecc 100644 --- a/blockservice/blockservice_test.go +++ b/blockservice/blockservice_test.go @@ -3,13 +3,13 @@ package blockservice import ( "testing" - "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" butil "github.com/ipfs/go-ipfs/blocks/blocksutil" offline "github.com/ipfs/go-ipfs/exchange/offline" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) func TestWriteThroughWorks(t *testing.T) { diff --git a/blockservice/test/blocks_test.go b/blockservice/test/blocks_test.go index 68f77be7e..45ac82955 100644 --- a/blockservice/test/blocks_test.go +++ b/blockservice/test/blocks_test.go @@ -7,15 +7,15 @@ import ( "testing" "time" - blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" . "github.com/ipfs/go-ipfs/blockservice" offline "github.com/ipfs/go-ipfs/exchange/offline" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func newObject(data []byte) blocks.Block { diff --git a/ci/Dockerfile.buildenv b/ci/Dockerfile.buildenv index 40971e0ff..0545150a3 100644 --- a/ci/Dockerfile.buildenv +++ b/ci/Dockerfile.buildenv @@ -1,4 +1,4 @@ -FROM golang:1.7 +FROM golang:1.8 MAINTAINER Jakub Sztandera diff --git a/circle.yml b/circle.yml index ccc888b06..5a6290c15 100644 --- a/circle.yml +++ b/circle.yml @@ -12,8 +12,8 @@ machine: post: - sudo rm -rf /usr/local/go - - if [ ! -e go1.7.linux-amd64.tar.gz ]; then curl -o go1.7.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz; fi - - sudo tar -C /usr/local -xzf go1.7.linux-amd64.tar.gz + - if [ ! -e go1.8.3.linux-amd64.tar.gz ]; then curl -o go1.8.3.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz; fi + - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz services: - docker @@ -30,7 +30,7 @@ dependencies: - cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps cache_directories: - - ~/go1.7.linux-amd64.tar.gz + - ~/go1.8.3.linux-amd64.tar.gz - "$HOME/.go_workspace/src/gx/ipfs" test: diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 4d43c422f..a1bf0d23d 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -7,6 +7,7 @@ import ( "io" "os" "path" + "strings" context "context" assets "github.com/ipfs/go-ipfs/assets" @@ -27,6 +28,13 @@ var initCmd = &cmds.Command{ ShortDescription: ` Initializes ipfs configuration files and generates a new keypair. +If you are going to run IPFS in server environment, you may want to +initialize it using 'server' profile. + +Available profiles: + 'server' - Disables local host discovery, recommended when + running IPFS on machines with public IPv4 addresses. + ipfs uses a repository in the local file system. By default, the repo is located at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable: @@ -40,6 +48,7 @@ environment variable: Options: []cmds.Option{ cmds.IntOption("bits", "b", "Number of bits to use in the generated RSA private key.").Default(nBitsForKeypairDefault), cmds.BoolOption("empty-repo", "e", "Don't add and pin help files to the local storage.").Default(false), + cmds.StringOption("profile", "p", "Apply profile settings to config. Multiple profiles can be separated by ','"), // TODO need to decide whether to expose the override as a file or a // directory. That is: should we allow the user to also specify the @@ -96,7 +105,18 @@ environment variable: } } - if err := doInit(os.Stdout, req.InvocContext().ConfigRoot, empty, nBitsForKeypair, conf); err != nil { + profile, _, err := req.Option("profile").String() + if err != nil { + res.SetError(err, cmds.ErrNormal) + return + } + + var profiles []string + if profile != "" { + profiles = strings.Split(profile, ",") + } + + if err := doInit(os.Stdout, req.InvocContext().ConfigRoot, empty, nBitsForKeypair, profiles, conf); err != nil { res.SetError(err, cmds.ErrNormal) return } @@ -108,10 +128,10 @@ Reinitializing would overwrite your keys. `) func initWithDefaults(out io.Writer, repoRoot string) error { - return doInit(out, repoRoot, false, nBitsForKeypairDefault, nil) + return doInit(out, repoRoot, false, nBitsForKeypairDefault, nil, nil) } -func doInit(out io.Writer, repoRoot string, empty bool, nBitsForKeypair int, conf *config.Config) error { +func doInit(out io.Writer, repoRoot string, empty bool, nBitsForKeypair int, confProfiles []string, conf *config.Config) error { if _, err := fmt.Fprintf(out, "initializing IPFS node at %s\n", repoRoot); err != nil { return err } @@ -132,6 +152,17 @@ func doInit(out io.Writer, repoRoot string, empty bool, nBitsForKeypair int, con } } + for _, profile := range confProfiles { + transformer, ok := config.ConfigProfiles[profile] + if !ok { + return fmt.Errorf("invalid configuration profile: %s", profile) + } + + if err := transformer(conf); err != nil { + return err + } + } + if err := fsrepo.Init(repoRoot, conf); err != nil { return err } diff --git a/core/builder.go b/core/builder.go index 2603914a6..e41693049 100644 --- a/core/builder.go +++ b/core/builder.go @@ -21,11 +21,11 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + retry "gx/ipfs/QmPP91WFAb8LCs8EMzGvDPPvg1kacbqRkoxgTTnUsZckGe/retry-datastore" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" - retry "gx/ipfs/QmUaGhKyLgTuYDdQsbKST1tYr2CVoix59rqaxdxqk2UbfK/retry-datastore" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index c3350addc..e7d94e912 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -11,7 +11,7 @@ import ( "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/core/commands/block.go b/core/commands/block.go index de71c493e..32b113fcc 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -7,13 +7,13 @@ import ( "io/ioutil" "strings" - "github.com/ipfs/go-ipfs/blocks" util "github.com/ipfs/go-ipfs/blocks/blockstore/util" cmds "github.com/ipfs/go-ipfs/commands" mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type BlockStat struct { @@ -149,20 +149,15 @@ It reads from stdin, and is a base58 encoded multihash. pref.Version = 1 format, _, _ := req.Option("format").String() - switch format { - case "cbor": - pref.Codec = cid.DagCBOR - case "protobuf": - pref.Codec = cid.DagProtobuf - case "raw": - pref.Codec = cid.Raw - case "v0": - pref.Version = 0 - pref.Codec = cid.DagProtobuf - default: + formatval, ok := cid.Codecs[format] + if !ok { res.SetError(fmt.Errorf("unrecognized format: %s", format), cmds.ErrNormal) return } + if format == "v0" { + pref.Version = 0 + } + pref.Codec = formatval mhtype, _, _ := req.Option("mhtype").String() mhtval, ok := mh.Names[mhtype] diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index 8b932064b..a01786dfd 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -8,10 +8,11 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" path "github.com/ipfs/go-ipfs/path" + pin "github.com/ipfs/go-ipfs/pin" - ipldcbor "gx/ipfs/QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR/go-ipld-cbor" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" + ipldcbor "gx/ipfs/Qmcdid3XrCxcoNQUqZKiiKtM7JXxtyipU3izyRqwjFbVWw/go-ipld-cbor" ) var DagCmd = &cmds.Command{ @@ -48,6 +49,7 @@ into an object of the specified format. Options: []cmds.Option{ cmds.StringOption("format", "f", "Format that the object will be added as.").Default("cbor"), cmds.StringOption("input-enc", "Format that the input object will be.").Default("json"), + cmds.BoolOption("pin", "Pin this object when adding.").Default(false), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -64,7 +66,17 @@ into an object of the specified format. ienc, _, _ := req.Option("input-enc").String() format, _, _ := req.Option("format").String() + dopin, _, err := req.Option("pin").Bool() + if err != nil { + res.SetError(err, cmds.ErrNormal) + return + } + if dopin { + defer n.Blockstore.PinLock().Unlock() + } + + var c *cid.Cid switch ienc { case "json": nd, err := convertJsonToType(fi, format) @@ -73,14 +85,11 @@ into an object of the specified format. return } - c, err := n.DAG.Add(nd) + c, err = n.DAG.Add(nd) if err != nil { res.SetError(err, cmds.ErrNormal) return } - - res.SetOutput(&OutputObject{Cid: c}) - return case "raw": nd, err := convertRawToType(fi, format) if err != nil { @@ -88,18 +97,27 @@ into an object of the specified format. return } - c, err := n.DAG.Add(nd) + c, err = n.DAG.Add(nd) if err != nil { res.SetError(err, cmds.ErrNormal) return } - - res.SetOutput(&OutputObject{Cid: c}) - return default: res.SetError(fmt.Errorf("unrecognized input encoding: %s", ienc), cmds.ErrNormal) return } + + if dopin { + n.Pinning.PinWithMode(c, pin.Recursive) + + err := n.Pinning.Flush() + if err != nil { + res.SetError(err, cmds.ErrNormal) + return + } + } + + res.SetOutput(&OutputObject{Cid: c}) }, Type: OutputObject{}, Marshalers: cmds.MarshalerMap{ diff --git a/core/commands/dht.go b/core/commands/dht.go index ac1a856b0..a5dd970c4 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -12,14 +12,14 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - notif "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing/notifications" - ipdht "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + notif "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing/notifications" b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" + ipdht "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht" ) var ErrNotDHT = errors.New("routing service is not a DHT") diff --git a/core/commands/files/files.go b/core/commands/files/files.go index f36fe3f1c..3373f4e6c 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -18,8 +18,8 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) var log = logging.Logger("cmds/files") diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 53d5ad419..e997a5254 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -9,7 +9,7 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/filestore" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var FileStoreCmd = &cmds.Command{ diff --git a/core/commands/ls.go b/core/commands/ls.go index 21c969106..61509a8af 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -16,7 +16,7 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" unixfspb "github.com/ipfs/go-ipfs/unixfs/pb" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) type LsLink struct { diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 9f103df39..15293be16 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -18,8 +18,8 @@ import ( path "github.com/ipfs/go-ipfs/path" ft "github.com/ipfs/go-ipfs/unixfs" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // ErrObjectTooLarge is returned when too much data was read from stdin. current limit 2m diff --git a/core/commands/ptp.go b/core/commands/p2p.go similarity index 79% rename from core/commands/ptp.go rename to core/commands/p2p.go index daeecae71..2714ad7c3 100644 --- a/core/commands/ptp.go +++ b/core/commands/p2p.go @@ -14,14 +14,14 @@ import ( ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" ) -// PTPListenerInfoOutput is output type of ls command -type PTPListenerInfoOutput struct { +// P2PListenerInfoOutput is output type of ls command +type P2PListenerInfoOutput struct { Protocol string Address string } -// PTPStreamInfoOutput is output type of streams command -type PTPStreamInfoOutput struct { +// P2PStreamInfoOutput is output type of streams command +type P2PStreamInfoOutput struct { HandlerID string Protocol string LocalPeer string @@ -30,18 +30,18 @@ type PTPStreamInfoOutput struct { RemoteAddress string } -// PTPLsOutput is output type of ls command -type PTPLsOutput struct { - Listeners []PTPListenerInfoOutput +// P2PLsOutput is output type of ls command +type P2PLsOutput struct { + Listeners []P2PListenerInfoOutput } -// PTPStreamsOutput is output type of streams command -type PTPStreamsOutput struct { - Streams []PTPStreamInfoOutput +// P2PStreamsOutput is output type of streams command +type P2PStreamsOutput struct { + Streams []P2PStreamInfoOutput } -// PTPCmd is the 'ipfs ptp' command -var PTPCmd = &cmds.Command{ +// P2PCmd is the 'ipfs p2p' command +var P2PCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Libp2p stream mounting.", ShortDescription: ` @@ -51,40 +51,40 @@ Note: this command is experimental and subject to change as usecases and APIs ar }, Subcommands: map[string]*cmds.Command{ - "listener": ptpListenerCmd, - "stream": ptpStreamCmd, + "listener": p2pListenerCmd, + "stream": p2pStreamCmd, }, } -// ptpListenerCmd is the 'ipfs ptp listener' command -var ptpListenerCmd = &cmds.Command{ +// p2pListenerCmd is the 'ipfs p2p listener' command +var p2pListenerCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "P2P listener management.", ShortDescription: "Create and manage listener p2p endpoints", }, Subcommands: map[string]*cmds.Command{ - "ls": ptpListenerLsCmd, - "open": ptpListenerListenCmd, - "close": ptpListenerCloseCmd, + "ls": p2pListenerLsCmd, + "open": p2pListenerListenCmd, + "close": p2pListenerCloseCmd, }, } -// ptpStreamCmd is the 'ipfs ptp stream' command -var ptpStreamCmd = &cmds.Command{ +// p2pStreamCmd is the 'ipfs p2p stream' command +var p2pStreamCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "P2P stream management.", ShortDescription: "Create and manage p2p streams", }, Subcommands: map[string]*cmds.Command{ - "ls": ptpStreamLsCmd, - "dial": ptpStreamDialCmd, - "close": ptpStreamCloseCmd, + "ls": p2pStreamLsCmd, + "dial": p2pStreamDialCmd, + "close": p2pStreamCloseCmd, }, } -var ptpListenerLsCmd = &cmds.Command{ +var p2pListenerLsCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "List active p2p listeners.", }, @@ -99,10 +99,10 @@ var ptpListenerLsCmd = &cmds.Command{ return } - output := &PTPLsOutput{} + output := &P2PLsOutput{} - for _, listener := range n.PTP.Listeners.Listeners { - output.Listeners = append(output.Listeners, PTPListenerInfoOutput{ + for _, listener := range n.P2P.Listeners.Listeners { + output.Listeners = append(output.Listeners, P2PListenerInfoOutput{ Protocol: listener.Protocol, Address: listener.Address.String(), }) @@ -110,11 +110,11 @@ var ptpListenerLsCmd = &cmds.Command{ res.SetOutput(output) }, - Type: PTPLsOutput{}, + Type: P2PLsOutput{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { headers, _, _ := res.Request().Option("headers").Bool() - list, _ := res.Output().(*PTPLsOutput) + list, _ := res.Output().(*P2PLsOutput) buf := new(bytes.Buffer) w := tabwriter.NewWriter(buf, 1, 2, 1, ' ', 0) for _, listener := range list.Listeners { @@ -131,7 +131,7 @@ var ptpListenerLsCmd = &cmds.Command{ }, } -var ptpStreamLsCmd = &cmds.Command{ +var p2pStreamLsCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "List active p2p streams.", }, @@ -145,10 +145,10 @@ var ptpStreamLsCmd = &cmds.Command{ return } - output := &PTPStreamsOutput{} + output := &P2PStreamsOutput{} - for _, s := range n.PTP.Streams.Streams { - output.Streams = append(output.Streams, PTPStreamInfoOutput{ + for _, s := range n.P2P.Streams.Streams { + output.Streams = append(output.Streams, P2PStreamInfoOutput{ HandlerID: strconv.FormatUint(s.HandlerID, 10), Protocol: s.Protocol, @@ -163,11 +163,11 @@ var ptpStreamLsCmd = &cmds.Command{ res.SetOutput(output) }, - Type: PTPStreamsOutput{}, + Type: P2PStreamsOutput{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) (io.Reader, error) { headers, _, _ := res.Request().Option("headers").Bool() - list, _ := res.Output().(*PTPStreamsOutput) + list, _ := res.Output().(*P2PStreamsOutput) buf := new(bytes.Buffer) w := tabwriter.NewWriter(buf, 1, 2, 1, ' ', 0) for _, stream := range list.Streams { @@ -184,7 +184,7 @@ var ptpStreamLsCmd = &cmds.Command{ }, } -var ptpListenerListenCmd = &cmds.Command{ +var p2pListenerListenCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Forward p2p connections to a network multiaddr.", ShortDescription: ` @@ -204,8 +204,8 @@ Note that the connections originate from the ipfs daemon process. return } - proto := "/ptp/" + req.Arguments()[0] - if n.PTP.CheckProtoExists(proto) { + proto := "/p2p/" + req.Arguments()[0] + if n.P2P.CheckProtoExists(proto) { res.SetError(errors.New("protocol handler already registered"), cmds.ErrNormal) return } @@ -216,21 +216,21 @@ Note that the connections originate from the ipfs daemon process. return } - _, err = n.PTP.NewListener(n.Context(), proto, addr) + _, err = n.P2P.NewListener(n.Context(), proto, addr) if err != nil { res.SetError(err, cmds.ErrNormal) return } // Successful response. - res.SetOutput(&PTPListenerInfoOutput{ + res.SetOutput(&P2PListenerInfoOutput{ Protocol: proto, Address: addr.String(), }) }, } -var ptpStreamDialCmd = &cmds.Command{ +var p2pStreamDialCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Dial to a p2p listener.", @@ -260,7 +260,7 @@ transparently connect to a p2p service. return } - proto := "/ptp/" + req.Arguments()[1] + proto := "/p2p/" + req.Arguments()[1] bindAddr, _ := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/0") if len(req.Arguments()) == 3 { @@ -271,13 +271,13 @@ transparently connect to a p2p service. } } - listenerInfo, err := n.PTP.Dial(n.Context(), addr, peer, proto, bindAddr) + listenerInfo, err := n.P2P.Dial(n.Context(), addr, peer, proto, bindAddr) if err != nil { res.SetError(err, cmds.ErrNormal) return } - output := PTPListenerInfoOutput{ + output := P2PListenerInfoOutput{ Protocol: listenerInfo.Protocol, Address: listenerInfo.Address.String(), } @@ -286,7 +286,7 @@ transparently connect to a p2p service. }, } -var ptpListenerCloseCmd = &cmds.Command{ +var p2pListenerCloseCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Close active p2p listener.", }, @@ -312,10 +312,10 @@ var ptpListenerCloseCmd = &cmds.Command{ return } - proto = "/ptp/" + req.Arguments()[0] + proto = "/p2p/" + req.Arguments()[0] } - for _, listener := range n.PTP.Listeners.Listeners { + for _, listener := range n.P2P.Listeners.Listeners { if !closeAll && listener.Protocol != proto { continue } @@ -327,7 +327,7 @@ var ptpListenerCloseCmd = &cmds.Command{ }, } -var ptpStreamCloseCmd = &cmds.Command{ +var p2pStreamCloseCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Close active p2p stream.", }, @@ -360,7 +360,7 @@ var ptpStreamCloseCmd = &cmds.Command{ } } - for _, stream := range n.PTP.Streams.Streams { + for _, stream := range n.P2P.Streams.Streams { if !closeAll && handlerID != stream.HandlerID { continue } diff --git a/core/commands/pin.go b/core/commands/pin.go index 272ac772f..7c9ac467e 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -16,7 +16,7 @@ import ( context "context" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var PinCmd = &cmds.Command{ diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index e680baacb..0fecd4796 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -10,14 +10,14 @@ import ( "sync" "time" - blocks "github.com/ipfs/go-ipfs/blocks" cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" floodsub "gx/ipfs/QmUpeULWfmtsgCnfuRN3BHsfhHvBxNphoYh4La4CMxGt2Z/floodsub" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var PubsubCmd = &cmds.Command{ diff --git a/core/commands/refs.go b/core/commands/refs.go index 026aa8548..53040c80b 100644 --- a/core/commands/refs.go +++ b/core/commands/refs.go @@ -12,9 +12,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // KeyList is a general type for outputting lists of keys diff --git a/core/commands/repo.go b/core/commands/repo.go index 2cde817b5..7aa0ea2d4 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -17,7 +17,7 @@ import ( lockfile "github.com/ipfs/go-ipfs/repo/fsrepo/lock" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type RepoVersion struct { diff --git a/core/commands/root.go b/core/commands/root.go index fa9eda051..d54d40571 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -47,7 +47,7 @@ ADVANCED COMMANDS pin Pin objects to local storage repo Manipulate the IPFS repository stats Various operational stats - ptp Libp2p stream mounting + p2p Libp2p stream mounting filestore Manage the filestore (experimental) NETWORK COMMANDS @@ -114,7 +114,7 @@ var rootSubcommands = map[string]*cmds.Command{ "object": ocmd.ObjectCmd, "pin": PinCmd, "ping": PingCmd, - "ptp": PTPCmd, + "p2p": P2PCmd, "pubsub": PubsubCmd, "refs": RefsCmd, "repo": RepoCmd, diff --git a/core/core.go b/core/core.go index 9a9822fd9..ac80cd32c 100644 --- a/core/core.go +++ b/core/core.go @@ -33,17 +33,17 @@ import ( mfs "github.com/ipfs/go-ipfs/mfs" namesys "github.com/ipfs/go-ipfs/namesys" ipnsrp "github.com/ipfs/go-ipfs/namesys/republisher" + p2p "github.com/ipfs/go-ipfs/p2p" path "github.com/ipfs/go-ipfs/path" pin "github.com/ipfs/go-ipfs/pin" - ptp "github.com/ipfs/go-ipfs/ptp" repo "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" nilrouting "github.com/ipfs/go-ipfs/routing/none" offroute "github.com/ipfs/go-ipfs/routing/offline" ft "github.com/ipfs/go-ipfs/unixfs" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ic "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" ipnet "gx/ipfs/QmPsBptED6X43GYg3347TAUruN3UfsAhaGTP9xbinYX7uf/go-libp2p-interface-pnet" mplex "gx/ipfs/QmQ3UABWTgK78utKeiVXaH9BrjC7Ydn1pRuwqnWHT3p4zh/go-smux-multiplex" discovery "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/discovery" @@ -52,8 +52,6 @@ import ( identify "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/protocol/identify" ping "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/protocol/ping" mssmux "gx/ipfs/QmRVYfZ7tWNHPBzWiG6KWGzvT2hcGems8srihsQE29x1U5/go-smux-multistream" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dht "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" mamask "gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" @@ -61,16 +59,18 @@ import ( pnet "gx/ipfs/QmTJoXQ24GqDf9MqAUwf3vW38HG6ahE9S7GzZoRMEeE8Kc/go-libp2p-pnet" floodsub "gx/ipfs/QmUpeULWfmtsgCnfuRN3BHsfhHvBxNphoYh4La4CMxGt2Z/floodsub" p2phost "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" swarm "gx/ipfs/QmVkDnNm71vYyY6s6rXwtmyDYis3WkKyrEhMECwT6R12uJ/go-libp2p-swarm" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" addrutil "gx/ipfs/QmbH3urJHTrZSUETgvQRriWM6mMFqyNSwCqnhknxfSGVWv/go-addr-util" yamux "gx/ipfs/Qmbn7RYyWzBVXiUp9jZ1dA4VADHy9DtS7iZLwfhEUQvm3U/go-smux-yamux" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" metrics "gx/ipfs/QmdibiN2wzuuXXz4JvqQ1ZGW3eUkoAy1AWznHFau6iePCc/go-libp2p-metrics" smux "gx/ipfs/QmeZBgYBHvxMukGK5ojg28BCNLB9SeXqT7XXg6o7r2GbJy/go-stream-muxer" + dht "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht" ) const IpnsValidatorTag = "ipns" @@ -131,7 +131,7 @@ type IpfsNode struct { IpnsRepub *ipnsrp.Republisher Floodsub *floodsub.PubSub - PTP *ptp.PTP + P2P *p2p.P2P proc goprocess.Process ctx context.Context @@ -247,7 +247,7 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin n.Floodsub = floodsub.NewFloodSub(ctx, peerhost) } - n.PTP = ptp.NewPTP(n.Identity, n.PeerHost, n.Peerstore) + n.P2P = p2p.NewP2P(n.Identity, n.PeerHost, n.Peerstore) // setup local discovery if do != nil { diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index e0c3d15cc..b2a7aaf4a 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -8,7 +8,7 @@ import ( ipfspath "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type CoreAPI struct { diff --git a/core/coreapi/interface/interface.go b/core/coreapi/interface/interface.go index a7762c8c2..363c5adac 100644 --- a/core/coreapi/interface/interface.go +++ b/core/coreapi/interface/interface.go @@ -5,8 +5,8 @@ import ( "errors" "io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - ipld "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + ipld "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type Path interface { diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index d0a1c7bc8..7c484d1c9 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -8,8 +8,8 @@ import ( coreunix "github.com/ipfs/go-ipfs/core/coreunix" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type UnixfsAPI CoreAPI diff --git a/core/coreapi/unixfs_test.go b/core/coreapi/unixfs_test.go index c0cd3d856..dc8b6d3c5 100644 --- a/core/coreapi/unixfs_test.go +++ b/core/coreapi/unixfs_test.go @@ -16,7 +16,7 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" unixfs "github.com/ipfs/go-ipfs/unixfs" - cbor "gx/ipfs/QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR/go-ipld-cbor" + cbor "gx/ipfs/Qmcdid3XrCxcoNQUqZKiiKtM7JXxtyipU3izyRqwjFbVWw/go-ipld-cbor" ) // `echo -n 'hello, world!' | ipfs add` diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 463289121..630ed22f5 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -23,10 +23,10 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" multibase "gx/ipfs/QmcxkxTVuURV2Ptse8TvkqH5BQDwV62X1x19JqqvbBzwUM/go-multibase" ) @@ -134,6 +134,7 @@ func (i *gatewayHandler) optionsHandler(w http.ResponseWriter, r *http.Request) func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) { urlPath := r.URL.Path + escapedURLPath := r.URL.EscapedPath() // If the gateway is behind a reverse proxy and mounted at a sub-path, // the prefix header can be set to signal this sub-path. @@ -173,12 +174,12 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr case nil: case coreiface.ErrOffline: if !i.node.OnlineMode() { - webError(w, "ipfs resolve -r "+urlPath, err, http.StatusServiceUnavailable) + webError(w, "ipfs resolve -r "+escapedURLPath, err, http.StatusServiceUnavailable) return } fallthrough default: - webError(w, "ipfs resolve -r "+urlPath, err, http.StatusNotFound) + webError(w, "ipfs resolve -r "+escapedURLPath, err, http.StatusNotFound) return } @@ -191,7 +192,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr case coreiface.ErrIsDir: dir = true default: - webError(w, "ipfs cat "+urlPath, err, http.StatusNotFound) + webError(w, "ipfs cat "+escapedURLPath, err, http.StatusNotFound) return } @@ -278,7 +279,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr ixnd, err := dirr.Find(ctx, "index.html") switch { case err == nil: - log.Debugf("found index.html link for %s", urlPath) + log.Debugf("found index.html link for %s", escapedURLPath) dirwithoutslash := urlPath[len(urlPath)-1] != '/' goget := r.URL.Query().Get("go-get") == "1" diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index da60e8a65..3a4760e71 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -140,6 +140,7 @@ func TestGatewayGet(t *testing.T) { {"localhost:5001", "/" + k, http.StatusNotFound, "404 page not found\n"}, {"localhost:5001", "/ipfs/" + k, http.StatusOK, "fnord"}, {"localhost:5001", "/ipns/nxdomain.example.com", http.StatusNotFound, "ipfs resolve -r /ipns/nxdomain.example.com: " + namesys.ErrResolveFailed.Error() + "\n"}, + {"localhost:5001", "/ipns/%0D%0A%0D%0Ahello", http.StatusNotFound, "ipfs resolve -r /ipns/%0D%0A%0D%0Ahello: " + namesys.ErrResolveFailed.Error() + "\n"}, {"localhost:5001", "/ipns/example.com", http.StatusOK, "fnord"}, {"example.com", "/", http.StatusOK, "fnord"}, } { diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 65a625ea2..77f889ace 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -13,7 +13,7 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("corerepo") diff --git a/core/corerepo/pinning.go b/core/corerepo/pinning.go index 908e7efaf..24a46fc60 100644 --- a/core/corerepo/pinning.go +++ b/core/corerepo/pinning.go @@ -21,8 +21,8 @@ import ( path "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func Pin(n *core.IpfsNode, ctx context.Context, paths []string, recursive bool) ([]*cid.Cid, error) { diff --git a/core/corerouting/core.go b/core/corerouting/core.go index b54753140..70df9d9fe 100644 --- a/core/corerouting/core.go +++ b/core/corerouting/core.go @@ -8,9 +8,9 @@ import ( repo "github.com/ipfs/go-ipfs/repo" supernode "github.com/ipfs/go-ipfs/routing/supernode" gcproxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" ) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 4a4affbd4..da5058c68 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -24,11 +24,11 @@ import ( posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" unixfs "github.com/ipfs/go-ipfs/unixfs" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("coreunix") diff --git a/core/coreunix/add_test.go b/core/coreunix/add_test.go index c1d182dde..e15a0d6a4 100644 --- a/core/coreunix/add_test.go +++ b/core/coreunix/add_test.go @@ -10,7 +10,6 @@ import ( "testing" "time" - "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" "github.com/ipfs/go-ipfs/blockservice" "github.com/ipfs/go-ipfs/commands/files" @@ -21,8 +20,9 @@ import ( "github.com/ipfs/go-ipfs/repo/config" pi "github.com/ipfs/go-ipfs/thirdparty/posinfo" "github.com/ipfs/go-ipfs/thirdparty/testutil" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestAddRecursive(t *testing.T) { diff --git a/core/coreunix/metadata.go b/core/coreunix/metadata.go index 25566e955..739a8c481 100644 --- a/core/coreunix/metadata.go +++ b/core/coreunix/metadata.go @@ -4,7 +4,7 @@ import ( core "github.com/ipfs/go-ipfs/core" dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error) { diff --git a/core/coreunix/metadata_test.go b/core/coreunix/metadata_test.go index fbb9ebbb9..995f21b4c 100644 --- a/core/coreunix/metadata_test.go +++ b/core/coreunix/metadata_test.go @@ -16,10 +16,10 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" context "context" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func getDagserv(t *testing.T) merkledag.DAGService { diff --git a/core/mock/mock.go b/core/mock/mock.go index 6895d3255..e480a2b5f 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -13,9 +13,9 @@ import ( ipnet "gx/ipfs/QmPsBptED6X43GYg3347TAUruN3UfsAhaGTP9xbinYX7uf/go-libp2p-interface-pnet" mocknet "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/net/mock" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" host "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" metrics "gx/ipfs/QmdibiN2wzuuXXz4JvqQ1ZGW3eUkoAy1AWznHFau6iePCc/go-libp2p-metrics" diff --git a/core/pathresolver.go b/core/pathresolver.go index 830150b53..642f7ed1c 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -8,8 +8,8 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" path "github.com/ipfs/go-ipfs/path" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // ErrNoNamesys is an explicit error for when an IPFS node doesn't diff --git a/docs/developer-certificate-of-origin b/docs/developer-certificate-of-origin new file mode 100644 index 000000000..8201f9921 --- /dev/null +++ b/docs/developer-certificate-of-origin @@ -0,0 +1,37 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/docs/transports.md b/docs/transports.md new file mode 100644 index 000000000..39ce127db --- /dev/null +++ b/docs/transports.md @@ -0,0 +1,12 @@ +## /ws and /wss -- websockets + +If you want browsers to connect to e.g. `/dns4/example.com/tcp/443/wss/ipfs/QmFoo` + +- [ ] An SSL cert matching the `/dns4` or `/dns6` name +- [ ] go-ipfs listening on `/ip4/127.0.0.1/tcp/8081/ws` + - 8081 is just an example + - note that it's `/ws` here, not `/wss` -- go-ipfs can't currently do SSL, see the next point +- [ ] nginx + - configured with the SSL cert + - listening on port 443 + - forwarding to 127.0.0.1:8081 diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 86e53dc2f..ce7bd6b26 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -9,7 +9,6 @@ import ( "sync" "time" - blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" exchange "github.com/ipfs/go-ipfs/exchange" decision "github.com/ipfs/go-ipfs/exchange/bitswap/decision" @@ -18,13 +17,14 @@ import ( notifications "github.com/ipfs/go-ipfs/exchange/bitswap/notifications" flags "github.com/ipfs/go-ipfs/flags" "github.com/ipfs/go-ipfs/thirdparty/delay" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" loggables "gx/ipfs/QmVesPmqbPp7xRGyY96tnBwzDtVV1nqv4SCVxo5zCqKyH8/go-libp2p-loggables" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/bitswap_test.go b/exchange/bitswap/bitswap_test.go index 3229b183b..770041c9f 100644 --- a/exchange/bitswap/bitswap_test.go +++ b/exchange/bitswap/bitswap_test.go @@ -8,7 +8,6 @@ import ( "testing" "time" - blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil" decision "github.com/ipfs/go-ipfs/exchange/bitswap/decision" @@ -16,11 +15,12 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" travis "github.com/ipfs/go-ipfs/thirdparty/testutil/ci/travis" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" p2ptestutil "gx/ipfs/Qma2j8dYePrvN5DoNgwh1uAuu3FFtEtrUQFmr737ws8nCp/go-libp2p-netutil" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // FIXME the tests are really sensitive to the network delay. fix them to work diff --git a/exchange/bitswap/decision/bench_test.go b/exchange/bitswap/decision/bench_test.go index f77044f94..3016fd07b 100644 --- a/exchange/bitswap/decision/bench_test.go +++ b/exchange/bitswap/decision/bench_test.go @@ -8,7 +8,7 @@ import ( "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" "github.com/ipfs/go-ipfs/thirdparty/testutil" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/decision/engine.go b/exchange/bitswap/decision/engine.go index 37e370db0..a51610e60 100644 --- a/exchange/bitswap/decision/engine.go +++ b/exchange/bitswap/decision/engine.go @@ -6,11 +6,11 @@ import ( "time" context "context" - blocks "github.com/ipfs/go-ipfs/blocks" bstore "github.com/ipfs/go-ipfs/blocks/blockstore" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/decision/engine_test.go b/exchange/bitswap/decision/engine_test.go index fdac4eba1..7c2da018e 100644 --- a/exchange/bitswap/decision/engine_test.go +++ b/exchange/bitswap/decision/engine_test.go @@ -9,12 +9,12 @@ import ( "testing" context "context" - blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" message "github.com/ipfs/go-ipfs/exchange/bitswap/message" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/decision/ledger.go b/exchange/bitswap/decision/ledger.go index 3826b7352..6c26439ae 100644 --- a/exchange/bitswap/decision/ledger.go +++ b/exchange/bitswap/decision/ledger.go @@ -6,7 +6,7 @@ import ( wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/decision/peer_request_queue.go b/exchange/bitswap/decision/peer_request_queue.go index d989174a2..0d37122e9 100644 --- a/exchange/bitswap/decision/peer_request_queue.go +++ b/exchange/bitswap/decision/peer_request_queue.go @@ -7,7 +7,7 @@ import ( wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" pq "github.com/ipfs/go-ipfs/thirdparty/pq" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/decision/peer_request_queue_test.go b/exchange/bitswap/decision/peer_request_queue_test.go index f0fa03bb2..edacbd065 100644 --- a/exchange/bitswap/decision/peer_request_queue_test.go +++ b/exchange/bitswap/decision/peer_request_queue_test.go @@ -11,7 +11,7 @@ import ( "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" "github.com/ipfs/go-ipfs/thirdparty/testutil" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestPushPop(t *testing.T) { diff --git a/exchange/bitswap/message/message.go b/exchange/bitswap/message/message.go index a0bc2215a..5c4c31154 100644 --- a/exchange/bitswap/message/message.go +++ b/exchange/bitswap/message/message.go @@ -4,14 +4,14 @@ import ( "fmt" "io" - blocks "github.com/ipfs/go-ipfs/blocks" pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" inet "gx/ipfs/QmRscs8KxrSmSv4iuevHv8JfuUzHBMoqiaHzxfDRiksd6e/go-libp2p-net" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // TODO move message.go into the bitswap package diff --git a/exchange/bitswap/message/message_test.go b/exchange/bitswap/message/message_test.go index ddcba8e17..c1f215523 100644 --- a/exchange/bitswap/message/message_test.go +++ b/exchange/bitswap/message/message_test.go @@ -6,10 +6,10 @@ import ( proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - blocks "github.com/ipfs/go-ipfs/blocks" pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func mkFakeCid(s string) *cid.Cid { diff --git a/exchange/bitswap/network/interface.go b/exchange/bitswap/network/interface.go index 7288024fe..f9289974f 100644 --- a/exchange/bitswap/network/interface.go +++ b/exchange/bitswap/network/interface.go @@ -4,8 +4,8 @@ import ( "context" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/network/ipfs_impl.go b/exchange/bitswap/network/ipfs_impl.go index 5b408a18e..c7b52bc3a 100644 --- a/exchange/bitswap/network/ipfs_impl.go +++ b/exchange/bitswap/network/ipfs_impl.go @@ -8,13 +8,13 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" inet "gx/ipfs/QmRscs8KxrSmSv4iuevHv8JfuUzHBMoqiaHzxfDRiksd6e/go-libp2p-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" host "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/notifications/notifications.go b/exchange/bitswap/notifications/notifications.go index 43322793b..1999948da 100644 --- a/exchange/bitswap/notifications/notifications.go +++ b/exchange/bitswap/notifications/notifications.go @@ -3,10 +3,10 @@ package notifications import ( "context" - blocks "github.com/ipfs/go-ipfs/blocks" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" pubsub "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/briantigerchow/pubsub" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) const bufferSize = 16 diff --git a/exchange/bitswap/notifications/notifications_test.go b/exchange/bitswap/notifications/notifications_test.go index ab83015e4..4312444fc 100644 --- a/exchange/bitswap/notifications/notifications_test.go +++ b/exchange/bitswap/notifications/notifications_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - blocks "github.com/ipfs/go-ipfs/blocks" blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestDuplicates(t *testing.T) { diff --git a/exchange/bitswap/stat.go b/exchange/bitswap/stat.go index 8dae9abbf..2f95d9e8b 100644 --- a/exchange/bitswap/stat.go +++ b/exchange/bitswap/stat.go @@ -3,7 +3,7 @@ package bitswap import ( "sort" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type Stat struct { diff --git a/exchange/bitswap/testnet/network_test.go b/exchange/bitswap/testnet/network_test.go index 44f663787..325892a46 100644 --- a/exchange/bitswap/testnet/network_test.go +++ b/exchange/bitswap/testnet/network_test.go @@ -5,12 +5,12 @@ import ( "testing" context "context" - blocks "github.com/ipfs/go-ipfs/blocks" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/testnet/peernet.go b/exchange/bitswap/testnet/peernet.go index 2ff7a05f9..1e59eb1d4 100644 --- a/exchange/bitswap/testnet/peernet.go +++ b/exchange/bitswap/testnet/peernet.go @@ -6,7 +6,7 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" mockpeernet "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/net/mock" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/testnet/virtual.go b/exchange/bitswap/testnet/virtual.go index da23b88a9..8c7db87eb 100644 --- a/exchange/bitswap/testnet/virtual.go +++ b/exchange/bitswap/testnet/virtual.go @@ -9,8 +9,8 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/testutils.go b/exchange/bitswap/testutils.go index fa5e7f940..4bae29ce3 100644 --- a/exchange/bitswap/testutils.go +++ b/exchange/bitswap/testutils.go @@ -10,8 +10,8 @@ import ( delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - ds_sync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + ds_sync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" p2ptestutil "gx/ipfs/Qma2j8dYePrvN5DoNgwh1uAuu3FFtEtrUQFmr737ws8nCp/go-libp2p-netutil" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/wantlist/wantlist.go b/exchange/bitswap/wantlist/wantlist.go index 94b8219c3..7c77998b3 100644 --- a/exchange/bitswap/wantlist/wantlist.go +++ b/exchange/bitswap/wantlist/wantlist.go @@ -6,7 +6,7 @@ import ( "sort" "sync" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type ThreadSafe struct { diff --git a/exchange/bitswap/wantmanager.go b/exchange/bitswap/wantmanager.go index bdb9db636..c6cce7ff7 100644 --- a/exchange/bitswap/wantmanager.go +++ b/exchange/bitswap/wantmanager.go @@ -11,7 +11,7 @@ import ( wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/bitswap/workers.go b/exchange/bitswap/workers.go index 028b9735d..648bfa403 100644 --- a/exchange/bitswap/workers.go +++ b/exchange/bitswap/workers.go @@ -11,7 +11,7 @@ import ( process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" procctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/exchange/interface.go b/exchange/interface.go index 58c4c14ae..fb590d25a 100644 --- a/exchange/interface.go +++ b/exchange/interface.go @@ -5,9 +5,9 @@ import ( "context" "io" - blocks "github.com/ipfs/go-ipfs/blocks" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // Any type that implements exchange.Interface may be used as an IPFS block diff --git a/exchange/offline/offline.go b/exchange/offline/offline.go index a70201c64..7c33b7af2 100644 --- a/exchange/offline/offline.go +++ b/exchange/offline/offline.go @@ -5,11 +5,11 @@ package offline import ( "context" - blocks "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" exchange "github.com/ipfs/go-ipfs/exchange" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func Exchange(bs blockstore.Blockstore) exchange.Interface { diff --git a/exchange/offline/offline_test.go b/exchange/offline/offline_test.go index efdf2c7b1..7055150ae 100644 --- a/exchange/offline/offline_test.go +++ b/exchange/offline/offline_test.go @@ -4,14 +4,14 @@ import ( "context" "testing" - blocks "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" "github.com/ipfs/go-ipfs/blocks/blocksutil" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - ds_sync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + ds_sync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestBlockReturnsErr(t *testing.T) { diff --git a/exchange/reprovide/reprovide.go b/exchange/reprovide/reprovide.go index 70e4ff703..a30261e45 100644 --- a/exchange/reprovide/reprovide.go +++ b/exchange/reprovide/reprovide.go @@ -6,7 +6,7 @@ import ( "time" blocks "github.com/ipfs/go-ipfs/blocks/blockstore" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" backoff "gx/ipfs/QmPJUtEJsm5YLUWhF6imvyCH8KZXRJa9Wup7FDMwTy5Ufz/backoff" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" ) diff --git a/exchange/reprovide/reprovide_test.go b/exchange/reprovide/reprovide_test.go index d4451bab0..67dd9de1b 100644 --- a/exchange/reprovide/reprovide_test.go +++ b/exchange/reprovide/reprovide_test.go @@ -4,13 +4,13 @@ import ( "testing" context "context" - blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" mock "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" . "github.com/ipfs/go-ipfs/exchange/reprovide" ) diff --git a/filestore/filestore.go b/filestore/filestore.go index 047d26b51..c1f2df981 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -10,13 +10,13 @@ package filestore import ( "context" - "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("filestore") diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 5569c61b5..2bbc43a26 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -11,8 +11,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func newTestFilestore(t *testing.T) (string, *Filestore) { diff --git a/filestore/fsrefstore.go b/filestore/fsrefstore.go index 46b385067..63978fbfd 100644 --- a/filestore/fsrefstore.go +++ b/filestore/fsrefstore.go @@ -7,17 +7,17 @@ import ( "os" "path/filepath" - "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/blocks/blockstore" pb "github.com/ipfs/go-ipfs/filestore/pb" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" posinfo "github.com/ipfs/go-ipfs/thirdparty/posinfo" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsns "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/namespace" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" proto "gx/ipfs/QmT6n4mspWYEya864BhCUJEgyxiRfmiSY9ruQwTUNpRKaM/protobuf/proto" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsns "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/namespace" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // FilestorePrefix identifies the key prefix for FileManager blocks. @@ -59,7 +59,6 @@ func NewFileManager(ds ds.Batching, root string) *FileManager { // closed. func (f *FileManager) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error) { q := dsq.Query{KeysOnly: true} - q.Prefix = FilestorePrefix.String() res, err := f.ds.Query(q) if err != nil { diff --git a/filestore/util.go b/filestore/util.go index 9a13de39a..6a1f90d17 100644 --- a/filestore/util.go +++ b/filestore/util.go @@ -8,9 +8,9 @@ import ( pb "github.com/ipfs/go-ipfs/filestore/pb" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // Status is used to identify the state of the block data referenced diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index b955c320c..e5e610851 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -20,7 +20,7 @@ import ( ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" fuse "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse" fs "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 54364afbb..b7cd0b9e9 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -22,9 +22,9 @@ import ( ci "github.com/ipfs/go-ipfs/thirdparty/testutil/ci" uio "github.com/ipfs/go-ipfs/unixfs/io" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" fstest "gx/ipfs/QmaFNtBAXX4nVMQWbUqNysXyhevUj1k4B1y5uS45LC7Vw9/fuse/fs/fstestutil" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) func maybeSkipFuseTests(t *testing.T) { diff --git a/importer/balanced/builder.go b/importer/balanced/builder.go index 460e3512b..f184f6170 100644 --- a/importer/balanced/builder.go +++ b/importer/balanced/builder.go @@ -5,7 +5,7 @@ import ( h "github.com/ipfs/go-ipfs/importer/helpers" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) func BalancedLayout(db *h.DagBuilderHelper) (node.Node, error) { diff --git a/importer/chunk/rabin_test.go b/importer/chunk/rabin_test.go index 907b80999..45f2b2061 100644 --- a/importer/chunk/rabin_test.go +++ b/importer/chunk/rabin_test.go @@ -3,8 +3,8 @@ package chunk import ( "bytes" "fmt" - "github.com/ipfs/go-ipfs/blocks" "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" "io" "testing" ) diff --git a/importer/helpers/dagbuilder.go b/importer/helpers/dagbuilder.go index de33563ef..681b8c391 100644 --- a/importer/helpers/dagbuilder.go +++ b/importer/helpers/dagbuilder.go @@ -9,8 +9,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // DagBuilderHelper wraps together a bunch of objects needed to diff --git a/importer/helpers/helpers.go b/importer/helpers/helpers.go index 643ec4124..cd268bdc8 100644 --- a/importer/helpers/helpers.go +++ b/importer/helpers/helpers.go @@ -9,8 +9,8 @@ import ( pi "github.com/ipfs/go-ipfs/thirdparty/posinfo" ft "github.com/ipfs/go-ipfs/unixfs" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // BlockSizeLimit specifies the maximum size an imported block can have. diff --git a/importer/importer.go b/importer/importer.go index 2c9e5db7c..cba5be521 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -13,7 +13,7 @@ import ( trickle "github.com/ipfs/go-ipfs/importer/trickle" dag "github.com/ipfs/go-ipfs/merkledag" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // Builds a DAG from the given file, writing created blocks to disk as they are diff --git a/importer/importer_test.go b/importer/importer_test.go index c8ccb8364..71c6424c1 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -12,8 +12,8 @@ import ( mdtest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) func getBalancedDag(t testing.TB, size int64, blksize int64) (node.Node, dag.DAGService) { diff --git a/importer/trickle/trickledag.go b/importer/trickle/trickledag.go index 257cbd718..2457a2c7a 100644 --- a/importer/trickle/trickledag.go +++ b/importer/trickle/trickledag.go @@ -9,7 +9,7 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // layerRepeat specifies how many times to append a child tree of a diff --git a/merkledag/coding.go b/merkledag/coding.go index b5c2075da..063003ac7 100644 --- a/merkledag/coding.go +++ b/merkledag/coding.go @@ -6,8 +6,8 @@ import ( pb "github.com/ipfs/go-ipfs/merkledag/pb" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // for now, we use a PBNode intermediate thing. diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 1a29b56e4..d23a42d07 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -7,13 +7,13 @@ import ( "strings" "sync" - blocks "github.com/ipfs/go-ipfs/blocks" bserv "github.com/ipfs/go-ipfs/blockservice" offline "github.com/ipfs/go-ipfs/exchange/offline" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" - ipldcbor "gx/ipfs/QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR/go-ipld-cbor" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" + ipldcbor "gx/ipfs/Qmcdid3XrCxcoNQUqZKiiKtM7JXxtyipU3izyRqwjFbVWw/go-ipld-cbor" ) var ErrNotFound = fmt.Errorf("merkledag: not found") diff --git a/merkledag/merkledag_test.go b/merkledag/merkledag_test.go index 2182f9098..e3a41bd15 100644 --- a/merkledag/merkledag_test.go +++ b/merkledag/merkledag_test.go @@ -13,7 +13,6 @@ import ( "testing" "time" - blocks "github.com/ipfs/go-ipfs/blocks" bserv "github.com/ipfs/go-ipfs/blockservice" bstest "github.com/ipfs/go-ipfs/blockservice/test" offline "github.com/ipfs/go-ipfs/exchange/offline" @@ -23,10 +22,11 @@ import ( mdpb "github.com/ipfs/go-ipfs/merkledag/pb" dstest "github.com/ipfs/go-ipfs/merkledag/test" uio "github.com/ipfs/go-ipfs/unixfs/io" + blocks "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestNode(t *testing.T) { diff --git a/merkledag/node.go b/merkledag/node.go index 4ef497184..8f9a6257b 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -5,9 +5,9 @@ import ( "encoding/json" "fmt" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var ErrNotProtobuf = fmt.Errorf("expected protobuf dag node") diff --git a/merkledag/node_test.go b/merkledag/node_test.go index c630a8a06..12a94ab7c 100644 --- a/merkledag/node_test.go +++ b/merkledag/node_test.go @@ -8,7 +8,7 @@ import ( . "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) func TestRemoveLink(t *testing.T) { diff --git a/merkledag/raw.go b/merkledag/raw.go index 7c5ba56af..3270b30ee 100644 --- a/merkledag/raw.go +++ b/merkledag/raw.go @@ -1,11 +1,11 @@ package merkledag import ( - "github.com/ipfs/go-ipfs/blocks" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) type RawNode struct { diff --git a/merkledag/test/utils.go b/merkledag/test/utils.go index c004d9a36..68e257265 100644 --- a/merkledag/test/utils.go +++ b/merkledag/test/utils.go @@ -5,8 +5,8 @@ import ( bsrv "github.com/ipfs/go-ipfs/blockservice" "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) func Mock() dag.DAGService { diff --git a/merkledag/traverse/traverse.go b/merkledag/traverse/traverse.go index e5caa9cf4..d18429b13 100644 --- a/merkledag/traverse/traverse.go +++ b/merkledag/traverse/traverse.go @@ -5,7 +5,7 @@ import ( "context" "errors" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // Order is an identifier for traversal algorithm orders diff --git a/merkledag/traverse/traverse_test.go b/merkledag/traverse/traverse_test.go index 601c39bfb..7f4f93fa5 100644 --- a/merkledag/traverse/traverse_test.go +++ b/merkledag/traverse/traverse_test.go @@ -8,7 +8,7 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" mdagtest "github.com/ipfs/go-ipfs/merkledag/test" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) func TestDFSPreNoSkip(t *testing.T) { diff --git a/merkledag/utils/diff.go b/merkledag/utils/diff.go index 87b27d20c..c497c426b 100644 --- a/merkledag/utils/diff.go +++ b/merkledag/utils/diff.go @@ -7,8 +7,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) const ( diff --git a/merkledag/utils/diffenum.go b/merkledag/utils/diffenum.go index 28229a4fa..1e656e4e4 100644 --- a/merkledag/utils/diffenum.go +++ b/merkledag/utils/diffenum.go @@ -6,8 +6,8 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // DiffEnumerate fetches every object in the graph pointed to by 'to' that is diff --git a/merkledag/utils/diffenum_test.go b/merkledag/utils/diffenum_test.go index 45a0e178b..fad992a64 100644 --- a/merkledag/utils/diffenum_test.go +++ b/merkledag/utils/diffenum_test.go @@ -8,8 +8,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" mdtest "github.com/ipfs/go-ipfs/merkledag/test" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func buildNode(name string, desc map[string]ndesc, out map[string]node.Node) node.Node { diff --git a/merkledag/utils/utils.go b/merkledag/utils/utils.go index 4a3d2e7f8..651101908 100644 --- a/merkledag/utils/utils.go +++ b/merkledag/utils/utils.go @@ -10,9 +10,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) type Editor struct { diff --git a/merkledag/utils/utils_test.go b/merkledag/utils/utils_test.go index 541920529..c05398440 100644 --- a/merkledag/utils/utils_test.go +++ b/merkledag/utils/utils_test.go @@ -8,7 +8,7 @@ import ( path "github.com/ipfs/go-ipfs/path" context "context" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestAddLink(t *testing.T) { diff --git a/mfs/dir.go b/mfs/dir.go index fdfb49538..c9cacb005 100644 --- a/mfs/dir.go +++ b/mfs/dir.go @@ -15,8 +15,8 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" ufspb "github.com/ipfs/go-ipfs/unixfs/pb" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var ErrNotYetImplemented = errors.New("not yet implemented") diff --git a/mfs/file.go b/mfs/file.go index 02a5b62c8..71ca2ced6 100644 --- a/mfs/file.go +++ b/mfs/file.go @@ -10,7 +10,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" mod "github.com/ipfs/go-ipfs/unixfs/mod" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) type File struct { diff --git a/mfs/mfs_test.go b/mfs/mfs_test.go index fa2e7c53d..75f5c0012 100644 --- a/mfs/mfs_test.go +++ b/mfs/mfs_test.go @@ -24,11 +24,11 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func emptyDirNode() *dag.ProtoNode { diff --git a/mfs/ops.go b/mfs/ops.go index 0d02cbb08..bb99d1860 100644 --- a/mfs/ops.go +++ b/mfs/ops.go @@ -9,7 +9,7 @@ import ( path "github.com/ipfs/go-ipfs/path" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // Mv moves the file or directory at 'src' to 'dst' diff --git a/mfs/repub_test.go b/mfs/repub_test.go index 832bee0d2..d96edf07f 100644 --- a/mfs/repub_test.go +++ b/mfs/repub_test.go @@ -7,7 +7,7 @@ import ( ci "github.com/ipfs/go-ipfs/thirdparty/testutil/ci" "context" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestRepublisher(t *testing.T) { diff --git a/mfs/system.go b/mfs/system.go index 934a32610..88e1f2ff4 100644 --- a/mfs/system.go +++ b/mfs/system.go @@ -19,9 +19,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var ErrNotExist = errors.New("no such rootfs") diff --git a/misc/release-checklist.md b/misc/release-checklist.md deleted file mode 100644 index 9c834ab94..000000000 --- a/misc/release-checklist.md +++ /dev/null @@ -1,32 +0,0 @@ -# ipfs {{version}} checklist - -## pre-release - -- [ ] CHANGELOG.md updated - PR: -- [ ] tests are green - - [ ] go-ipfs tests - - [ ] sharness tests - - [ ] webui works - - [ ] js-ipfs-api tests - - [ ] deploy on one of our hosts - -## RC cycle -- [ ] versions changed to {{version}}-rcX: - - [ ] in repo/config/version.go - - [ ] in package.json -- [ ] release {{version}}-rcX on dist - -## release -- [ ] versions changed to {{version}}: - - [ ] in repo/config/version.go - - [ ] in package.json -- [ ] gx publish done and commited -- [ ] signed version tag pushed -- [ ] fast forward merge of **master** to **release** -- [ ] push release to dist - -## post-release -- [ ] bump version to {{version+1}}-dev: - - [ ] in repo/config/version.go - - [ ] in package.json - diff --git a/namesys/namesys.go b/namesys/namesys.go index 1f662bd82..33883eb39 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -7,9 +7,9 @@ import ( path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index 7df4ac926..40f3bbe74 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -11,7 +11,8 @@ import ( "github.com/ipfs/go-ipfs/unixfs" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) type mockResolver struct { @@ -76,7 +77,7 @@ func TestNamesysResolution(t *testing.T) { } func TestPublishWithCache0(t *testing.T) { - dst := ds.NewMapDatastore() + dst := dssync.MutexWrap(ds.NewMapDatastore()) priv, _, err := ci.GenerateKeyPair(ci.RSA, 1024) if err != nil { t.Fatal(err) diff --git a/namesys/publisher.go b/namesys/publisher.go index cba463492..31fbbc1da 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -14,9 +14,9 @@ import ( dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" ft "github.com/ipfs/go-ipfs/unixfs" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" record "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record" dhtpb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index b33328b68..a8fa74d04 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -11,12 +11,12 @@ import ( path "github.com/ipfs/go-ipfs/path" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ic "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" gpctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" recpb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index c7e13e853..6eeb958c8 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -10,8 +10,8 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/namesys/routing.go b/namesys/routing.go index 6b94876c6..45eb38557 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -9,14 +9,14 @@ import ( pb "github.com/ipfs/go-ipfs/namesys/pb" path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("namesys") diff --git a/ptp/ptp.go b/p2p/p2p.go similarity index 73% rename from ptp/ptp.go rename to p2p/p2p.go index e7842838b..17f913fa6 100644 --- a/ptp/ptp.go +++ b/p2p/p2p.go @@ -1,4 +1,4 @@ -package ptp +package p2p import ( "context" @@ -14,8 +14,8 @@ import ( manet "gx/ipfs/Qmf1Gq7N45Rpuw7ev47uWgH6dLPtdnvcMRNPkVBwqjLJg2/go-multiaddr-net" ) -// PTP structure holds information on currently running streams/listeners -type PTP struct { +// P2P structure holds information on currently running streams/listeners +type P2P struct { Listeners ListenerRegistry Streams StreamRegistry @@ -24,38 +24,38 @@ type PTP struct { peerstore pstore.Peerstore } -// NewPTP creates new PTP struct -func NewPTP(identity peer.ID, peerHost p2phost.Host, peerstore pstore.Peerstore) *PTP { - return &PTP{ +// NewP2P creates new P2P struct +func NewP2P(identity peer.ID, peerHost p2phost.Host, peerstore pstore.Peerstore) *P2P { + return &P2P{ identity: identity, peerHost: peerHost, peerstore: peerstore, } } -func (ptp *PTP) newStreamTo(ctx2 context.Context, p peer.ID, protocol string) (net.Stream, error) { +func (p2p *P2P) newStreamTo(ctx2 context.Context, p peer.ID, protocol string) (net.Stream, error) { ctx, cancel := context.WithTimeout(ctx2, time.Second*30) //TODO: configurable? defer cancel() - err := ptp.peerHost.Connect(ctx, pstore.PeerInfo{ID: p}) + err := p2p.peerHost.Connect(ctx, pstore.PeerInfo{ID: p}) if err != nil { return nil, err } - return ptp.peerHost.NewStream(ctx2, p, pro.ID(protocol)) + return p2p.peerHost.NewStream(ctx2, p, pro.ID(protocol)) } // Dial creates new P2P stream to a remote listener -func (ptp *PTP) Dial(ctx context.Context, addr ma.Multiaddr, peer peer.ID, proto string, bindAddr ma.Multiaddr) (*ListenerInfo, error) { +func (p2p *P2P) Dial(ctx context.Context, addr ma.Multiaddr, peer peer.ID, proto string, bindAddr ma.Multiaddr) (*ListenerInfo, error) { lnet, _, err := manet.DialArgs(bindAddr) if err != nil { return nil, err } listenerInfo := ListenerInfo{ - Identity: ptp.identity, + Identity: p2p.identity, Protocol: proto, } - remote, err := ptp.newStreamTo(ctx, peer, proto) + remote, err := p2p.newStreamTo(ctx, peer, proto) if err != nil { return nil, err } @@ -74,7 +74,7 @@ func (ptp *PTP) Dial(ctx context.Context, addr ma.Multiaddr, peer peer.ID, proto listenerInfo.Closer = listener listenerInfo.Running = true - go ptp.doAccept(&listenerInfo, remote, listener) + go p2p.doAccept(&listenerInfo, remote, listener) default: return nil, errors.New("unsupported protocol: " + lnet) @@ -83,7 +83,7 @@ func (ptp *PTP) Dial(ctx context.Context, addr ma.Multiaddr, peer peer.ID, proto return &listenerInfo, nil } -func (ptp *PTP) doAccept(listenerInfo *ListenerInfo, remote net.Stream, listener manet.Listener) { +func (p2p *P2P) doAccept(listenerInfo *ListenerInfo, remote net.Stream, listener manet.Listener) { defer listener.Close() local, err := listener.Accept() @@ -103,10 +103,10 @@ func (ptp *PTP) doAccept(listenerInfo *ListenerInfo, remote net.Stream, listener Local: local, Remote: remote, - Registry: &ptp.Streams, + Registry: &p2p.Streams, } - ptp.Streams.Register(&stream) + p2p.Streams.Register(&stream) stream.startStreaming() } @@ -143,18 +143,18 @@ func (il *P2PListener) Close() error { } // Listen creates new P2PListener -func (ptp *PTP) registerStreamHandler(ctx2 context.Context, protocol string) (*P2PListener, error) { +func (p2p *P2P) registerStreamHandler(ctx2 context.Context, protocol string) (*P2PListener, error) { ctx, cancel := context.WithCancel(ctx2) list := &P2PListener{ - peerHost: ptp.peerHost, + peerHost: p2p.peerHost, proto: pro.ID(protocol), conCh: make(chan net.Stream), ctx: ctx, cancel: cancel, } - ptp.peerHost.SetStreamHandler(list.proto, func(s net.Stream) { + p2p.peerHost.SetStreamHandler(list.proto, func(s net.Stream) { select { case list.conCh <- s: case <-ctx.Done(): @@ -165,30 +165,30 @@ func (ptp *PTP) registerStreamHandler(ctx2 context.Context, protocol string) (*P return list, nil } -// NewListener creates new ptp listener -func (ptp *PTP) NewListener(ctx context.Context, proto string, addr ma.Multiaddr) (*ListenerInfo, error) { - listener, err := ptp.registerStreamHandler(ctx, proto) +// NewListener creates new p2p listener +func (p2p *P2P) NewListener(ctx context.Context, proto string, addr ma.Multiaddr) (*ListenerInfo, error) { + listener, err := p2p.registerStreamHandler(ctx, proto) if err != nil { return nil, err } listenerInfo := ListenerInfo{ - Identity: ptp.identity, + Identity: p2p.identity, Protocol: proto, Address: addr, Closer: listener, Running: true, - Registry: &ptp.Listeners, + Registry: &p2p.Listeners, } - go ptp.acceptStreams(&listenerInfo, listener) + go p2p.acceptStreams(&listenerInfo, listener) - ptp.Listeners.Register(&listenerInfo) + p2p.Listeners.Register(&listenerInfo) return &listenerInfo, nil } -func (ptp *PTP) acceptStreams(listenerInfo *ListenerInfo, listener Listener) { +func (p2p *P2P) acceptStreams(listenerInfo *ListenerInfo, listener Listener) { for listenerInfo.Running { remote, err := listener.Accept() if err != nil { @@ -214,19 +214,19 @@ func (ptp *PTP) acceptStreams(listenerInfo *ListenerInfo, listener Listener) { Local: local, Remote: remote, - Registry: &ptp.Streams, + Registry: &p2p.Streams, } - ptp.Streams.Register(&stream) + p2p.Streams.Register(&stream) stream.startStreaming() } - ptp.Listeners.Deregister(listenerInfo.Protocol) + p2p.Listeners.Deregister(listenerInfo.Protocol) } // CheckProtoExists checks whether a protocol handler is registered to // mux handler -func (ptp *PTP) CheckProtoExists(proto string) bool { - protos := ptp.peerHost.Mux().Protocols() +func (p2p *P2P) CheckProtoExists(proto string) bool { + protos := p2p.peerHost.Mux().Protocols() for _, p := range protos { if p != proto { diff --git a/ptp/registry.go b/p2p/registry.go similarity index 99% rename from ptp/registry.go rename to p2p/registry.go index 586719eba..e1a454f1e 100644 --- a/ptp/registry.go +++ b/p2p/registry.go @@ -1,4 +1,4 @@ -package ptp +package p2p import ( "fmt" diff --git a/package.json b/package.json index 283987b0b..0cafe5da6 100644 --- a/package.json +++ b/package.json @@ -130,9 +130,9 @@ }, { "author": "jbenet", - "hash": "QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364", + "hash": "QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG", "name": "go-datastore", - "version": "1.2.0" + "version": "1.2.2" }, { "author": "codahale", @@ -178,15 +178,15 @@ }, { "author": "whyrusleeping", - "hash": "QmUaGhKyLgTuYDdQsbKST1tYr2CVoix59rqaxdxqk2UbfK", + "hash": "QmPP91WFAb8LCs8EMzGvDPPvg1kacbqRkoxgTTnUsZckGe", "name": "retry-datastore", - "version": "1.1.2" + "version": "1.1.4" }, { "author": "whyrusleeping", - "hash": "QmTGLHiFMABaPXGAJMA2tu3DXkaFLTxkQXKeowp2jMqvEk", + "hash": "QmdQRoFgg8jTNP5NLn6AuTgpEnDhwkVdBPEBUSTtPiY2yQ", "name": "failstore", - "version": "1.0.2" + "version": "1.0.4" }, { "author": "whyrusleeping", @@ -196,27 +196,27 @@ }, { "author": "whyrusleeping", - "hash": "QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ", + "hash": "Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB", "name": "go-cid", - "version": "0.7.12" + "version": "0.7.16" }, { "author": "whyrusleeping", - "hash": "QmXZEfbEv9sXG9JnLoMNhREDMDgkq5Jd7uWJ7d77VJ4pxn", + "hash": "QmUTshC2PP4ZDqkrFfDU4JGJFMWjYnunxPgkQ6ZCA2hGqh", "name": "go-ds-flatfs", - "version": "1.1.2" + "version": "1.1.4" }, { "author": "whyrusleeping", - "hash": "QmNPv1yzXBqxzqjfTzHCeBoicxxZgHzLezdY2hMCZ3r6EU", + "hash": "QmSb95iHExSSb47zpmyn5CyY5PZidVWSjyKyDqgYQrnKor", "name": "go-ds-measure", - "version": "1.2.0" + "version": "1.2.2" }, { "author": "whyrusleeping", - "hash": "QmaHHmfEozrrotyhyN44omJouyuEtx6ahddqV6W5yRaUSQ", + "hash": "QmPdvXuXWAR6gtxxqZw42RtSADMwz4ijVmYHGS542b6cMz", "name": "go-ds-leveldb", - "version": "1.0.1" + "version": "1.0.3" }, { "author": "whyrusleeping", @@ -237,9 +237,9 @@ "version": "0.1.2" }, { - "hash": "QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez", + "hash": "QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3", "name": "go-libp2p-kad-dht", - "version": "2.5.1" + "version": "2.5.4" }, { "author": "whyrusleeping", @@ -255,15 +255,15 @@ }, { "author": "whyrusleeping", - "hash": "Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck", + "hash": "QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv", "name": "go-ipld-format", - "version": "0.4.6" + "version": "0.4.10" }, { "author": "whyrusleeping", - "hash": "QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR", + "hash": "Qmcdid3XrCxcoNQUqZKiiKtM7JXxtyipU3izyRqwjFbVWw", "name": "go-ipld-cbor", - "version": "1.2.2" + "version": "1.2.5" }, { "author": "lgierth", @@ -306,12 +306,142 @@ "hash": "QmfJHywXQu98UeZtGJBQrPAR6AtmDjjbe3qjTo9piXHPnx", "name": "murmur3", "version": "0.0.0" + }, + { + "author": "whyrusleeping", + "hash": "Qma2j8dYePrvN5DoNgwh1uAuu3FFtEtrUQFmr737ws8nCp", + "name": "go-libp2p-netutil", + "version": "0.2.15" + }, + { + "hash": "QmaQG6fJdzn2532WHoPdVwKqftXr6iCSr5NtWyGi1BHytT", + "name": "go-libp2p-kbucket", + "version": "2.1.9" + }, + { + "author": "whyrusleeping", + "hash": "QmbH3urJHTrZSUETgvQRriWM6mMFqyNSwCqnhknxfSGVWv", + "name": "go-addr-util", + "version": "1.1.5" + }, + { + "author": "whyrusleeping", + "hash": "Qmbn7RYyWzBVXiUp9jZ1dA4VADHy9DtS7iZLwfhEUQvm3U", + "name": "go-smux-yamux", + "version": "1.2.0" + }, + { + "author": "whyrusleeping", + "hash": "QmcxkxTVuURV2Ptse8TvkqH5BQDwV62X1x19JqqvbBzwUM", + "name": "go-multibase", + "version": "0.2.3" + }, + { + "author": "whyrusleeping", + "hash": "QmcXRdAP5bCCm51X7XfDUrQ8Q9PsrKbU75pyvB18iuKob5", + "name": "go-libp2p-interface-conn", + "version": "0.4.7" + }, + { + "author": "multiformats", + "hash": "QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj", + "name": "go-multiaddr", + "version": "1.2.2" + }, + { + "author": "whyrusleeping", + "hash": "QmdibiN2wzuuXXz4JvqQ1ZGW3eUkoAy1AWznHFau6iePCc", + "name": "go-libp2p-metrics", + "version": "1.6.9" + }, + { + "author": "whyrusleeping", + "hash": "QmeZBgYBHvxMukGK5ojg28BCNLB9SeXqT7XXg6o7r2GbJy", + "name": "go-stream-muxer", + "version": "1.1.0" + }, + { + "author": "multiformats", + "hash": "Qmf1Gq7N45Rpuw7ev47uWgH6dLPtdnvcMRNPkVBwqjLJg2", + "name": "go-multiaddr-net", + "version": "1.5.4" + }, + { + "author": "libp2p", + "hash": "QmPsBptED6X43GYg3347TAUruN3UfsAhaGTP9xbinYX7uf", + "name": "go-libp2p-interface-pnet", + "version": "2.0.2" + }, + { + "author": "whyrusleeping", + "hash": "QmRscs8KxrSmSv4iuevHv8JfuUzHBMoqiaHzxfDRiksd6e", + "name": "go-libp2p-net", + "version": "1.6.11" + }, + { + "author": "whyrusleeping", + "hash": "QmRVYfZ7tWNHPBzWiG6KWGzvT2hcGems8srihsQE29x1U5", + "name": "go-smux-multistream", + "version": "1.5.5" + }, + { + "author": "whyrusleeping", + "hash": "QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv", + "name": "multiaddr-filter", + "version": "1.0.2" + }, + { + "author": "whyrusleeping", + "hash": "QmT6n4mspWYEya864BhCUJEgyxiRfmiSY9ruQwTUNpRKaM", + "name": "protobuf", + "version": "0.0.0" + }, + { + "author": "whyrusleeping", + "hash": "QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf", + "name": "go-base58", + "version": "0.0.0" + }, + { + "author": "whyrusleeping", + "hash": "QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC", + "name": "go-libp2p-host", + "version": "1.3.14" + }, + { + "author": "whyrusleeping", + "hash": "QmVkDnNm71vYyY6s6rXwtmyDYis3WkKyrEhMECwT6R12uJ", + "name": "go-libp2p-swarm", + "version": "1.6.15" + }, + { + "author": "whyrusleeping", + "hash": "QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n", + "name": "go-ipfs-util", + "version": "1.2.4" + }, + { + "hash": "QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ", + "name": "go-libp2p-record", + "version": "2.1.4" + }, + { + "author": "whyrusleeping", + "hash": "QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN", + "name": "go-libp2p-protocol", + "version": "1.0.0" + }, + { + "author": "stebalien", + "hash": "QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh", + "name": "go-block-format", + "version": "0.1.2" } ], "gxVersion": "0.10.0", "language": "go", "license": "MIT", "name": "go-ipfs", - "version": "0.4.9" + "version": "0.4.10" } diff --git a/path/path.go b/path/path.go index 419f6c9c9..bdb5ba156 100644 --- a/path/path.go +++ b/path/path.go @@ -5,7 +5,7 @@ import ( "path" "strings" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // ErrBadPath is returned when a given path is incorrectly formatted diff --git a/path/resolver.go b/path/resolver.go index 22bde65ee..09703cd76 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -9,9 +9,9 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("path") diff --git a/path/resolver_test.go b/path/resolver_test.go index 6e7ad64de..020861024 100644 --- a/path/resolver_test.go +++ b/path/resolver_test.go @@ -9,8 +9,8 @@ import ( dagmock "github.com/ipfs/go-ipfs/merkledag/test" path "github.com/ipfs/go-ipfs/path" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" util "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) func randNode() *merkledag.ProtoNode { diff --git a/pin/gc/gc.go b/pin/gc/gc.go index f92e8eead..e838046f8 100644 --- a/pin/gc/gc.go +++ b/pin/gc/gc.go @@ -9,8 +9,8 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" pin "github.com/ipfs/go-ipfs/pin" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // Result represents an incremental output from a garbage collection diff --git a/pin/pin.go b/pin/pin.go index 4270884d9..47886ba6f 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -12,10 +12,10 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" dutils "github.com/ipfs/go-ipfs/merkledag/utils" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var log = logging.Logger("pin") diff --git a/pin/pin_test.go b/pin/pin_test.go index 072761f0a..c0068705b 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -10,10 +10,10 @@ import ( "github.com/ipfs/go-ipfs/exchange/offline" mdag "github.com/ipfs/go-ipfs/merkledag" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func randNode() (*mdag.ProtoNode, *cid.Cid) { diff --git a/pin/set.go b/pin/set.go index 472142b5c..833f32cde 100644 --- a/pin/set.go +++ b/pin/set.go @@ -12,9 +12,9 @@ import ( "github.com/ipfs/go-ipfs/merkledag" "github.com/ipfs/go-ipfs/pin/internal/pb" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) const ( diff --git a/pin/set_test.go b/pin/set_test.go index f31cb890f..50e27a0e1 100644 --- a/pin/set_test.go +++ b/pin/set_test.go @@ -10,9 +10,9 @@ import ( offline "github.com/ipfs/go-ipfs/exchange/offline" dag "github.com/ipfs/go-ipfs/merkledag" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func ignoreCids(_ *cid.Cid) {} diff --git a/repo/config/profile.go b/repo/config/profile.go new file mode 100644 index 000000000..2f754617c --- /dev/null +++ b/repo/config/profile.go @@ -0,0 +1,31 @@ +package config + +// ConfigProfiles is a map holding configuration transformers +var ConfigProfiles = map[string]func(*Config) error{ + "server": func(c *Config) error { + + // defaultServerFilters has a list of non-routable IPv4 prefixes + // according to http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml + defaultServerFilters := []string{ + "/ip4/10.0.0.0/ipcidr/8", + "/ip4/100.64.0.0/ipcidr/10", + "/ip4/169.254.0.0/ipcidr/16", + "/ip4/172.16.0.0/ipcidr/12", + "/ip4/192.0.0.0/ipcidr/24", + "/ip4/192.0.0.0/ipcidr/29", + "/ip4/192.0.0.8/ipcidr/32", + "/ip4/192.0.0.170/ipcidr/32", + "/ip4/192.0.0.171/ipcidr/32", + "/ip4/192.0.2.0/ipcidr/24", + "/ip4/192.168.0.0/ipcidr/16", + "/ip4/198.18.0.0/ipcidr/15", + "/ip4/198.51.100.0/ipcidr/24", + "/ip4/203.0.113.0/ipcidr/24", + "/ip4/240.0.0.0/ipcidr/4", + } + + c.Swarm.AddrFilters = append(c.Swarm.AddrFilters, defaultServerFilters...) + c.Discovery.MDNS.Enabled = false + return nil + }, +} diff --git a/repo/config/version.go b/repo/config/version.go index 325bb8ae3..f9894347e 100644 --- a/repo/config/version.go +++ b/repo/config/version.go @@ -4,6 +4,6 @@ package config var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.4.9" +const CurrentVersionNumber = "0.4.10" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" diff --git a/repo/fsrepo/defaultds.go b/repo/fsrepo/defaultds.go index ea41235ea..8997bcaab 100644 --- a/repo/fsrepo/defaultds.go +++ b/repo/fsrepo/defaultds.go @@ -8,11 +8,11 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/thirdparty/dir" - measure "gx/ipfs/QmNPv1yzXBqxzqjfTzHCeBoicxxZgHzLezdY2hMCZ3r6EU/go-ds-measure" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - mount "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/syncmount" - flatfs "gx/ipfs/QmXZEfbEv9sXG9JnLoMNhREDMDgkq5Jd7uWJ7d77VJ4pxn/go-ds-flatfs" - levelds "gx/ipfs/QmaHHmfEozrrotyhyN44omJouyuEtx6ahddqV6W5yRaUSQ/go-ds-leveldb" + levelds "gx/ipfs/QmPdvXuXWAR6gtxxqZw42RtSADMwz4ijVmYHGS542b6cMz/go-ds-leveldb" + measure "gx/ipfs/QmSb95iHExSSb47zpmyn5CyY5PZidVWSjyKyDqgYQrnKor/go-ds-measure" + flatfs "gx/ipfs/QmUTshC2PP4ZDqkrFfDU4JGJFMWjYnunxPgkQ6ZCA2hGqh/go-ds-flatfs" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + mount "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/syncmount" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" ) diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 53358ada2..5438edd89 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -23,7 +23,7 @@ import ( "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir" - measure "gx/ipfs/QmNPv1yzXBqxzqjfTzHCeBoicxxZgHzLezdY2hMCZ3r6EU/go-ds-measure" + measure "gx/ipfs/QmSb95iHExSSb47zpmyn5CyY5PZidVWSjyKyDqgYQrnKor/go-ds-measure" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" util "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" diff --git a/repo/fsrepo/fsrepo_test.go b/repo/fsrepo/fsrepo_test.go index d6387eec8..d23ffe095 100644 --- a/repo/fsrepo/fsrepo_test.go +++ b/repo/fsrepo/fsrepo_test.go @@ -9,7 +9,7 @@ import ( "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/thirdparty/assert" - datastore "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + datastore "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" ) // swap arg order diff --git a/repo/repo.go b/repo/repo.go index db60bcc7a..4de90efa8 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -8,7 +8,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" config "github.com/ipfs/go-ipfs/repo/config" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" ) diff --git a/routing/mock/centralized_client.go b/routing/mock/centralized_client.go index 3dad5d320..7886201b6 100644 --- a/routing/mock/centralized_client.go +++ b/routing/mock/centralized_client.go @@ -8,14 +8,14 @@ import ( dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" "github.com/ipfs/go-ipfs/thirdparty/testutil" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" dhtpb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/routing/mock/centralized_server.go b/routing/mock/centralized_server.go index afa250b9a..d65ab3ac1 100644 --- a/routing/mock/centralized_server.go +++ b/routing/mock/centralized_server.go @@ -8,10 +8,10 @@ import ( "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dssync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dssync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/routing/mock/centralized_test.go b/routing/mock/centralized_test.go index 3c51340d6..5b2386236 100644 --- a/routing/mock/centralized_test.go +++ b/routing/mock/centralized_test.go @@ -10,7 +10,7 @@ import ( u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestKeyNotFound(t *testing.T) { diff --git a/routing/mock/dht.go b/routing/mock/dht.go index b9ee9b5ba..83a030ba6 100644 --- a/routing/mock/dht.go +++ b/routing/mock/dht.go @@ -4,9 +4,9 @@ import ( context "context" "github.com/ipfs/go-ipfs/thirdparty/testutil" mocknet "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/net/mock" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - sync "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" - dht "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + sync "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" + dht "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht" ) type mocknetserver struct { diff --git a/routing/mock/interface.go b/routing/mock/interface.go index 4e9f3e8d5..ae46c1ea7 100644 --- a/routing/mock/interface.go +++ b/routing/mock/interface.go @@ -10,8 +10,8 @@ import ( delay "github.com/ipfs/go-ipfs/thirdparty/delay" "github.com/ipfs/go-ipfs/thirdparty/testutil" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/routing/none/none_client.go b/routing/none/none_client.go index 66767fdd0..cde9dd26f 100644 --- a/routing/none/none_client.go +++ b/routing/none/none_client.go @@ -6,10 +6,10 @@ import ( repo "github.com/ipfs/go-ipfs/repo" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" p2phost "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/routing/offline/offline.go b/routing/offline/offline.go index 2be677920..f492d73be 100644 --- a/routing/offline/offline.go +++ b/routing/offline/offline.go @@ -7,14 +7,14 @@ import ( dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" record "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record" pb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ) diff --git a/routing/offline/offline_test.go b/routing/offline/offline_test.go index f4ccb2729..aaa44befc 100644 --- a/routing/offline/offline_test.go +++ b/routing/offline/offline_test.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "github.com/ipfs/go-ipfs/thirdparty/testutil" - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" "testing" ) diff --git a/routing/supernode/client.go b/routing/supernode/client.go index 47345cd82..04936acaf 100644 --- a/routing/supernode/client.go +++ b/routing/supernode/client.go @@ -8,16 +8,16 @@ import ( proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" - routing "gx/ipfs/QmNdaQ8itUU9jEZUwTsG4gHMaPmRfi6FEe89QjQAFbep3M/go-libp2p-routing" - dhtpb "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht/pb" + routing "gx/ipfs/QmP1wMAqk6aZYRZirbaAwmrNeqFRgQrwBt3orUtvSa1UYD/go-libp2p-routing" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" loggables "gx/ipfs/QmVesPmqbPp7xRGyY96tnBwzDtVV1nqv4SCVxo5zCqKyH8/go-libp2p-loggables" pb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" + dhtpb "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht/pb" ) var log = logging.Logger("supernode") diff --git a/routing/supernode/proxy/loopback.go b/routing/supernode/proxy/loopback.go index d38cc4f43..0452e7b7e 100644 --- a/routing/supernode/proxy/loopback.go +++ b/routing/supernode/proxy/loopback.go @@ -2,10 +2,10 @@ package proxy import ( context "context" - dhtpb "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht/pb" inet "gx/ipfs/QmRscs8KxrSmSv4iuevHv8JfuUzHBMoqiaHzxfDRiksd6e/go-libp2p-net" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" + dhtpb "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht/pb" ) // RequestHandler handles routing requests locally diff --git a/routing/supernode/proxy/standard.go b/routing/supernode/proxy/standard.go index eaa9e0786..c214643ee 100644 --- a/routing/supernode/proxy/standard.go +++ b/routing/supernode/proxy/standard.go @@ -4,7 +4,6 @@ import ( "context" "errors" - dhtpb "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht/pb" inet "gx/ipfs/QmRscs8KxrSmSv4iuevHv8JfuUzHBMoqiaHzxfDRiksd6e/go-libp2p-net" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" host "gx/ipfs/QmUywuGNZoUKV8B9iyvup9bPkLiMrhTsyVMkeSXW5VxAfC/go-libp2p-host" @@ -13,6 +12,7 @@ import ( ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" kbucket "gx/ipfs/QmaQG6fJdzn2532WHoPdVwKqftXr6iCSr5NtWyGi1BHytT/go-libp2p-kbucket" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" + dhtpb "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht/pb" ) const ProtocolSNR = "/ipfs/supernoderouting" diff --git a/routing/supernode/server.go b/routing/supernode/server.go index 95e70e0be..6ed1bfe1d 100644 --- a/routing/supernode/server.go +++ b/routing/supernode/server.go @@ -8,12 +8,12 @@ import ( proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - datastore "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dhtpb "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht/pb" + datastore "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" pb "gx/ipfs/QmWYCqr6UDqqD1bfRybaAPtbAqcN3TSJpveaBXMwbQ3ePZ/go-libp2p-record/pb" pstore "gx/ipfs/QmXZSd1qR5BxZkPyuwfT5jpqQFScZccoZvDneXsKzCNHWX/go-libp2p-peerstore" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" + dhtpb "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht/pb" ) // Server handles routing queries using a database backend diff --git a/routing/supernode/server_test.go b/routing/supernode/server_test.go index 925dad867..05dfb68f4 100644 --- a/routing/supernode/server_test.go +++ b/routing/supernode/server_test.go @@ -3,8 +3,8 @@ package supernode import ( "testing" - datastore "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dhtpb "gx/ipfs/QmRmroYSdievxnjiuy99C8BzShNstdEWcEF3LQHF7fUbez/go-libp2p-kad-dht/pb" + datastore "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dhtpb "gx/ipfs/QmfDWfnZZiwHSD58FE2PveLQhZZhZjbuvo1TU1Zu4P9Hd3/go-libp2p-kad-dht/pb" ) func TestPutProviderDoesntResultInDuplicates(t *testing.T) { diff --git a/tar/format.go b/tar/format.go index e3e02d8af..58f2ea181 100644 --- a/tar/format.go +++ b/tar/format.go @@ -15,8 +15,8 @@ import ( path "github.com/ipfs/go-ipfs/path" uio "github.com/ipfs/go-ipfs/unixfs/io" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) var log = logging.Logger("tarfmt") diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 8bf3945e3..957bab07d 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -4,13 +4,13 @@ import ( "bytes" "testing" - "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/mock" + "gx/ipfs/QmXxGS5QsUxpR3iqL5DjmsYPHR1Yz74siRQ4ChJqWFosMh/go-block-format" context "context" mocknet "gx/ipfs/QmQA5mdxru8Bh6dpC9PJfSkumqnmHgJX7knxSgBo5Lpime/go-libp2p/p2p/net/mock" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) func TestBitswapWithoutRouting(t *testing.T) { diff --git a/test/integration/grandcentral_test.go b/test/integration/grandcentral_test.go index 659e2aeaa..e4d207327 100644 --- a/test/integration/grandcentral_test.go +++ b/test/integration/grandcentral_test.go @@ -9,8 +9,8 @@ import ( "testing" context "context" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/corerouting" diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 6d2bfa26f..e0ee86079 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -126,6 +126,28 @@ test_expect_success "clean up ipfs dir" ' rm -rf "$IPFS_PATH" ' +# test init profiles +test_expect_success "'ipfs init --profile' with invalid profile fails" ' + BITS="1024" && + test_must_fail ipfs init --bits="$BITS" --profile=nonexistent_profile 2> invalid_profile_out + EXPECT="Error: invalid configuration profile: nonexistent_profile" && + grep "$EXPECT" invalid_profile_out +' + +test_expect_success "'ipfs init --profile' succeeds" ' + BITS="1024" && + ipfs init --bits="$BITS" --profile=server +' + +test_expect_success "'ipfs config Swarm.AddrFilters' looks good" ' + ipfs config Swarm.AddrFilters > actual_config && + test $(cat actual_config | wc -l) = 17 +' + +test_expect_success "clean up ipfs dir" ' + rm -rf "$IPFS_PATH" +' + test_init_ipfs test_launch_ipfs_daemon diff --git a/test/sharness/t0031-mount-publish.sh b/test/sharness/t0031-mount-publish.sh index 7164232e8..9776afd8d 100755 --- a/test/sharness/t0031-mount-publish.sh +++ b/test/sharness/t0031-mount-publish.sh @@ -40,7 +40,7 @@ test_expect_success FUSE "'ipfs mount' output looks good" ' ' test_expect_success "cannot publish after mounting /ipns" ' - echo "Error: You cannot manually publish while IPNS is mounted." >expected && + echo "Error: cannot manually publish while IPNS is mounted" >expected && test_must_fail ipfsi 0 name publish '$HASH' 2>actual && test_cmp expected actual ' diff --git a/test/sharness/t0053-dag.sh b/test/sharness/t0053-dag.sh index fed63640c..bf2a45e76 100755 --- a/test/sharness/t0053-dag.sh +++ b/test/sharness/t0053-dag.sh @@ -113,9 +113,18 @@ test_dag_cmd() { ' test_expect_success "non-canonical cbor input is normalized" ' - HASH=$(cat ../t0053-dag-data/non-canon.cbor | ipfs dag put --format=cbor --input-enc=raw) && - test $HASH = "zdpuAmxF8q6iTUtkB3xtEYzmc5Sw762qwQJftt5iW8NTWLtjC" || - test_fsh echo $HASH + HASH=$(cat ../t0053-dag-data/non-canon.cbor | ipfs dag put --format=cbor --input-enc=raw) && + test $HASH = "zdpuAmxF8q6iTUtkB3xtEYzmc5Sw762qwQJftt5iW8NTWLtjC" || + test_fsh echo $HASH + ' + + test_expect_success "add an ipld with pin" ' + PINHASH=$(printf {\"foo\":\"bar\"} | ipfs dag put --pin=true) + ' + + test_expect_success "after gc, objects still acessible" ' + ipfs repo gc > /dev/null && + ipfs refs -r --timeout=2s $PINHASH > /dev/null ' } diff --git a/test/sharness/t0180-p2p.sh b/test/sharness/t0180-p2p.sh new file mode 100755 index 000000000..a6f696421 --- /dev/null +++ b/test/sharness/t0180-p2p.sh @@ -0,0 +1,165 @@ +#!/bin/sh + +test_description="Test experimental p2p commands" + +. lib/test-lib.sh + +# start iptb + wait for peering +test_expect_success 'init iptb' ' + iptb init -n 2 --bootstrap=none --port=0 +' + +test_expect_success 'generate test data' ' + echo "ABCDEF" > test0.bin && + echo "012345" > test1.bin +' + +startup_cluster 2 + +test_expect_success 'peer ids' ' + PEERID_0=$(iptb get id 0) && + PEERID_1=$(iptb get id 1) +' + +test_expect_success "test ports are closed" ' + (! (netstat -ln | grep "LISTEN" | grep ":10101 ")) && + (! (netstat -ln | grep "LISTEN" | grep ":10102 ")) +' + +test_expect_success 'fail without config option being enabled' ' + test_must_fail ipfsi 0 p2p stream ls +' + +test_expect_success "enable filestore config setting" ' + ipfsi 0 config --json Experimental.Libp2pStreamMounting true + ipfsi 1 config --json Experimental.Libp2pStreamMounting true +' + +test_expect_success 'start p2p listener' ' + ipfsi 0 p2p listener open p2p-test /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log +' + +test_expect_success 'Test server to client communications' ' + ma-pipe-unidir --listen --pidFile=listener.pid send /ip4/127.0.0.1/tcp/10101 < test0.bin & + + go-sleep 500ms && + kill -0 $(cat listener.pid) && + + ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && + ma-pipe-unidir recv /ip4/127.0.0.1/tcp/10102 > client.out && + test ! -f listener.pid +' + +test_expect_success 'Test client to server communications' ' + ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 > server.out & + + go-sleep 500ms && + kill -0 $(cat listener.pid) && + + ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && + ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < test1.bin && + go-sleep 250ms && + test ! -f listener.pid +' + +test_expect_success 'server to client output looks good' ' + test_cmp client.out test0.bin +' + +test_expect_success 'client to server output looks good' ' + test_cmp server.out test1.bin +' + +test_expect_success "'ipfs listener p2p ls' succeeds" ' + echo "/ip4/127.0.0.1/tcp/10101 /p2p/p2p-test" > expected && + ipfsi 0 p2p listener ls > actual +' + +test_expect_success "'ipfs p2p listener ls' output looks good" ' + test_cmp expected actual +' + +test_expect_success "Cannot re-register app handler" ' + (! ipfsi 0 p2p listener open p2p-test /ip4/127.0.0.1/tcp/10101) +' + +test_expect_success "'ipfs p2p stream ls' output is empty" ' + ipfsi 0 p2p stream ls > actual && + test_must_be_empty actual +' + +test_expect_success "Setup: Idle stream" ' + ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 & + + ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && + ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 & + + go-sleep 500ms && + kill -0 $(cat listener.pid) && kill -0 $(cat client.pid) +' + +test_expect_success "'ipfs p2p stream ls' succeeds" ' + echo "2 /p2p/p2p-test /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected + ipfsi 0 p2p stream ls > actual +' + +test_expect_success "'ipfs p2p stream ls' output looks good" ' + test_cmp expected actual +' + +test_expect_success "'ipfs p2p stream close' closes stream" ' + ipfsi 0 p2p stream close 2 && + ipfsi 0 p2p stream ls > actual && + [ ! -f listener.pid ] && [ ! -f client.pid ] && + test_must_be_empty actual +' + +test_expect_success "'ipfs p2p listener close' closes app handler" ' + ipfsi 0 p2p listener close p2p-test && + ipfsi 0 p2p listener ls > actual && + test_must_be_empty actual +' + +test_expect_success "Setup: Idle stream(2)" ' + ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 & + + ipfsi 0 p2p listener open p2p-test2 /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log && + ipfsi 1 p2p stream dial $PEERID_0 p2p-test2 /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && + ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 & + + go-sleep 500ms && + kill -0 $(cat listener.pid) && kill -0 $(cat client.pid) +' + +test_expect_success "'ipfs p2p stream ls' succeeds(2)" ' + echo "3 /p2p/p2p-test2 /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected + ipfsi 0 p2p stream ls > actual + test_cmp expected actual +' + +test_expect_success "'ipfs p2p listener close -a' closes app handlers" ' + ipfsi 0 p2p listener close -a && + ipfsi 0 p2p listener ls > actual && + test_must_be_empty actual +' + +test_expect_success "'ipfs p2p stream close -a' closes streams" ' + ipfsi 0 p2p stream close -a && + ipfsi 0 p2p stream ls > actual && + [ ! -f listener.pid ] && [ ! -f client.pid ] && + test_must_be_empty actual +' + +test_expect_success "'ipfs p2p listener close' closes app numeric handlers" ' + ipfsi 0 p2p listener open 1234 /ip4/127.0.0.1/tcp/10101 && + ipfsi 0 p2p listener close 1234 && + ipfsi 0 p2p listener ls > actual && + test_must_be_empty actual +' + +test_expect_success 'stop iptb' ' + iptb stop +' + +test_done + diff --git a/test/sharness/t0180-ptp.sh b/test/sharness/t0180-ptp.sh deleted file mode 100755 index b321bad8e..000000000 --- a/test/sharness/t0180-ptp.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh - -test_description="Test experimental ptp commands" - -. lib/test-lib.sh - -# start iptb + wait for peering -test_expect_success 'init iptb' ' - iptb init -n 2 --bootstrap=none --port=0 -' - -test_expect_success 'generate test data' ' - echo "ABCDEF" > test0.bin && - echo "012345" > test1.bin -' - -startup_cluster 2 - -test_expect_success 'peer ids' ' - PEERID_0=$(iptb get id 0) && - PEERID_1=$(iptb get id 1) -' - -test_expect_success "test ports are closed" ' - (! (netstat -ln | grep "LISTEN" | grep ":10101 ")) && - (! (netstat -ln | grep "LISTEN" | grep ":10102 ")) -' - -test_must_fail 'fail without config option being enabled' ' - ipfsi 0 ptp stream ls -' - -test_expect_success "enable filestore config setting" ' - ipfsi 0 config --json Experimental.Libp2pStreamMounting true - ipfsi 1 config --json Experimental.Libp2pStreamMounting true -' - -test_expect_success 'start ptp listener' ' - ipfsi 0 ptp listener open ptp-test /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log -' - -test_expect_success 'Test server to client communications' ' - ma-pipe-unidir --listen send /ip4/127.0.0.1/tcp/10101 < test0.bin & - SERVER_PID=$! - - ipfsi 1 ptp stream dial $PEERID_0 ptp-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && - ma-pipe-unidir recv /ip4/127.0.0.1/tcp/10102 > client.out && - wait $SERVER_PID -' - -test_expect_success 'Test client to server communications' ' - ma-pipe-unidir --listen recv /ip4/127.0.0.1/tcp/10101 > server.out & - SERVER_PID=$! - - ipfsi 1 ptp stream dial $PEERID_0 ptp-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && - ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < test1.bin - wait $SERVER_PID -' - -test_expect_success 'server to client output looks good' ' - test_cmp client.out test0.bin -' - -test_expect_success 'client to server output looks good' ' - test_cmp server.out test1.bin -' - -test_expect_success "'ipfs listener ptp ls' succeeds" ' - echo "/ip4/127.0.0.1/tcp/10101 /ptp/ptp-test" > expected && - ipfsi 0 ptp listener ls > actual -' - -test_expect_success "'ipfs ptp listener ls' output looks good" ' - test_cmp expected actual -' - -test_expect_success "Cannot re-register app handler" ' - (! ipfsi 0 ptp listener open ptp-test /ip4/127.0.0.1/tcp/10101) -' - -test_expect_success "'ipfs ptp stream ls' output is empty" ' - ipfsi 0 ptp stream ls > actual && - test_must_be_empty actual -' - -test_expect_success "Setup: Idle stream" ' - ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 & - - ipfsi 1 ptp stream dial $PEERID_0 ptp-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && - ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 & - - go-sleep 500ms && - kill -0 $(cat listener.pid) && kill -0 $(cat client.pid) -' - -test_expect_success "'ipfs ptp stream ls' succeeds" ' - echo "2 /ptp/ptp-test /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected - ipfsi 0 ptp stream ls > actual -' - -test_expect_success "'ipfs ptp stream ls' output looks good" ' - test_cmp expected actual -' - -test_expect_success "'ipfs ptp stream close' closes stream" ' - ipfsi 0 ptp stream close 2 && - ipfsi 0 ptp stream ls > actual && - [ ! -f listener.pid ] && [ ! -f client.pid ] && - test_must_be_empty actual -' - -test_expect_success "'ipfs ptp listener close' closes app handler" ' - ipfsi 0 ptp listener close ptp-test && - ipfsi 0 ptp listener ls > actual && - test_must_be_empty actual -' - -test_expect_success "Setup: Idle stream(2)" ' - ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 & - - ipfsi 0 ptp listener open ptp-test2 /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log && - ipfsi 1 ptp stream dial $PEERID_0 ptp-test2 /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log && - ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 & - - go-sleep 500ms && - kill -0 $(cat listener.pid) && kill -0 $(cat client.pid) -' - -test_expect_success "'ipfs ptp stream ls' succeeds(2)" ' - echo "3 /ptp/ptp-test2 /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected - ipfsi 0 ptp stream ls > actual - test_cmp expected actual -' - -test_expect_success "'ipfs ptp listener close -a' closes app handlers" ' - ipfsi 0 ptp listener close -a && - ipfsi 0 ptp listener ls > actual && - test_must_be_empty actual -' - -test_expect_success "'ipfs ptp stream close -a' closes streams" ' - ipfsi 0 ptp stream close -a && - ipfsi 0 ptp stream ls > actual && - [ ! -f listener.pid ] && [ ! -f client.pid ] && - test_must_be_empty actual -' - -test_expect_success "'ipfs ptp listener close' closes app numeric handlers" ' - ipfsi 0 ptp listener open 1234 /ip4/127.0.0.1/tcp/10101 && - ipfsi 0 ptp listener close 1234 && - ipfsi 0 ptp listener ls > actual && - test_must_be_empty actual -' - -test_expect_success 'stop iptb' ' - iptb stop -' - -test_done - diff --git a/test/sharness/t0250-files-api.sh b/test/sharness/t0250-files-api.sh index ffd5bc8ad..5ade5a4c3 100755 --- a/test/sharness/t0250-files-api.sh +++ b/test/sharness/t0250-files-api.sh @@ -10,17 +10,16 @@ test_description="test the unix files api" test_init_ipfs -# setup files for testing -test_expect_success "can create some files for testing" ' - FILE1=$(echo foo | ipfs add -q) && - FILE2=$(echo bar | ipfs add -q) && - FILE3=$(echo baz | ipfs add -q) && - mkdir stuff_test && +create_files() { + FILE1=$(echo foo | ipfs add "$@" -q) && + FILE2=$(echo bar | ipfs add "$@" -q) && + FILE3=$(echo baz | ipfs add "$@" -q) && + mkdir -p stuff_test && echo cats > stuff_test/a && echo dogs > stuff_test/b && echo giraffes > stuff_test/c && - DIR1=$(ipfs add -q stuff_test | tail -n1) -' + DIR1=$(ipfs add -r "$@" -q stuff_test | tail -n1) +} verify_path_exists() { # simply running ls on a file should be a good 'check' @@ -90,6 +89,8 @@ test_sharding() { } test_files_api() { + ROOT_HASH=$1 + test_expect_success "can mkdir in root" ' ipfs files mkdir /cats ' @@ -159,6 +160,12 @@ test_files_api() { verify_dir_contents /cats file1 ' + test_expect_success "file has correct hash and size in directory" ' + echo "file1 $FILE1 4" > ls_l_expected && + ipfs files ls -l /cats > ls_l_actual && + test_cmp ls_l_expected ls_l_actual + ' + test_expect_success "can read file" ' ipfs files read /cats/file1 > file1out ' @@ -402,7 +409,7 @@ test_files_api() { test_expect_success "root hash not bubbled up yet" ' test -z "$ONLINE" || (ipfs refs local > refsout && - test_expect_code 1 grep QmcwKfTMCT7AaeiD92hWjnZn9b6eh9NxnhfSzN5x2vnDpt refsout) + test_expect_code 1 grep $ROOT_HASH refsout) ' test_expect_success "changes bubbled up to root on inspection" ' @@ -410,7 +417,7 @@ test_files_api() { ' test_expect_success "root hash looks good" ' - export EXP_ROOT_HASH="QmcwKfTMCT7AaeiD92hWjnZn9b6eh9NxnhfSzN5x2vnDpt" && + export EXP_ROOT_HASH="$ROOT_HASH" && echo $EXP_ROOT_HASH > root_hash_exp && test_cmp root_hash_exp root_hash ' @@ -521,26 +528,47 @@ test_files_api() { ipfs files rm -r /foobar && ipfs files rm -r /adir ' + + test_expect_success "root mfs entry is empty" ' + verify_dir_contents / + ' + + test_expect_success "repo gc" ' + ipfs repo gc + ' } # test offline and online -test_files_api - -test_expect_success "clean up objects from previous test run" ' - ipfs repo gc +test_expect_success "can create some files for testing" ' + create_files ' +test_files_api QmcwKfTMCT7AaeiD92hWjnZn9b6eh9NxnhfSzN5x2vnDpt -test_launch_ipfs_daemon +test_expect_success "can create some files for testing with raw-leaves" ' + create_files --raw-leaves +' +test_files_api QmTpKiKcAj4sbeesN6vrs5w3QeVmd4QmGpxRL81hHut4dZ + +test_launch_ipfs_daemon --offline ONLINE=1 # set online flag so tests can easily tell -test_files_api -test_kill_ipfs_daemon +test_expect_success "can create some files for testing" ' + create_files +' +test_files_api QmcwKfTMCT7AaeiD92hWjnZn9b6eh9NxnhfSzN5x2vnDpt + +test_expect_success "can create some files for testing with raw-leaves" ' + create_files --raw-leaves +' +test_files_api QmTpKiKcAj4sbeesN6vrs5w3QeVmd4QmGpxRL81hHut4dZ + +test_kill_ipfs_daemon --offline test_expect_success "enable sharding in config" ' ipfs config --json Experimental.ShardingEnabled true ' -test_launch_ipfs_daemon +test_launch_ipfs_daemon --offline test_sharding test_kill_ipfs_daemon diff --git a/test/supernode_client/main.go b/test/supernode_client/main.go index 3bd4f77fb..0096afa54 100644 --- a/test/supernode_client/main.go +++ b/test/supernode_client/main.go @@ -24,8 +24,8 @@ import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr" unit "github.com/ipfs/go-ipfs/thirdparty/unit" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" context "context" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" diff --git a/thirdparty/datastore2/datastore_closer.go b/thirdparty/datastore2/datastore_closer.go index d726a2d35..6d48bc959 100644 --- a/thirdparty/datastore2/datastore_closer.go +++ b/thirdparty/datastore2/datastore_closer.go @@ -3,7 +3,7 @@ package datastore2 import ( "io" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" ) type ThreadSafeDatastoreCloser interface { diff --git a/thirdparty/datastore2/delayed.go b/thirdparty/datastore2/delayed.go index 092ba2292..49ce46f54 100644 --- a/thirdparty/datastore2/delayed.go +++ b/thirdparty/datastore2/delayed.go @@ -1,8 +1,8 @@ package datastore2 import ( - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - dsq "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/query" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + dsq "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/query" delay "github.com/ipfs/go-ipfs/thirdparty/delay" ) diff --git a/thirdparty/datastore2/threadsafe.go b/thirdparty/datastore2/threadsafe.go index 42b7a6b7a..36f90be7a 100644 --- a/thirdparty/datastore2/threadsafe.go +++ b/thirdparty/datastore2/threadsafe.go @@ -3,7 +3,7 @@ package datastore2 import ( "io" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" ) // ClaimThreadSafe claims that a Datastore is threadsafe, even when diff --git a/thirdparty/ds-help/key.go b/thirdparty/ds-help/key.go index 0c4fab85b..b0b2ebe98 100644 --- a/thirdparty/ds-help/key.go +++ b/thirdparty/ds-help/key.go @@ -1,9 +1,9 @@ package dshelp import ( - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" base32 "gx/ipfs/QmZvZSVtvxak4dcTkhsQhqd1SQ6rg5UzaSTu62WfWKjj93/base32" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) // TODO: put this code into the go-datastore itself diff --git a/thirdparty/posinfo/posinfo.go b/thirdparty/posinfo/posinfo.go index a28c995d3..4dabf83f5 100644 --- a/thirdparty/posinfo/posinfo.go +++ b/thirdparty/posinfo/posinfo.go @@ -3,7 +3,7 @@ package posinfo import ( "os" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) type PosInfo struct { diff --git a/thirdparty/testutil/datastore.go b/thirdparty/testutil/datastore.go index 7cc5aba52..55314c9fa 100644 --- a/thirdparty/testutil/datastore.go +++ b/thirdparty/testutil/datastore.go @@ -2,8 +2,8 @@ package testutil import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" - syncds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync" + "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore" + syncds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/sync" ) func ThreadSafeCloserMapDatastore() ds2.ThreadSafeDatastoreCloser { diff --git a/thirdparty/testutil/gen.go b/thirdparty/testutil/gen.go index 10a719f52..0649cd848 100644 --- a/thirdparty/testutil/gen.go +++ b/thirdparty/testutil/gen.go @@ -10,7 +10,7 @@ import ( ci "gx/ipfs/QmP1DfoUjiWH2ZBo1PBH6FupdBucbDepx3HpWmEY6JMUpY/go-libp2p-crypto" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" peer "gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer" ma "gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr" diff --git a/unixfs/archive/archive.go b/unixfs/archive/archive.go index c28b2fe68..cf1d74ac9 100644 --- a/unixfs/archive/archive.go +++ b/unixfs/archive/archive.go @@ -11,7 +11,7 @@ import ( tar "github.com/ipfs/go-ipfs/unixfs/archive/tar" uio "github.com/ipfs/go-ipfs/unixfs/io" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // DefaultBufSize is the buffer size for gets. for now, 1MB, which is ~4 blocks. diff --git a/unixfs/archive/tar/writer.go b/unixfs/archive/tar/writer.go index 5498c463e..01d7fd833 100644 --- a/unixfs/archive/tar/writer.go +++ b/unixfs/archive/tar/writer.go @@ -13,8 +13,8 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" upb "github.com/ipfs/go-ipfs/unixfs/pb" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) // Writer is a utility structure that helps to write diff --git a/unixfs/hamt/hamt.go b/unixfs/hamt/hamt.go index d0b60a9c6..1a6b3d1f9 100644 --- a/unixfs/hamt/hamt.go +++ b/unixfs/hamt/hamt.go @@ -31,9 +31,9 @@ import ( format "github.com/ipfs/go-ipfs/unixfs" upb "github.com/ipfs/go-ipfs/unixfs/pb" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" "gx/ipfs/QmfJHywXQu98UeZtGJBQrPAR6AtmDjjbe3qjTo9piXHPnx/murmur3" ) diff --git a/unixfs/io/dagreader.go b/unixfs/io/dagreader.go index 9abfe0c9d..17cd6b4ca 100644 --- a/unixfs/io/dagreader.go +++ b/unixfs/io/dagreader.go @@ -10,8 +10,8 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) var ErrIsDir = errors.New("this dag node is a directory") diff --git a/unixfs/io/dirbuilder.go b/unixfs/io/dirbuilder.go index 8d8509763..83b49df9d 100644 --- a/unixfs/io/dirbuilder.go +++ b/unixfs/io/dirbuilder.go @@ -8,9 +8,9 @@ import ( mdag "github.com/ipfs/go-ipfs/merkledag" format "github.com/ipfs/go-ipfs/unixfs" hamt "github.com/ipfs/go-ipfs/unixfs/hamt" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // ShardSplitThreshold specifies how large of an unsharded directory diff --git a/unixfs/io/resolve.go b/unixfs/io/resolve.go index f9213b55c..75d88a72b 100644 --- a/unixfs/io/resolve.go +++ b/unixfs/io/resolve.go @@ -7,7 +7,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" hamt "github.com/ipfs/go-ipfs/unixfs/hamt" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" ) // ResolveUnixfsOnce resolves a single hop of a path through a graph in a diff --git a/unixfs/mod/dagmodifier.go b/unixfs/mod/dagmodifier.go index 090cdb593..00a3c1c93 100644 --- a/unixfs/mod/dagmodifier.go +++ b/unixfs/mod/dagmodifier.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "errors" + "fmt" "io" chunk "github.com/ipfs/go-ipfs/importer/chunk" @@ -13,9 +14,9 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" + cid "gx/ipfs/Qma4RJSuh7mMeJQYCqMbKzekn6EwBo7HEs5AQYjVRMQATB/go-cid" ) var ErrSeekFail = errors.New("failed to seek properly") @@ -29,7 +30,7 @@ var writebufferSize = 1 << 21 // Dear god, please rename this to something more pleasant type DagModifier struct { dagserv mdag.DAGService - curNode *mdag.ProtoNode + curNode node.Node splitter chunk.SplitterGen ctx context.Context @@ -42,14 +43,18 @@ type DagModifier struct { read uio.DagReader } +var ErrNotUnixfs = fmt.Errorf("dagmodifier only supports unixfs nodes (proto or raw)") + func NewDagModifier(ctx context.Context, from node.Node, serv mdag.DAGService, spl chunk.SplitterGen) (*DagModifier, error) { - pbn, ok := from.(*mdag.ProtoNode) - if !ok { - return nil, mdag.ErrNotProtobuf + switch from.(type) { + case *mdag.ProtoNode, *mdag.RawNode: + // ok + default: + return nil, ErrNotUnixfs } return &DagModifier{ - curNode: pbn.Copy().(*mdag.ProtoNode), + curNode: from.Copy(), dagserv: serv, splitter: spl, ctx: ctx, @@ -144,19 +149,29 @@ func (dm *DagModifier) Write(b []byte) (int, error) { return n, nil } -func (dm *DagModifier) Size() (int64, error) { - pbn, err := ft.FromBytes(dm.curNode.Data()) - if err != nil { - return 0, err - } +var ErrNoRawYet = fmt.Errorf("currently only fully support protonodes in the dagmodifier") - if dm.wrBuf != nil { - if uint64(dm.wrBuf.Len())+dm.writeStart > pbn.GetFilesize() { +// Size returns the Filesize of the node +func (dm *DagModifier) Size() (int64, error) { + switch nd := dm.curNode.(type) { + case *mdag.ProtoNode: + pbn, err := ft.FromBytes(nd.Data()) + if err != nil { + return 0, err + } + if dm.wrBuf != nil && uint64(dm.wrBuf.Len())+dm.writeStart > pbn.GetFilesize() { return int64(dm.wrBuf.Len()) + int64(dm.writeStart), nil } + return int64(pbn.GetFilesize()), nil + case *mdag.RawNode: + if dm.wrBuf != nil { + return 0, ErrNoRawYet + } + sz, err := nd.Size() + return int64(sz), err + default: + return 0, ErrNotUnixfs } - - return int64(pbn.GetFilesize()), nil } // Sync writes changes to this dag to disk @@ -222,7 +237,12 @@ func (dm *DagModifier) Sync() error { // modifyDag writes the data in 'data' over the data in 'node' starting at 'offset' // returns the new key of the passed in node and whether or not all the data in the reader // has been consumed. -func (dm *DagModifier) modifyDag(node *mdag.ProtoNode, offset uint64, data io.Reader) (*cid.Cid, bool, error) { +func (dm *DagModifier) modifyDag(n node.Node, offset uint64, data io.Reader) (*cid.Cid, bool, error) { + node, ok := n.(*mdag.ProtoNode) + if !ok { + return nil, false, ErrNoRawYet + } + f, err := ft.FromBytes(node.Data()) if err != nil { return nil, false, err @@ -301,13 +321,19 @@ func (dm *DagModifier) modifyDag(node *mdag.ProtoNode, offset uint64, data io.Re } // appendData appends the blocks from the given chan to the end of this dag -func (dm *DagModifier) appendData(node *mdag.ProtoNode, spl chunk.Splitter) (node.Node, error) { - dbp := &help.DagBuilderParams{ - Dagserv: dm.dagserv, - Maxlinks: help.DefaultLinksPerBlock, +func (dm *DagModifier) appendData(nd node.Node, spl chunk.Splitter) (node.Node, error) { + switch nd := nd.(type) { + case *mdag.ProtoNode: + dbp := &help.DagBuilderParams{ + Dagserv: dm.dagserv, + Maxlinks: help.DefaultLinksPerBlock, + } + return trickle.TrickleAppend(dm.ctx, nd, dbp.New(spl)) + case *mdag.RawNode: + return nil, fmt.Errorf("appending to raw node types not yet supported") + default: + return nil, ErrNotUnixfs } - - return trickle.TrickleAppend(dm.ctx, node, dbp.New(spl)) } // Read data from this dag starting at the current offset @@ -367,12 +393,12 @@ func (dm *DagModifier) CtxReadFull(ctx context.Context, b []byte) (int, error) { } // GetNode gets the modified DAG Node -func (dm *DagModifier) GetNode() (*mdag.ProtoNode, error) { +func (dm *DagModifier) GetNode() (node.Node, error) { err := dm.Sync() if err != nil { return nil, err } - return dm.curNode.Copy().(*mdag.ProtoNode), nil + return dm.curNode.Copy(), nil } // HasChanges returned whether or not there are unflushed changes to this dag @@ -452,7 +478,12 @@ func (dm *DagModifier) Truncate(size int64) error { } // dagTruncate truncates the given node to 'size' and returns the modified Node -func dagTruncate(ctx context.Context, nd *mdag.ProtoNode, size uint64, ds mdag.DAGService) (*mdag.ProtoNode, error) { +func dagTruncate(ctx context.Context, n node.Node, size uint64, ds mdag.DAGService) (*mdag.ProtoNode, error) { + nd, ok := n.(*mdag.ProtoNode) + if !ok { + return nil, ErrNoRawYet + } + if len(nd.Links()) == 0 { // TODO: this can likely be done without marshaling and remarshaling pbn, err := ft.FromBytes(nd.Data()) diff --git a/unixfs/mod/dagmodifier_test.go b/unixfs/mod/dagmodifier_test.go index d7b3f3267..b22844194 100644 --- a/unixfs/mod/dagmodifier_test.go +++ b/unixfs/mod/dagmodifier_test.go @@ -9,6 +9,7 @@ import ( h "github.com/ipfs/go-ipfs/importer/helpers" trickle "github.com/ipfs/go-ipfs/importer/trickle" + mdag "github.com/ipfs/go-ipfs/merkledag" ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" testu "github.com/ipfs/go-ipfs/unixfs/test" @@ -105,7 +106,7 @@ func TestDagModifierBasic(t *testing.T) { t.Fatal(err) } - size, err := ft.DataSize(node.Data()) + size, err := ft.DataSize(node.(*mdag.ProtoNode).Data()) if err != nil { t.Fatal(err) } diff --git a/unixfs/test/utils.go b/unixfs/test/utils.go index ada15a086..cadc8081d 100644 --- a/unixfs/test/utils.go +++ b/unixfs/test/utils.go @@ -14,8 +14,8 @@ import ( mdagmock "github.com/ipfs/go-ipfs/merkledag/test" ft "github.com/ipfs/go-ipfs/unixfs" + node "gx/ipfs/QmPAKbSsgEX5B6fpmxa61jXYnoWzZr5sNafd3qgPiSH8Uv/go-ipld-format" u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - node "gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format" ) func SizeSplitterGen(size int64) chunk.SplitterGen {