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

@btc-vision/op-vm

v0.2.5

Published

OP-VM executable for Bitcoin Smart Contracts

Downloads

197

Readme

OP_VM

Rust Bitcoin AssemblyScript TypeScript NodeJS NPM Gulp ESLint

code style: prettier

Package: @btc-vision/op-vm

Overview

Welcome to the OP_NET Rust VM, an experimental virtual machine designed for evaluating smart contracts on the Bitcoin network using Rust and Wasmer. This VM is part of the broader OP_NET initiative, which aims to bring smart contract functionality to Bitcoin. However, please note that this code is currently in an experimental stage and is subject to frequent breaking changes. Nothing is final, and you should expect ongoing development and instability.

Key Features

  • Wasmer Integration: The VM leverages Wasmer, a leading WebAssembly runtime, to execute smart contracts.
  • N-API Integration: This project uses N-API to interface the Rust VM with Node.js, enabling seamless interaction between JavaScript/TypeScript code and Rust.
  • Multi-platform Support: The VM is built with support for a wide range of platforms, including various Linux distributions, macOS, Windows, and even Android.

Project Structure

The project is organized into the following directories:

  • src/: Contains the Rust source code for the VM.
    • application/: (Currently empty, might be reserved for application-level logic in the future)
    • domain/: Core domain logic of the VM.
      • assembly_script/: Handles functionality related to AssemblyScript.
      • runner/: Contains the code that runs and manages contracts, including setting up environments, managing instances, and handling custom imports.
      • vm/: Core virtual machine components, including gas cost management, logging, and other critical VM operations.
    • interfaces/: Manages external function calls and N-API bindings.
      • napi/: Implements external functions that interface with Node.js.
  • target/: Build artifacts, including the compiled VM binaries, are stored here.

Getting Started

Prerequisites

  • Node.js: Version 16 or higher is required.
  • Rust: You must have Rust installed to compile and develop this project.
  • wasm-pack: To work with Wasmer, ensure that wasm-pack is installed.
  • @napi-rs/cli: This is a required dependency for managing N-API bindings.

Installation

  1. Clone the repository:

    git clone git://github.com/btc-vision/op-vm.git
    cd op-vm
  2. Install dependencies:

    npm install
  3. Build the project:

    To build the project for your platform, run:

    npm run build

    To build in debug mode:

    npm run build:debug

Usage

After building the project, you can use the VM to evaluate Bitcoin smart contracts by integrating it into your Node.js applications. Since this is an experimental module, documentation on specific APIs and usage examples is still under development. Please refer to the source code for detailed insights on how the VM operates.

Scripts

  • npm run build: Compiles the Rust code into a platform-specific binary.
  • npm run build:debug: Compiles the Rust code with debug information.
  • npm run artifacts: Generates artifacts for all supported platforms.
  • npm run universal: Builds a universal binary.
  • npm run version: Updates the package version.
  • npm run postinstall: Automatically runs the build script after installation.

Supported Platforms

This project aims to support a wide range of platforms. The N-API bindings and Wasmer runtime are configured to work on various architectures, including:

  • Linux: x86_64, aarch64, armv7
  • macOS: x86_64, arm64
  • Windows: x86_64, i686
  • Android: aarch64, armv7
  • FreeBSD: x86_64
  • Other: RISC-V, Musl variants, etc.

Contributing

Given the experimental nature of this project, contributions are welcome, but please be aware that the codebase is evolving rapidly. If you encounter any issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Signed commits are required, and please adhere to the project's code of conduct.

Warning: Experimental Code

This project is in the early stages of development and is considered experimental. Expect breaking changes, incomplete features, and potential bugs. Use this code at your own risk, and avoid relying on it for production purposes until it reaches a more stable state.

License

This project is licensed under a custom license. For more information, please refer to the LICENSE.md file.

Contact

For more information, visit the OP_NET homepage or reach out via the repository's GitHub page.