import.ts 437 B

123456789101112131415
  1. import { connectUpstream } from './joystream/ws'
  2. import { addBlockRange } from './joystream'
  3. const main = async () => {
  4. const args = process.argv.slice(2)
  5. if (args.length !== 2) return
  6. const startBlock = +args[0]
  7. const endBlock = +args[1]
  8. console.log(`[Joystream] Syncing blocks from ${startBlock} to ${endBlock}`)
  9. const api = await connectUpstream()
  10. await api.isReady
  11. addBlockRange(api, startBlock, endBlock)
  12. }
  13. main()