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

validana-cli

v2.2.0

Published

A command-line interface client for the Validana blockchain platform

Downloads

3

Readme

validana-cli

A command-line interface client for the Validana blockchain platform

npm license dependencies

Overview

This package provides a simple CLI for the Validana blockchain platform, based on the validana-client library. For more information about the Validana blockchain platform refer to https://validana.io.

Installation

Install using npm:

sudo npm -g i validana-cli

You can now directly start using validana-cli from your command line.

By default validana-cli tries to connect to an instance of validana-server running on localhost. Use the --url option to connect to a specific server.

Running your own blockchain

The easiest way to run your own Validana blockchain is using Docker: Clone the validana-processor repository in an empty directory, generate two passwords for the database and a private key using the validana-cli key generate command, configure these passwords, the private key and a prefix of your choosing in the docker-compose.yml file included in the repository, and run the blockchain with docker-compose up -d. You can now use the private key you generated to create and delete smart contracts. See the usage examples below for more things you can do.

Usage examples

Show general usage information:

validana-cli

Get help on how a specifc CLI command works:

validana-cli help contract execute

Generate a new keypair and print it:

validana-cli key generate

List available smart contracts:

validana-cli contract list --prefix myblockchain

Create a new smart contract:

validana-cli contract create --prefix myblockchain --contract-file contracts/mycontract.json --signing-keyfile keyfile.json

Execute a smart contract with a given payload:

validana-cli contract execute --prefix myblockchain --contract-type mycontract --payload '{"foo": "bar"}' --signing-key L2onu5qevxBfjB6xGSkxMqzRZLT6nN9ZRWXFz5doognwbcVM2CfB

Wait for a transaction to be processed and get its result:

validana-cli transaction await --prefix myblockchain --id b043790915bc2f9b6bf8ae470f49c32d

Note that all validana-cli commands accept both parameters and files as input and always output their result as JSON. As a result you can combine most commands in various ways using simple redirection in your shell.

For example, to execute a smart contract using a newly generated key, waiting for it to be processed and then printing the block id in which the smart contract was created (using the json CLI tool):

export VALIDANA_PREFIX=myblockchain
validana-cli contract execute --contract-type mycontract --payload-file mypayload.json --signing-key "$(validana-cli key generate)" | validana-cli transaction await --id-file - | json blockId

You may also consider setting up tab-completion in your shell:

validana-cli completion

Issues and contributing

If you have any issues with validana-cli, check the issue tracker of this project and the upstream issue tracker to see whether it was already reported by someone else. If not, go ahead and create a new issue. Try to include as much information (CLI version, commands to reproduce) as possible.

While I personally probably won't have much time to continue developing this project, I do very much welcome contributions! If you have fixed a bug, added a new command or have some other contribution, feel free to open a pull request on GitHub.

License

validana-cli is freely distributable under the terms of the AGPLv3 license.