Skip to content

Commit

Permalink
Merge pull request #13 from ledhed2222/swap-client
Browse files Browse the repository at this point in the history
replace rippled-ws-client with xrpl-client
  • Loading branch information
WietseWind authored Mar 7, 2023
2 parents 1eb0e47 + 43842b4 commit 9e94722
Show file tree
Hide file tree
Showing 4 changed files with 632 additions and 189 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ const {
CurrencyFields,
} = require('./schema')

const Client = require('rippled-ws-client')
const XrplClient = require('xrpl-client').XrplClient
const BigQuery = require('@google-cloud/bigquery')
const bigquery = new BigQuery({ projectId: PROJECT_ID })

const XRPLNodeUrl = typeof process.env.NODE === 'undefined' ? 'wss://s2.ripple.com' : process.env.NODE.trim()
const StartLedger = typeof process.env.LEDGER === 'undefined' ? 32570 : parseInt(process.env.LEDGER)

console.log('Fetch XRPL transactions into Google BigQuery')

const Client = new XrplClient(XRPLNodeUrl)

new Client(XRPLNodeUrl).then(Connection => {
Client.ready().then(Connection => {
let Stopped = false
let LastLedger = 0

Expand Down
6 changes: 4 additions & 2 deletions ledgerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ const {
LEDGER_TABLE_NAME,
} = require('./schema')

const Client = require('rippled-ws-client')
const XrplClient = require('xrpl-client').XrplClient
const BigQuery = require('@google-cloud/bigquery')
const bigquery = new BigQuery({ projectId: PROJECT_ID })

const XRPLNodeUrl = typeof process.env.NODE === 'undefined' ? 'wss://s2.ripple.com' : process.env.NODE.trim()
const StartLedger = typeof process.env.LEDGER === 'undefined' ? 32570 : parseInt(process.env.LEDGER)

console.log('Fetch XRPL Ledger Info into Google BigQuery')

const Client = new XrplClient(XRPLNodeUrl)

new Client(XRPLNodeUrl).then(Connection => {
Client.ready().then(Connection => {
let Stopped = false
let LastLedger = 0

Expand Down
Loading

0 comments on commit 9e94722

Please sign in to comment.