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

[OPCORE-948]: fix(chain): peerId is available for bootstrap #88

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cyan-kids-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@smartcontractkit/operator-ui': minor
---

Peer ID field is introduced when Node is running as bootstrap peer
4 changes: 4 additions & 0 deletions src/components/Form/ChainConfigurationForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,9 @@ describe('ChainConfigurationForm', () => {
expect(await findByTestId('ocr2Multiaddr-helper-text')).toHaveTextContent(
'Required',
)

expect(
await findByTestId('ocr2P2PPeerID-helper-text'),
).not.toHaveTextContent('Required')
})
})
47 changes: 22 additions & 25 deletions src/components/Form/ChainConfigurationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,28 @@ export const ChainConfigurationForm = withStyles(styles)(
/>
</Grid>

<Grid item xs={12} md={6}>
<Field
component={TextField}
id="ocr2P2PPeerID"
name="ocr2P2PPeerID"
label="Peer ID"
select
required={!values.ocr2IsBootstrap}
fullWidth
helperText="The Peer ID used for this chain"
FormHelperTextProps={{
'data-testid': 'ocr2P2PPeerID-helper-text',
}}
>
{p2pKeys.map((key) => (
<MenuItem key={key.peerID} value={key.peerID}>
{key.peerID}
</MenuItem>
))}
</Field>
</Grid>

{values.ocr2IsBootstrap ? (
<Grid item xs={12}>
<Field
Expand All @@ -476,31 +498,6 @@ export const ChainConfigurationForm = withStyles(styles)(
</Grid>
) : (
<>
<Grid item xs={12} md={6}>
<Field
component={TextField}
id="ocr2P2PPeerID"
name="ocr2P2PPeerID"
label="Peer ID"
select
required
fullWidth
helperText="The Peer ID used for this chain"
FormHelperTextProps={{
'data-testid': 'ocr2P2PPeerID-helper-text',
}}
>
{p2pKeys.map((key) => (
<MenuItem
key={key.peerID}
value={key.peerID}
>
{key.peerID}
</MenuItem>
))}
</Field>
</Grid>

<Grid item xs={12} md={6}>
<Field
component={TextField}
Expand Down
27 changes: 18 additions & 9 deletions src/screens/FeedsManager/SupportedChainsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,19 @@ const renderBootstrap = (
| FeedsManager_ChainConfigFields['ocr2JobConfig']
| FeedsManager_ChainConfigFields['ocr1JobConfig'],
) => (
<Grid item xs={12} sm={1} md={5}>
<DetailsCardItemTitle title="Multiaddr" />
<DetailsCardItemValue value={cfg.multiaddr} />
</Grid>
<>
<Grid item xs={12} md={5}>
<DetailsCardItemTitle title="Multiaddr" />
<DetailsCardItemValue value={cfg.multiaddr} />
</Grid>

{cfg.__typename === 'OCR2JobConfig' && (
<Grid item xs={12} md={5}>
<DetailsCardItemTitle title="P2P Peer ID" />
<DetailsCardItemValue value={cfg.p2pPeerID} />
</Grid>
)}
</>
)

const renderOracle = (
Expand All @@ -158,11 +167,11 @@ const renderOracle = (
| FeedsManager_ChainConfigFields['ocr1JobConfig'],
) => (
<>
<Grid item xs={12} sm={1} md={5}>
<Grid item xs={12} md={5}>
graham-chainlink marked this conversation as resolved.
Show resolved Hide resolved
<DetailsCardItemTitle title="P2P Peer ID" />
<DetailsCardItemValue value={cfg.p2pPeerID} />
</Grid>
<Grid item xs={12} sm={1} md={5}>
<Grid item xs={12} md={5}>
<DetailsCardItemTitle title="OCR Key ID" />
<DetailsCardItemValue value={cfg.keyBundleID} />
</Grid>
Expand Down Expand Up @@ -196,7 +205,7 @@ const FluxMonitorJobTypeRow = withStyles(styles)(
}

return (
<Grid item xs={12} sm={1} md={12}>
<Grid item xs={12} md={12}>
<div className={classes.jobTypeContainer}>
<DetailsCardItemTitle title="Job Type" />
<DetailsCardItemValue value="Flux Monitor" />
Expand All @@ -218,7 +227,7 @@ const OCRJobTypeRow = withStyles(styles)(

return (
<>
<Grid item xs={12} sm={1} md={2}>
<Grid item xs={12} md={2}>
<div className={classes.jobTypeContainer}>
<DetailsCardItemTitle title="Job Type" />
<DetailsCardItemValue
Expand All @@ -245,7 +254,7 @@ const OCR2JobTypeRow = withStyles(styles)(

return (
<>
<Grid item xs={12} sm={1} md={2}>
<Grid item xs={12} md={2}>
<div className={classes.jobTypeContainer}>
<DetailsCardItemTitle title="Job Type" />
<DetailsCardItemValue
Expand Down
Loading