-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathactivate_savanna.sh
executable file
·35 lines (29 loc) · 1.3 KB
/
activate_savanna.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
#!/usr/bin/env bash
####
# Once private network is setup and running with legacy consensus algo
# we can switch over to new finality method
# For each producers we will register new BLS keys
# and `switchtosvnn` will activate Savanna Algorithm
####
ENDPOINT=$1
# First array starts from the second argument to the 22st argument
PUBLIC_KEY=("${@:2:4}")
# Second array starts from the 23rd argument to the 43rd argument
PROOF_POSSESION=("${@:5:7}")
# unwindw our producer finalizer keys and make activating call
# New System Contracts Replace with actions regfinkey, and switchtosvnn
# regfinkey [producer name] [public key] [proof of possession]
counter=0
for producer_name in bpa bpb bpc
do
# Execute the cleos command error if vars not set
# void system_contract::regfinkey( const name& finalizer_name, const std::string& finalizer_key, const std::string& proof_of_possession)
cleos --url $ENDPOINT push action eosio regfinkey "{\"finalizer_name\":\"${producer_name:?}\", \
\"finalizer_key\":\"${PUBLIC_KEY[$counter]:?}\", \
\"proof_of_possession\":\"${PROOF_POSSESION[$counter]:?}\"}" -p ${producer_name:?}
let counter+=1
done
sleep 1
# switchtosvnn
# void system_contract::switchtosvnn()
cleos --url $ENDPOINT push action eosio switchtosvnn '{}' -p eosio