Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smartcosmos/sample-protobufs

Package Overview
Dependencies
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartcosmos/sample-protobufs

Protobuf files for gRPC APIs

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
6
Weekly downloads
 
Created
Source

@smartcosmos/sample-protobufs

This package provides the protobuf definitions for a sample 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/sample-protobufs';

new GRPCServer({
  configuration: {
    port: config.GRPC_PORT,
    host: config.GRPC_HOST,
  },
  logger: config.LoggerConfig,
})
.addService({
  protoPackage: 'sample.hello',
  protoService: 'HelloService',
  protoPath: protoPaths.sample, // imported from a protobuf package
}, {
  serviceClass: servicePackages.sample.hello.HelloService, // class of the service implementation
  params: { remotes, models },
});

Setting up a client

import { GRPCClient } from '@smartcosmos/cosmos-service-builder';
import protoPaths from '@smartcosmos/sample-protobufs';

const grpcClients = {
  ...new GRPCClient({
    protoPath: protoPaths.sample,
    logger: config.LoggerConfig,
  }).connect(config.GRPC_SERVER_SAMPLE_ADDRESS),
};

FAQs

Package last updated on 19 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc