check-op-node.ts 608 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import { task, types } from 'hardhat/config'
import { OpNodeProvider } from '@eth-optimism/core-utils'

// TODO(tynes): add in config validation
task('check-op-node', 'Validate the config of the op-node')
  .addParam(
    'opNodeUrl',
    'URL of the OP Node.',
    'http://localhost:7545',
    types.string
  )
  .setAction(async (args) => {
    const provider = new OpNodeProvider(args.opNodeUrl)

    const syncStatus = await provider.syncStatus()
    console.log(JSON.stringify(syncStatus, null, 2))

    const config = await provider.rollupConfig()
    console.log(JSON.stringify(config, null, 2))
  })