# evm-breakpoints

> Human-friendly interface for Ethereum VM breakpoints - debugging helper

Latest version **0.0.1** (published 2017-11-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install evm-breakpoints
pnpm add evm-breakpoints
yarn add evm-breakpoints
bun add evm-breakpoints
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-11-22 |
| First published | 2017-11-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Viktor Lopata |
| Maintainers | webcerebrium |
| Keywords | solidity, debugging, debug, breakpoints, ethereum, smart-contracts, blockchain |

## Links

- npm: https://www.npmjs.com/package/evm-breakpoints
- Repository: https://github.com/webcerebrium/evm-breakpoints
- Homepage: https://github.com/webcerebrium/evm-breakpoints#readme
- Issues: https://github.com/webcerebrium/evm-breakpoints/issues
- npm.io page: https://npm.io/package/evm-breakpoints

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-11-22

## README

# evm-breakpoints
Human-friendly interface for Ethereum VM breakpoints - debugging helper.

## Example of library usage in tests:

```javascript
const evm = reuqire('evm-breakpoints');

const logger = evm.breakpoint().add({
  contractFile: "./build/contracts/Simple.json", // we should take full compilation info from the given file
  lines: [21] // multiple lines can be specified as breakpoints
});

const debug = evm.iterator(web3, txHash, logger);
while (!debug.stopped()) {
  console.log(debug.get());
  debug.next();
}
```
please see `examples/truffle` for a full example of debugging local variables.


## Example of library usage in web:

In web environment, you need to compile the contract, and then provide iterator source map from compiled version

```javascript
var evm = window.evmBreakpoints;
evm
  .contract({ source: contractSoure, compiler: "latest"  })
  .on('ready', function(compiled) {
     var json = compiled.contracts[contractName];
     var logger = evm.breakpoint().add({ source, sourceMap: json.srcmapRuntime, lines: [21] });
     var debug = evm.iterator(web3, txHash, logger);
     while (!debug.stopped()) {
       console.log(debug.get());
       debug.next();
     }
  })
  .on('error', console.error);
```
please see `examples/web/index.html` for a full example of debugging local variables.

## Disclaimer

Work of the library is based on experimental `web3.debug.traceTransaction`, so please keep following the updates

- HTTP RPC "debug" api must be enabled
https://github.com/ethereum/go-ethereum/wiki/Management-APIs#debug_tracetransaction

- If you are receiving `Error: missing trie node`,
in order to use trace api of geth you have to synchronize your node with `--syncmode full`

## License
MIT. Anyone can copy, change, derive further work from this repository without any restrictions.

---
_Source: https://npm.io/package/evm-breakpoints · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
