Giter Site home page Giter Site logo

cleancoindev / zkbob-console Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zkbob/zkbob-console

0.0 1.0 0.0 83.23 MB

Simple web tool for manual testing of the zkBob features

Shell 2.09% JavaScript 6.19% TypeScript 90.85% CSS 0.27% HTML 0.46% Dockerfile 0.14%

zkbob-console's Introduction

zkBob Web Console

The simple tool to test and demonstrate zkBob solution possibilities

Running locally

Make sure you are using node js version higher or equal than 14.0.0. The repo has been tested with node v16.14.1 and npm v8.5.0

  1. Clone repository and install dependencies
git clone https://github.com/zkBob/zkbob-console.git
cd zkbob-console
yarn install
  1. Set appropriated settings in the .env file

  2. Put circuit parameters and keys in asset folder. The same files should be located on relayer node

  3. Run local bundle

yarn dev
  1. Open your browser and enter http://localhost:3000/ in the address line

It's recommended to clear your browser's history and cookies in case of you was used previous version of console

Creating Docker container

Suppose you already done local running and set appropriated parameters and settings

  1. Fix your docker ID in this line

  2. Build the prouction pack and push your container to the Docker Hub: ./scripts/publish-docker

Using console

Account maintenance

get-seed <password> print the seed phrase for the current account (current password needed)

get-sk <password> get zkBob account spending key (current password needed,

L1-level commands

get-addres get the linked account address. This address derived from account mnemonic phrase

get-balance get the linked account balance (native coins)

get-token-balance get the linked account balance (tokens)

testnet-mint <amount> mint some unshielded tokens (available on testnets only)

transfer <to> <amount> transfer native coins to the destination L1 address

transfer-token <to> <amount> transfer tokens to the destination L1 address

L2-level commands

gen-shielded-address generate a new zkBob shielded address

get-shielded-balance get calculated private balance (with optimistic balance)

deposit-shielded <amount> [times] deposit some tokens into zk-account (approving allowance scheme which require native coins presenting on the balance to cover token approve transaction fee). Specify times numeric value to repeat the operation several times

deposit-shielded-permittable <amount> [times] deposit some tokens into zk-account (permit scheme, no native coins needed). Specify times numeric value to repeat the operation several times

deposit-shielded-permittable-ephemeral <amount> <index> deposit some tokens from the internal ephemeral address (permit scheme)

transfer-shielded <shielded address> <amount> [times | +] move shielded tokens to the another zkBob account (inside a pool). You can specify times numeric value to repeat the operation several times OR enter the multitransfer mode with adding + sign at the end of the command

withdraw-shielded <amount> [address] [times] withdraw shielded tokens from the zk accouint to the native address (to the your account if address is ommited). Specify times numeric value to repeat the operation several times

history print all transactions related to your account

Transactions configuration

max-transfer calculate maximum available token amount for outcoming transaction (transfer or withdrawal)

tx-amounts <amount> [fee] [+], get transfer\withdrawal configuration for specified amount ant fee per transaction. Type + sign at the end of the command to enter the multitransfer mode

fee-estimate-deposit <amount> estimate fee for depositing requested amount of tokens

`fee-estimate-transfer [amount2 amount3 ...]' estimate fee for transfering requested amount of tokens. Add additional token amounts (the only space accepted as a separator) to estimate fee for multitransfer mode

fee-estimate-withdraw <amount> estimate fee for withdrawing requested amount of tokens

limits [address] get pool contract limits for the specified address (linked account address will be used by default)

Service commands

shielded-address-info <shielded address> get all available info for the shielded address

internal-state print your account and incoming notes (internal representation, for debug purposes only)

root [index] print local and remote Merkle tree root or retrieve just local one at the specified index (local and remote roots should be tha same for same indicies)

siblings <index> get left siblings at specified index (partial tree support). The index should be multiple of 128 and less than current index   rollback <index> rollback the user's state to the specified index (the index should be multiple of 128 and less than current index)

sync force synchronize user's state      sync-stat print available state synchronization statistics from the library

get-ephemeral-address [index] get the concrete ephemeral address or show first unused one

get-ephemeral-used show all used ephemeral addresses

get-ephemeral-address-privkey <index> get private key for concrete ephemeral address

wipe-state wipe internal state and history

clear clear the terminal

reset log out from the current account

version print console version

environment print environment variables

help display CLI commands list

tutorial print usage example

zkbob-console's People

Contributors

allfi avatar evgenkor avatar voidxnull avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.