From be9296b2f9cbb3479afc845fe13667ff4f2af106 Mon Sep 17 00:00:00 2001 From: Graham Goh Date: Mon, 16 Sep 2024 23:41:57 +1000 Subject: [PATCH] fix(chain): peerId is introduced for bootstrap Add a new field for peerID in the chain config form when it is running as bootstrap node for OCR2 When `Is this node running as a bootstrap peer?` is selected, peerId is now available as a field. --- .changeset/cyan-kids-boil.md | 5 ++ .../Form/ChainConfigurationForm.test.tsx | 4 ++ .../Form/ChainConfigurationForm.tsx | 47 +++++++++---------- .../FeedsManager/SupportedChainsCard.tsx | 27 +++++++---- 4 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 .changeset/cyan-kids-boil.md diff --git a/.changeset/cyan-kids-boil.md b/.changeset/cyan-kids-boil.md new file mode 100644 index 0000000..51e8112 --- /dev/null +++ b/.changeset/cyan-kids-boil.md @@ -0,0 +1,5 @@ +--- +'@smartcontractkit/operator-ui': minor +--- + +Peer ID field is introduced when Node is running as bootstrap peer diff --git a/src/components/Form/ChainConfigurationForm.test.tsx b/src/components/Form/ChainConfigurationForm.test.tsx index 96d2dfc..6a94b41 100644 --- a/src/components/Form/ChainConfigurationForm.test.tsx +++ b/src/components/Form/ChainConfigurationForm.test.tsx @@ -180,5 +180,9 @@ describe('ChainConfigurationForm', () => { expect(await findByTestId('ocr2Multiaddr-helper-text')).toHaveTextContent( 'Required', ) + + expect( + await findByTestId('ocr2P2PPeerID-helper-text'), + ).not.toHaveTextContent('Required') }) }) diff --git a/src/components/Form/ChainConfigurationForm.tsx b/src/components/Form/ChainConfigurationForm.tsx index a7f520c..b9956ab 100644 --- a/src/components/Form/ChainConfigurationForm.tsx +++ b/src/components/Form/ChainConfigurationForm.tsx @@ -459,6 +459,28 @@ export const ChainConfigurationForm = withStyles(styles)( /> + + + {p2pKeys.map((key) => ( + + {key.peerID} + + ))} + + + {values.ocr2IsBootstrap ? ( ) : ( <> - - - {p2pKeys.map((key) => ( - - {key.peerID} - - ))} - - - ( - - - - + <> + + + + + + {cfg.__typename === 'OCR2JobConfig' && ( + + + + + )} + ) const renderOracle = ( @@ -158,11 +167,11 @@ const renderOracle = ( | FeedsManager_ChainConfigFields['ocr1JobConfig'], ) => ( <> - + - + @@ -196,7 +205,7 @@ const FluxMonitorJobTypeRow = withStyles(styles)( } return ( - +
@@ -218,7 +227,7 @@ const OCRJobTypeRow = withStyles(styles)( return ( <> - +
- +