How to use the iotex-antenna/lib/rpc-method/node-rpc-method function in iotex-antenna

To help you get started, we’ve selected a few iotex-antenna examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iotexproject / iotex-explorer / src / server / gateways / gateways.ts View on Github external
!(server.config.gateways.mongoose && server.config.gateways.mongoose.uri)
  ) {
    server.logger.warn(
      "cannot start server without gateways.mongoose.uri provided in configuration"
    );
  } else {
    // @ts-ignore
    mongoose.connect(server.config.gateways.mongoose.uri).catch(err => {
      server.logger.warn(`failed to connect mongoose: ${err}`);
    });
  }
  // @ts-ignore
  server.gateways.mongoose = mongoose;

  const gateways = server.config.gateways;
  server.gateways.antenna = new RpcMethod(gateways.iotexAntenna);
  server.gateways.coinmarketcap = { fetchCoinPrice };
  server.gateways.sendgrid = getSendgrid(gateways.sendgrid);
}