MDK Logo

Pools

Pools page and pool-authoring dialog for configuring mining pools

Authoring UI for mining pools. PoolManagerPools is the plug-and-play feature composite used by the demo; AddPoolModal is the pool-authoring dialog it opens on demand.

For miner-to-pool assignment via the explorer, see Miner explorer. For the landing surface, see Dashboard.

Prerequisites

  • Complete the @mdk/foundation installation and add the dependency
  • A connected Redux store with actionsSlice wired up. PoolManagerPools and AddPoolModal dispatch pool-config actions
  • Pool configuration data (PoolConfigData[]) sourced from your API layer
  • Feature flags that gate optional controls: ADD_POOL_ENABLED, SHOW_CREDENTIAL_TEMPLATE, SHOW_POOL_VALIDATION (re-exported from @mdk/foundation)

Components

ComponentDescription
PoolManagerPoolsPool Manager pools page with accordion list and Add Pool action
AddPoolModalDialog for authoring a new pool configuration

PoolManagerPools

Feature composite that renders the pools page: header with **Add Pool** button (gated by ADD_POOL_ENABLED), a loader/error state, and a collapsible accordion listing every pool with its endpoints, credentials template, and validation status. Opens AddPoolModal on demand.

Import

import { PoolManagerPools } from '@mdk/foundation'

Props

PropTypeDefaultDescription
poolConfigPoolConfigData[]requiredPool configuration source; hydrated by usePoolConfigs
backButtonClick() => voidrequiredFires when the operator clicks the "Pool Manager" back link

Behaviour

  • Renders a page header (title + back link) with an Add Pool button gated by the ADD_POOL_ENABLED flag
  • Shows a loader while usePoolConfigs is loading, or a CoreAlert on error
  • Lists every pool in a collapsible accordion: each row shows the pool name, description, unit/miner counts, and a validation badge; expanding a row reveals the endpoints list, credentials template, and a Test Configuration action
  • Opens AddPoolModal when the Add Pool button is clicked

Basic usage

<PoolManagerPools
  poolConfig={poolConfigs}
  backButtonClick={() => router.push('/pool-manager')}
/>

Styling

  • .mdk-pm-pools: Root element
  • .mdk-pm-pools__header: Title and action row
  • .mdk-pm-pools__header-title: Page title
  • .mdk-pm-pools__back-link: Back link button
  • .mdk-pm-pools__accordion: Accordion root
  • .mdk-pm-pools__accordion-item, .mdk-pm-pools__accordion-trigger, .mdk-pm-pools__accordion-content: Accordion parts

AddPoolModal

Dialog that collects pool info, endpoints, and credential template fields. Validates with Zod and dispatches ACTION_TYPES.REGISTER_POOL_CONFIG through actionsSlice on submit.

Dialog for authoring a new pool configuration. Collects pool info, endpoints, and credential template fields; validates with Zod; dispatches ACTION_TYPES.REGISTER_POOL_CONFIG to actionsSlice on submit.

Import

import { AddPoolModal } from '@mdk/foundation'

Props

PropTypeDefaultDescription
isOpenbooleanfalseControls visibility
onClose() => voidrequiredCloses the dialog

Form schema

  • groupName: required, non-empty (Pool Name)
  • description: optional
  • workerName: required, non-empty (Pool Username)
  • suffixType: nullable, shown when SHOW_CREDENTIAL_TEMPLATE is on
  • endpoints: required, minimum 1, maximum MAX_POOL_ENDPOINTS

Role labels for endpoints are derived from position using POOL_ENDPOINT_INDEX_ROLES and POOL_ENDPOINT_ROLES_LABELS.

Basic usage

const {
  modalOpen,
  handleOpen,
  handleClose,
} = useContextualModal()

<AddPoolModal isOpen={modalOpen} onClose={handleClose} />

Styling

  • .mdk-pm-add-pool-modal: Root dialog
  • .mdk-pm-add-pool-modal__section-header: Section headings (e.g. POOL INFO, ENDPOINTS CONFIGURATION, CREDENTIALS TEMPLATE)
  • .mdk-pm-add-pool-modal__endpoints-section, .mdk-pm-add-pool-modal__endpoints-header, .mdk-pm-add-pool-modal__endpoints-list: Endpoints region
  • .mdk-pm-add-pool-modal__endpoint, .mdk-pm-add-pool-modal__endpoint-header, .mdk-pm-add-pool-modal__endpoint-role, .mdk-pm-add-pool-modal__endpoint-fields: Per-endpoint blocks
  • .mdk-pm-add-pool-modal__validation-section, .mdk-pm-add-pool-modal__validation-status: Shown when SHOW_POOL_VALIDATION is on
  • .mdk-pm-add-pool-modal__footer: Actions

On this page