Skip to content

feat(bot): allow chain configuration#5

Merged
silent-cipher merged 3 commits into
mainfrom
feat/multi-chains
Aug 30, 2025
Merged

feat(bot): allow chain configuration#5
silent-cipher merged 3 commits into
mainfrom
feat/multi-chains

Conversation

@silent-cipher
Copy link
Copy Markdown
Collaborator

PR Includes -

  • can set network to calibration or mainnet

@FilOzzy FilOzzy added this to FOC Aug 30, 2025
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Aug 30, 2025
@silent-cipher silent-cipher requested a review from Copilot August 30, 2025 06:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables network configuration for the Filecoin dealbot, allowing it to operate on either calibration or mainnet networks instead of being hardcoded to calibration.

  • Adds a configurable network field that accepts "calibration" or "mainnet" values
  • Refactors configuration structure to use typed interfaces and removes default fallbacks
  • Updates all network-dependent services to use the configured network dynamically

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/config/app.config.ts Restructures configuration with typed interfaces and adds network parameter
src/wallet-sdk/wallet-sdk.service.ts Updates to use dynamic network configuration for RPC URLs and contract addresses
src/scheduler/scheduler.service.ts Refactors configuration access to use typed interfaces
src/retrieval/retrieval.service.ts Updates CDN hostname selection based on network configuration
src/infrastructure/database/database.module.ts Removes default fallbacks and uses typed configuration
src/deal/deal.service.ts Updates RPC URL selection to use configured network
src/dataSource/dataSource.service.ts Refactors to use typed configuration for dataset path
src/common/types.ts Adds Network type definition
src/common/constants.ts Changes CDN_HOSTNAME to network-keyed CDN_HOSTNAMES object
.env.example Updates configuration examples and adds network parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/common/constants.ts Outdated
Comment thread src/infrastructure/database/database.module.ts
@silent-cipher silent-cipher merged commit 93ed0ca into main Aug 30, 2025
@github-project-automation github-project-automation Bot moved this from 📌 Triage to 🎉 Done in FOC Aug 30, 2025
SgtPooki added a commit that referenced this pull request May 5, 2026
* docs(checks): close resolved TBDs in data-storage, events, README

Items previously marked TBD that are now implemented in code:

- data-storage.md assertions #3, #5, #6, #7 (pieceConfirmed, IPNI
  discoverability, retrievability, all-checks-gated) -> Yes.
- data-storage.md poll intervals: replace TBD_VARIABLE refs with the
  concrete sources (hardcoded POLLING_INTERVAL_MS = 2.5s for SP piece
  status, IPNI_VERIFICATION_POLLING_MS env var with 2s default for IPNI
  verification; doc previously claimed 5s).
- data-storage.md section 7 header drops TBD; intro disclaimer removed.
- data-storage.md "TBD Summary" rewritten as "Implementation History"
  with code references for inline retrieval, CID integrity, per-deal
  timeout (AbortController -> DealStatus.FAILED), gated status, status
  model, onPieceConfirmed, IPFS gateway retrieval, filecoin-pin CAR.
- events-and-metrics.md: pieceConfirmed -> Yes (pieceConfirmedOnChainMs
  histogram); ipfsRetrievalIntegrityChecked -> implemented inline via
  per-block sha256 verification in ipfs-block.strategy.ts (no discrete
  event); ipfsRetrievalFirstByte/LastByteReceived marked Partial since
  duration histograms exist but no discrete event; histogram-buckets
  TBD replaced with link to metrics-prometheus.module.ts.
- README.md: name the dataset-creation job (data-set-creation) and
  reference its config envs.

Still TBD (not changed in this commit): uploadToSpStart,
ipniVerificationStart, ipfsRetrievalStart events; jobs.md PR #263
lookahead-skip; PDP_SUBGRAPH_ENDPOINT production value.

* docs(checks): address review feedback on callback names and event states

- data-storage.md: rename Synapse callbacks to plural form
  (onPiecesAdded, onPiecesConfirmed) to match deal.service.ts.
- events-and-metrics.md: same rename in the event list. Clarify that
  dealCreated maps to DealStatus.DEAL_CREATED only after all gates pass
  (upload alone sets UPLOADED, not DEAL_CREATED).
- events-and-metrics.md: ipfsRetrievalIntegrityChecked downgraded from
  Yes to Partial since no discrete event is emitted (inline check
  only).
- events-and-metrics.md: Mermaid timeline now matches the table -
  ipfsRetrievalFirstByteReceived/LastByteReceived labelled as
  "Partial: histogram only", ipfsRetrievalIntegrityChecked labelled
  "Partial: inline check, no event".
- README.md: refer to the canonical pg-boss job type
  data_set_creation (underscore) so operators can map the doc to
  jobType values.

* docs(checks): fix unreadable Mermaid rect fill in event timeline

The 'Data Storage Only' rect used rgb(50, 50, 50), which renders as a
near-black block that hides the message labels and arrows inside it
(both on GitHub light/dark themes). Switch to a translucent
rgba(120, 120, 200, 0.15) so the highlight is visible without
obscuring content.

* docs(events): reframe Event List as timing markers, not emitted events

The 'events' in this doc are named anchors used to define metric Timer
Starts/Ends; dealbot does not necessarily emit each as a discrete
Prometheus event or log line. Add an explicit note up top so readers
don't expect every entry to map to an emitted event, and update rows
that were marked TBD/Partial purely because no discrete event is
emitted.

- uploadToSpStart -> Yes (anchor: deal.uploadStartTime in
  deal.service.ts:255).
- ipniVerificationStart -> Yes (anchor: ipniVerificationStartTime in
  ipni-verification.service.ts:63 - drives ipniVerifyMs).
- ipfsRetrievalStart -> Yes (anchor: retrieval startTime in
  retrieval-addons.service.ts:227; logs 'retrieval_started').
- ipfsRetrievalFirstByteReceived -> Yes (drives
  ipfsRetrievalFirstByteMs).
- ipfsRetrievalLastByteReceived -> Yes (drives
  ipfsRetrievalLastByteMs).
- ipfsRetrievalIntegrityChecked -> Yes (per-block sha256 in
  ipfs-block.strategy.ts; inline, no discrete event).
- Mermaid timeline: drop the (TBD) / (Partial: ...) annotations on
  these markers so the diagram and the table agree.

* docs(events): drop Implemented column from Event List

All rows are now Yes (each marker is anchored in code), so the column
adds no signal. Anchor details folded into the Source-of-truth column.
Intro note tightened.

* Update docs/checks/data-storage.md

Co-authored-by: Puspendra Mahariya <95584952+silent-cipher@users.noreply.github.com>

* Update docs/checks/README.md

Co-authored-by: Puspendra Mahariya <95584952+silent-cipher@users.noreply.github.com>

---------

Co-authored-by: Puspendra Mahariya <95584952+silent-cipher@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

3 participants