Commit Graph

188 Commits

Author SHA1 Message Date
Andrew Gillis
d1ccdf052b
chore: migrate bootstrap to ipfs/boxo (#10158) 2023-10-31 18:25:14 +01:00
Jorropo
a3e09af203 fix: silence staticcheck warning for fx.Extract usage
See https://github.com/ipfs/kubo/pull/9423#issuecomment-1341038770
2022-12-12 03:47:17 +01:00
Gus Eggert
795c2cf819
docs: add fx plugin documentation to plugins.md (#9191) 2022-08-13 08:08:52 -04:00
Gus Eggert
310dca55dd feat: add fx options plugin
This adds a plugin interface that lets the plugin modify the fx
options that are passed to fx when the app is initialized. This means
plugins can inject their own implementations of IPFS interfaces. This
enables granular customization of go-ipfs behavior by plugins, such
as:

- Bitswap with custom filters (e.g. for CID blocking) Custom interface

- implementations such as Pinner or DAGService

- Dynamic configuration of libp2p ...

One downside of this is that we're exposing the entire dependency
graph, init hooks, initialization, etc. to users, so this comes with a
caveat that we reserve the right to make breaking changes to the graph
structure and initialization logic (although this historically happens
rarely). If these things are changed, we should mention them in
release notes and changelogs though, since they could impact users of
this plugin interface.

I'm not particularly fond of DI frameworks (and neither are some of
the folks work on/near go-ipfs), but it seems unlikely that somebody
will rewrite the dependency wiring and lifecycle hooks of go-ipfs, and
add dynamic extension points, so this seems like a palatable
compromise.

There are also problems that we should clean up in how model the
go-ipfs app in fx, such as:

- We make extensive use of nested fx.Options, which fx itself
discourages because it "limits the user's ability to customize their
application". It should be easy to flatten these out into a single
[]fx.Option slice.

- We pass around a list of opaque libp2p opts, which makes it hard to
customize after-the-fact...we should consider naming each of these
opts and providing them to fx as proper dependencies, so that they can
be explicitly overridden.

- We call fx.Invoke() in some places with anonymous functions. We
should instead only pass exported functions to fx.Invoke(), so that
they have exported names, which would make it easier to remove/augment
the invocations that happen when the app is initialized.

These aren't blocking issues, they just make it harder and more
brittle to customize go-ipfs with this plugin.
2022-08-12 17:04:29 -04:00
Marcin Rataj
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
Lucas Molas
519863ecab fix(core/node): unwrap fx error in node construction 2022-03-16 19:32:31 -03:00
Steven Allen
efdb8db276 fix: get rid of shutdown errors
Instead of feeding through the top-level context, feed through a cancel-free
context (that still carries the same context values). Then, when the top-level
context is canceled, call `stop` to shut everything down in-order. Finally,
cancel the inner context to make sure everything has been cleaned up.

Ideally, we just wouldn't use contexts for this. But this is strictly better
than what we have.
2020-03-29 20:48:43 -07:00
Michael Avila
ce75f1c18f
Separate imports
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Michael Avila
6d6ce8fba7
Introduce first strategic provider: do nothing
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Łukasz Magiera
7cfb4aa2b4 core: call app.Stop once 2019-05-25 18:42:45 +02:00
Steven Allen
4924b80e10 chore: fix linter nits
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-05-14 09:38:26 -07:00
Łukasz Magiera
e4cf66008f Move option parsing to BuildCfg; fix imports
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
3ac605744f Separate function to parse BuildCfg into Options
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
fd0c06a825 Remove DI module dependency on BuildCfg
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
d35dac70f0 Cleanup core package
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
adbc85bf8a Remove old constructor code
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
d0670f22ef Rewire teardown routines to lifecycles
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
0ba7661d20 Fix context propagation sortof
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
bfaffb2d75 Fix bootstrap
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
cc2be2e73a Fix goprocess / lifecycle / ctx relations
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
ccc576b693 More constructor fixes
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
65d8fad008 Properly set IsOnline in NewNode
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
361ba691ed Organize NewNode a bit
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Łukasz Magiera
0fd2f80be7 Initial DI node implementation
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Steven Allen
1f293eff1b chore: fix a bunch of issues caught by golangci-lint
Most of these are probably harmless but a few looked like they might actually be
bugs. Most of them are just faulty tests.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-29 11:57:45 +00:00
Michael Avila
dde397ebc1
Refactor per code climate rules
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-03-11 09:55:13 -07:00
Michael Avila
a9b6534687
Provide root node immediately when add and pin add
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-03-08 14:27:43 -08:00
Jakub Sztandera
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
Steven Allen
3dac4609a8 split 'mode' into IsOnline and IsDaemon flags
1. They don't _have_ to be mutually exclusive.
2. local, mode, etc is _really_ confusing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-04 19:00:47 -08:00
Steven Allen
f227862e88 gx: update go-ipfs-cmds, go-bitswap, go-libp2p-kad-dht, and go-mplex
Fixes the latest batch of bugs found in RC testing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-27 12:39:24 -08:00
Hector Sanjuan
6972a9aa4d Gx Bubble. libp2p-6.0.38
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-02-27 01:10:59 +00:00
Steven Allen
fea7ae727f gx: update go-cid
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 20:29:06 -08:00
Steven Allen
f924f57c61 gx: update go-bitswap and go-libp2p-kad-dht
* go-bitswap: fix some race conditions.
* go-libp2p-kad-dht: fix a goroutine leak.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 17:19:54 -08:00
Jakub Sztandera
28cf3de0f9 Update protobuf
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-02-18 20:46:22 +01:00
Steven Allen
cf0d4706e2 gx: update libp2p stuff
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-14 14:58:35 -08:00
Steven Allen
e97a60b073 gx: update go-ipfs-files
fix compatibility issue with js-ipfs

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-11 10:48:58 -08:00
Steven Allen
2c93eeffc6 gx: update go-libp2p-peer
Switch _back_ to the 0.4.18 style of peer IDs while we figure things out. See
https://github.com/libp2p/specs/issues/138.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-07 17:41:39 -08:00
Łukasz Magiera
7c2aa0e9a9 gx: update go-unixfs to propagate archive changes
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-30 20:58:32 +01:00
Łukasz Magiera
53e55e3314 gx: update go-unixfs to 1.2.14 and go-bitswap to 1.1.21
(and everything else...)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-23 11:01:38 -08:00
Steven Allen
08cc5da55f gx: update deps
Importantly:

* fixes a bunch of MFS bugs
* pulls in some bitswap improvements

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-08 19:19:34 -08:00
Łukasz Magiera
7b4ab36817 gx: update go-ipfs-config
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-04 02:37:06 +01:00
Steven Allen
5894291139 gx: update go-ipfs-config
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-20 10:07:32 -08:00
Łukasz Magiera
0618fd77be gx: update go-ipfs-files to 2.0
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-20 13:52:20 +01:00
Steven Allen
2eafa3f3ca startup: always load the private key
Loading this at the last minute means we need a bunch of special cases
in *every* command that needs routing, namesys, or even the public key.

If we ever have a case where we don't want to do this, we can add an option to
the (eventual) IPFS constructor. Handling this up-front is going to be
significantly less error prone.

Motivation: https://github.com/ipfs/go-ipfs/pull/5825/files#diff-fe35ea64d478c4f3fb767a3f618e5d01R863

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-13 11:48:55 -08:00
Steven Allen
9dcec2b3e2 gx: update go-libp2p-peer
Reverts the changes that allowed small keys (ed25519 keys) to be inlined.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-07 15:37:23 -08:00
Kevin Atkinson
feb4808975 Gx update go-merkledag and related deps.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2018-11-28 17:21:36 -05:00
Steven Allen
cef645936d gx: update go-ipfs-config
* AutoRelay options for #5785.
* Badger truncate-by-default option for #5275, #5625.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-26 17:42:13 -08:00
hannahhoward
0963c9cdcb Update go-ipfs-delay and assoc deps
License: MIT
Signed-off-by: hannahhoward <hannah@hannahhoward.net>
2018-11-15 18:53:45 -08:00
Steven Allen
0d80fc54c3 gx: update go-log and sha256
fixes #5709

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-02 21:17:20 -07:00
Steven Allen
ec9fac7379 gx: update go-ipld-cbor
(might as well do this at the same time)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-02 13:17:44 -07:00