Commit Graph

54 Commits

Author SHA1 Message Date
Hector Sanjuan
8ced9b16de chore: general dependency upgrade (build fixes come later) 2020-03-22 14:50:25 +01:00
Hector Sanjuan
4ea830f74e Feat: ipfs-cluster-follow
This adds a new cluster command: ipfs-cluster-follow.

This command allows initializing and running follower peers as configured by a
remote-source configuration. The command can list configured peers
and obtain information for each of them.

Peers are launched with the rest API listening on a local unix socket. The
command can be run to list the items in the cluster pinset using this
endpoint. Alternatively, if no socket is present, the peer will be assumed to
be offline and the pin list will be directly read from the datastore.

Cluster peers launched with this command (and their configurations) are
compatible with ipfs-cluster-ctl and ipfs-cluster-service. We purposely do not
support most configuration options here. Using ipfs-cluster-ctl or launching
the peers using ipfs-cluster-service is always an option when the usecase
deviates from that supported by ipfs-cluster-follow.

Examples:

$ ipfs-cluster-follow -> list configured peers
$ ipfs-cluster-follow --help
$ ipfs-cluster-follow <clusterName> init <url>
$ ipfs-cluster-follow <clusterName> info
$ ipfs-cluster-follow <clusterName> run
$ ipfs-cluster-follow <clusterName> list
2019-12-07 15:38:59 +01:00
Hector Sanjuan
a6c83f72ba Fix #973: update quic-transport
Did not build in windows before...
2019-12-06 10:58:30 +01:00
Hector Sanjuan
71217ac5d1 restapi client: support talking to unix sockets
Setting APIAddr to a Unix socket multiaddress will just work.
2019-12-02 11:56:16 +01:00
Hector Sanjuan
f9411539f0 go.mod: remove btcd indirect dependency
It causes a checksum mismatch error and it is not needed directly.
2019-11-21 11:46:22 -06:00
Kishan Mohanbhai Sagathiya
9bef8ea04e Bump btcd to v0.20.1-beta 2019-11-21 14:05:44 +05:30
Hector Sanjuan
3a22da58ee
Merge pull request #955 from marten-seemann/update-quic
update go-libp2p-quic-transport to v0.2.1
2019-11-09 14:55:32 +01:00
Marten Seemann
dc4dc977f3 update go-libp2p-quic-transport to v0.2.1 2019-11-09 18:39:24 +07:00
Hector Sanjuan
df08d76c2c Fix #949: Cluster peers should advertise their external earlier
This lowers the activation threshold for an observed addressed
to 1 and increases the OwnObservedAddressTTL to infinite.

This should let cluster peers (particularly in small clusters)
advertise their known external addresses asap so that other peers
can include them in their peerstores (and save them on shutdown).

By default this only happens when an external address has received 4
connections in the last 40 minutes. In NATed environments this may
result in cluster peers advertising right away their NAT-translated address/ports
which may not be dialable, but in other cases that address seems to be
indeed dialable (docker).
2019-11-07 13:05:31 +01:00
Hector Sanjuan
834a95b44a update go-dot to latest tag 2019-11-07 12:52:17 +01:00
Hector Sanjuan
71bf98ac86 go.mod 2019-11-07 10:51:46 +01:00
Kishan Mohanbhai Sagathiya
4d8ef92b3d health/graph: Improve graph
Mark local, trusted peers. Add peernames. Improve display.
2019-11-07 10:47:29 +01:00
Hector Sanjuan
b08fe09cec Move to latest quic-transport 2019-11-05 12:52:08 +01:00
Hector Sanjuan
73ab101a3a Use latest go-libp2p-raft
Does not spit errors when no addresses are known for a peer.
2019-11-05 12:51:18 +01:00
Hector Sanjuan
8d7ff58787 Use fixed version of go-libp2p-tls 2019-11-05 12:51:15 +01:00
Hector Sanjuan
24491ab3fc Update to latest quic-transport 2019-11-05 12:50:46 +01:00
Hector Sanjuan
669e75aefc libp2p host: add secio as alternative, do not rewrap host
Only use QUIC for tests, as TCP+TLS has proven very unreliable.
2019-11-05 12:50:46 +01:00
Kishan Mohanbhai Sagathiya
ce85bfc745 Added support for QUIC
- Cluster peers will now be able dial and listen using QUIC
- By default QUIC is enabled, to disable it remove QUIC listen address
from service.json
- This commit also adds a config option for whether to act as relay or
not, EnableRelayHop
2019-11-05 12:50:46 +01:00
Kishan Sagathiya
295915272b Tests: multiple fixes to tests reliability (#943)
This makes a number of fixes to improve the reliability of tests.
2019-10-31 21:51:13 +01:00
Hector Sanjuan
be4be9a494 Dependency update 2019-09-27 18:54:42 +02:00
Hector Sanjuan
1a0998f10d CRDT: update and increase timeout
* Update go-ds-crdt to 0.1.5 which adds a return statement in case of error fetching a node.
* Increase DAG-Get timeout to 2 minutes
* Downgrade go-bitswap to 0.1.6.
2019-09-12 19:22:52 +02:00
Kishan Mohanbhai Sagathiya
6c863df9fe Merge branch 'master' of github.com:ipfs/ipfs-cluster into feat/http-logging 2019-08-29 21:37:04 +05:30
Hector Sanjuan
bab0485616 Update go-ds-crdt 2019-08-28 12:07:47 +02:00
Hector Sanjuan
c030dd7c8c Update go-ds-crdt 2019-08-27 11:49:24 +02:00
Kishan Mohanbhai Sagathiya
c32281f9e0 Logging for Cluster HTTP APIs
This commit introduces logging for Cluster HTTP APIs.
It adds a config element `send_logs_to_file`, which tells whether logs
should be saved in a file or shown in standard output.

Requests are logged as per Apache Common Log Format (CLF)
http://httpd.apache.org/docs/2.2/logs.html#common

Fixes #574
2019-08-21 21:03:38 +05:30
Hector Sanjuan
406e8b5954 Update unixfs and reprovide too 2019-08-14 13:48:03 +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
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
Hector Sanjuan
3ff6ccbd77 Fix #648: Update go-libp2p-peerstore with ttl fixes 2019-07-29 13:34:24 +02:00
Hector Sanjuan
0e668f60bf Update go-libp2p to 0.2.1
Fixes #845
2019-07-23 15:14:21 +02:00
Hector Sanjuan
d8cb4cd7d8 Update dependencies 2019-07-05 18:12:57 +01:00
Hector Sanjuan
353d403b3a Fix badger breaking EVERYTHING 2019-06-23 09:57:45 +01:00
Hector Sanjuan
b804e61ef0 Update deps along with go-libp2p-core refactor
Lots of rewrites in imports...
2019-06-14 13:10:45 +02:00
Hector Sanjuan
588596d28e Merge branch 'master' into fix/expose-badger-conf 2019-06-07 21:38:09 +02:00
Hector Sanjuan
ab46f233e7 Dependency update and cleanup to libp2p-0.0.30
This has been horrible and won't even last, but the fixes in libp2p
required it.
2019-05-25 00:30:25 +02:00
Hector Sanjuan
ba5e423f58 Feat: introduce a ConnectionManager for the libp2p host
As follow up to #787, this uses the default libp2p connection manager for the
cluster libp2p host. The connection manager settings can be set in the main
configuration section (but it should be compatible with previous
configurations which have it unset).

This PR is just introducing the connection manager. Peer connection
protection etc will come in additional PRs.
2019-05-23 00:34:47 +02:00
Adrian Lanzafame
fd82463601
remove omitempty
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:46:28 +10:00
Adrian Lanzafame
655aef4011
expose entire badger config
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:43:18 +10:00
Adrian Lanzafame
3d4412ffd4
expose badger loading mode conf
For simplicity, I haven't exposed the entire
badger config. Also, due to go default values and
the badger implementation, I have had to extract the
two loading mode config values so we can determine
whether it has actually has been set by the user in
the json config file.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-05-21 22:42:40 +10:00
Hector Sanjuan
c59873e076 update deps 2019-05-21 11:34:33 +02:00
Hector Sanjuan
9ffd08520d Downgrade discovery 2019-05-21 11:05:51 +02:00
Hector Sanjuan
8c8e449bc9 Update go-ds-crdt 2019-05-21 10:38:37 +02:00
Hector Sanjuan
c23bb9abb0 Bump deps 2019-05-17 13:58:26 +02:00
Hector Sanjuan
d51c2a0377 Merge branch 'master' into feat/monitor-ring 2019-05-16 15:46:30 +02:00
Hector Sanjuan
5fc5c6d38c Re-update 2019-05-08 13:33:22 +02:00
Hector Sanjuan
539dfcd6ec Update exporter import paths 2019-04-29 18:57:13 +02:00
Hector Sanjuan
0fd70e45f3 Update deps 2019-04-29 17:26:22 +02:00
Adrian Lanzafame
eae4329cb3
address pr feedback
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-18 16:18:19 +10:00
Adrian Lanzafame
4338ea6905
refactor prob to use gonum and pass []float64
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-04-18 16:16:39 +10:00
Hector Sanjuan
acbd7fda60 Consensus: add new "crdt" consensus component
This adds a new "crdt" consensus component using go-ds-crdt.

This implies several refactors to fully make cluster consensus-component
independent:

* Delete mapstate and fully adopt dsstate (after people have migrated).
* Return errors from state methods rather than ignoring them.
* Add a new "datastore" modules so that we can configure datastores in the
   main configuration like other components.
* Let the consensus components fully define the "state.State". Thus, they do
not receive the state, they receive the storage where we put the state (a
go-datastore).
* Allow to customize how the monitor component obtains Peers() (the current
  peerset), including avoiding using the current peerset. At the moment the
  crdt consensus uses the monitoring component to define the current peerset.
  Therefore the monitor component cannot rely on the consensus component to
  produce a peerset.
* Re-factor/re-implementation of "ipfs-cluster-service state"
  operations. Includes the dissapearance of the "migrate" one.

The CRDT consensus component defines creates a crdt-datastore (with ipfs-lite)
and uses it to intitialize a dssate. Thus the crdt-store is elegantly
wrapped. Any modifications to the state get automatically replicated to other
peers. We store all the CRDT DAG blocks in the local datastore.

The consensus components only expose a ReadOnly state, as any modifications to
the shared state should happen through them.

DHT and PubSub facilities must now be created outside of Cluster and passed in
so they can be re-used by different components.
2019-04-17 19:14:26 +02:00