-
Notifications
You must be signed in to change notification settings - Fork 10
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
22 changed files
with
2,608 additions
and
194 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Empty file.
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,40 @@ | ||
use itertools::Itertools; | ||
use std::fs::File; | ||
use std::io; | ||
use std::io::BufRead; | ||
use std::path::PathBuf; | ||
|
||
pub fn main() { | ||
let accounts_meta_file = | ||
PathBuf::from("/Users/stefan/mango/projects/geyser-misc/ledger-debug-accounts.txt"); | ||
|
||
let file = File::open(accounts_meta_file).expect("file must exist"); | ||
let reader = io::BufReader::new(file); | ||
for blocks in &reader.lines().chunks(9) { | ||
let blocks = blocks.collect_vec(); | ||
let account_pk = blocks[0].as_ref().unwrap().replace(":", ""); | ||
if account_pk == "" { | ||
break; | ||
} | ||
let owner_pk = blocks[2].as_ref().unwrap(); | ||
let ltick = owner_pk.find("'"); | ||
let rtick = owner_pk.rfind("'"); | ||
let owner_pk = &owner_pk[ltick.unwrap() + 1..rtick.unwrap()]; | ||
|
||
let data_len = blocks[6].as_ref().unwrap().replace(" data_len: ", ""); | ||
|
||
println!("{};{};{}", account_pk, owner_pk, data_len); | ||
} | ||
} | ||
|
||
/* | ||
16FMCmgLzCNNz6eTwGanbyN2ZxvTBSLuQ6DZhgeMshg: | ||
balance: 0.00095352 SOL | ||
owner: 'Feature111111111111111111111111111111111111' | ||
executable: false | ||
slot: 0 | ||
rent_epoch: 0 | ||
data_len: 9 | ||
data: 'AQAAAAAAAAAA' | ||
encoding: "base64" | ||
*/ |
Oops, something went wrong.