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

Enhance Wallet Service with Support for Multiple Storage Drivers #1612

Open
Ja7ad opened this issue Nov 26, 2024 · 0 comments
Open

Enhance Wallet Service with Support for Multiple Storage Drivers #1612

Ja7ad opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers pactus-wallet Wallet
Milestone

Comments

@Ja7ad
Copy link
Contributor

Ja7ad commented Nov 26, 2024

Description

The current wallet service supports only JSON files for reading and writing wallet details (e.g., addresses, information, and history). While functional, JSON files have limitations in handling larger datasets and can introduce complexity as the wallet scales.

Proposed Solution

To address these limitations, I propose implementing a storage driver system using polymorphism. This approach will enable the wallet service to support multiple internal and external storage drivers, such as JSON, SQLite, MySQL, and more.

Design Overview

We can introduce an abstraction layer with an interface for reading and writing wallet data. This interface will define methods for interacting with the wallet's vault. Below is an example of the proposed structure:

type Driver interface {
	Reader
	CreateValidator(ctx context.Context,label string) error
	CreateBlsAccount(ctx context.Context,label string) error
	// Additional methods as needed
}

type Reader interface {
	IsEncrypted(ctx context.Context) bool
	GetAddressInfo(ctx context.Context, addr string) (*AddressInfo, error)
	// Additional methods as needed
}
@Ja7ad Ja7ad added enhancement New feature or request Wallet pactus-wallet good first issue Good for newcomers labels Nov 26, 2024
@b00f b00f added this to the v1.7.0 milestone Dec 21, 2024
@pactus-project pactus-project deleted a comment from ethsdev Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers pactus-wallet Wallet
Projects
None yet
Development

No branches or pull requests

2 participants