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

Implement a storage service to upload contracts on S3 #1728

Open
wants to merge 10 commits into
base: staging
Choose a base branch
from

Conversation

marcocastignoli
Copy link
Member

@marcocastignoli marcocastignoli commented Oct 29, 2024

This PR implements an S3-based storage service. The service allows uploading verified contract files to an S3 bucket while maintaining the same directory structure as RepositoryV2.

  • Added new S3RepositoryService class that implements the storage interface
  • Added S3 configuration options in .env.dev
  • Integrated AWS SDK for S3 operations
  • Added S3 storage service initialization in the server setup

S3RepositoryService is an extension of RepositoryV2, in which the write/delete/get file functions are overridden: instead of editing a fs, it's calling the AWS SDK APIs.

TODO:

  • Clean code
  • Add tests

@marcocastignoli marcocastignoli marked this pull request as ready for review October 30, 2024 15:01
@kuzdogan
Copy link
Member

Haven't looked yet but IMO we should name it to S3Repository instead of RepositoryS3 it looks too similar toRepositoryV3

@marcocastignoli
Copy link
Member Author

Haven't looked yet but IMO we should name it to S3Repository instead of RepositoryS3 it looks too similar toRepositoryV3

I already called it like this in the code but forgot to update the description, I had the same thought yesterday :D

@manuelwedler manuelwedler self-assigned this Oct 31, 2024
@manuelwedler manuelwedler self-requested a review October 31, 2024 09:27
Copy link
Collaborator

@manuelwedler manuelwedler left a comment

Choose a reason for hiding this comment

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

Great solution to our problem with the s3 sync script :)

I only have a few minor comments.

services/server/src/config/local-test.js Show resolved Hide resolved
services/server/package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@manuelwedler manuelwedler left a comment

Choose a reason for hiding this comment

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Sprint - In Progress
Development

Successfully merging this pull request may close these issues.

3 participants