@plmtest/processes-protobufs
v1.0.1
Published
Protobuf files for process gRPC APIs
Readme
@smartcosmos/processes-protobufs
This package provides the protobuf definitions for processes gRPC API.
Once imported, it provides the absolute paths for proto files to set up gRPC clients and servers.
Usage
Setting up a server
import { GRPCServer } from '@smartcosmos/cosmos-service-builder';
import protoPaths from '@smartcosmos/processes-protobufs';
new GRPCServer({
configuration: {
port: config.GRPC_PORT,
host: config.GRPC_HOST,
},
logger: config.LoggerConfig,
})
.addService({
protoPackage: 'process',
protoService: 'ProcessService',
protoPath: protoPaths.process, // imported from a protobuf package
}, {
serviceClass: servicePackages.process.ProcessService, // class of the service implementation
params: { remotes, models },
});Setting up a client
import { GRPCClient } from '@smartcosmos/cosmos-service-builder';
import protoPaths from '@smartcosmos/processes-protobufs';
const grpcClients = {
...new GRPCClient({
protoPath: protoPaths.process,
logger: config.LoggerConfig,
}).connect(config.GRPC_SERVER_PROCESS_ADDRESS),
};