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

feat: Allow changing network name before submitting a "Add network" FE-1183 #1725

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nelitow
Copy link
Contributor

@nelitow nelitow commented Dec 16, 2024

This PR adds an input field to the review step when adding a network to allow adding multiple networks that have the same name. Specially useful for testing and development.
localhost_3000_

Sample docker-compse.yml to run two local nodes to test this PR.
version: '3'

services:
  fuel-core-1:
    platform: linux/amd64
    container_name: '${PROJECT:-fuel-node}_fuel-core-1'
    environment:
      FUEL_IP: ${FUEL_IP}
      FUEL_CORE_PORT: 4000
      NETWORK_NAME: '${PROJECT} local 1'
      MIN_GAS_PRICE: ${MIN_GAS_PRICE}
      CONSENSUS_KEY_SECRET: ${WALLET_SECRET}
    build: ./fuel-core
    ports:
      - '${FUEL_CORE_PORT_1:-4000}:4000'
    volumes:
      - fuel-core-db-1:/mnt/db
    healthcheck:
      test: curl --fail http://localhost:4000/v1/health || exit 1
      interval: 1s
      timeout: 5s
      retries: 20

  fuel-core-2:
    platform: linux/amd64
    container_name: '${PROJECT:-fuel-node}_fuel-core-2'
    environment:
      FUEL_IP: ${FUEL_IP}
      FUEL_CORE_PORT: 4001
      NETWORK_NAME: '${PROJECT} local 2'
      MIN_GAS_PRICE: ${MIN_GAS_PRICE}
      CONSENSUS_KEY_SECRET: ${WALLET_SECRET}
    build: ./fuel-core
    ports:
      - '${FUEL_CORE_PORT_2:-4001}:4001'
    volumes:
      - fuel-core-db-2:/mnt/db
    healthcheck:
      test: curl --fail http://localhost:4001/v1/health || exit 1
      interval: 1s
      timeout: 5s
      retries: 20

  faucet-1:
    platform: linux/amd64
    container_name: '${PROJECT:-fuel-node}_faucet-1'
    environment:
      MIN_GAS_PRICE: ${MIN_GAS_PRICE}
      WALLET_SECRET_KEY: ${WALLET_SECRET}
      DISPENSE_AMOUNT: ${DISPENSE_AMOUNT}
      FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core-1:4000/v1/graphql
    image: ghcr.io/fuellabs/faucet:4f7bec0
    ports:
      - '${FUEL_FAUCET_PORT_1:-4040}:3000'
    links:
      - fuel-core-1
    depends_on:
      fuel-core-1:
        condition: service_healthy

  faucet-2:
    platform: linux/amd64
    container_name: '${PROJECT:-fuel-node}_faucet-2'
    environment:
      MIN_GAS_PRICE: ${MIN_GAS_PRICE}
      WALLET_SECRET_KEY: ${WALLET_SECRET}
      DISPENSE_AMOUNT: ${DISPENSE_AMOUNT}
      FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core-2:4001/v1/graphql
    image: ghcr.io/fuellabs/faucet:4f7bec0
    ports:
      - '${FUEL_FAUCET_PORT_2:-4041}:3000'
    links:
      - fuel-core-2
    depends_on:
      fuel-core-2:
        condition: service_healthy

volumes:
  fuel-core-db-1:
    name: '${PROJECT:-fuel-node}_fuel-core-db-1'
  fuel-core-db-2:
    name: '${PROJECT:-fuel-node}_fuel-core-db-2'

- Added a controlled input for customizing the network name in the NetworkForm component.
- Implemented useEffect to set the network name based on the chainName when reviewing.
- Updated AddNetwork component to ensure the name is required before adding a network.
- Improved error handling in NetworkService to check for existing networks by name and URL separately.
@nelitow nelitow self-assigned this Dec 16, 2024
@nelitow nelitow changed the title feat: enhance NetworkForm with dynamic name field and validation to allow for smae-name networks FE-1183 feat: Allow changing network name before submitting a "Add network" FE-1183 Dec 16, 2024
@nelitow nelitow marked this pull request as draft December 16, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant