-
Notifications
You must be signed in to change notification settings - Fork 17
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
Move all rmb handlers to api-gateway #2223
Conversation
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.
Amazing job Abderahman. I only have few comments below. We need to also make this is well tested before we deploy to devnet.
cmds/modules/api_gateway/main.go
Outdated
manager, | ||
router.Serve, | ||
peer.WithKeyType(peer.KeyTypeEd25519), | ||
peer.WithRelay(environment.MustGet().RelayURL[0]), |
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.
We need to support having multiple relays. This is probably need to be modified in the sdk peer already.
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.
yep, it's already being done here
pkg/api_gateway/network.go
Outdated
func (g *apiGateway) networkPublicConfigGetHandler(ctx context.Context, payload []byte) (interface{}, error) { | ||
return g.networkerStub.GetPublicConfig(ctx) | ||
} | ||
func (g *apiGateway) networkInterfacesHandler(ctx context.Context, payload []byte) (interface{}, error) { |
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 am just wondering if this logic should be part of the api, or networkd. I mean the api here shows understanding of the internals of some network internals.
Just a thought, no need to modify it immediately
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 think it's mostly preparing input for networkd and parsing its output so it isn't really a lot of networking logic, that's why I didn't move it.
cmds/modules/noded/main.go
Outdated
log.Fatal().Err(err).Msg("unexpected error") | ||
} | ||
}() | ||
server.Register(zbus.ObjectID{Name: "host", Version: "0.0.1"}, perfMon) |
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.
isn't this a double register of the object host
?
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.
check the return error from register. this should return an error because you trying to register an object with the same id
afd3ff5
to
f0b1177
Compare
31c1ea6
to
6d7afe1
Compare
6d7afe1
to
fc9f44c
Compare
Description
Move all rmb handlers to api-gateway and use
peer.Router
instead of usingrmb-peer
binary.Changes
pkg/api-gateway
.Related Issues
Checklist