-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate ipld plugin and ipfs #152
Merged
Merged
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b8d0734
config: add IPFS config
liamsi d013c3a
Add ConfigRoot option
liamsi b2008b9
also init ipfs on "tendermint init"
liamsi d4befbe
add repo root to config
liamsi c87f9ba
spawn an ipfs node together with a tendermint node
liamsi ecb9463
update to new rsmt2d API and update go.mod
liamsi 1590a49
init ipfs node on integration test
liamsi 44812b6
go fmt
liamsi f75476d
Moved (pre)loading the plugin to init() of the plugin package itself
liamsi 93aabb6
run Ipfs node OnStart
liamsi 9b61a1f
minor doc changes and a few sacrificies to the linter gods
liamsi 2b1a284
Thanks for catching this @Wondertan
liamsi 7d7c2aa
rebased onto master
liamsi 10f294c
Fix those e2e docker issues:
liamsi 5ef9ab9
Fix quotes glitch in the toml template
liamsi 4d0df8e
Fix the e2e tests by initializing ipfs repos before running tendemrin…
liamsi d608cdb
Fix typo
liamsi 3c8bc45
Invert if-statements
liamsi 2e9912c
Merge remote-tracking branch 'origin/ismail/integrate_ipfs' into isma…
liamsi 4675af8
Clarifying comments instead of TODOs
liamsi e1095a6
Fix typo in error string
liamsi 0784cae
Captialize IPFS
liamsi 2e92a4b
fix sentence
liamsi 1b3528a
review feedback:
liamsi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
} | ||
liamsi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: what does
// add counter part in ResetAllCmd
mean? Is it a TODO? The location is just weird, to the right of the function decl.For the rest of the comment lines here, can these be moved above the function decl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's simply a description of what happens internally: it takes the (few) ipfs related config flags from the tendermint config and applies them to the ipfs config. Yeah, can move these up though.
Regarding the
ResetAllCmd
, I can't remember tbh. Let me double check.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this should indeed be a TODO: tendermint has a sub-command
unsafe-reset-all
, which:I guess, we should probably delete the ipfs data (block store), too? That would be identical of deleting all chunks that node sampled so far. I'm not sure yet. Let's make it a todo.