-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeFund
More file actions
158 lines (116 loc) · 8.74 KB
/
DeFund
File metadata and controls
158 lines (116 loc) · 8.74 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
wget -q -O defund.sh https://api.nodes.guru/defund.sh && chmod +x defund.sh && sudo /bin/bash defund.sh
source $HOME/.bash_profile
defundd keys add wallet
Faucet = https://bitszn.com/faucets.html
defundd q bank balances YOUR_WALLET_ADDRESS
Create validator:
defundd tx staking create-validator \
--amount=1000000ufetf \
--pubkey=$(defundd tendermint show-validator) \
--moniker="$DEFUND_NODENAME" \
--chain-id=defund-private-1 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas="auto" \
--from=wallet
journalctl -u defund -f
systemctl restart defund
curl localhost:26657/status
curl -s localhost:26657/status | jq .result.sync_info.catching_up
defundd keys show wallet --bech val -a
defundd tx staking delegate YOUR_VALOPER_ADDRESS 10000000ufetf --from wallet --chain-id defund-private-1 --fees 1000ufetf
defundd query staking validators --limit 2000 -o json | jq -r '.validators[] | select(.status=="BOND_STATUS_BONDED") | [.operator_address, .status, (.tokens|tonumber / pow(10; 6)), .description.moniker] | @csv' | column -t -s"," | sort -k3 -n -r
defundd query staking validators --limit 2000 -o json | jq -r '.validators[] | select(.status=="BOND_STATUS_UNBONDED") | [.operator_address, .status, (.tokens|tonumber / pow(10; 6)), .description.moniker] | @csv' | column -t -s"," | sort -k3 -n -r
Testnet сontinues
The user interface is available for testing. You can go to http://defund.app/ and take part in a closed testnet. Detailed instructions will be posted soon, and a Bugs and Wishes section will be added to Discord
Node 1 is slow...
Update snapshot:
systemctl stop defund
cd ~/.defund/
cp data/priv_validator_state.json .
mv data data_old
wget http://repository.activenodes.io/snapshots/defund-private-1_2022-06-13.tar.gz
tar xzvf defund*.tar.gz
rm defund*.tar.gz
mv priv_validator_state.json data/
systemctl start defund && journalctl -u defund.service -f -o cat
Remove old snapshot:
cd ~/.defund/
rm -rf data_old
Testnet2
sudo apt update && sudo apt upgrade -y
sudo apt install make clang pkg-config libssl-dev build-essential git gcc chrony curl jq ncdu bsdmainutils htop net-tools lsof fail2ban wget -y
ver="1.19.1" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
git clone https://github.com/defund-labs/defund
cd defund
git checkout v0.1.0-alpha
make install
cd $HOME
DEFUND_MONIKER="your_name"
DEFUND_CHAIN="defund-private-2"
DEFUND_WALLET="your_name"
echo 'export DEFUND_MONIKER='${DEFUND_MONIKER} >> $HOME/.bash_profile
echo 'export DEFUND_CHAIN='${DEFUND_CHAIN} >> $HOME/.bash_profile
echo 'export DEFUND_WALLET='${DEFUND_WALLET} >> $HOME/.bash_profile
source $HOME/.bash_profile
defundd init $DEFUND_MONIKER --chain-id $DEFUND_CHAIN
defundd keys add $DEFUND_WALLET
Recover
defundd keys add $DEFUND_WALLET --recover
DEFUND_ADDR=$(defundd keys show $DEFUND_WALLET -a)
echo 'export DEFUND_ADDR='${DEFUND_ADDR} >> $HOME/.bash_profile
source $HOME/.bash_profile
defundd add-genesis-account $DEFUND_ADDR 100000000ufetf
defundd gentx $DEFUND_WALLET 90000000ufetf \
--chain-id defund-private-2 \
--moniker=$DEFUND_MONIKER \
--commission-max-change-rate=0.01 \
--commission-max-rate=0.20 \
--commission-rate=0.05
napshot
height: 4,232,328 (5 hours ago); size: 95GB; pruning: custom/100/0/10; indexer: null
# install dependencies, if needed
sudo apt update
sudo apt install lz4 -y
sudo systemctl stop defundd
cp $HOME/.defund/data/priv_validator_state.json $HOME/.defund/priv_validator_state.json.backup
defundd tendermint unsafe-reset-all --home $HOME/.defund --keep-addr-book
rm -rf $HOME/.defund/data
SNAP_NAME=$(curl -s https://snapshots3-testnet.nodejumper.io/defund-testnet/ | egrep -o ">defund-private-3.*\.tar.lz4" | tr -d ">")
curl https://snapshots3-testnet.nodejumper.io/defund-testnet/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.defund
mv $HOME/.defund/priv_validator_state.json.backup $HOME/.defund/data/priv_validator_state.json
sudo systemctl restart defundd
sudo journalctl -u defundd -f --no-hostname -o cat
State Sync
sudo systemctl stop defundd
cp $HOME/.defund/data/priv_validator_state.json $HOME/.defund/priv_validator_state.json.backup
defundd tendermint unsafe-reset-all --home $HOME/.defund --keep-addr-book
SNAP_RPC="https://defund-testnet.nodejumper.io:443"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
peers="6366ac3af3995ecbc48c13ce9564aef0c7a6d7df@defund-testnet.nodejumper.io:28656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.defund/config/config.toml
sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.defund/config/config.toml
mv $HOME/.defund/priv_validator_state.json.backup $HOME/.defund/data/priv_validator_state.json
sudo systemctl restart defundd
sudo journalctl -u defundd -f --no-hostname -o cat
Live Peers
number of active peers: 50
6366ac3af3995ecbc48c13ce9564aef0c7a6d7df@defund-testnet.nodejumper.io:28656,[email protected]:33656,[email protected]:29656,[email protected]:45656,[email protected]:26656,[email protected]:36656,[email protected]:46656,[email protected]:40656,[email protected]:40656,[email protected]:26656,[email protected]:26656,[email protected]:26666,[email protected]:48656,[email protected]:26656,[email protected]:46656,[email protected]:28656,[email protected]:40656,[email protected]:40656,[email protected]:26656,[email protected]:40656,[email protected]:40656,[email protected]:36656,[email protected]:26656,[email protected]:40656,[email protected]:16656,[email protected]:26656,[email protected]:31656,[email protected]:60856,[email protected]:29656,[email protected]:34656,[email protected]:27656,[email protected]:26656,[email protected]:26656,[email protected]:46656,[email protected]:26656,[email protected]:26656,[email protected]:27656,[email protected]:40656,[email protected]:26656,[email protected]:40656,[email protected]:26656,[email protected]:28656,[email protected]:26656,[email protected]:26656,[email protected]:24666,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:40656,[email protected]:26656
peers="6366ac3af3995ecbc48c13ce9564aef0c7a6d7df@defund-testnet.nodejumper.io:28656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.defund/config/config.toml
curl -s https://snapshots3-testnet.nodejumper.io/defund-testnet/addrbook.json > $HOME/.defund/config/addrbook.js