-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gitopia
136 lines (105 loc) · 5.08 KB
/
Gitopia
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
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
ver="1.18.2"
cd $HOME
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" >> ~/.bash_profile
source ~/.bash_profile
go version
NODENAME="Node_name"
PORT=15
echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
echo "export WALLET=wallet" >> $HOME/.bash_profile
echo "export GCHAIN_ID=gitopia-janus-testnet-2" >> $HOME/.bash_profile
echo "export GPORT=${GPORT}" >> $HOME/.bash_profile
source $HOME/.bash_profile
cd $HOME
curl https://get.gitopia.com | bash
git clone -b v1.2.0 gitopia://gitopia/gitopia
cd gitopia && make install
gitopiad init $NODENAME --chain-id $GCHAIN_ID
gitopiad config chain-id $GCHAIN_ID
gitopiad config keyring-backend test
gitopiad config node tcp://localhost:${GPORT}657
wget https://server.gitopia.com/raw/gitopia/testnets/master/gitopia-janus-testnet-2/genesis.json.gz
gunzip genesis.json.gz
mv genesis.json $HOME/.gitopia/config/genesis.json
wget -qO $HOME/.gitopia/config/addrbook.json "https://raw.githubusercontent.com/sergiomateiko/addrbooks/main/gitopia/addrbook.json"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${GPORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${GPORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${GPORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${GPORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${GPORT}660\"%" $HOME/.gitopia/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${GPORT}317\"%; s%^address = \":8080\"%address = \":${GPORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GPORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${GPORT}091\"%" $HOME/.gitopia/config/app.toml
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.gitopia/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001utlore\"/" $HOME/.gitopia/config/app.toml
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="50"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.gitopia/config/app.toml
seeds=""
peers="[email protected]:60756,[email protected]:11356"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.gitopia/config/config.toml
gitopiad tendermint unsafe-reset-all
sudo tee /etc/systemd/system/gitopiad.service > /dev/null <<EOF
[Unit]
Description=gitopiaNode
After=network-online.target
[Service]
User=$USER
ExecStart=$(which gitopiad) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && sudo systemctl enable gitopiad && sudo systemctl restart gitopiad
sudo journalctl -u gitopiad -f -o cat
gitopiad keys add $WALLET
GADDRESS=$(gitopiad keys show $WALLET -a)
echo 'export EADDRESS='${GADDRESS} >> $HOME/.bash_profile
gitopiad query bank balances $GADDRESS
GVALOPER=$(gitopiad keys show $WALLET --bech val -a)
echo 'export EVALOPER='${GVALOPER} >> $HOME/.bash_profile
source $HOME/.bash_profile
gitopiad tx staking create-validator \
--amount=1000000utlore \
--pubkey=$(gitopiad tendermint show-validator) \
--moniker=$NODENAME \
--chain-id=$GCHAIN_ID \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas="auto" \
--gas-prices="0.002utlore" \
--gas-adjustment="1.3" \
--from=$WALLET
gitopiad tx staking edit-validator \
--from=$WALLET \
--website="https://t.me/cryptorussianbears" \
--identity="2D5D009F1C1AAD3A" \
--details="Early adopter cryptoenthusiast" \
--chain-id=$GCHAIN_ID \
--fees=300utlore \
--gas-adjustment="1"
Sync
gitopiad status 2>&1 | jq .SyncInfo
SynkAddrBook
sudo systemctl stop gitopiad
gitopiad tendermint unsafe-reset-all
wget -qO $HOME/.gitopia/config/addrbook.json "http://65.108.6.45:8000/gitopia/addrbook.json"
Selfstake
gitopiad tx staking delegate $(gitopiad keys show wallet --bech val -a) 1000000utlore --from wallet --chain-id gitopia-janus-testnet-2 --gas-prices 0.1utlore --gas-adjustment 1.5 --gas auto -y
gitopiad tx slashing unjail --from $WALLET --chain-id $GCHAIN_ID
Delite:
sudo systemctl stop gitopiad && sudo systemctl disable gitopiad
sudo rm -rf /etc/systemd/system/gitopiad
sudo rm -rf /usr/local/bin/gitopiad
sudo rm -rf $HOME/.gitopia
sudo rm -rf $HOME/gitopia