npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

avm-debug-adapter

v0.3.0

Published

Algorand AVM transaction and smart contract debugger using the Debugger Adapter Protocol

Downloads

122

Readme

AVM Debugger

GitHub Actions Workflow npm version

Summary

This repo contains an AVM debugger which adheres to the Debug Adapter Protocol. This protocol is used by a variety of clients, and this repo additionally implements a basic client for VS Code.

Unlike traditional debuggers, which typically execute code as it is being debugged, this debugger operates on an execution trace. The trace is created by the algod simulate API. This debugger is not responsible for compiling programs, assembling transaction groups, or executing transactions/programs. It is only responsible for replaying the execution trace, which must already exist.

This code is based on the vscode-mock-debug repo.

Usage

There are multiple ways to invoke the debug adapter exported by this package.

CLI

The debug adapter can be invoked from the command line using the avm-debug-adapter command.

If given no arguments, the debug adapter will use stdin and stdout to process messages.

To run as a server, use the --port option, shown below:

$ npm exec avm-debug-adapter -- --port=8080
>> running as a server, listening on 8080

Programmatically

// AvmDebugSession is a vscode.DebugAdapter implementation and can be imported
// directly if you don't want to run it as a server.
import { AvmDebugSession } from 'avm-debug-adapter';

// From node, you can create a debug adapter server like so
import { Server, nodeFileAccessor } from 'avm-debug-adapter/node';

const server = new Server({
  fileAccessor: nodeFileAccessor,
  port: 8080,
  onSocketError: (err) => {
    console.error(err);
  },
  onServerError: (err) => {
    console.error(err);
  },
});

console.log('Server listening on port ' + server.port());

process.on('SIGTERM', () => {
  server.close();
});

Features

See FEATURES.md for a list of features this debugger supports.

Build and Run

  1. Clone the repo.
  2. npm i to install dependencies.
  3. Open the project folder in VS Code.
  4. From the Run and Debug menu, run the Extension configuration to open the AVM Debug extension in another VS Code window.
  5. In the new window, go to its Run and Debug menu to select and launch one of the existing configurations.
  6. You are now in a debugging session of a transaction group. You can step through the transaction group, inspect variables, set breakpoints and more. See FEATURES.md for more details.