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 api support for epoch atx stream #220

Merged
merged 1 commit into from
Mar 24, 2023
Merged

Conversation

countvonzero
Copy link
Contributor

part of spacemeshos/go-spacemesh#4089

for stand-alone binary to create bootstrap/fallback beacon and activeset

Copy link
Contributor

@dshulyak dshulyak left a comment

Choose a reason for hiding this comment

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

i think i would prefer to design some more generic, but if it works then we can use this

@@ -99,3 +99,11 @@ message LayerStreamRequest {}
message LayerStreamResponse {
Layer layer = 1;
}

message EpochStreamRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

i thought that we already have some api to query atxs, we could use that until there is time to design new.

i wanted to have something similar to TransactionResult for every object.

type AtxService interface {
     Stream(Request) 
}

type Request struct {
    EpochStart, EpochEnd uint32 // includes all in range[EpochStart, EpochEnd)
    Smesher []byte // if not empty filters by smesher
}

and basically similar api for every other object that can be consumed for various purposes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so if you look at api/node.go in go-spacemesh, there is no interface that allows the API to query all atx ids in an epoch.
what's currently available is for the caller to query full atx data by atx ids.

my assumption is also that we will rework something new for the api. current state is difficult for me to use. so this would be short-lived and replaced by v2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'd really like the primitive types to be consumed directly in v2. (u32, u64, []byte)

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds fine to me

@countvonzero countvonzero merged commit 5540748 into master Mar 24, 2023
@fasmat fasmat deleted the add-epoch-atx-api branch March 28, 2023 14:56
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.

None yet

2 participants