|
5 | 5 | <title>Debugger for NEAR Protocol Contracts</title>
|
6 | 6 | <meta name="description" content="A web-based tool for debugging contracts written for NEAR Protocol">
|
7 | 7 | <script async type="module" src="./loader.js"></script>
|
| 8 | + <link rel="stylesheet" type="text/css" href="./neardebug.css"> |
8 | 9 | </head>
|
9 | 10 | <body>
|
10 |
| - <h2><center> |
| 11 | + <header> |
| 12 | + <h2> |
11 | 13 | A basic debugger for NEAR Contracts (prototype ver.)
|
12 |
| - </center></h2> |
13 |
| - <form id="contract_form"> |
| 14 | + </h2> |
| 15 | + |
| 16 | + <p> |
| 17 | + Here you can execute and debug in your browser contracts meant to run on the NEAR protocol. |
| 18 | + Use the browser built-in developer tools (often available via <kbd>Ctrl</kbd>/<kbd>Cmd</kbd> |
| 19 | + <kbd>Shift</kbd><kbd>I</kbd>): log messages and errors will show up in the console and you |
| 20 | + can use the debugger to step through the contract code. |
| 21 | + </p> |
| 22 | + |
| 23 | + <p> |
| 24 | + The debugging experience will differ between browsers. For instance Chromium supports DWARF |
| 25 | + debug info. Contracts built from Rust source will embed such debug info into the |
| 26 | + <code>.wasm</code> file, for example, so long as debug info is enabled. This would then allow |
| 27 | + debugging Rust code and not the underlying WebAssembly! |
| 28 | + </p> |
| 29 | + |
| 30 | + <p> |
| 31 | + <code>window.contract</code> in the console will allow you to explore some specifics of the |
| 32 | + contract runtime throughout the execution of the contract. |
| 33 | + </p> |
| 34 | + </header> |
14 | 35 |
|
15 |
| - <label for="contract">Contract WASM: <input type="file" id="contract" /></label> |
16 |
| - <label for="methods">Method <select id="methods"></select></label> |
17 | 36 |
|
18 |
| - <div> |
19 |
| - <input type="submit" id="execute" value="Execute!" /> |
20 |
| - </div> |
| 37 | + <form id="contract_form"> |
| 38 | + |
| 39 | + <label for="contract">Contract WASM </label> |
| 40 | + <input type="file" name="contract" id="contract" /> |
| 41 | + <label for="methods">Method </label> |
| 42 | + <select id="methods" name="method"></select> |
| 43 | + <input type="submit" id="execute" value="Execute!" disabled /> |
21 | 44 |
|
22 | 45 | <h3>Context</h3>
|
23 | 46 |
|
24 |
| - <label for="attached_deposit"> Attached Deposit (u128): <input type="text" id="attached_deposit" placeholder="0" /></label> |
25 |
| - <label for="input"> Input (bytes): <textarea id="input" placeholder="">{}</textarea></label> |
| 47 | + <label for="attached_deposit"> Attached Deposit (u128)</label> |
| 48 | + <input type="text" name="attached_deposit" id="attached_deposit" placeholder="0" /> |
| 49 | + <label for="input"> Input (bytes)</label> |
| 50 | + <textarea id="input" name="input" placeholder="">{}</textarea> |
26 | 51 |
|
27 | 52 | <h3>State</h3>
|
28 | 53 |
|
29 |
| - <button id="storage_button" action="none">Log Storage to Console (window.contractStorage)</button> |
30 |
| - |
31 | 54 | </form>
|
32 |
| - |
33 | 55 | </body>
|
34 | 56 | </html>
|
0 commit comments