-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate ipld plugin and ipfs (#152)
* config: add IPFS config * Add ConfigRoot option * also init ipfs on "tendermint init" * add repo root to config * spawn an ipfs node together with a tendermint node * update to new rsmt2d API and update go.mod * init ipfs node on integration test * go fmt * Moved (pre)loading the plugin to init() of the plugin package itself * run Ipfs node OnStart * minor doc changes and a few sacrificies to the linter gods * Thanks for catching this @Wondertan * rebased onto master * Fix those e2e docker issues: - go mod download requires submodules mod/sum files to be copied over too * Fix quotes glitch in the toml template * Fix the e2e tests by initializing ipfs repos before running tendemrint nodes * Fix typo Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> * Invert if-statements * Clarifying comments instead of TODOs * Fix typo in error string Co-authored-by: John Adler <adlerjohn@users.noreply.github.com> * Captialize IPFS Co-authored-by: John Adler <adlerjohn@users.noreply.github.com> * fix sentence Co-authored-by: John Adler <adlerjohn@users.noreply.github.com> * review feedback: - move comments on top of function - spaces instead of tabs - fix typo - explain code duplication - add todo about unsafe-reset-all Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
- Loading branch information
1 parent
0eccfb2
commit ceb881a
Showing
13 changed files
with
1,304 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package config | ||
|
||
// IPFSConfig defines a subset of the IPFS config that will be passed to the IPFS init and IPFS node (as a service) | ||
// spun up by the tendermint node. | ||
// It is mostly concerned about port configuration (Addresses). | ||
type IPFSConfig struct { | ||
// is where the generated IPFS config and files will be stored. | ||
// The default is ~/.tendermint/ipfs. | ||
ConfigRootPath string | ||
// TODO: can we avoid copying the fields from ipfs' config.Addresses here? | ||
// TODO: also, these are only used on init. Maybe ConfigRootPath is sufficient? | ||
API string // address for the local API (RPC) | ||
Gateway string // address to listen on for IPFS HTTP object gateway | ||
// swarm related options: | ||
Swarm []string // addresses for the swarm to listen on | ||
Announce []string // swarm addresses to announce to the network | ||
NoAnnounce []string // swarm addresses not to announce to the network | ||
} | ||
|
||
// DefaultIPFSConfig returns a default config different from the default IPFS config. | ||
// This avoids conflicts with existing installations when running LazyLedger-core node | ||
// locally for testing purposes. | ||
func DefaultIPFSConfig() *IPFSConfig { | ||
return &IPFSConfig{ | ||
ConfigRootPath: "ipfs/", | ||
API: "/ip4/127.0.0.1/tcp/5002", | ||
Gateway: "/ip4/127.0.0.1/tcp/5002", | ||
Swarm: []string{"/ip4/0.0.0.0/tcp/4002", "/ip6/::/tcp/4002"}, | ||
} | ||
} | ||
|
||
func (cfg *Config) IPFSRepoRoot() string { | ||
return rootify(cfg.IPFS.ConfigRootPath, cfg.RootDir) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.