Skip to content

Commit

Permalink
docs(firehose-protos): document protos
Browse files Browse the repository at this point in the history
  • Loading branch information
suchapalaver committed Oct 21, 2024
1 parent 5ebe688 commit 0de0bfe
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
12 changes: 5 additions & 7 deletions crates/firehose-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ ETHEREUM_API_KEY=<YOUR-API-KEY>
### proto files

We use the following protobuffers developed by Streamingfast via our
[`semiotic-ai/sf-protos` crate](https://github.com/semiotic-ai/sf-protos):
[`firehose-protos` crate](./../firehose-protos/README.md):

- [`streamingfast/proto/sf/firehose/v2/firehose.proto`](https://github.com/streamingfast/proto/blob/develop/sf/firehose/v2/firehose.proto)
- [`streamingfast/firehose-ethereum/proto/sf/ethereum/type/v2/type.proto`](https://github.com/streamingfast/firehose-ethereum/blob/335607aac766f9f3c6946d8b1ad3c8e36ab70930/proto/sf/ethereum/type/v2/type.proto)

See
[`streamingfast/substreams-ethereum`](https://github.com/streamingfast/substreams-ethereum/blob/c925dfa58675c4284884b3fdec9c2b3c4047ce7c/core/src/pb/generated.rs)
for more on how Streamingfast use these protobuffers.
See the [`firehose-protos` docs](./../firehose-protos/README.md) for information
on these protobuffers and links to the different repos that they've come from.

### gRPC service examples

Below is the description output for the Firehose gRPC server using `grpcurl`.

```terminal
grpcurl -plaintext <your-grpc-service>:<port> describe
Expand Down
33 changes: 33 additions & 0 deletions crates/firehose-protos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# `firehose-protos`

StreamingFast's and Pinax's Rust-compiled protocol buffers for Firehose,
used in [header-accumulator](./../header-accumulator/Readme.md),
[flat-files-decoder](./../flat-files-decoder/Readme.md), and
[forrestrie](./../../README.md).

## Protobuffer definitions

### [`block.proto`](https://github.com/streamingfast/firehose-ethereum/blob/335607aac766f9f3c6946d8b1ad3c8e36ab70930/proto/sf/ethereum/type/v2/type.proto)

Representation of the tracing of a block in the Ethereum blockchain.

### [`bstream.proto`](https://github.com/streamingfast/bstream/blob/develop/proto/sf/bstream/v1/bstream.proto)

`Block` type from the Streamingfast block streaming Handlers library. Lower level building block of dfuse.

### [`firehose.proto`](https://github.com/streamingfast/proto/blob/develop/sf/firehose/v2/firehose.proto)

Firehose fetch and streaming, client and server gRPC implementation.

### [`type.proto`](https://github.com/pinax-network/firehose-beacon/blob/main/proto/sf/beacon/type/v1/type.proto)

Pinax's Firehose Beacon `Block` implementation.

## Tests

### Data

`exec_layer_block_20562650_header.json` was serialized to JSON from a
`firehose_protos::ethereum::r#type::v2::Block` received from a Firehose endpoint
over gRPC and then redacted to only contain data for the fields necessary
to compute the `Header`.

0 comments on commit 0de0bfe

Please sign in to comment.