-
Notifications
You must be signed in to change notification settings - Fork 12
/
devshell.toml
134 lines (113 loc) · 3.16 KB
/
devshell.toml
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
# https://numtide.github.io/devshell
# Faucet Contract
[[commands]]
name = "faucet-deploy"
category = "01 faucet contract"
command = """
cd $(git rev-parse --show-toplevel)/01-faucet-contract
echo "./01-faucet-contract/run-deploy-contract.js"
./run-deploy-contract.js
"""
help = "Deploy the faucet contract to devnet"
[[commands]]
name = "faucet-request"
category = "01 faucet contract"
command = """
cd $(git rev-parse --show-toplevel)/01-faucet-contract
./run-request.js $@
"""
help = "Use a request file to send a request to the faucet contract on devnet"
# Goliath Wallet
[[commands]]
name = "goliath-start"
category = "02 goliath wallet"
command = """
cd $(git rev-parse --show-toplevel)/02-goliath-wallet
pnpm install
pnpm run dev
"""
help = "Start the Goliath wallet frontend (Ctrl+C to stop)"
# Charkha Lending Protocol
[[commands]]
name = "charkha-start"
category = "03 charkha lending"
command = """
cd $(git rev-parse --show-toplevel)/03-charkha-lending/frontend
pnpm install
pnpm run dev
"""
help = "Start the Charkha lending dapp (Ctrl+C to stop)"
# Devnet
[[commands]]
name = "devnet-start"
category = "devnet"
command = """
cd $(git rev-parse --show-toplevel)/devnet
echo "Starting devnet (takes about 60 seconds...)"
git submodule update --init
docker compose pull
if [ ! -d "db" ]; then
echo "db directory does not exist, creating one from snapshot."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cp -r ../devnet-backup/db-linux db
elif [[ "$OSTYPE" == "darwin"* ]]; then
cp -r ../devnet-backup/db-macos db
else
echo "unknown operating system (only linux and macos supported)"
fi
fi
docker compose -f docker-compose.minimal.yaml up --detach --remove-orphans
"""
help = "Start the devnet blockchain simulator"
[[commands]]
name = "devnet-clean"
category = "devnet"
command = """
cd $(git rev-parse --show-toplevel)/devnet
docker compose -f docker-compose.minimal.yaml down
if [ -d "db" ]; then
echo "Replacing db directory with snapshot."
sudo rm -rf db
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cp -r ../devnet-backup/db-linux db
elif [[ "$OSTYPE" == "darwin"* ]]; then
cp -r ../devnet-backup/db-macos db
else
echo "unknown operating system (only linux and macos supported)"
fi
fi
"""
help = "Stop the devnet blockchain simulator and reset the database."
[[commands]]
name = "devnet-stop"
category = "devnet"
command = """
cd $(git rev-parse --show-toplevel)/devnet
docker compose -f docker-compose.minimal.yaml down
"""
help = "Stop the devnet blockchain simulator"
# Tools
[[commands]]
package = "nodejs-16_x"
category = "tools"
name = "node"
help = "The Node runtime and NPM package manager"
[[commands]]
package = "pact"
category = "tools"
name = "pact"
help = "The Pact programming language"
[[commands]]
package = "nodePackages.pnpm"
category = "tools"
name = "pnpm"
help = "The performant node package manager"
[[commands]]
package = "z3"
category = "tools"
name = "z3"
help = "The Z3 theorem prover"
# Shell
[devshell]
name = "real-world-pact"
motd = "{202}🔨 Welcome to the Real World Pact developer shell!{reset}\n$(type -p menu &>/dev/null && menu)\n"