Skip to content

A command line tool that wraps Optimisms superchain-registry

License

Notifications You must be signed in to change notification settings

blmalone/superchain-registry-cli

Repository files navigation

superchain-registry-cli

Generated by Dall-e given this README as a prompt

A command line tool that wraps Optimisms superchain-registry repository.

Introduction

The superchain-registry-cli is designed to simplify interactions with the superchain-registry, providing a user-friendly command line interface for developers and operators.

Prerequisites

  • Ensure you have Go installed on your system.

Installation

  • Install superchain-registry-cli:
    • go install github.com/blmalone/superchain-registry-cli/sure@latest
  • Optionally, install jq for JSON processing:
    • brew install jq on macOS

Usage

After installation, run sure --help for a full breakdown of the available functionality.

General sure usage

Examples

  • List all chains in the superchain (default is mainnet):

        sure list
        sure ls --json
        sure ls --target sepolia
  • Get all addresses for a chain:

        sure get-addresses --chain op
        sure ga -c op
        sure ga -c op -tg sepolia
  • Get a specific address by name (fuzzy match on --address-name):

        sure ga -c zora --address-name l1 # all addresses containing "l1" - not case sensitive
        sure ga -c zora -an L1CrossDomainMessengerProxy
  • Get all addresses for a given name across the superchain (fuzzy match on --address-name):

        sure ga -an L1StandardBridge
  • Usage with cast:

        cast call $(sure ga -c op -an L1Standard --json | jq -r '.op.addrs.L1StandardBridgeProxy') "version()(string)"
    
        # When you know there will be only one address
        cast call $(sure ga -c op -an L1Standard --json | jq -r '.op.addrs | to_entries | .[0].value') "version()(string)"

Contributing

Contributions are welcome! Fork this repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A command line tool that wraps Optimisms superchain-registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published