You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One reason the current API is so broken is that the data model is not well designed. As one example there's currently no way to query a single reward or reward by smesherID (spacemeshos/api#272). It's not possible to query account data (AccountDataQuery, AccountDataStream), smesher reward data (SmesherDataQueryRequest) or global state data (GlobalStateStreamRequest) by layer. It's not possible to read global state data except using a stream, which means there's no way to query historical state data. It's not possible to query account data (AccountMeshDataQueryRequest) using a range of layers (only a start layer). There's no way to look up a block, without looking up a layer, and there's no way to look up an epoch, only a stream EpochStreamRequest. Etc.
For many applications, including the explorer and much of what Smapp does, a GraphQL API would make a lot more sense. It would largely replace the need for the explorer to use streams (which continually time out), and would make historical queries and resyncing/checking data much easier. It would allow custom queries that "drill down" to a specific data item, e.g., a specific block or tx without performing multiple back-and-forth queries (e.g. epoch -> layer -> block -> tx).
I'm not suggesting replacing the existing gRPC API entirely with GraphQL. Certain API services, e.g., admin/debug services, those used to control the node, the new PoST service API, etc. are probably better off as gRPC.
The text was updated successfully, but these errors were encountered:
One reason the current API is so broken is that the data model is not well designed. As one example there's currently no way to query a single reward or reward by smesherID (spacemeshos/api#272). It's not possible to query account data (
AccountDataQuery
,AccountDataStream
), smesher reward data (SmesherDataQueryRequest
) or global state data (GlobalStateStreamRequest
) by layer. It's not possible to read global state data except using a stream, which means there's no way to query historical state data. It's not possible to query account data (AccountMeshDataQueryRequest
) using a range of layers (only a start layer). There's no way to look up a block, without looking up a layer, and there's no way to look up an epoch, only a streamEpochStreamRequest
. Etc.For many applications, including the explorer and much of what Smapp does, a GraphQL API would make a lot more sense. It would largely replace the need for the explorer to use streams (which continually time out), and would make historical queries and resyncing/checking data much easier. It would allow custom queries that "drill down" to a specific data item, e.g., a specific block or tx without performing multiple back-and-forth queries (e.g. epoch -> layer -> block -> tx).
I'm not suggesting replacing the existing gRPC API entirely with GraphQL. Certain API services, e.g., admin/debug services, those used to control the node, the new PoST service API, etc. are probably better off as gRPC.
The text was updated successfully, but these errors were encountered: