Skip to content

Feat config aggr#18

Merged
longfeiWan9 merged 4 commits intomainfrom
feat-configAggr
Feb 19, 2025
Merged

Feat config aggr#18
longfeiWan9 merged 4 commits intomainfrom
feat-configAggr

Conversation

@longfeiWan9
Copy link
Copy Markdown
Contributor

@longfeiWan9 longfeiWan9 commented Feb 14, 2025

This PR focuses on refactor the code base to better implement a configuration-driven approach for the aggregation service, buffer service, client and even deal service, etc.

  • Codebase Refinements
    The update includes substantial code modifications to separate different components into a better go project structure. These changes aim to improve code readability, and maintainability, and easy to add more modular functions in the future. The new structure is:

    xchainClient/
    ├── cmd/
    │   └── xchain.go                # CLI entry point and command registration
    ├── config/
    │   └── config.go                # Configuration structs and loading functions
    │   └── config.json              # Describe all the configuration for xchainClient
    ├── services/
    │   ├── aggregator/
    │   │   ├── aggregator.go        # Aggregation service business logic (e.g., NewAggregator, run, sendDeal)
    │   ├── buffer/
    │   │   ├── bufferHttp.go            # Buffer service business logic (e.g., NewBufferHTTPService, startBufferService)
    │   └── client/                           # (Existing package) – contains client commands such as OfferFileAction
    │       └── client.go                  # Client repeated operations: testing offer data, new keystore, etc.
    │   └── deal/                            # (Existing package) – contains client commands such as OfferFileAction
    │       └── storageDeal.go      # Make storage deal on Filecoin via different approaches: directly with SP, through smart contracts. etc.
    ├── types/
    │   └── common.go                # Shared types used across packages (e.g., common API responses, timestamp mixins)
    ├── utils/
    │   └──  utils.go                 # Generic helper functions (e.g., context helpers, file/path utilities)
    ├── go.mod
    └── go.sum
    
  • Configuration Integration for Aggregation Service
    When running the xchainClient, we can choose whether to run aggregation or not.

    • YES, xchainClient will run aggregation and sendDeal to SP
    • NO, xchainClient will directly make deals on Filecoin by calling ClientContract. (Need to be implemented)

This pull request represents a meaningful step forward in making the xchainClient more configurable and user-friendly, aligning with best practices for scalable application development.

closes #3

@longfeiWan9 longfeiWan9 marked this pull request as draft February 14, 2025 04:01
@longfeiWan9 longfeiWan9 marked this pull request as ready for review February 14, 2025 08:56
@longfeiWan9 longfeiWan9 self-assigned this Feb 14, 2025
@longfeiWan9 longfeiWan9 requested a review from snissn February 17, 2025 03:34
@longfeiWan9
Copy link
Copy Markdown
Contributor Author

@snissn I am going to merge this. I have been testing xchainClien and it is working fine.

@longfeiWan9 longfeiWan9 merged commit 6723437 into main Feb 19, 2025
1 check passed
@longfeiWan9 longfeiWan9 deleted the feat-configAggr branch February 19, 2025 03:06
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.

Configurable for data aggregation

1 participant