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

scrypt-cli

v0.2.1

Published

CLI tool for creating and managing sCrypt projects.

Downloads

669

Readme

sCrypt CLI

A CLI tool to make development of sCrypt faster and easier.

Build Status

Usage

Note: Node version 16 or greater is required.

Create a new sCrypt smart contract project

npx scrypt-cli project my-proj

or simply

npx scrypt-cli p my-proj

The command creates a new directory my-proj which contains a demo sCrypt smart contract along with needed scaffolding.

Read the projects README.md for more info on how to test and deploy the generated smart contract.

You can also use the following command to generate a stateful smart contract project:

npx scrypt-cli p --state my-proj

Lastly, you can create an sCrypt library project with the following option:

npx scrypt-cli p --lib my-lib

Compile sCrypt smart contracts

npx scrypt-cli compile

This will search current project for classes extending SmartContract and compile them. This will produce a contract artifact file for each compiled class. The files will be stored under the artifacts directory.

The command needs to run in the root directory of the project.

Compile sCrypt Smart Contract under Watch

npx scrypt-cli compile --watch

Initiate smart contract compilation in watch mode. This mode allows you to observe real-time updates and notifications regarding any errors specific to the smart contract compilation phase, which are distinct from TypeScript errors. During watch mode, smart contracts get automatically compiled after a change is made to any of the smart contract source files.

Compile using the --asm option

npx scrypt-cli compile --asm

The --asm option is used to apply inline assembly optimizations. These are defined under the .asm/ directory in the root of the project (auto genereted when using --asm option with the project command). Read more in the docs.

Deploy sCrypt smart contracts

npx scrypt-cli deploy

This will create a deployment script template deploy.ts if it doesn't exist yet. If it does it executes it. Projects generated using the sCrypt CLI will already have deploy.ts present.

You can also run a deployment script with a different name using the f option:

npx scrypt-cli deploy -f myDeployScript.ts

Verify a deployed smart contract

With the verify you can verify that a already deployed output script was produced by the specified sCrypt code.

npx scrypt-cli verify <scriptHash> <contractPath>

The first positional argument is the double-SHA256 hash of the deployed output script, commonly used by block explorers to index scripts. The second one is the path to the file which contains the sCrypt smart contract. Note, that the file must also include all the code it depends on, i.e. third party libraries.

Using the network option, you can specify on which network the contract is deployed. This defaults to test, indicating the Bitcoin testnet:

npx scrypt-cli verify --network main <scriptHash> <contractPath>

You can also specify the version of sCrypt used during verification. By default, the command will use the version specified in package.json:

npx scrypt-cli verify -V 0.2.1-beta.9 <scriptHash> <contractPath>

Get system info

When filing an issue a lot of time it's useful to provide information about your system. You can get this information with the following command:

npx scrypt-cli system

Show version

Show the version of scrypt-cli:

npx scrypt-cli -v

Using latest version

  1. run command with latest tag:
npx scrypt-cli@latest -v

or

  1. clear cache to fetch the latest version:
npx clear-npx-cache
npx scrypt-cli -v