This repository has been archived by the owner on Sep 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal.init.sh
executable file
·84 lines (66 loc) · 3.39 KB
/
local.init.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
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
#!/bin/sh
# set variables for the chain
VALIDATOR_NAME=validator1
CHAIN_ID=eywa-contract
KEY_NAME=eywa-contract-key
CHAINFLAG="--chain-id ${CHAIN_ID}"
TOKEN_AMOUNT="10000000000000000000000000stake"
STAKING_AMOUNT="1000000000stake"
# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
# query the DA Layer start height, in this case we are querying
# our local devnet at port 26657, the RPC. The RPC endpoint is
# to allow users to interact with Celestia's nodes by querying
# the node's state and broadcasting transactions on the Celestia
# network. The default port is 26657.
DA_BLOCK_HEIGHT=$(curl http://0.0.0.0:26657/block | jq -r '.result.block.header.height')
export AUTH_TOKEN=$(docker exec $(docker ps -q) celestia bridge --node.store /bridge auth admin)
# rollkit logo
cat <<'EOF'
:=+++=.
-++- .-++:
.=+=. :++-.
-++- .=+=: .
.=+=: -%@@@*
+%- .=#@@@@@@*
-++- -*%@@@@@@%+:
.=*=. .=#@@@@@@@%=.
-++-.-++: =*#@@@@@%+:.-++-=-
.=+=. :=+=.-: @@#=. .-*@@@@%
=*=: .-==+- :+#@@@@@@%-
:++- -*@@@@@@@#=:
=%+=. .=#@@@@@@@#%:
-++: -++- *+=@@@@%+: =#*##-
=*=. :=+=---@*=. .=*@@@@@%
.-+=: :-: :+%@@@@@@%+.
:=+- -*@@@@@@@#=.
.=+=: .=#@@@@@@%*-
-++- *=.@@@#+:
.====+*-.
______ _ _ _ _ _
| ___ \ | || || | (_)| |
| |_/ / ___ | || || | __ _ | |_
| / / _ \ | || || |/ /| || __|
| |\ \ | (_) || || || < | || |_
\_| \_| \___/ |_||_||_|\_\|_| \__|
EOF
# echo variables for the chain
echo -e "\n\n\n\n\n Your NAMESPACE_ID is $NAMESPACE_ID \n\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n\n\n\n\n"
# build the gm chain with Rollkit
ignite chain build
# reset any existing genesis/chain data
eywa-contractd tendermint unsafe-reset-all
# initialize the validator with the chain ID you set
eywa-contractd init $VALIDATOR_NAME --chain-id $CHAIN_ID
# add keys for key 1 and key 2 to keyring-backend test
eywa-contractd keys add $KEY_NAME --keyring-backend test
# add these as genesis accounts
eywa-contractd add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test
# set the staking amounts in the genesis transaction
eywa-contractd gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test
# collect genesis transactions
eywa-contractd collect-gentxs
# start the chain
eywa-contractd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
# uncomment the next command if you are using lazy aggregation
# gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rollkit.lazy_aggregator