Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
quannadev committed Apr 30, 2024
1 parent ee09658 commit 75f90f4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1002,3 +1002,40 @@ where
BLOCK_SIZE: max block-size in the download range
2: safety factor
```

### PubSub Producer Feature

Config:

```rust
#[derive(Serialize, Deserialize)]
struct PubSubConfig {
pubsub_topic: String,
pubsub_ordering_key: Option<String>,
pubsub_compression: bool, //Compress message data with lz4
}
```

Env
```shell
export pubsub_topic=example
export pubsub_ordering_key=example_eth
export pubsub_compression=false/true
```

Run
```shell
cargo build --release -F pubsub

./target/release/ingestor \
--start-block 12369611 \
--batch 10 \
--task-limit 10 \
--channel-size 2 \
--block-partition 100000 \
--config secrets/ethereum.toml \
--request-timeout 50 \
--producer pubsub \
--resumer redis://localhost:6379

```
1 change: 0 additions & 1 deletion ingestor/src/producers/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use google_cloud_pubsub::publisher::{Publisher};
use serde::{Deserialize, Serialize};
use common_libs::async_trait::async_trait;
use common_libs::envy;
use common_libs::log::info;
use crate::core::ProducerTrait;
use crate::proto::BlockTrait;

Expand Down

0 comments on commit 75f90f4

Please sign in to comment.