Coder Social home page Coder Social logo

vyper-protocol / vyper-cli Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 1.37 MB

๐ŸŽผ Command Line to interact with on chain Vyper program suite

Home Page: https://vyper-protocol.github.io/vyper-cli/vyper/

Rust 100.00%
solana solana-client rust cli command-line

vyper-cli's Introduction

Vyper-Cli

Command Line to interact with on chain Vyper program suite

rust checks

deploy cargo docs

Installation

1. Download the source code.

$ git clone [email protected]:vyper-protocol/vyper-cli.git
$ cd vyper-cli

2. Build

$ cargo build

3. Install

$ cargo install --path .

Usage

$ vyper <option> <command>

Example

Get current version
$ vyper --version
Fetch tranche configuration
$ vyper core fetch 5Q8tNcpKjBSGHyW3LEr1rGAJeuuLWCbYB5frL79XacRC

vyper-cli's People

Contributors

iamakshat0 avatar iamakshat01 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vyper-cli's Issues

Documentation website

We need to generate a documentation website that will serve as main point of reference for users and developers.

The website will have, for each command:

  • syntax explanation (required parameters and optional ones)
  • examples

The structure will be something like:

  • introduction
  • core commands
    • fetch
  • redeem logic commands
    • forward
      • fetch
  • rate commands
    • switchboard
      • fetch

The website will be hosted on github pages, from this repo.

For the website generation we can do some research in order to check which is the best tool. Probably rust md-book is currently a good option, we're currently using it for vyper main developer docs (here the source and here the deploy gh action). If we can find some tool that generate automatically the docs from the source code comments we can evaluate that as well.

Read redeemlogic_forward state account

This will be a new command in the redeem_logic_forward sub suite, we need to fetch a redeem_logic_state and print in the console all the parameters inside (strike, notional, etc..)

Overwrite provider parameters

We have to replicate the same anchor behavior in order to allow the user to overwrite the provider details: cluster and wallet. If we check in the anchor cli command we have always these options available:

        --provider.cluster <CLUSTER>    Cluster override
        --provider.wallet <WALLET>      Wallet override

We should replicate the same feat. the open source repo for the anchor cli is here

Redeem Logic plugin state creation

We have to include the possibility to create redeem logic plugin states for all the following types:

  • #29
  • settled forward
  • vanilla option
  • farming
  • fila
  • lending fee
  • lending
  • digital #40

We can open multiple PRs addressing this issues, if that's convenient. Then we'll track progress checking the above list

Redeem Logic plugin state fetching

We have to include the possibility to fetch redeem logic plugin states from all the following plugins:

  • forward
  • settled forward
  • vanilla option
  • farming
  • fila
  • lending fee
  • lending
  • digital #40

We can open multiple PRs addressing this issues, if that's convenient. Then we'll track progress checking the above list

Read last aggregator value from switchboard

Given a switchboard aggregator account we should be able to read the last saved value. This will be useful as a standalone command in the rate_switchboard sub suite and as a collateral data fetching the rate_state fetching pointed at #12

More on aggregator last value here

Improve installation documentation

We need to provide easier options to install the CLI in docs, for example:

cargo install --git https://github.com/vyper-protocol/vyper-cli vyper --force

We need also to provide instructions on how to update the executable (ie running the same command).

Rate plugin state fetching

We have to include the possibility to fetch rate plugin states from all the following plugins:

  • switchboard
  • pyth #39
  • poolv2
  • twap
  • mock

We can open multiple PRs addressing this issues, if that's convenient. Then we'll track progress checking the above list

Rate plugin state creation

We have to include the possibility to create rate plugin states from all the following types:

  • switchboard #41
  • pyth #39
  • poolv2
  • twap
  • mock

We can open multiple PRs addressing this issues, if that's convenient. Then we'll track progress checking the above list

Basic documentation

Create proper documentation in readme.md to give instructions on how to download the CLI and how to compile locally. This will be useful as long as we'll provide pre compiled binaries on github releases assets (example here).

Introduce cli common libraries

Evaluate the followings:

https://github.com/console-rs/console
https://docs.rs/indicatif/latest/indicatif/
https://docs.rs/dialoguer/latest/dialoguer/

Check dependencies used here

Move contracts publickey in a settings toml file

Currently we have all the chain smart contracts public keys hardcoded in the codebase:

vyper-cli/src/main.rs

Lines 35 to 38 in c9fc594

const VYPER_CORE_ID: &str = "vyPErCcGJKQQBeeQ59gXcWrDyU4vBrq8qQfacwmsAsp";
const REDEEM_LOGIC_FORWARD: &str = "BrpV1re8MshA8qskKVxcEG8zXG3vf2uLX6myeTKAyhsK";
const RATE_SWITCHBOARD: &str = "2hGXiH1oEQwjCXRx8bNdHTi49ScZp7Mj2bxcjxtULKe1";
const OTC: &str = "8aHSkExY28qCvg4gnTLU7y1Ev6HnpJ1NxuWb9XtEesVt";

We should move these parameters to an external file for easy tuning. For example it could be a settings.toml file (in order to prepare the field also for future user settings/preferences).

Once created the settings.toml file we can create a new command to open it in a text editor in order to allow users to change it, for example:

vyper-cli settings open

I would avoid creating a command for changing each setting entry from the suite, for now it's not needed.

Better error handling

Fetching an unexisting tranche config result in this output:

โžœ  vyper-cli git:(feat/cli-setup) cargo run -- core fetch 5Q8tNcpKjBSGHyW3LEr1rGAJeuuLWCbYB5frL79XacRC
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/vyper core fetch 5Q8tNcpKjBSGHyW3LEr1rGAJeuuLWCbYB5frL79XacRC`
thread 'main' panicked at 'Could not find tranche with given publickey: AccountNotFound', src/ops/core_ops.rs:22:84
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

we need a better error handling

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.