-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup_neurons_fund.sh
executable file
·34 lines (23 loc) · 1.06 KB
/
setup_neurons_fund.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
#!/usr/bin/env bash
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
. ./constants.sh normal
set -x
export CURRENT_DX_IDENT=$(${DFX} identity whoami)
for NF_NEURON_IDENTITY in "${HOME}/.config/dfx/identity/"nns-nf-neuron*; do
${DFX} identity use "${NF_NEURON_IDENTITY}"
NEURON_ID="$(${DFX} canister --network "${NETWORK}" call nns-governance get_neuron_ids "()" | sed 's/(vec { //' | sed 's/ .*//')"
echo "Setting up Neurons' Fund neuron ${NEURON_ID} ..."
PEM_FILE="$(readlink -f "${NF_NEURON_IDENTITY}/identity.pem")"
quill \
--insecure-local-dev-mode \
--pem-file "$PEM_FILE" \
neuron-manage \
--join-community-fund "$NEURON_ID" \
> msg.json
quill --insecure-local-dev-mode send msg.json --yes
JNF=$(${DFX} canister --network "${NETWORK}" call nns-governance get_full_neuron "(${NEURON_ID})" | grep joined_community_fund_timestamp_seconds)
[[ "$JNF" == *"nat64"* ]] || { echo "One of the initial Neurons did not join the NF"; exit 1; }
done
# Switch back to the previous identity
${DFX} identity use "$CURRENT_DX_IDENT"