-
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
Showing
17 changed files
with
2,666 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,14 @@ | ||
[package] | ||
name = "raw_blocks_starknet" | ||
edition = { workspace = true } | ||
version = { workspace = true } | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
common = { path = "../../common" } | ||
substreams-bitcoin = { workspace = true } | ||
substreams = { workspace = true } | ||
prost = { workspace = true } | ||
prost-types = { 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,30 @@ | ||
.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: protogen | ||
protogen: | ||
substreams protogen --exclude-paths google | ||
|
||
.PHONY: parquet | ||
parquet: | ||
substreams-sink-files run starknet.substreams.pinax.network:443 substreams.yaml map_events './out' 0:500 --encoder parquet --file-block-count 100 --development-mode |
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,2 @@ | ||
mod map_events; | ||
mod pb; |
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,8 @@ | ||
use substreams::{errors::Error, pb::substreams::Clock}; | ||
|
||
use crate::pb::{pinax::starknet::EventsOutput, sf::starknet::r#type::v1::Block}; | ||
|
||
#[substreams::handlers::map] | ||
pub fn map_events(_clock: Clock, _block: Block) -> Result<EventsOutput, Error> { | ||
Ok(EventsOutput::default()) | ||
} |
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,57 @@ | ||
// @generated | ||
// @@protoc_insertion_point(attribute:parquet) | ||
pub mod parquet { | ||
include!("parquet.rs"); | ||
// @@protoc_insertion_point(parquet) | ||
} | ||
pub mod pinax { | ||
// @@protoc_insertion_point(attribute:pinax.starknet) | ||
pub mod starknet { | ||
include!("pinax.starknet.rs"); | ||
// @@protoc_insertion_point(pinax.starknet) | ||
} | ||
} | ||
pub mod sf { | ||
pub mod starknet { | ||
pub mod r#type { | ||
// @@protoc_insertion_point(attribute:sf.starknet.type.v1) | ||
pub mod v1 { | ||
include!("sf.starknet.type.v1.rs"); | ||
// @@protoc_insertion_point(sf.starknet.type.v1) | ||
} | ||
} | ||
} | ||
// @@protoc_insertion_point(attribute:sf.substreams) | ||
pub mod substreams { | ||
include!("sf.substreams.rs"); | ||
// @@protoc_insertion_point(sf.substreams) | ||
pub mod index { | ||
// @@protoc_insertion_point(attribute:sf.substreams.index.v1) | ||
pub mod v1 { | ||
include!("sf.substreams.index.v1.rs"); | ||
// @@protoc_insertion_point(sf.substreams.index.v1) | ||
} | ||
} | ||
pub mod rpc { | ||
// @@protoc_insertion_point(attribute:sf.substreams.rpc.v2) | ||
pub mod v2 { | ||
include!("sf.substreams.rpc.v2.rs"); | ||
// @@protoc_insertion_point(sf.substreams.rpc.v2) | ||
} | ||
} | ||
pub mod sink { | ||
pub mod service { | ||
// @@protoc_insertion_point(attribute:sf.substreams.sink.service.v1) | ||
pub mod v1 { | ||
include!("sf.substreams.sink.service.v1.rs"); | ||
// @@protoc_insertion_point(sf.substreams.sink.service.v1) | ||
} | ||
} | ||
} | ||
// @@protoc_insertion_point(attribute:sf.substreams.v1) | ||
pub mod v1 { | ||
include!("sf.substreams.v1.rs"); | ||
// @@protoc_insertion_point(sf.substreams.v1) | ||
} | ||
} | ||
} |
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,80 @@ | ||
// @generated | ||
// This file is @generated by prost-build. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, Copy, PartialEq, ::prost::Message)] | ||
pub struct Column { | ||
/// Not implemented yet but planned so we reserved the field id now | ||
/// optional string name = 1; | ||
#[prost(enumeration="ColumnType", optional, tag="2")] | ||
pub r#type: ::core::option::Option<i32>, | ||
#[prost(enumeration="Compression", optional, tag="3")] | ||
pub compression: ::core::option::Option<i32>, | ||
} | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] | ||
#[repr(i32)] | ||
pub enum ColumnType { | ||
UnspecifiedColumnType = 0, | ||
Uint256 = 1, | ||
Int256 = 2, | ||
} | ||
impl ColumnType { | ||
/// String value of the enum field names used in the ProtoBuf definition. | ||
/// | ||
/// The values are not transformed in any way and thus are considered stable | ||
/// (if the ProtoBuf definition does not change) and safe for programmatic use. | ||
pub fn as_str_name(&self) -> &'static str { | ||
match self { | ||
ColumnType::UnspecifiedColumnType => "UNSPECIFIED_COLUMN_TYPE", | ||
ColumnType::Uint256 => "UINT256", | ||
ColumnType::Int256 => "INT256", | ||
} | ||
} | ||
/// Creates an enum from field names used in the ProtoBuf definition. | ||
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { | ||
match value { | ||
"UNSPECIFIED_COLUMN_TYPE" => Some(Self::UnspecifiedColumnType), | ||
"UINT256" => Some(Self::Uint256), | ||
"INT256" => Some(Self::Int256), | ||
_ => None, | ||
} | ||
} | ||
} | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] | ||
#[repr(i32)] | ||
pub enum Compression { | ||
Uncompressed = 0, | ||
Snappy = 1, | ||
Gzip = 2, | ||
Lz4Raw = 3, | ||
Brotli = 4, | ||
Zstd = 5, | ||
} | ||
impl Compression { | ||
/// String value of the enum field names used in the ProtoBuf definition. | ||
/// | ||
/// The values are not transformed in any way and thus are considered stable | ||
/// (if the ProtoBuf definition does not change) and safe for programmatic use. | ||
pub fn as_str_name(&self) -> &'static str { | ||
match self { | ||
Compression::Uncompressed => "UNCOMPRESSED", | ||
Compression::Snappy => "SNAPPY", | ||
Compression::Gzip => "GZIP", | ||
Compression::Lz4Raw => "LZ4_RAW", | ||
Compression::Brotli => "BROTLI", | ||
Compression::Zstd => "ZSTD", | ||
} | ||
} | ||
/// Creates an enum from field names used in the ProtoBuf definition. | ||
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { | ||
match value { | ||
"UNCOMPRESSED" => Some(Self::Uncompressed), | ||
"SNAPPY" => Some(Self::Snappy), | ||
"GZIP" => Some(Self::Gzip), | ||
"LZ4_RAW" => Some(Self::Lz4Raw), | ||
"BROTLI" => Some(Self::Brotli), | ||
"ZSTD" => Some(Self::Zstd), | ||
_ => None, | ||
} | ||
} | ||
} | ||
// @@protoc_insertion_point(module) |
Oops, something went wrong.