Codota Logo For Javascript
@grpc/grpc-js
Code IndexAdd Codota to your IDE (free)

How to use @grpc/grpc-js

Best JavaScript code snippets using @grpc/grpc-js(Showing top 3 results out of 1,395)

origin: PegaSysEng/orchestrate-node

/**
  * Creates a new ContractRegistry instance
  *
  * @param endpoint - the URL and port of the contract registry RPC
  * @param options - optional gRPC channel options
  */
 constructor(endpoint: string, options?: ChannelOptions) {
  this.rpcClient = new Client(endpoint, ChannelCredentials.createInsecure(), options)
 }
origin: ArcBlock/forge-js

/**
  * Initialize grpc-node clients for each rpc service, lazy connection under the surface
  *
  * @private
  */
 _initRpcClients() {
  const socket = this._endpoint.split('//').pop();
  this.clients = Object.keys(rpcs).reduce((acc, x) => {
   debug('initRpcClient', x);
   acc[x] = new rpcs[x](socket, grpc.credentials.createInsecure());
   return acc;
  }, {});
 }
origin: PegaSysEng/orchestrate-node

private rpc(method: string, requestData: Buffer, callback: UnaryCallback<Buffer>, authToken?: string) {
  const serializeF = (request: Buffer) => request
  const deSerializeF = (response: Buffer) => response

  const metadata = new Metadata()
  if (authToken) {
   metadata.set('Authorization', authToken)
  }

  this.rpcClient.makeUnaryRequest(
   `contractregistry.ContractRegistry/${method}`,
   serializeF,
   deSerializeF,
   requestData,
   metadata,
   callback
  )
 }
@grpc/grpc-js(npm)

Most used @grpc/grpc-js functions

  • ChannelCredentials.createInsecure
  • Client.makeUnaryRequest
  • Metadata.set
  • createInsecure
  • credentials

Popular in JavaScript

  • mime-types
    The ultimate javascript content-type utility.
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • ms
    Tiny millisecond conversion utility
  • debug
    small debugging utility
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • fs
  • lodash
    Lodash modular utilities.
  • minimatch
    a glob matcher in javascript
  • Top plugins for WebStorm
    The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
Get Codota for your IDE now