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

Network CLI #9

Merged
merged 16 commits into from
Jul 9, 2019
Merged

Network CLI #9

merged 16 commits into from
Jul 9, 2019

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Jul 8, 2019

No description provided.

@@ -20,6 +22,12 @@ func main() {
Name: "lotus",
Usage: "Filecoin decentralized storage network client",
Version: build.Version,
Metadata: map[string]interface{}{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a slightly weird way to wire this through

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed (this is just the first thing I tried)

node/api.go Outdated
in := &resAPI.Internal

return fx.Options(
provideApi(versionAPI, &in.Version),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we building the api stuff with DI? That seems like it shouldnt be that hard to do manually (actually, seems easier to do manually to me)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against doing this 'manually', just wanted to investigate alternative approaches.

The main point of this is avoiding the Node object.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, In general, I don't think the Node object is bad, as long as nothing depends on it (aka, it never gets passed to a function) and it never has any methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with go-ipfs (coreapi) / go-filecoin way - d852b3f, changing to something else in the future should be easy enough

@magik6k magik6k marked this pull request as ready for review July 8, 2019 21:22
magik6k and others added 5 commits July 9, 2019 12:49
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu
Copy link
Contributor

Kubuxu commented Jul 9, 2019

@magik6k in future use context.TODO instead of Background for context that hasn't been wired in yet.

@magik6k magik6k requested a review from whyrusleeping July 9, 2019 13:46
@magik6k magik6k mentioned this pull request Jul 9, 2019
Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems pretty straightforward. We will have to think about how to best wire the api stuff through, the metadata hack seems odd to me

@whyrusleeping whyrusleeping merged commit b843dcb into master Jul 9, 2019
@Kubuxu
Copy link
Contributor

Kubuxu commented Jul 9, 2019

@whyrusleeping the metdata is like context value so it is hacky but it makes sense. The cli API doesn't provide another way AFAIK. We could also explicitly initialise the API or fork the cli lib.

@Kubuxu Kubuxu deleted the feat/netcli branch July 15, 2019 13:41
magik6k added a commit that referenced this pull request Aug 10, 2020
readme: Add a section about architecture
magik6k added a commit that referenced this pull request Aug 10, 2020
magik6k pushed a commit that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants