Skip to content

Commit

Permalink
log account key + block size
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Apr 18, 2024
1 parent 793de09 commit 458f827
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions examples/stream_blocks_single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,18 @@ pub async fn main() {
);

tokio::spawn(async move {
let mut wtr = csv::Writer::from_path("accounts-mainnet.csv").unwrap();

let mut green_stream = pin!(green_stream);
while let Some(message) = green_stream.next().await {
match message {
Message::GeyserSubscribeUpdate(subscriber_update) => {
match subscriber_update.update_oneof {
Some(UpdateOneof::Account(update)) => {

Check warning on line 113 in examples/stream_blocks_single.rs

View workflow job for this annotation

GitHub Actions / test

Diff in /home/runner/work/geyser-grpc-connector/geyser-grpc-connector/examples/stream_blocks_single.rs
info!("got update (green)!!! slot: {}", update.slot);
let key = update.account.unwrap().pubkey;
let account_info = update.account.unwrap();
let account_pk = Pubkey::try_from(account_info.pubkey).unwrap();
info!("got account update (green)!!! {} - {:?} - {} bytes",
update.slot, account_pk, account_info.data.len());
let bytes: [u8; 32] =
key.try_into().unwrap_or(Pubkey::default().to_bytes());
let pubkey = Pubkey::new_from_array(bytes);
wtr.write_record(&[pubkey.to_string()]).unwrap();
wtr.flush().unwrap();
account_pk.to_bytes();
}
_ => {}
}
Expand Down

0 comments on commit 458f827

Please sign in to comment.