Commit Graph

788 Commits

Author SHA1 Message Date
Hector Sanjuan
b989e1726d api/rest: refactor run() (codeclimate)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:53:07 +01:00
Hector Sanjuan
e5ac535c44 api/rest: refactor LoadJSON (codeclimate)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:48:46 +01:00
Hector Sanjuan
5cd048a65d api: move some util functions to util.go (codeclimate file lines)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:43:14 +01:00
Hector Sanjuan
a73d7e6f7e Relocate multiaddrJoin and multiaddrSplit to api/types.h
So they can serve as multi-module helpers without having circular deps.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:37:32 +01:00
Hector Sanjuan
2227e5e25f rest/client: refactor transport setup (codeclimate)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:23:38 +01:00
Hector Sanjuan
f74c7b2c6e Feat #305: Golinting
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-16 13:08:11 +01:00
Hector Sanjuan
de07a9dd70
Merge pull request #344 from ipfs/feat/wrong-secrets
Fix #167: Useful messages when consensus doesn't start
2018-03-16 11:41:05 +01:00
Hector Sanjuan
73581b0471 ipfs-cluster-ctl: Allow libp2p multiaddress as --host. Use libp2p in that case.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 17:15:23 +01:00
Hector Sanjuan
3eee5d0ddb cluster-service: re-use cluster libp2p host for rest API by default
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 17:14:22 +01:00
Hector Sanjuan
4bed9d0076 api/rest/client: add private networks support.
Also, re-use some convinient functions provided by pnet.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 17:14:22 +01:00
Hector Sanjuan
bbe2407531 rest/client: add support for libp2p-tunneled http.
This adds support for libp2p-tunneled http to the rest api component.

If PeerAddr is specified in the configuration, then we will create a
libp2p host and communicate with the API using that.

Tests run now in both http and libp2p mode.

Note: pnet support not included, but coming up

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 17:14:22 +01:00
Hector Sanjuan
fb4bda8880 restapi: Expose the http endpoints on libp2p
This commits allows restapi to serve/tunnel http on a libp2p stream.

NewWitHost(...) allows to provide a libp2p host during initialization
which is then used to obtain a listener with go-libp2p-gostream.

Alternatively, if the configuration provides an ID, PrivateKey and Libp2pListenAddr,
a host is created directly by us and used to get the listener.

The protocol tag used is provided by the p2phttp library which will
be used by the client.

All tests now run against the libp2p node too.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 17:14:22 +01:00
Hector Sanjuan
3b715041ac RestAPI: support libp2p host parameters in configuration
This adds support for parameters to create a libp2p host
in the REST API configuration: ID, PrivateKey and ListenMultiaddr.

These parameters default to nil/empty and are ommited in the default
configuration. They are only supposed to be used when the user wants
the REST API to use a different libp2p host than a provided one (upcoming
changes).

Pnet protector not supported yet in this case. Underlying basic auth
should cover that front. Will implement if someone has a usecase.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 00:04:54 +01:00
Hector Sanjuan
5956dce69f Create cluster Host in ipfs-cluster-service.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 00:04:54 +01:00
Hector Sanjuan
07a66851cb consensus/raft: use new host constructor in tests
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 00:04:54 +01:00
Hector Sanjuan
41b17bf477 Cluster: add libp2p host parameter to constructor.
NewCluster() now takes an optional Host parameter.
The rationale is to allow to re-use an existing libp2p Host
when creating the cluster.

The NewClusterHost method now allows to create a host
with the options used by cluster.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-15 00:04:54 +01:00
Hector Sanjuan
836d552fbb Fix go4-lock name in package.json
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-13 23:52:45 +01:00
Hector Sanjuan
1abeff62c7
Merge pull request #345 from ipfs/update/libp2p
Update libp2p and deps to correct versions
2018-03-13 17:01:01 +01:00
Hector Sanjuan
a746255719 Fix tests
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-13 16:30:47 +01:00
Hector Sanjuan
c231fe8060 Update libp2p and deps to correct versions
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-13 15:32:56 +01:00
Hector Sanjuan
b56888e5bb
Merge pull request #334 from ipfs/fix/client/timeout
rest/client: double default timeout
2018-03-13 10:49:37 +01:00
Hector Sanjuan
4f9fccde72 Addressing feedback
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-13 10:37:47 +01:00
Hector Sanjuan
740f314976 Fix #167: Useful messages when consensus doesn't start
This will display a few hints when consensus fails to start.
If consensus doesn't start (normally WaitForLeader times out),
it's because of libp2p not being able to reach other peers.

This sometimes also means that the wrong protector key (secret)
is being used, even though libp2p does not give us clear
indications.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-12 22:54:59 +01:00
Wyatt Daviau
05b64481b9
Merge pull request #342 from ipfs/feat/recursive-pins
Feat/recursive pins
2018-03-12 14:14:59 -04:00
Hector Sanjuan
6278640d20
Merge pull request #341 from ipfs/feat/pin-priority-peers
ToPin call and priority pinning
2018-03-12 17:46:51 +01:00
Wyatt Daviau
b0e8452020 fix errors
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-12 11:33:46 -04:00
Wyatt Daviau
d7d2dca9cd fix errors
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-12 11:06:42 -04:00
Wyatt Daviau
bdc373de61 Migration to state specifying recursive attribute
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-12 11:06:42 -04:00
Wyatt Daviau
1b7b9185e2 support for recursive pins
extension to api types
modifications to ipfsconnector

License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-12 11:06:42 -04:00
Adrian Lanzafame
7715eff0f6 rest/client: ipfs-cluster-ctl: double default timeout
Change the rest/client's and ipfs-cluster-ctl's default
timeout from 60 to 120.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-03-10 11:20:56 +10:00
Hector Sanjuan
c276c31ad6
Merge pull request #331 from ipfs/feat/pin-refs
Feat #326: Adds "refs -r" pinning method support + multiple pin workers
2018-03-10 01:28:09 +01:00
Wyatt Daviau
e2c4b6f5a9 consolidate Pin and PinTo
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-09 17:16:20 -05:00
Wyatt Daviau
0a34f3382b ToPin call and priority pinning
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-03-09 17:13:35 -05:00
Hector Sanjuan
f469966d02 Fix tests with bad json
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-09 17:30:06 +01:00
Hector Sanjuan
039996948c Fix #324: Travis doesn't fail
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-09 17:30:06 +01:00
Hector Sanjuan
e8f9fe5566 ipfshttp: Re-use pinning test for both methods
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-09 15:01:29 +01:00
Hector Sanjuan
6a858efbcc ipfshttp: refactor post(). Fix race condition. Support custom http.Client.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-09 15:01:29 +01:00
Hector Sanjuan
fb4812ec79 Feat #326: Adds "refs -r" pinning method support + multiple pin workers
This fixes #326. It adds a new `pin_method` configuration option to the
`ipfshttp` component allows to configure it to perform `refs -r <cid>` before
the `pin/add` call. By fetching content before pinning, we don't have
a global lock in place, and we can have several pin-requests to
ipfs in parallel.

It also adds a `concurrent_pins` option to the pin tracker, which
launches more pin workers so it can potentially trigger more pins at
the same time. This is a minimal intervention in the pintracker as #308
is still pending.

Documentation for the configuration file has been updated.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-03-09 15:01:29 +01:00
Hector Sanjuan
4e1f59062d
Merge pull request #333 from ipfs/feat/service/lock-msg
lock file location printed in log
2018-03-08 10:32:12 +01:00
Adrian Lanzafame
7e1e98d582 lock file location printed in log
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-03-08 16:47:58 +10:00
Hector Sanjuan
6ca0f53ee5
Merge pull request #329 from ipfs/feat/ctl-cmd/no-status-flag
ipfs-cluster-ctl cmd: add no-status flag to pin add/rm
2018-03-07 11:11:21 +01:00
Adrian Lanzafame
c4468bab49 ipfs-cluster-ctl cmd: add no-status flag to pin add/rm
It simply skips the status call on the globalClient, along
with the associated time.Sleep(1000), if the `--no-status`
flag is provided with the command.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-03-07 11:46:40 +10:00
Hector Sanjuan
5108ee1957
Merge pull request #328 from ipfs/doc/cluster-guide-broken-link
Fix broken link
2018-03-06 11:54:45 +01:00
Adrian Lanzafame
e8e9b349f5
Fix broken link
Link to "How to Build and Update a Cluster" was broken.

License: MIT
Signed-off-by: Adrian Lanzafame <adrian.lanzafame@protocol.ai>
2018-03-06 12:21:25 +10:00
Hector Sanjuan
36e7ea6496
gx publish 0.3.4
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-02-20 20:26:17 +01:00
Hector Sanjuan
2e9bcec005
Release 0.3.4
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-02-20 20:25:44 +01:00
Hector Sanjuan
f9b2084977 Merge branch '0.3.4/changelog' 2018-02-20 20:23:26 +01:00
Hector Sanjuan
0b0270f408
Merge pull request #320 from ipfs/fix/official-builds
Fix: official builds panic on start
2018-02-20 20:20:40 +01:00
Hector Sanjuan
f40dec428a Changelog: 0.3.4
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-02-20 19:37:52 +01:00
Hector Sanjuan
5ba746a9ca Fix: official builds panic on start
Since the commit variable is not set in these builds :(

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-02-20 17:55:18 +01:00