Skip to content

pandres95/virtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtool: Virto tools CLI

Toolkit to prove the usability of tools behind Virto Network's framework. It uses libwallet and sube to work.

Getting Started

Requisites

Rust

Since under the hood, sube uses some unstable features (like async_traits), you'll need to install the latest version from the nightly channel.

Here you can find the instructions on how you can install Rust toolchain. After doing so, update to the latest version on nightly, running:

rustup update nightly

After that, you'll need to add ~/.cargo/bin to the session PATH.

# If you use bash
echo "export PATH=$PATH:$HOME/.cargo/bin" >> ~/.bashrc
# If you use zsh
echo "export PATH=$PATH:$HOME/.cargo/bin" >> ~/.zshrc

Dependencies

For this specific proof of concept, the tool uses the following dependencies:

prs We use it as a storage backend for your accounts (see src/vault/pass.rs on libwallet to get more details).

To install a pretty handful CLI to manage your accounts run:

cargo install prs-cli

The Westend chain

Even though you can change it to use any other chain (see cmd/balance.rs:15 and cmd/transfer.rs:19 to change them).

Installing from source

Download the source repository

git clone https://github.com/pandres95/virtool.git
cd virtool

Update the dependencies on your local machine:

cargo update

To build and install:

cargo +nightly install --path .

Setting up your account

First, you'll need to specify the name you'll use for storing your account locally. Let's say it's acct.

If you previously have a mnemonic seed to setup your account, you can add it using prs CLI:

prs add libwallet_accounts/acct

Otherwise, go to the next section.

Usage

When running virtool, the program shows the following help:

virtool 1.0.0

USAGE:
    virtool --uname <uname> <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -u, --uname <uname>

SUBCOMMANDS:
    balance
    help        Prints this message or the help of the given subcommand(s)
    transfer

Get your balance

To find the balance for you acct account, run:

virtool -u acct balance

Make a transfer

To make a transfer from you acct account to another account, run:

virtool -u acct transfer --dest <dest> --value <value>

Where:

  • dest is the address for the destination account. This can be either in SS58 format or in Public Key Hex (0x) format.
  • value is the amount to transfer in the smallest unit (e.g. Westend's smallest unit is 10-12 WND).

Releases

No releases published

Packages

No packages published

Languages