graphprotocol / firehose-arweave

The firehose integration with the garii
Apache License 2.0
3 stars 2 forks source link

Review protobuf block format. #6

Open maoueh opened 2 years ago

maoueh commented 2 years ago

https://github.com/ChainSafe/firehose-arweave/blob/5c79bb69ffac61f2fce981ac364829ce89b3f688/proto/sf/arweave/type/v1/type.proto#L9

I would like to review the block format, where it was taken from and the net effect on the end user.

If we are using the types as defined by the HTTP API, it seems the format is different based on the block height? What do we represent in the block model, the latest version, the common base? All?

https://docs.arweave.org/developers/server/http-api#block-format

clearloop commented 2 years ago

thegarii adapts all of the format of Arweave blocks,

for parsing Arweave blocks from json, see https://github.com/ChainSafe/thegarii/blob/8a289c066e9515dd09a7aa32f16f2eec12ee20c3/src/types.rs#L8

for convert inner block types into protobuf, see https://github.com/ChainSafe/thegarii/blob/8a289c066e9515dd09a7aa32f16f2eec12ee20c3/src/pb.rs#L43

see also, the arweave client in golang

https://github.com/everFinance/goar/blob/main/types/block.go