-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Network CLI #9
Conversation
@@ -20,6 +22,12 @@ func main() { | |||
Name: "lotus", | |||
Usage: "Filecoin decentralized storage network client", | |||
Version: build.Version, | |||
Metadata: map[string]interface{}{ |
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.
this is a slightly weird way to wire this through
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.
Agreed (this is just the first thing I tried)
node/api.go
Outdated
in := &resAPI.Internal | ||
|
||
return fx.Options( | ||
provideApi(versionAPI, &in.Version), |
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.
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)
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.
I'm not against doing this 'manually', just wanted to investigate alternative approaches.
The main point of this is avoiding the Node
object.
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.
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.
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.
Went with go-ipfs (coreapi) / go-filecoin way - d852b3f, changing to something else in the future should be easy enough
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]>
@magik6k in future use |
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
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.
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 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. |
readme: Add a section about architecture
No description provided.