Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network selection and network bindings #1261

Open
hardyjosh opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1281
Open

network selection and network bindings #1261

hardyjosh opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1281
Assignees
Labels

Comments

@hardyjosh
Copy link
Contributor

hardyjosh commented Feb 11, 2025

Network Selection and Bindings

GUI Network Selection

Allows defining a curated list of networks with human-readable names for UI display and selection.

gui:
  networks-select:
    <network-key>:
      name: <display-name>

Required fields per network:

  • name: Human readable display name for the network

The network-key must correspond to a defined network in the networks section.

Example:

gui:
  networks-select:
    base:
      name: Base
    flare:
      name: Flare
    arbitrum:
      name: Arbitrum One

We'll need methods so that the front end can get a list of the available networks for the strat, and save it. The selected network will also need to go into state so it can be deserialized.

Network Bindings

Defines network-specific bindings that can be referenced in scenarios. When a network is selected, its bindings become available in the scenario context.

network-bindings:
  <network-key>:
    <binding-name>: <binding-value>
  • Each network-key must correspond to a defined network in the networks section
  • binding-name and binding-value are arbitrary key-value pairs
  • Values are treated as strings and passed directly to the scenario context
  • Bindings can be referenced in scenarios using ${network-bindings.}
  • The active set of bindings is determined by the network of the deployment containing the scenario

Example:

network-bindings:
  base:
    raindex-subparser: "0x123abc"
    network-specific-constant: "42"
  
  flare:
    raindex-subparser: "0x456def" 
    flare-specific-value: "some-value"

Usage in scenarios:

scenarios:
  my-scenario:
    bindings:
      parser-address: ${network-bindings.raindex-subparser}

The network-bindings field can appear:

  • In the main config YAML
  • In separate YAML documents merged into the config
  • Directly in .rain files as front matter

When a user selects a network from the networks-select GUI, the corresponding network bindings are automatically made available in the scenario context.

@hardyjosh hardyjosh changed the title network bindings network selection and network bindings Feb 11, 2025
@findolor findolor linked a pull request Feb 12, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants