-
Notifications
You must be signed in to change notification settings - Fork 4
/
activate
176 lines (150 loc) · 9.79 KB
/
activate
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/env bash
# ###############################################################
# VARS
# ###############################################################
# Set here.
export NCTL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set casper-node root if not already set by CI.
if [ -z "$NCTL_CASPER_HOME" ]; then
NCTL_CASPER_HOME=${NCTL_CASPER_HOME:-$( cd "$( dirname "${NCTL[0]}" )" && pwd )}
export NCTL_CASPER_HOME="$NCTL_CASPER_HOME"/casper-node
fi
# Set casper-client root.
NCTL_CASPER_CLIENT_ROOT=${NCTL_CASPER_CLIENT_ROOT:-$( cd "$( dirname "${NCTL_CASPER_HOME[0]}" )" && pwd )}
export NCTL_CASPER_CLIENT_HOME="$NCTL_CASPER_CLIENT_ROOT"/casper-client-rs
# Set casper-node-launcher root.
NCTL_CASPER_NODE_LAUNCHER_ROOT=${NCTL_CASPER_NODE_LAUNCHER_ROOT:-$( cd "$( dirname "${NCTL_CASPER_HOME[0]}" )" && pwd )}
export NCTL_CASPER_NODE_LAUNCHER_HOME="$NCTL_CASPER_NODE_LAUNCHER_ROOT"/casper-node-launcher
# Set sidecar root.
NCTL_CASPER_SIDECAR_ROOT=${NCTL_CASPER_SIDECAR_ROOT:-$( cd "$( dirname "${NCTL_CASPER_HOME[0]}" )" && pwd )}
export NCTL_CASPER_SIDECAR_HOME="$NCTL_CASPER_SIDECAR_ROOT"/casper-sidecar
# ###############################################################
# UTILS
# ###############################################################
source "$NCTL"/sh/utils/main.sh
# ###############################################################
# ALIASES
# ###############################################################
# Assets.
alias nctl-assets-dump='source $NCTL/sh/assets/dump.sh'
alias nctl-assets-ls='source $NCTL/sh/assets/list.sh'
alias nctl-assets-setup='source $NCTL/sh/assets/setup.sh'
alias nctl-assets-setup-from-stage='source $NCTL/sh/assets/setup_from_stage.sh'
alias nctl-assets-teardown='source $NCTL/sh/assets/teardown.sh'
alias nctl-assets-upgrade-from-stage='source $NCTL/sh/assets/upgrade_from_stage.sh'
# Binaries.
alias nctl-compile='source $NCTL/sh/assets/compile.sh'
alias nctl-compile-client='source $NCTL/sh/assets/compile_client.sh'
alias nctl-compile-node='source $NCTL/sh/assets/compile_node.sh'
alias nctl-compile-node-launcher='source $NCTL/sh/assets/compile_node_launcher.sh'
alias nctl-compile-sidecar='source $NCTL/sh/assets/compile_sidecar.sh'
# Staging.
alias nctl-stage-build='source $NCTL/sh/staging/build.sh'
alias nctl-stage-build-from-settings='source $NCTL/sh/staging/build_from_settings.sh'
alias nctl-stage-init-settings='source $NCTL/sh/staging/init_settings.sh'
alias nctl-stage-set-remote='source $NCTL/sh/staging/set_remote.sh'
alias nctl-stage-set-remotes='source $NCTL/sh/staging/set_remotes.sh'
alias nctl-stage-teardown='source $NCTL/sh/staging/teardown.sh'
# Node control.
alias nctl-clean='source $NCTL/sh/node/clean.sh'
alias nctl-clean-logs='source $NCTL/sh/node/clean_logs.sh'
alias nctl-interactive='source $NCTL/sh/node/interactive.sh'
alias nctl-join='source $NCTL/sh/node/join.sh'
alias nctl-leave='source $NCTL/sh/node/leave.sh'
alias nctl-ports='lsof -i tcp | grep -E "casper-no|casper-si" | grep LISTEN | sort'
alias nctl-processes='ps -aux | grep "$NCTL" | less'
alias nctl-restart='source $NCTL/sh/node/restart.sh'
alias nctl-rotate='source $NCTL/sh/misc/rotate_nodeset.sh'
alias nctl-start='source $NCTL/sh/node/start.sh'
alias nctl-start-after-n-blocks='source $NCTL/sh/node/start_after_n_blocks.sh'
alias nctl-start-after-n-eras='source $NCTL/sh/node/start_after_n_eras.sh'
alias nctl-status='source $NCTL/sh/node/status.sh'
alias nctl-stop='source $NCTL/sh/node/stop.sh'
alias nctl-upgrade-protocol='source $NCTL/sh/node/upgrade.sh'
alias nctl-emergency-upgrade='source $NCTL/sh/node/emergency_upgrade.sh'
# Blocking commands.
alias nctl-await-n-blocks='source $NCTL/sh/misc/await_n_blocks.sh'
alias nctl-await-n-eras='source $NCTL/sh/misc/await_n_eras.sh'
alias nctl-await-until-block-n='source $NCTL/sh/misc/await_until_block_n.sh'
alias nctl-await-until-era-n='source $NCTL/sh/misc/await_until_era_n.sh'
# Views #1: chain.
alias nctl-view-chain-account='source $NCTL/sh/views/view_chain_account.sh'
alias nctl-view-chain-auction-info='source $NCTL/sh/views/view_chain_auction_info.sh'
alias nctl-view-chain-balance='source $NCTL/sh/views/view_chain_balance.sh'
alias nctl-view-chain-balances='source $NCTL/sh/views/view_chain_balances.sh'
alias nctl-view-chain-block='source $NCTL/sh/views/view_chain_block.sh'
alias nctl-view-chain-block-transfers='source $NCTL/sh/views/view_chain_block_transfers.sh'
alias nctl-view-chain-deploy='source $NCTL/sh/views/view_chain_deploy.sh'
alias nctl-view-chain-era='source $NCTL/sh/views/view_chain_era.sh'
alias nctl-view-chain-era-info='source $NCTL/sh/views/view_chain_era_info.sh'
alias nctl-view-chain-height='source $NCTL/sh/views/view_chain_height.sh'
alias nctl-view-chain-state-root-hash='source $NCTL/sh/views/view_chain_state_root_hash.sh'
alias nctl-view-chain-lfb='source $NCTL/sh/views/view_chain_lfb.sh'
alias nctl-view-chain-spec='source $NCTL/sh/views/view_chain_spec.sh'
alias nctl-view-chain-spec-accounts='source $NCTL/sh/views/view_chain_spec_accounts.sh'
# Views #2: node.
alias nctl-view-node-config='source $NCTL/sh/views/view_node_config.sh'
alias nctl-dport='source $NCTL/sh/node/dport.sh'
alias nctl-view-node-error-log='source $NCTL/sh/views/view_node_log_stderr.sh'
alias nctl-view-node-log='source $NCTL/sh/views/view_node_log_stdout.sh'
alias nctl-view-node-peers='source $NCTL/sh/views/view_node_peers.sh'
alias nctl-view-node-peer-count='source $NCTL/sh/views/view_node_peer_count.sh'
alias nctl-view-node-ports='source $NCTL/sh/views/view_node_ports.sh'
alias nctl-view-node-rpc-endpoint='source $NCTL/sh/views/view_node_rpc_endpoint.sh'
alias nctl-view-node-rpc-schema='source $NCTL/sh/views/view_node_rpc_schema.sh'
alias nctl-view-node-status='source $NCTL/sh/views/view_node_status.sh'
alias nctl-view-node-storage='source $NCTL/sh/views/view_node_storage.sh'
# Views #3: node metrics.
alias nctl-view-node-metrics='source $NCTL/sh/views/view_node_metrics.sh'
alias nctl-view-node-pending-deploy-count='source $NCTL/sh/views/view_node_metrics.sh metric=pending_deploy'
alias nctl-view-node-finalised-block-count='source $NCTL/sh/views/view_node_metrics.sh metric=amount_of_blocks'
alias nctl-view-node-finalisation-time='source $NCTL/sh/views/view_node_metrics.sh metric=finalization_time'
# Views #4: faucet.
alias nctl-view-faucet-account='source $NCTL/sh/views/view_faucet_account.sh'
# Views #5: user.
alias nctl-view-user-account='source $NCTL/sh/views/view_user_account.sh'
# Views #6: validator.
alias nctl-view-validator-account='source $NCTL/sh/views/view_validator_account.sh'
# Contracts #1: KV storage.
alias nctl-contracts-hello-world-install='source $NCTL/sh/contracts-hello-world/do_install.sh'
# Contracts #2: Transfers.
alias nctl-transfer='source $NCTL/sh/contracts-transfers/do_dispatch_native.sh'
alias nctl-transfer-native='source $NCTL/sh/contracts-transfers/do_dispatch_native.sh'
alias nctl-transfer-native-batch-dispatch='source $NCTL/sh/contracts-transfers/do_dispatch_native_batch.sh'
alias nctl-transfer-native-batch-prepare='source $NCTL/sh/contracts-transfers/do_prepare_native_batch.sh'
alias nctl-transfer-wasm='source $NCTL/sh/contracts-transfers/do_dispatch_wasm.sh'
alias nctl-transfer-wasm-batch-dispatch='source $NCTL/sh/contracts-transfers/do_dispatch_wasm_batch.sh'
alias nctl-transfer-wasm-batch-prepare='source $NCTL/sh/contracts-transfers/do_prepare_wasm_batch.sh'
# Contracts #3: Auction.
alias nctl-auction-activate='source $NCTL/sh/contracts-auction/do_bid_activate.sh'
alias nctl-auction-bid='source $NCTL/sh/contracts-auction/do_bid.sh'
alias nctl-auction-withdraw='source $NCTL/sh/contracts-auction/do_bid_withdraw.sh'
alias nctl-auction-delegate='source $NCTL/sh/contracts-auction/do_delegate.sh'
alias nctl-auction-undelegate='source $NCTL/sh/contracts-auction/do_delegate_withdraw.sh'
# Contracts #4: ERC-20.
alias nctl-erc20-approve='source $NCTL/sh/contracts-erc20/do_approve.sh'
alias nctl-erc20-install='source $NCTL/sh/contracts-erc20/do_install.sh'
alias nctl-erc20-fund-users='source $NCTL/sh/contracts-erc20/do_fund_users.sh'
alias nctl-erc20-transfer='source $NCTL/sh/contracts-erc20/do_transfer.sh'
alias nctl-erc20-view-allowances='source $NCTL/sh/contracts-erc20/view_allowances.sh'
alias nctl-erc20-view-details='source $NCTL/sh/contracts-erc20/view_details.sh'
alias nctl-erc20-view-balances='source $NCTL/sh/contracts-erc20/view_balances.sh'
# Contracts #5: KV storage.
alias nctl-kv-storage-get-key='source $NCTL/sh/contracts-kv/get_key.sh'
alias nctl-kv-storage-install='source $NCTL/sh/contracts-kv/do_install.sh'
alias nctl-kv-storage-set-key='source $NCTL/sh/contracts-kv/set_key.sh'
# Scenarios #1: Execute protocol upgrade.
alias nctl-exec-upgrade-scenario-1='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_01.sh'
alias nctl-exec-upgrade-scenario-2='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_02.sh'
alias nctl-exec-upgrade-scenario-3='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_03.sh'
alias nctl-exec-upgrade-scenario-4='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_04.sh'
alias nctl-exec-upgrade-scenario-5='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_05.sh'
alias nctl-exec-upgrade-scenario-6='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_06.sh'
alias nctl-exec-upgrade-scenario-7='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_07.sh'
alias nctl-exec-upgrade-scenario-8='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_08.sh'
alias nctl-exec-upgrade-scenario-9='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_09.sh'
alias nctl-exec-upgrade-scenario-10='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_10.sh'
alias nctl-exec-upgrade-scenario-11='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_11.sh'
alias nctl-exec-upgrade-scenario-12='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_12.sh'
alias nctl-exec-upgrade-scenario-13='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_13.sh'
alias nctl-exec-upgrade-scenario-14='source $NCTL/sh/scenarios-upgrades/upgrade_scenario_14.sh'