Skip to content

Commit a8b04c3

Browse files
committed
Merge branch 'master' of https://github.com/ipfs/go-ipfs into upstream
2 parents 4d1055c + 67828a4 commit a8b04c3

162 files changed

Lines changed: 1663 additions & 1552 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codeclimate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ exclude_paths:
1111
engines:
1212
fixme:
1313
enabled: true
14+
config:
15+
strings:
16+
- FIXME
17+
- HACK
18+
- XXX
19+
- BUG
1420
golint:
1521
enabled: true
1622
govet:

.gx/lastpubver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.8: QmPnTPuoB9y4Wzm3j8BdUmoqG7icmN7zGazDLuT4Duke9S
1+
0.4.9: QmQuvzi7p2qv9oduQ8o6fhPXDBCns9ryjjxqumyNvE5gZs

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
### 0.4.9 - 2017-04-30
44

5+
Ipfs 0.4.9 is a maintenance release that contains several useful bugfixes and
6+
improvements. Notably, `ipfs add` has gained the ability to select which CID
7+
version will be output. The common ipfs hash that looks like this:
8+
`QmRjNgF2mRLDT8AzCPsQbw1EYF2hDTFgfUmJokJPhCApYP` is a multihash. Multihashes
9+
allow us to specify the hashing algorithm that was used to verify the data, but
10+
it doesn't give us any indication of what format that data might be. To address
11+
that issue, we are adding another couple of bytes to the prefix that will allow us
12+
to indicate the format of the data referenced by the hash. This new format is
13+
called a Content ID, or CID for short. The previous bare multihashes will still
14+
be fully supported throughout the entire application as CID version 0. The new
15+
format with the type information will be CID version 1. To give an example,
16+
the content referenced by the hash above is "Hello Ipfs!". That same content,
17+
in the same format (dag-protobuf) using CIDv1 is
18+
`zb2rhkgXZVkT2xvDiuUsJENPSbWJy7fdYnsboLBzzEjjZMRoG`.
19+
20+
CIDv1 hashes are supported in ipfs versions back to 0.4.5. Nodes running 0.4.4
21+
and older will not be able to load content via CIDv1 and we recommend that they
22+
update to a newer version.
23+
24+
There are many other use cases for CIDs. Plugins can be written to
25+
allow ipfs to natively address content from any other merkletree based system,
26+
such as git, bitcoin, zcash and ethereum -- a few systems we've already started work on.
27+
28+
Aside from the CID flag, there were many other changes as noted below:
29+
530
- Features
631
- Add support for using CidV1 in 'ipfs add' ([ipfs/go-ipfs#3743](https://github.com/ipfs/go-ipfs/pull/3743))
732
- Improvements

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ From there:
7070
### From Linux package managers
7171

7272
- [Arch Linux](#arch-linux)
73+
- [Nix](#nix)
7374
- [Snap](#snap)
7475

7576
#### Arch Linux
@@ -83,6 +84,15 @@ Development version of go-ipfs is also on AUR under
8384
[go-ipfs-git](https://aur.archlinux.org/packages/go-ipfs-git/).
8485
You can install it using your favourite AUR Helper or manually from AUR.
8586

87+
### Nix
88+
89+
For Linux and MacOSX you can use the purely functional package manager [Nix](https://nixos.org/nix/):
90+
91+
```
92+
$ nix-env -i ipfs
93+
```
94+
You can also install the Package by using it's attribute name, which is also `ipfs`.
95+
8696
#### Snap
8797

8898
With snap, in any of the [supported Linux distributions](https://snapcraft.io/docs/core/install):
@@ -114,6 +124,8 @@ $ cd $GOPATH/src/github.com/ipfs/go-ipfs
114124
$ make install
115125
```
116126

127+
If you are building on FreeBSD instead of `make install` use `gmake install`.
128+
117129
#### Building on less common systems
118130

119131
If your operating system isn't officially supported, but you still want to try

Rules.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ include $(dir)/Rules.mk
5353
dir := exchange/bitswap/message/pb
5454
include $(dir)/Rules.mk
5555

56-
dir := diagnostics/pb
57-
include $(dir)/Rules.mk
58-
5956
dir := pin/internal/pb
6057
include $(dir)/Rules.mk
6158

@@ -70,7 +67,6 @@ include $(dir)/Rules.mk
7067
# core targets #
7168
# -------------------- #
7269

73-
7470
build: $(TGT_BIN)
7571
.PHONY: build
7672

@@ -146,6 +142,7 @@ help:
146142
@echo ' test_go_short'
147143
@echo ' test_go_expensive'
148144
@echo ' test_go_race'
145+
@echo ' test_go_megacheck' - Run the `megacheck` vetting tool
149146
@echo ' test_sharness_short'
150147
@echo ' test_sharness_expensive'
151148
@echo ' test_sharness_race'

bin/check_version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ check_at_least_version() {
3535
# if the second dot doesn't match, we consider it a prerelease
3636

3737
if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9]\+\)"); then
38-
# this captured digit is neccessary, since expr returns code 1 if the output is empty
38+
# this captured digit is necessary, since expr returns code 1 if the output is empty
3939
if expr "$MIN_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
4040
MIN_PRERELEASE="0"
4141
else
@@ -48,7 +48,7 @@ check_at_least_version() {
4848
MIN_FIX="0"
4949
fi
5050
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9]\+\)"); then
51-
# this captured digit is neccessary, since expr returns code 1 if the output is empty
51+
# this captured digit is necessary, since expr returns code 1 if the output is empty
5252
if expr "$CUR_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
5353
CUR_PRERELEASE="0"
5454
else

blocks/blocks_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ func TestManualHash(t *testing.T) {
9191

9292
u.Debug = true
9393

94-
block, err = NewBlockWithCid(data, c)
94+
_, err = NewBlockWithCid(data, c)
9595
if err != ErrWrongHash {
9696
t.Fatal(err)
9797
}
98-
9998
}

blocks/blockstore/arc_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func testArcCached(ctx context.Context, bs Blockstore) (*arccache, error) {
3030
func createStores(t *testing.T) (*arccache, Blockstore, *callbackDatastore) {
3131
cd := &callbackDatastore{f: func() {}, ds: ds.NewMapDatastore()}
3232
bs := NewBlockstore(syncds.MutexWrap(cd))
33-
arc, err := testArcCached(nil, bs)
33+
arc, err := testArcCached(context.TODO(), bs)
3434
if err != nil {
3535
t.Fatal(err)
3636
}

blocks/blockstore/blockstore.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ func NewBlockstore(d ds.Batching) Blockstore {
102102
type blockstore struct {
103103
datastore ds.Batching
104104

105-
lk sync.RWMutex
106-
gcreq int32
107-
gcreqlk sync.Mutex
108-
109105
rehash bool
110106
}
111107

@@ -246,9 +242,8 @@ func NewGCLocker() GCLocker {
246242
}
247243

248244
type gclocker struct {
249-
lk sync.RWMutex
250-
gcreq int32
251-
gcreqlk sync.Mutex
245+
lk sync.RWMutex
246+
gcreq int32
252247
}
253248

254249
// Unlocker represents an object which can Unlock

blocks/blockstore/bloom_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (b *bloomcache) hasCached(k *cid.Cid) (has bool, ok bool) {
118118
}
119119
if b.BloomActive() {
120120
blr := b.bloom.HasTS(k.Bytes())
121-
if blr == false { // not contained in bloom is only conclusive answer bloom gives
121+
if !blr { // not contained in bloom is only conclusive answer bloom gives
122122
b.hits.Inc()
123123
return false, true
124124
}

0 commit comments

Comments
 (0)