Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
];
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();
}
];
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);
});
+ 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,
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;
})
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();