Dusan Sekulic b1c9261f14 [SDK] Persist tx history, vtxos & Provide transaction feed (#354)
* SDK - GetTransactionsStream add to rest/grpc

no session, pattern or user messages provided

* SDK - AppDataRepository added, store refactor

This patch introduces a significant refactor of the Ark SDK codebase. The primary changes involve:

1. **Domain Package Introduction**: A new `domain` package has been created under `store`, encapsulating core data structures and interfaces such as `ConfigData`, `Transaction`, `SdkRepository`, and various repository interfaces. This enhances modularity and separation of concerns.

2. **Replacement of Store with Domain Objects**: All references to the `store` package's `StoreData` have been replaced with `domain.ConfigData`. This change reflects a shift towards using domain-driven design, where the core business logic is represented by domain objects.

3. **Repository Pattern Implementation**: The code has been refactored to use repositories for accessing and managing data. `ConfigRepository` and `TransactionRepository` interfaces are introduced, providing methods for managing configuration data and transactions, respectively.

4. **New Storage Implementations**: New storage implementations using BadgerDB are introduced for persisting transactions (`transaction_repository.go`). This change indicates a move towards more robust and scalable data storage solutions.

5. **Service Layer Introduction**: A service layer (`service.go`) is introduced, which acts as a facade for the underlying data repositories. This layer abstracts the data access logic and provides a unified interface for interacting with configuration and transaction data.

6. **Code Simplification and Cleanup**: The patch removes redundant code and simplifies the existing codebase by consolidating store-related logic and enhancing the overall structure of the code.

7. **Testing Enhancements**: Test cases are updated to reflect the changes in the data access layer, ensuring that the new repository pattern and domain objects are properly tested.

Overall, this refactor aims to improve the maintainability, scalability, and testability of the codebase by adopting best practices such as domain-driven design, repository pattern, and separation of concerns.

* 'SDK listen for tx stream

This diff represents a substantial refactor and enhancement of the `ark-sdk` client, which involves modifications to multiple files, primarily in the `pkg/client-sdk` and `server/internal/core/application` directories. Here's a summary of the key changes:

1. **Configuration and Initialization**:
   - Refactor to replace file-based configuration store with a domain-based approach.
   - Introduced `ListenTransactionStream` configuration to allow real-time transaction event listening.

2. **Client SDK Enhancements**:
   - The client SDK now supports asynchronous transaction streaming and handling.
   - Introduced methods to get transaction event channels and stop the client gracefully.
   - Expanded the `ArkClient` interface to include these new functionalities.

3. **Transaction Handling**:
   - Added support for listening to and processing transaction events in real-time.
   - Implemented methods to handle different types of transactions, including boarding, redeem, and round transactions.
   - Expanded the `Transaction` struct to include more metadata, such as `BoardingVOut`.

4. **Repository Changes**:
   - Introduced `VtxoRepository` for managing VTXO-related operations.
   - Modified `AppDataRepository` to include `VtxoRepository`.

5. **Example and Test Adjustments**:
   - Updated example code to utilize the new transaction streaming capabilities.
   - Adjusted tests to reflect changes in client initialization and configuration handling.

6. **Dependency Updates**:
   - Updated `go.mod` and `go.sum` to include new dependencies such as `badger` for data storage and potentially updated versions of existing packages.

These changes collectively enhance the functionality of the `ark-sdk` client by enabling real-time transaction handling, improving configuration management, and providing a more robust and scalable client architecture. This update seems to be aimed at improving the efficiency and responsiveness of the client application, likely in response to increased demands for real-time data processing and analysis.'

* merge

* go work sync

* test fix

* Tiny refactor (#2)

* tiny refactor

* renaming

* Renamings

* Fixes (#3)

---------

Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
2024-10-17 17:36:48 +02:00
2024-03-05 14:25:53 +01:00
2024-09-16 15:40:10 +02:00
2024-06-03 19:29:56 +02:00
2024-08-09 01:15:16 +02:00

Ark

GitHub release (latest by date) Docker Image Integration ci_unit GitHub Go Reference

Welcome to the Ark monorepo, a comprehensive solution for off-chain Bitcoin and Liquid transactions.

Ark logo

⚠️ IMPORTANT DISCLAIMER: ALPHA SOFTWARE Ark is currently in alpha stage. This software is experimental and under active development. DO NOT ATTEMPT TO USE IN PRODUCTION. Use at your own risk.

Supported Networks and Wallets

Covenant-less Covenant
Network Bitcoin signet, Bitcoin regtest Liquid, Liquid testnet, Liquid regtest
Wallet Embedded lnwallet Ocean wallet

Usage Documentation

For a comprehensive guide on how to set up and use Ark, please visit our Developer Portal. For a quick-start with Docker, head over to our Quick Start guide where you can setup an Ark Server and Clients in a local Bitcoin regtest network.

Repository Structure

  • api-spec: Ark Protocol Buffer API specification
  • client: ark Single-key wallet CLI for interacting with the ASP
  • common: Shared code between the server and client
  • pkg/client-sdk: Go SDK for interacting with ASPs running the Ark protocol. It offers WASM bindings to interact with the SDK from the browser and other environments.
  • server: arkd Ark Service Provider (ASP) - the always-on daemon

Development

For detailed development instructions, including running tests, and contributing to the implementations, please refer to the README files in the server and client directories.

Compile binary from source

To compile Ark binaries from source, you can use the following Make commands from the root of the monorepo:

  • make build-server: Builds the arkd binary (Ark Service Provider)
  • make build-client: Builds the ark binary (Single-key wallet CLI)
  • make build-wasm: Builds the WebAssembly bindings
  • make build: Builds all components for the current architecture (server, client, and WebAssembly SDK)
  • make build-all: Cross-compile all components for all supported architectures

For example, to build both the server and client binaries, run:

make build

This will compile the arkd and ark binaries for your current architecture. For more detailed build instructions and options, please refer to the README files in the server and client directories.

Contributing Guidelines

  1. No force pushing in PRs: Always use git push --force-with-lease to avoid overwriting others' work.
  2. Sign your commits: Use GPG to sign your commits for verification.
  3. Squash and merge: When merging PRs, use the "Squash and merge" option to maintain a clean commit history.
  4. Testing: Add tests for each new major feature or bug fix.
  5. Keep master green: The master branch should always be in a passing state. All tests must pass before merging.

Local Development Setup

  1. Install Go (version 1.18 or later)

  2. Install Nigiri for local Bitcoin and Liquid networks

  3. Clone this repository:

    git clone https://github.com/ark-network/ark.git
    cd ark
    
  4. Install dependencies:

    go work sync
    
  5. Build the project:

    cd server
    make build
    cd ../client
    make build
    

Note: You need to run make build in both the server and client directories separately.

Support

If you encounter any issues or have questions, please file an issue on our GitHub Issues page.

Security

We take the security of Ark seriously. If you discover a security vulnerability, we appreciate your responsible disclosure.

Currently, we do not have an official bug bounty program. However, we value the efforts of security researchers and will consider offering appropriate compensation for significant, responsibly disclosed vulnerabilities.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Description
No description provided
Readme MIT 13 MiB
Languages
Go 97.9%
HTML 1.1%
Makefile 0.5%
Shell 0.3%
Dockerfile 0.2%