Skip to content
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 24 commits into from
Feb 26, 2021
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor doc changes and a few sacrificies to the linter gods
liamsi committed Feb 23, 2021

Verified

This commit was signed with the committer’s verified signature.
liamsi Ismail Khoffi
commit 9b61a1fd822ecca0ec747c4e2903cebfac32d795
6 changes: 4 additions & 2 deletions config/toml.go
Original file line number Diff line number Diff line change
@@ -464,12 +464,14 @@ namespace = "{{ .Instrumentation.Namespace }}"
# IPFS repo root.
repo-root = "{{ .IPFS.ConfigRootPath}}"
## Below options will be passed to ipfs when initializing an ipfs repo.
## They will be written into the repo-root/config on init.
## To modify the generated config, edit repo-root/config accordingly.
# Address for the local API (RPC).
api = "{{ .IPFS.API }}"
# Address to listen on for IPFS HTTP object gateway.
gateway = "{{ .IPFS.Gateway }}
# Addresses for the swarm to listen on
swarm = "[{{ range .IPFS.Swarm }}{{ printf "%q, " . }}{{end}}]"
# Swarm addresses to announce to the network
2 changes: 1 addition & 1 deletion consensus/state.go
Original file line number Diff line number Diff line change
@@ -810,7 +810,7 @@ func (cs *State) handleMsg(mi msgInfo) {
// We probably don't want to stop the peer here. The vote does not
// necessarily comes from a malicious peer but can be just broadcasted by
// a typical peer.
// https://github.com/lazyledger/lazyledger-core/issues/1281
// https://github.com/tendermint/lazyledger-core/issues/1281
// }

// NOTE: the vote is broadcast to peers by the reactor listening
5 changes: 1 addition & 4 deletions node/node.go
Original file line number Diff line number Diff line change
@@ -1479,15 +1479,12 @@ func setupPlugins(path string, logger log.Logger) error {
if err != nil {
return fmt.Errorf("error loading plugins: %s", err)
}
plugins.Load(&nodes.LazyLedgerPlugin{})
if err != nil {
if err := plugins.Load(&nodes.LazyLedgerPlugin{}); err != nil {
return fmt.Errorf("error loading lazyledger plugin: %s", err)
}

if err := plugins.Initialize(); err != nil {
return fmt.Errorf("error initializing plugins: plugins.Initialize(): %s", err)
}

if err := plugins.Inject(); err != nil {
logger.Error("error initializing plugins: could not Inject()", "err", err)
}
8 changes: 3 additions & 5 deletions rpc/test/helpers.go
Original file line number Diff line number Diff line change
@@ -211,7 +211,6 @@ func initIpfs(config *cfg.Config, loadPlugins bool, log log.Logger) error { // a
if err != nil {
return err
}

if err := tmos.EnsureDir(repoRoot, 0700); err != nil {
return err
}
@@ -223,18 +222,16 @@ func initIpfs(config *cfg.Config, loadPlugins bool, log log.Logger) error { // a
if err := plugins.Load(&nodes.LazyLedgerPlugin{}); err != nil {
return err
}

if err := plugins.Initialize(); err != nil {
return fmt.Errorf("error initializing plugins: %s", err)
}

if err := plugins.Inject(); err != nil {
return fmt.Errorf("error initializing plugins: %s", err)
}
}
conf, err = ipfscfg.InitWithIdentity(identity)
if err != nil {
return fmt.Errorf("InitWithIdentity(): %w", err)
return fmt.Errorf("intializing config failed, InitWithIdentity(): %w", err)
}

if err := fsrepo.Init(repoRoot, conf); err != nil {
@@ -258,7 +255,8 @@ func RecreateConfig(o *Options) {
o.recreateConfig = true
}

// DoNotLoadIpfsPlugins
// DoNotLoadIpfsPlugins instructs the RPC test to not load the IPFS plugins, e.g.,
// to prevent loading them several times.
func DoNotLoadIpfsPlugins(o *Options) {
o.loadIpfsPlugins = false
}