How to use the ripple-lib.Remote.from_config function in ripple-lib

To help you get started, we’ve selected a few ripple-lib 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 ripple / rippled / test / testutils.js View on Github external
function connect_websocket(callback) {
        self.remote = data.remote = Remote.from_config(host, !!opts.verbose_ws);
        self.remote.once('connected', function() {
        // self.remote.once('ledger_closed', function() {
          callback();
        });
        self.remote.connect();
      }
    ];
github radrbiz / radard / test / testutils.js View on Github external
function connect_websocket(callback) {
        self.remote = data.remote = Remote.from_config(host, !!opts.verbose_ws);
        self.remote.once('connected', function() {
        // self.remote.once('ledger_closed', function() {
          callback();
        });
        self.remote.connect();
      }
    ];
github ripple / rippled / bin / rlint.js View on Github external
var finish = function (remote) {
  remote.disconnect();

  // XXX Because remote.disconnect() doesn't work:
  process.exit();
};

console.log("args: ", process.argv.length);
console.log("args: ", process.argv);

if (process.argv.length < 4) {
  usage();
}
else {
  var remote  = Remote.from_config({
        websocket_ip:   process.argv[2],
        websocket_port: process.argv[3],
      })
    .once('ledger_closed', function (m) {
        console.log("ledger_closed: ", JSON.stringify(m, undefined, 2));

        if (process.argv.length === 5) {
          var ledger_index  = process.argv[4];

          ledger_request(remote, ledger_index, function (l) {
              if (l) {
                ledger_verify(l);
              }

              finish(remote);
            });
github ripple-unmaintained / ripple-watch / bot.js View on Github external
+ say_type + " "
        + (say_watch_irc || say_watch);

    var output_irc  =
        m.engine_result === 'tesSUCCESS'
          ? output_irc_base
          : m.engine_result.match('tecPATH_DRY|tecPATH_PARTIAL') === null
            ? irc.colors.wrap('light_red', m.engine_result)
            : undefined;

    writeWatch(output_irc, output_console);
  }
};
 
remote  =
  Remote
    .from_config(remote_config)
    .once('ledger_closed', function (m) {
        self.rippled  = true;

        console.log("*** Connected to rippled");

        if (process.argv.length > 2)
        {
          remote
            .request_tx(process.argv[2])
            .on('success', function (m) {
                // Send transaction as per normal.
                console.log("REPLAY %s", JSON.stringify(m, undefined, 2));

                remote.emit('transaction_all', {
                  transaction: m,
github ripple-unmaintained / ripple-chart / rbc.js View on Github external
setup_sources(function () {
      remote  =
        Remote
          .from_config(rippled_config)
          .on('ledger_closed', function (m) {
              // console.log("ledger_closed: ", JSON.stringify(m, undefined, 2));

              info.ledger = m;

              if ('validated_ledgers' in m) {
                process_validated(m.validated_ledgers);

                process_books(m.ledger_index);
              }
            })
          .on('error', function (e) {
              console.log('Remote error: ', e);
              throw e;
            })
github ripple-unmaintained / ripple-chart / rchart.js View on Github external
setup_sources(function () {
      remote  =
        Remote
          .from_config(rippled_config)
          .on('ledger_closed', function (m) {
              // console.log("ledger_closed: ", JSON.stringify(m, undefined, 2));

              info.ledger = m;

              if ('validated_ledgers' in m) {
                process_validated(m.validated_ledgers); // Build trade database.
              }
            })
          .on('error', function (e) {
              console.log('Remote error: ', e);
              throw e;
            })

          .connect();