@@ -96,6 +96,26 @@ run_web3_send() {
96
96
| netcat 127.0.0.1 " $web3_port " -q 0
97
97
}
98
98
99
+ run_web3_ganache () {
100
+ local web3_port
101
+ web3_port=" $1 " ; shift
102
+
103
+ notif ' Launching web3 client'
104
+ $0 web3 " $web3_port " " $@ " &
105
+ while ! netcat -z 127.0.0.1 " $web3_port " ; do sleep 0.1; done
106
+ notif ' Generating accounts'
107
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0xdc7e9a7c64933ab893160b79d099c254d274e1c40c6df6d5239e1a623e3d6de1", "balance":"0x56BC75E2D63100000"' }
108
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x6e2687f9732d970c6b1d5baa3dff26c4af36257552bc17df737afbc00ca70de2", "balance":"0x56BC75E2D63100000"' }
109
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0xd34d8e873da77217abaef9424a7d87fce351b603920c7f5288d7701c5f148860", "balance":"0x56BC75E2D63100000"' }
110
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x976b5ec9253759d4a2746c37597841beba57527123dc3db2165b637adce58bcb", "balance":"0x56BC75E2D63100000"' }
111
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x23dff7ac7981167eb5386e51c3d6d2e3ca9dc219315749b2058d0a2d1e21625e", "balance":"0x56BC75E2D63100000"' }
112
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0xe040e4bf96d8c9d3a8d1ffb22b30ed4b0a79a25342d656c5a8e2784b0fab752f", "balance":"0x56BC75E2D63100000"' }
113
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x13abddd7d94165fc46bed2cad6b0b14cd0267a85f70ad5c26cce82c609e0bf87", "balance":"0x56BC75E2D63100000"' }
114
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x0e29f7d6984bb47d60db479212ca56af516705b07d8753b474bd7f0db8bc1921", "balance":"0x56BC75E2D63100000"' }
115
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0xea7fe1480e9ab71c261c5e1e727f36482f84dbdb07dbf8c8e9f767dcecf87568", "balance":"0x56BC75E2D63100000"' }
116
+ $0 web3-send " $web3_port " firefly_addAccount {' "key":"0x5f9addbbf41ae2e3d6cb7b07ffabf2c5ff6edc3a38c9dd64a9afd23df02ad7ee", "balance":"0x56BC75E2D63100000"' }
117
+ }
118
+
99
119
run_klab () {
100
120
local run_mode klab_log
101
121
@@ -167,16 +187,17 @@ run_command="$1" ; shift
167
187
168
188
if [[ " $run_command " == ' help' ]]; then
169
189
echo "
170
- usage: $0 run [--backend (ocaml|java|llvm|haskell)] <pgm> <K arg>*
171
- $0 interpret [--backend (ocaml|llvm)] [--debug] <pgm> <interpreter arg>*
172
- $0 kast [--backend (ocaml|java|llvm|haskell|web3)] <pgm> <output format> <K arg>*
173
- $0 prove [--backend (java|haskell)] <spec> <K arg>* -m <def_module>
174
- $0 search [--backend (java|haskell)] <pgm> <pattern> <K arg>*
175
- $0 web3 [--debug|--dump] <port>
176
- $0 web3-send <port> <web3 method> <web3 params>
177
- $0 klab-run <pgm> <K arg>*
178
- $0 klab-prove <spec> <K arg>* -m <def_module>
179
- $0 klab-view <spec>
190
+ usage: $0 run [--backend (ocaml|java|llvm|haskell)] <pgm> <K arg>*
191
+ $0 interpret [--backend (ocaml|llvm)] [--debug] <pgm> <interpreter arg>*
192
+ $0 kast [--backend (ocaml|java|llvm|haskell|web3)] <pgm> <output format> <K arg>*
193
+ $0 prove [--backend (java|haskell)] <spec> <K arg>* -m <def_module>
194
+ $0 search [--backend (java|haskell)] <pgm> <pattern> <K arg>*
195
+ $0 web3 [--debug|--dump] <port>
196
+ $0 web3-ganache [--debug|--dump] <port>
197
+ $0 web3-send <port> <web3 method> <web3 params>
198
+ $0 klab-run <pgm> <K arg>*
199
+ $0 klab-prove <spec> <K arg>* -m <def_module>
200
+ $0 klab-view <spec>
180
201
181
202
$0 run : Run a single EVM program
182
203
$0 interpret : Run JSON EVM programs without K Frontend (external parser)
@@ -185,6 +206,7 @@ if [[ "$run_command" == 'help' ]]; then
185
206
$0 search : Search for a K pattern in an EVM program execution
186
207
$0 web3 : Run version of semantics which understand Web3 RPC (**UNDER CONSTRUCTION**)
187
208
$0 web3-send : Send message to running Web3 instance of KEVM (**UNDER CONSTRUCTION**)
209
+ $0 web3-ganache : Run version of semantics which understand Web3 RPC and is able to communicate with Truffle Test Framework (**UNDER CONSTRUCTION**)
188
210
$0 klab-(run|prove) : Run program or prove spec and dump StateLogs which KLab can read
189
211
$0 klab-view : View the statelog associated with a given program or spec
190
212
@@ -257,6 +279,7 @@ case "$run_command-$backend" in
257
279
search-@ (java| haskell) ) run_search " $@ " ;;
258
280
web3-@ (llvm) ) run_web3 " $@ " ;;
259
281
web3-send-@ (llvm) ) run_web3_send " $@ " ;;
282
+ web3-ganache-@ (llvm) ) run_web3_ganache " $@ " ;;
260
283
klab-@ (run| prove)-java ) run_klab " ${run_command# klab-} " " $@ " ;;
261
284
klab-view-java ) view_klab " $@ " ;;
262
285
* ) $0 help ; fatal " Unknown command on backend: $run_command $backend " ;;
0 commit comments