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

Add read only builder #326

Merged
merged 8 commits into from
Aug 16, 2024
Merged

Conversation

juanbono
Copy link
Contributor

What Changed?
This PR adds a new constructor for what used to be the Clients struct.

Now it is separated into 2 structs:

  • without writers, wallet and private key
  • with writers, wallet and private key

In this way there is a function for building only the reader part of the clients.

Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

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

Good start. Just need to rename some of the structs.

chainio/clients/avsregistry/builder.go Outdated Show resolved Hide resolved
chainio/clients/elcontracts/builder.go Outdated Show resolved Hide resolved
chainio/clients/builder.go Outdated Show resolved Hide resolved
chainio/clients/builder.go Outdated Show resolved Hide resolved
chainio/clients/builder.go Outdated Show resolved Hide resolved
chainio/clients/builder.go Outdated Show resolved Hide resolved
@juanbono
Copy link
Contributor Author

I addressed all the comments and added some more docs. cc @samlaf

@juanbono juanbono requested a review from samlaf August 15, 2024 14:30
chainio/clients/builder.go Outdated Show resolved Hide resolved
chainio/clients/builder.go Show resolved Hide resolved
samlaf
samlaf previously approved these changes Aug 15, 2024
Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

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

LGTM!

// Build an AVS registry client with the given configuration,
// HTTP and WS clients, and logger, but without a private key.
//
// This is useful for read-only operations, such as fetching metrics.
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does it mean by fetching metrics here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think can be confusing. I'll remove that bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@shrimalmadhur shrimalmadhur merged commit e5c3fb8 into Layr-Labs:dev Aug 16, 2024
4 checks passed
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.

4 participants