address feedback and add WaitForPinnedStatus
address feedback and rework WaitFor
implement StatusFilter
address feedback and rework StatusFilter
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The IPFS() methods returns an ipfs Shell pointing to the ipfs-cluster
proxy endpoint. The location can be customized (via ProxyAddr configuration
option) or it is assumed to be the same as the PeerAddr/APIAddr, with
a different port (the default).
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
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>
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>
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>
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>
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>