-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.bat
71 lines (52 loc) · 2.54 KB
/
init.bat
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
rem tabi compile on windows
rem install golang , gcc, sed for windows
rem 1. install msys2 : https://www.msys2.org/
rem 2. pacman -S mingw-w64-x86_64-toolchain
rem pacman -S sed
rem pacman -S mingw-w64-x86_64-jq
rem 3. add path C:\msys64\mingw64\bin
rem C:\msys64\usr\bin
set KEY="dev0"
set CHAINID="tabi_9789-1"
set MONIKER="localtestnet"
set KEYRING="test"
set KEYALGO="eth_secp256k1"
set LOGLEVEL="info"
# to trace evm
#TRACE="--trace"
set TRACE=""
set HOME=%USERPROFILE%\.tabid
echo %HOME%
set ETHCONFIG=%HOME%\config\config.toml
set GENESIS=%HOME%\config\genesis.json
set TMPGENESIS=%HOME%\config\tmp_genesis.json
@echo build binary
go build .\cmd\tabid
@echo clear home folder
del /s /q %HOME%
tabid config keyring-backend %KEYRING%
tabid config chain-id %CHAINID%
tabid keys add %KEY% --keyring-backend %KEYRING% --algo %KEYALGO%
rem Set moniker and chain-id for Tabi (Moniker can be anything, chain-id must be an integer)
tabid init %MONIKER% --chain-id %CHAINID%
rem Change parameter token denominations to atabi
cat %GENESIS% | jq ".app_state[\"staking\"][\"params\"][\"bond_denom\"]=\"atabi\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"crisis\"][\"constant_fee\"][\"denom\"]=\"atabi\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"gov\"][\"deposit_params\"][\"min_deposit\"][0][\"denom\"]=\"atabi\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"mint\"][\"params\"][\"mint_denom\"]=\"atabi\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
rem increase block time (?)
cat %GENESIS% | jq ".consensus_params[\"block\"][\"time_iota_ms\"]=\"30000\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
rem gas limit in genesis
cat %GENESIS% | jq ".consensus_params[\"block\"][\"max_gas\"]=\"10000000\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
rem setup
sed -i "s/create_empty_blocks = true/create_empty_blocks = false/g" %ETHCONFIG%
rem Allocate genesis accounts (cosmos formatted addresses)
tabid add-genesis-account %KEY% 100000000000000000000000000atabi --keyring-backend %KEYRING%
rem Sign genesis transaction
tabid gentx %KEY% 1000000000000000000000atabi --keyring-backend %KEYRING% --chain-id %CHAINID%
rem Collect genesis tx
tabid collect-gentxs
rem Run this to ensure everything worked and that the genesis file is setup correctly
tabid validate-genesis
rem Start the node (remove the --pruning=nothing flag if historical queries are not needed)
tabid start --pruning=nothing %TRACE% --log_level %LOGLEVEL% --minimum-gas-prices=0.0001atabi