-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
494ced1
commit f4efbe7
Showing
6 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "blocks" | ||
version = "0.1.0" | ||
authors = ["Yaro <[email protected]>"] | ||
description = "Blocks Substream" | ||
license = "MIT OR Apache-2.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[badges] | ||
maintenance = { status = "actively-developed" } | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
prost = { workspace = true } | ||
prost-types = { workspace = true } | ||
substreams = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.PHONY: all | ||
all: | ||
make build | ||
make pack | ||
make graph | ||
make info | ||
|
||
.PHONY: build | ||
build: | ||
cargo build --target wasm32-unknown-unknown --release | ||
|
||
.PHONY: pack | ||
pack: | ||
substreams pack | ||
|
||
.PHONY: graph | ||
graph: | ||
substreams graph | ||
|
||
.PHONY: info | ||
info: | ||
substreams info | ||
|
||
%: ; @substreams gui -e $@.substreams.pinax.network:443 map_blocks -s -5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Clock Substream | ||
|
||
> Common "clock" substream that works for any substreams-instrumented firehose endpoint | ||
## Usage | ||
```bash | ||
$ make build | ||
|
||
$ make eth | ||
$ make bitcoin | ||
$ make bsc | ||
$ make eos | ||
``` | ||
|
||
## Graph | ||
```mermaid | ||
graph TD; | ||
map_blocks[map: map_blocks]; | ||
sf.substreams.v1.Clock[source: sf.substreams.v1.Clock] --> map_blocks; | ||
``` | ||
|
||
## Info | ||
```yaml | ||
Package name: blocks | ||
Version: v0.1.0 | ||
Doc: Blocks | ||
Modules: | ||
---- | ||
Name: map_blocks | ||
Initial block: 2 | ||
Kind: map | ||
Input: source: sf.substreams.v1.Clock | ||
Output Type: proto:sf.substreams.v1.Clock | ||
Hash: 44c506941d5f30db6cca01692624395d1ac40cd1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use substreams::pb::substreams::Clock; | ||
|
||
#[substreams::handlers::map] | ||
pub fn map_blocks(clock: Clock) -> Result<Clock, substreams::errors::Error> { | ||
Ok(clock) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
specVersion: v0.1.0 | ||
package: | ||
name: blocks | ||
version: v0.1.0 | ||
url: https://github.com/pinax-network/substreams | ||
doc: Blocks | ||
|
||
binaries: | ||
default: | ||
type: wasm/rust-v1 | ||
file: ../target/wasm32-unknown-unknown/release/blocks.wasm | ||
|
||
modules: | ||
- name: map_blocks | ||
kind: map | ||
initialBlock: 2 | ||
inputs: | ||
- source: sf.substreams.v1.Clock | ||
output: | ||
type: proto:sf.substreams.v1.Clock |