-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump-storage.sh
49 lines (35 loc) · 2.42 KB
/
dump-storage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
STORAGE=~/github/phantasma/phantasma-storage-data
OUT=../output/
json_format () {
jq . $1 > $1_f
mv $1_f $1
}
sh build-rocksdb-storage-reader.sh
mkdir -p output
cd ./bin
# Getting all addresses and names
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-addresses --output-format=csv --output=$OUT/addresses.csv
# Getting all token symbols (both fungible and non-fungible)
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-token-symbols --output-format=csv --output=$OUT/tokens_list.csv
# Getting staking data using addresses.csv
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-staking-claims --subkeys-csv=$OUT/addresses.csv --output-format=json --output=$OUT/staking_claims.json
json_format $OUT/staking_claims.json
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-stakes --subkeys-csv=$OUT/addresses.csv --output-format=json --output=$OUT/stakes.json
json_format $OUT/stakes.json
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-staking-master-age --subkeys-csv=$OUT/addresses.csv --output-format=json --output=$OUT/staking_master_age.json
json_format $OUT/staking_master_age.json
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-staking-master-claims --subkeys-csv=$OUT/addresses.csv --output-format=json --output=$OUT/staking_master_claims.json
json_format $OUT/staking_master_claims.json
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-staking-leftovers --subkeys-csv=$OUT/addresses.csv --output-format=json --output=$OUT/staking_leftovers.json
json_format $OUT/staking_leftovers.json
# Getting non-fungible token balances using tokens_list.csv
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-balances-nft --subkeys-csv=$OUT/tokens_list.csv --output-format=json --output=$OUT/nft_balances.json
json_format $OUT/nft_balances.json
# Getting fungible token balances using tokens_list.csv
./rocksdb-storage-reader -p $STORAGE -f=chain.main --dump-balances --subkeys-csv=$OUT/tokens_list.csv --output-format=json --output=$OUT/fungible_balances.json
json_format $OUT/fungible_balances.json
# NFTs data
./rocksdb-storage-reader -p $STORAGE -d -f=chain.main --dump-nfts --nft-balances-json=$OUT/nft_balances.json --output-format=json --output=$OUT/nft_datas.json
json_format $OUT/nft_datas.json
./rocksdb-storage-reader -p $STORAGE -d -f=chain.main --dump-series --nft-balances-json=$OUT/nft_balances.json --output-format=json --output=$OUT/nft_series.json
json_format $OUT/nft_series.json