• Mark Tyneway's avatar
    core-utils,contracts-bedrock,ci: OpNodeProvider + check · 0df744f6
    Mark Tyneway authored
    Implements a simple `OpNodeProvider` that can be used
    to query the op-node. It is used as part of a ci check
    against the devnet. It should add some more health related
    things, now it just prints of rpc responses. This will
    help to debug things.
    0df744f6
check-op-node.ts 608 Bytes
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))
  })