Skip to content

Commit 9aaa033

Browse files
committed
Gather genesis tools infra
1 parent ad9def7 commit 9aaa033

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
NETWORK=$1
3+
AGGREGATOR_NODE=$2
4+
POOL_ID=$3
5+
POOL_STAKES=$4
6+
7+
exec_sql_aggregator() {
8+
sqlite3 data/$1/$2/mithril/stores/aggregator.sqlite3 "$3"
9+
}
10+
11+
fix_stake_distribution_aggregator() {
12+
LAST_EPOCH=$(exec_sql_aggregator $1 $2 "SELECT MAX(key) FROM stake;")
13+
14+
exec_sql_aggregator $1 $2 "UPDATE stake SET value = json_insert(json(value), '$.${POOL_ID}', ${POOL_STAKES}) WHERE key = '$LAST_EPOCH';"
15+
exec_sql_aggregator $1 $2 "SELECT * FROM stake WHERE key = $LAST_EPOCH;"
16+
}
17+
18+
fix_stake_distribution_aggregator $NETWORK $AGGREGATOR_NODE $POOL_ID $POOL_STAKES
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
NETWORK=$1
3+
SIGNER_NODE=$2
4+
POOL_ID=$3
5+
POOL_STAKES=$4
6+
7+
exec_sql_signer() {
8+
sqlite3 data/$1/$2/mithril/stores/signer.sqlite3 "$3"
9+
}
10+
11+
fix_stake_distribution_signer() {
12+
LAST_EPOCH=$(exec_sql_aggregator $1 $2 "SELECT MAX(key) FROM stake;")
13+
14+
exec_sql_signer $1 $2 "UPDATE stake SET value = json_insert(json(value), '$.${POOL_ID}', ${POOL_STAKES}) WHERE key = '$LAST_EPOCH';"
15+
exec_sql_signer $1 $2 "SELECT * FROM stake WHERE key = $LAST_EPOCH;"
16+
}
17+
18+
fix_stake_distribution_signer $NETWORK $SIGNER_NODE $POOL_ID $POOL_STAKES
19+

0 commit comments

Comments
 (0)