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

implement new deployment style #1014

Merged
merged 6 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/mesg-foundation/core/database"
"github.com/mesg-foundation/core/logger"
"github.com/mesg-foundation/core/sdk"
servicesdk "github.com/mesg-foundation/core/sdk/service"
"github.com/mesg-foundation/core/server/grpc"
"github.com/mesg-foundation/core/service/manager/dockermanager"
"github.com/mesg-foundation/core/version"
Expand All @@ -24,7 +23,6 @@ type dependencies struct {
executionDB database.ExecutionDB
container container.Container
sdk *sdk.SDK
serviceSDK *servicesdk.ServiceSDK
}

func initDependencies() (*dependencies, error) {
Expand Down Expand Up @@ -58,16 +56,12 @@ func initDependencies() (*dependencies, error) {
// init sdk.
sdk := sdk.New(m, c, serviceDB, executionDB)

// init service sdk.
serviceSDK := servicesdk.New(m, c, serviceDB, executionDB)

return &dependencies{
config: config,
container: c,
serviceDB: serviceDB,
executionDB: executionDB,
sdk: sdk,
serviceSDK: serviceSDK,
}, nil
}

Expand Down Expand Up @@ -135,7 +129,7 @@ func main() {
}

// init gRPC server.
server := grpc.New(dep.config.Server.Address, dep.sdk, dep.serviceSDK)
server := grpc.New(dep.config.Server.Address, dep.sdk)

logrus.Infof("starting MESG Core version %s", version.Version)

Expand Down
204 changes: 204 additions & 0 deletions protobuf/api/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions protobuf/api/service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

import "protobuf/definition/service.proto";

package api;

service ServiceX {
ilgooz marked this conversation as resolved.
Show resolved Hide resolved
rpc Create (CreateServiceRequest) returns (CreateServiceResponse) {}
}

message CreateServiceRequest {
definition.Service definition = 1;
}

message CreateServiceResponse {
string sid = 1;
string hash = 2;
}