Commit Graph

1860 Commits

Author SHA1 Message Date
Kishan Mohanbhai Sagathiya
512bf6a13b Pin recover on all peers
- recover works without `--local` flag as well (recovers all pins on all
peers)
- remove extra space from rpc policy

Fixes #763
2019-08-21 11:19:07 +05:30
Kishan Mohanbhai Sagathiya
e6d183fd70 Addressed reviews 2019-08-20 10:49:28 +05:30
Kishan Mohanbhai Sagathiya
05a4661145 Use the updated sharness library 2019-08-19 16:49:27 +05:30
Kishan Mohanbhai Sagathiya
0b6c376bad Metadata can be set and shown from ctl
This commit adds
- `metadata` option to `pin add` and `add` commands
- ability to set metadata from `/add` rest API
2019-08-19 10:29:06 +05:30
Kishan Mohanbhai Sagathiya
6bd897ac47 Added UserAllocations support for add 2019-08-16 18:13:06 +05:30
Kishan Mohanbhai Sagathiya
eba6efd457 Merge branch 'master' of github.com:ipfs/ipfs-cluster into feat/sort-responses 2019-08-16 13:34:09 +05:30
Kishan Mohanbhai Sagathiya
6656b80a00 Some more occurences of /ipfs
and use  SwapToP2pMultiaddrs (very helpful since ipfs still send
addresses with `/ipfs` tag)
2019-08-16 11:56:09 +05:30
Kishan Sagathiya
edd5e33a1b
Update api/rest/restapi.go 2019-08-14 19:49:15 +05:30
Hector Sanjuan
62b7054d31 Fix: pintrackers: Do not spam the logs when running recover
Currently logs every pin we call recover with. We call recover regularly.
So it will print all pins.
2019-08-14 14:10:44 +02:00
Hector Sanjuan
5e4c8d9418 Ctl: increase host-name spacing in status output
Allow for slightly longer hostnames
2019-08-14 14:10:11 +02:00
Hector Sanjuan
6743f92e51 Fix: do not set PinUpdate when cid is Undef
It gets set to 'b' and then prints an error when parsing.
2019-08-14 14:09:46 +02:00
Hector Sanjuan
406e8b5954 Update unixfs and reprovide too 2019-08-14 13:48:03 +02:00
Hector Sanjuan
ce2457a7aa Fix: peerstore reading panics on empty lines 2019-08-14 13:44:26 +02:00
Hector Sanjuan
08f5f9f62a Update go-ds-crdt
I could not sleep last night and my mind randomly discovered that go-ds-crdt
had a small problem which is now partially addressed.
2019-08-14 10:57:46 +02:00
Kishan Mohanbhai Sagathiya
229953f943 Merge branch 'master' of github.com:ipfs/ipfs-cluster into fix/api-improvements 2019-08-14 09:05:56 +05:30
Hector Sanjuan
dc2e73dfc2
Release 0.11.0-rc6 2019-08-13 20:25:53 +02:00
Hector Sanjuan
216d288b65
Merge pull request #884 from ipfs/fix/883-testadd
Fix #883: Tweak timeouts for better tests
2019-08-13 20:24:09 +02:00
Hector Sanjuan
28ae394fa9 Fix #883: Tweak timeouts for better tests 2019-08-13 19:44:48 +02:00
Hector Sanjuan
ea977d43aa
Merge pull request #882 from ipfs/fix/docker-crdt
Improve Docker support for CRDTs
2019-08-13 19:44:04 +02:00
Hector Sanjuan
4556cbe726 Docker: improve for CRDTs
This:

  * Allows choosing the consensus for the automatic "init" on Docker with
  IPFS_CLUSTER_CONSENSUS.

  * Removes IPFS_PATH and the sed replacements for 0.0.0.0 on RestAPI and
  Ipfsproxy endpoints because these are easily supported by setting env vars
  correctly and pose some security risk when running with net=host.

  * Brings up to date Dockerfile-test and Dockerfile-bundle, even if mostly
  unused.
2019-08-13 19:32:38 +02:00
Hector Sanjuan
bd6d01b32e Docker-compose: simplify, use CRDTs and mDNS
This makes the docker-compose.yml a way to get a test-example cluster up and
running. Since mDNS works now, cluster peers can auto-discover in the docker
network and do not need a command override to bootstrap.

More docs have been added to the top to make sure users use it to get up and
running with a test-cluster. Unnecessary port-exposures have been
removed. Cluster options have been set in a more canonical way using env vars.
2019-08-13 19:32:38 +02:00
Hector Sanjuan
dc3170b1d2 cluster: add mDNS service discovery
I always thought the libp2p node would do this, but it is not the case.
With this, CRDT peers are able to autodiscover on local networks.
2019-08-13 19:32:38 +02:00
Kishan Mohanbhai Sagathiya
06729def89 Use router.NotFoundHandler instead 2019-08-13 22:55:43 +05:30
Hector Sanjuan
912740e2f7
Merge pull request #871 from ipfs/issue_852
Improve error handling on `add`
2019-08-13 19:16:50 +02:00
Kishan Mohanbhai Sagathiya
935c824b33 Merge branch 'master' of github.com:ipfs/ipfs-cluster into fix/api-improvements 2019-08-13 22:34:51 +05:30
Hector Sanjuan
b1769edf0c Tests: add: do not delete test folders when shutting down peer 2019-08-13 18:19:10 +02:00
Hector Sanjuan
f9889e712f
Merge pull request #875 from ipfs/fix/pin-methods
ipfshttp: Remove "refs" method
2019-08-13 17:27:48 +02:00
Hector Sanjuan
b6b44f65f7 Adder: fix tests
rpc mock returned 0 allocations and things started failing.
2019-08-13 17:26:02 +02:00
Hector Sanjuan
b4f6fe284d Remove all references to pin_method 2019-08-13 16:16:45 +02:00
Hector Sanjuan
111cc29fc6 Add tests: fix tests for adder BlockPutHelper 2019-08-13 16:06:20 +02:00
Hector Sanjuan
5c2af68459 Adder: BlockPutHelper should fail on all RPC errors
It kept trying even when the destination libp2p host was down
because that's a ClientError.
2019-08-13 16:06:20 +02:00
Kishan Mohanbhai Sagathiya
70e429f925 Fix #852: Improve error handling on add
Keep sending blocks while adding as long as one destination works.
2019-08-13 16:06:20 +02:00
Hector Sanjuan
5303a7f721
Merge pull request #874 from ipfs/feat/865-init-consensus
Service: Select consensus on "init" (not on "daemon")
2019-08-13 10:21:45 +02:00
Hector Sanjuan
3b3e3493a8 Service: init: improve log messages
Align with previous behaviour and make sure it is logged that
the configuration file was written.

Do not say "peerstore written with 0 entries" as that might be
taken like an error.
2019-08-12 16:58:06 +02:00
Hector Sanjuan
fc965f9528 service: init: do not create badger section when using Raft. 2019-08-12 16:44:22 +02:00
Hector Sanjuan
850b57e62e ipfshttp: Remove "refs" method
go-ipfs no longer performs a global lock when two simultaneous requests to pin
happen. This allows us to remove a bunch of code.
2019-08-12 12:16:01 +02:00
Hector Sanjuan
d8c20adc4e
Merge pull request #869 from ipfs/fix/732-pin-update-the-good-way
Fix #732: Introduce native pin/update
2019-08-12 12:15:30 +02:00
Hector Sanjuan
25d0ec03f9
Merge pull request #876 from ipfs/fix/stringsliceflag
Use string flag instead of string slice
2019-08-12 12:06:17 +02:00
Kishan Mohanbhai Sagathiya
684f58894d Use string flag instead of string slice
Because string slice is not very user friendly. Using string instead
would allow us to pass a comma separated list of arguments in one option
2019-08-12 11:31:26 +02:00
Hector Sanjuan
2311bdac19 daemon: do consensus things inside a switch 2019-08-12 10:39:49 +02:00
Hector Sanjuan
2815debebc sharness: test init with crdt 2019-08-12 10:36:00 +02:00
Hector Sanjuan
e614d2e9b2
Merge pull request #867 from ipfs/crdt/trust-all
CRDT: TrustAll by default.
2019-08-12 10:27:24 +02:00
Hector Sanjuan
f32a53c4e6 Daemon: "init" do not TrustAll when passing --peers 2019-08-12 10:25:55 +02:00
Hector Sanjuan
676ad1b61e CRDT: TrustAll by default. 2019-08-12 10:25:04 +02:00
Kishan Mohanbhai Sagathiya
f022a70f4c Make sure all API errors are in JSON
This commit introduces a catchAllHandler(which returns error not found),
which will be used if path doesn't match with any other pattern.
2019-08-12 13:00:11 +05:30
Kishan Mohanbhai Sagathiya
ee6a35d9b5 Sort addresses in /id
and thus in GET `/peers` as well
2019-08-11 21:15:43 +05:30
Kishan Mohanbhai Sagathiya
c6192cebf4 Use p2p protocol name over ipfs for multiaddr 2019-08-11 19:06:45 +05:30
Hector Sanjuan
063c5f1b78 Service: Select consensus on "init" (not on "daemon")
Fixes #865.

This makes the necessary changes so that consensu is selected on "init" with a
flag set, by default, to "crdt". This generates only a "crdt" or a "raft"
section, not both.

If the configuration file has a "raft" section, "raft" will be used to start
the daemon. If it has a "crdt" section, "crdt" will be used. If it has none or
both sections, an error will happen.

This also affects "state *" commands, which will now autoselect how to work
from the existing configuration.
2019-08-09 19:20:53 +02:00
Hector Sanjuan
3720d288a0 Adder: fix old mock rpc in tests 2019-08-09 17:13:01 +02:00
Hector Sanjuan
fb2d427035 Travis: run all tests 2019-08-09 16:12:32 +02:00