Skip to content

Commit

Permalink
refactor folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Jul 13, 2024
1 parent 41de446 commit 1acd5d1
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/substreams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- name: Install substreams
uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/streamingfast/substreams/releases/download/v1.1.14/substreams_linux_x86_64.tar.gz'
uri: 'https://github.com/streamingfast/substreams/releases/download/v1.9.0/substreams_linux_x86_64.tar.gz'
name: 'substreams'
version: '1.1.14'
version: '1.9.0'

- run: make
- uses: softprops/action-gh-release@v1
Expand Down
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
name = "blocks"
version = "0.2.0"
authors = ["Denis <[email protected]>", "Zhi"]
description = "Messari Blocks"
license = "MIT"
edition = "2021"
publish = false
[workspace]
members = [
"blocks/evm",
"common"
]

[badges]
maintenance = { status = "actively-developed" }
resolver = "2"

[lib]
crate-type = ["cdylib"]
[workspace.package]
edition = "2021"
version = "0.1.0"

[dependencies]
[workspace.dependencies]
substreams = "0.5"
substreams-entity-change = "1.3"
substreams-ethereum = "0.9"
substreams-entity-change = "1.3"
# substreams-antelope = "0.4"
# substreams-bitcoin = "1.0"
# substreams-near = "0.9"
34 changes: 1 addition & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
.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

.PHONY: run
run:
substreams run -e eth.substreams.pinax.network:443 graph_out -s 20293026 -t 20293027

.PHONY: gui
gui:
substreams gui -e eth.substreams.pinax.network:443 graph_out -s 1000 -t 1001

.PHONY: deploy
deploy:
graph build
graph deploy --studio clock
cd blocks/evm; $(MAKE) --no-print-directory all
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Substreams Messari Blocks
# Substreams Raw Blocks

## Supported Block Types
## Supported Networks

- [x] Ethereum
- [x] EVM
- [x] Ethereum
- [x] Arbitrum
- [x] BNB
- [x] Optimism (OP)
- [x] Avalanche-C
- [x] Polygon
- [ ] Bitcoin
- [ ] Solana

## Data types
## Raw Data

- [x] Raw On-Chain Data
- [ ] Decoded Data
- [ ] Transformed Data
- [x] Blocks
- [ ] Creation Traces
- [ ] Logs
- [ ] Transactions
- [ ] Traces

## Data Visualization

Expand All @@ -22,4 +30,13 @@
- Clickhouse
- Postgres
- Amazon Redshift
https://aws.amazon.com/redshift/
https://aws.amazon.com/redshift/

## Graph

```mermaid
graph TD;
graph_out[map: graph_out];
sf.substreams.v1.Clock[source: sf.substreams.v1.Clock] --> graph_out;
sf.ethereum.type.v2.Block[source: sf.ethereum.type.v2.Block] --> graph_out;
```
13 changes: 13 additions & 0 deletions blocks/evm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "raw_blocks_evm"
edition.workspace = true
version.workspace = true

[lib]
crate-type = ["cdylib"]

[dependencies]
common = { path = "../../common" }
substreams-ethereum = { workspace = true }
substreams-entity-change = { workspace = true }
substreams = { workspace = true }
35 changes: 35 additions & 0 deletions blocks/evm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.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

.PHONY: run
run:
substreams run -e eth.substreams.pinax.network:443 graph_out -s 20293026 -t 20293027

.PHONY: gui
gui:
substreams gui -e eth.substreams.pinax.network:443 graph_out -s 1000 -t 1001

.PHONY: deploy
deploy:
graph build
graph deploy --studio clock
File renamed without changes.
3 changes: 1 addition & 2 deletions src/maps.rs → blocks/evm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use common::{block_time_to_date, bytes_to_hex};
use substreams::errors::Error;
use substreams::pb::substreams::Clock;
use substreams_entity_change::pb::entity::EntityChanges;
use substreams_entity_change::tables::Tables;
use substreams_ethereum::pb::eth::v2::Block;

use crate::utils::{bytes_to_hex, block_time_to_date};

#[substreams::handlers::map]
pub fn graph_out(clock: Clock, block: Block) -> Result<EntityChanges, Error> {
let mut tables = Tables::new();
Expand Down
8 changes: 4 additions & 4 deletions substreams.yaml → blocks/evm/substreams.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
specVersion: v0.1.0
package:
name: blocks
name: raw_blocks_evm
version: v0.1.0
url: https://github.com/pinax-network/substreams-messari-blocks
doc: Messari Blocks
url: https://github.com/pinax-network/substreams-raw-blocks
doc: Raw Blocks for EVM

imports:
entities: https://github.com/streamingfast/substreams-sink-entity-changes/releases/download/v1.3.2/substreams-sink-entity-changes-v1.3.2.spkg

binaries:
default:
type: wasm/rust-v1
file: ./target/wasm32-unknown-unknown/release/blocks.wasm
file: ../../target/wasm32-unknown-unknown/release/raw_blocks_evm.wasm

modules:
- name: graph_out
Expand Down
7 changes: 7 additions & 0 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "common"
edition.workspace = true
version.workspace = true

[dependencies]
substreams.workspace = true
File renamed without changes.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.65.0"
channel = "1.69.0"
components = [ "rustfmt" ]
targets = [ "wasm32-unknown-unknown" ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/lib.rs

This file was deleted.

0 comments on commit 1acd5d1

Please sign in to comment.