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

Manager node backend additions. #521

Conversation

ivcosla
Copy link

@ivcosla ivcosla commented Aug 20, 2019

Implements #226

@evanlinjin evanlinjin changed the title [WIP] Feature/226 manaager node backend additions [WIP] Manager node backend additions. Aug 21, 2019

a, err := app.Setup(&app.Config{AppName: "skychat", AppVersion: "1.0", ProtocolVersion: "0.0.1"})
appName := "skychat"
fmt.Println(os.Args)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this line have any purpose? Looks like it may be a forgotten debug print.

Copy link
Author

Choose a reason for hiding this comment

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

Yes just a print, that I should remove when work on the PR is finished.

cmd/apps/skychat/chat.go Show resolved Hide resolved
cmd/apps/skychat/chat.go Outdated Show resolved Hide resolved
cmd/skywire-cli/commands/node/app.go Outdated Show resolved Hide resolved
pkg/app/log.go Outdated Show resolved Hide resolved
pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/hypervisor/hypervisor.go Outdated Show resolved Hide resolved
pkg/visor/rpc.go Outdated Show resolved Hide resolved
pkg/visor/rpc_client.go Outdated Show resolved Hide resolved
Copy link

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

Good stuff. Some comments.

pkg/app/log.go Outdated Show resolved Hide resolved
return logs, err
}

func iterateFromKey(c *bbolt.Cursor, logs *[]string) error {

Choose a reason for hiding this comment

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

@nkryuchkov How do you suggest we do this? And how should it be used in LogsSince?

pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/app/log_test.go Outdated Show resolved Hide resolved
pkg/hypervisor/hypervisor.go Outdated Show resolved Hide resolved
@ivcosla
Copy link
Author

ivcosla commented Aug 27, 2019

There are linter errors preventing the PR to pass tests on travis. Those errors belong to other packages and should be fixed in a different PR.

@ivcosla ivcosla changed the title [WIP] Manager node backend additions. Manager node backend additions. Aug 27, 2019
@nkryuchkov
Copy link
Collaborator

nkryuchkov commented Aug 27, 2019

Linter errors are fixed in skycoin/skywire#537

@nkryuchkov nkryuchkov self-requested a review August 27, 2019 22:25
defer func() {
err := db.Close()
if err != nil {
panic(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why panicking instead of returning an error is preferred here and in Store method?

Run: func(_ *cobra.Command, args []string) {
var t time.Time

if args[1] == "beginning" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think of extracting the "beginning" constant here?

vh.Status = http.StatusOK
}
httputil.WriteJSON(w, r, http.StatusOK, vh)
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we get rid of it? Looks redundant.

return m.withCtx(m.nodeCtx, func(w http.ResponseWriter, r *http.Request, ctx *httpCtx) {
u, err := ctx.RPC.Uptime()
if err != nil {
httputil.WriteJSON(w, r, http.StatusInternalServerError, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need a return statement here, because httputil.WriteJSON(w, r, http.StatusOK, u) would be also executed.

@evanlinjin
Copy link

What's the situation with this PR?

@ivcosla
Copy link
Author

ivcosla commented Sep 6, 2019

It can be merged after conflicts are fixed

@ivcosla ivcosla merged commit 7d712a3 into skycoin:mainnet-milestone1 Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants