Coder Social home page Coder Social logo

golem-client's Introduction

golem-client Continuous integration

Client for Brass Golem Network.

Subprojects

  • actix-wamp (api docs) - Asynchronous client library for WAMP.

  • golem-rpc-api (api docs) - Typesafe binding for Brass Golem RPC services.

  • golem-rpc-api-macro - Procedural macros for binding Brass Golem RPC endpoints.

  • golemcli - command line interface for Brass Golem (re)implemented in Rust.

GolemCLI

Install or Upgrade

On Unix:

curl -sSf https://golemfactory.github.io/golem-client/install/golemcli-update.sh | bash

Compilation prerequisites (Windows)

This project builds under Windows (validated under VC toolchain), after following prerequisites are installed:

golem-client's People

Contributors

craigmayhew avatar etam avatar jiivan avatar kmazurek avatar kubkon avatar mdtanrikulu avatar prekucki avatar stranger80 avatar tworec avatar weaselix avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golem-client's Issues

change subcommand name: res -> cache

res command looks like an unnecessary command in the main command list. It can be also confused with setting amount of resources for the provider.
Better description of res - Manage resource storage

mainnet/testnet info

In regular golemcli you need to type golemcli debug rpc golem.mainnet in order to know whether golem node is connected to mainnet or testnet.

  1. There should be more intuitive way to check whether golem node is connected to mainnet or testnet.
  2. I think it would be nice to have such info also in welcome message.

golemcli status

Implement provider info and print
provider_state: {'status': 'Idle'}

TODO: 360 view about golem node.

Running status

  • Process is running/stoped/stoping (on shutdown?)
  • Components is Starting/Running/Failed
  • mainet / testnet
  • golem version
  • node name
  • disk usage

Network status

  • is connected
  • ports status
  • number of nodes in the network

Account status

  • GNT / ETH
  • 0x1308f7345c455ED528bC80C37C7EC175Abe502B4

Providers status

  • is task working ?

  • processing status

  • pending payments

  • Subtasks accepted (in session): 0

  • Subtasks rejected (in session): 0

  • Subtasks failed (in session): 0

  • Subtasks computed (in session): 0

  • Subtasks in network: 0

Requestor status

  • is any task active?
  • tasks progress

CLI tasks section

Commands:

  • abort Abort a task
  • create Create a task from file. Note: no client-side validation is performed yet. This will change in the future
  • delete Delete a task
  • dump Dump an existing task
  • purge Deletes all tasks
  • restart Restart a task
  • restart_subtasks Restart given subtasks from a task
  • show Show task details
  • stats Show statistics for tasks
  • subtasks Show sub-tasks
  • template Dump a task template
  • unsupport Show statistics for unsupported tasks

Other tasks:

  • initial integration tests

Show dates for incomes

As an end user i want to know when a payment was received so i can get a better picture of when the task was payed.

From public chat we where investigating some "missing" payments, now we used the debug rpc call to get the dates, would be nice to have golemcli incomes ... also print the end ( and start? ) dates of the payments

CLI incomes section

  • add --full flag, and present public key
  • in not full mode, present ETH address

original sample json (not correct, bc of nil)

[
  [
    {
      "subtask": "1e12a7e4-50a3-11e9-9521-1bac4bb5328e",
      "payer": "1bac4bb5328ec9fc70b336e7c720dbb0c9cd23b8782c8bfc66f2a946ab036b8b6b71775cb04ad08d606f652ba476d9692c77cbd135f534d68f54c12e3edc039a",
      "value": "33333333333333334",
      "status": "awaiting",
      "transaction": nil,
      "created": 1553699819.286437,
      "modified": 1557242132.961853
    },
...
    {
      "subtask": "b5bf888a-4fba-11e9-a993-1bac4bb5328e",
      "payer": "1bac4bb5328ec9fc70b336e7c720dbb0c9cd23b8782c8bfc66f2a946ab036b8b6b71775cb04ad08d606f652ba476d9692c77cbd135f534d68f54c12e3edc039a",
      "value": "10",
      "status": "confirmed",
      "transaction": "8062f4dccade73a728589f9e0db65792a6551b65d30f9fea1968a13d578052ba",
      "created": 1553599935.011557,
      "modified": 1557242132.963763
    },

rendered as

payer               status    value
------------------  --------  ---------------
1bac4bb5..3edc039a  awaiting  0.03333333 GNT
...
1bac4bb5..3edc039a  confirmed  0.00000000 GNT
1bac4bb5..3edc039a  confirmed  0.01877905 GNT

run benchmark from cli is not working

./golemcli.py envs recount BLENDER
RPC: call error: <twisted.python.failure.Failure autobahn.wamp.exception.ApplicationError: ApplicationError(error=<wamp.error.runtime_error>, args=['expected str, bytes or os.PathLike object, not NoneType'], kwargs={}, enc_algo=None)>
[10:01:12.117877] ERROR: Exception: ApplicationError(error=<wamp.error.runtime_error>, args=['expected str, bytes or os.PathLike object, not NoneType'], kwargs={}, enc_algo=None)

New password handling

Test 1

Type weak password

$ ./golemcli.py account unlock
No account found, generate one by setting a password
This command will time out in 30 seconds.
Password:
Password is not strong enough. Please use capitals, numbers and special characters.

TODO:

use https://github.com/shssoichiro/zxcvbn-rs min password length is 5 and min password score is 2

account_name = getpass.getuser() or ''
            result = zxcvbn.zxcvbn(pswd, user_inputs=['Golem', account_name])
            # print(result['score'])
            if result['score'] < MIN_SCORE:
                return "Password is not strong enough. " \
                    "Please use capitals, numbers and special characters."

Test 2

Catch password confirmation.

No account found, generate one by setting a password
This command will time out in 30 seconds.
Password:
Confirm password:
Password and confirmation do not match.

Test 3

Password catch timeout

$ ./golemcli.py account unlock
No account found, generate one by setting a password
This command will time out in 30 seconds.
Password:[11:36:15.569613] ERROR: Command timed out

golemcli rpc on locked account

  • env.hw.caps
  • env.hw.preset
  • env.hw.presets
  • env.hw.virtualization
  • golem.mainnet
  • golem.password.key_exists
  • golem.password.set
  • golem.password.unlocked
  • golem.terms
  • golem.terms.accept
  • golem.terms.show
  • golem.version

Detect mainnet or testnet

Using HTTPS cert check if given connection is for mainnet or testnet.

Original Issue

When running golemapp --mainnet the command returned by the terminal is Waiting for a password to unlock the account. Run golemcli account unlock and enter your password. Which is untrue for the mainnet version, as it should state Waiting for a password to unlock the account Run golemcli --mainnet account unlock and enter your password. The current command that is shown by CLI is valid only for the testnet version

  • Either change the info as above
  • Or detect for a user which version he is running and don’t require --mainnet flag for any commands in the command line interface after previously entering testnet or mainnet

Incomes and Payments filtering

Incomes and Payments should have additional arguments printed out at first, as it is not obvious that user can filter them with additional commands

Incomes

  • All
  • Awaiting
  • Confirmed
  • Total (or just print sum under each above)

Payments

As above

golemcli Concent

concent on
concent off
concent status
concent terms (show|accept|status)

concent deposit payments - lists payments
concent deposit - show balance

incomes: unknown variant arbitraged_by_concent

golem version: 0.22.1
cli version: 0.3.0

listing incomes fails with:

unknown variant `arbitraged_by_concent`, expected one of `awaiting`, `sent`, `confirmed`, `overdue`
err: ProcessingError { context: "", cause: Error("unknown variant `arbitraged_by_concent`, expected one of `awaiting`, `sent`, `confirmed`, `overdue`", line: 0, column: 0) }

golemcli network blacklist

Implement option to unblock node, as currently there is only option to block someone. Unblocking must be done manually by user in his local files

# - shows blacklist
golemcli network blacklist 
# added removes from blacklist
golemcli network blacklist { --add <node_id> | --del <node_id> }

golemcli subtasks moved to tasks

subtasks from main command list are duplicated from tasks command line. And it seems that they should be removed, as they lack all the commands that are needed (available in tasks commands)

TODO: consider tasks subtasks vs tasks subtask for single suntasks details

CLI network section

Commands:

  • block - Block provider
  • connect - Connect to a node
  • dht - Show known nodes
  • show - Show connected nodes
  • status - Show client status

Other tasks:

  • tests

Parse Error Responses

ERROR [golem_rpc_api::rpc] on comp.task.create unable to parse: [Array([Null, Object({"error_details": Object({"missing_funds": Array([Object({"available": Number(0), "currency": String("GNT"), "required": Number(1000000000000000000)}), Object({"available": Number(0), "currency": String("ETH"), "required": Number(652000000000000)})])}), "error_msg": String("Not enough funds available.\nRequired GNT: 1.000000, available:
0.000000\nRequired ETH: 0.000652, available: 0.000000\n"), "error_type": String("NotEnoughFunds")})])]: invalid type: map, expected a string
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ProcessingError { context: "", cause: Error("invalid type: map, expected a string", line: 0, column: 0) }', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

golemcli presets support

Command line

Showing the current resource configuration.

$ golemcli res show
---
cpu_cores: 2
disk: 306M
memory: 1.2G

Updateing resource configuration.

$ golemcli res update --cores 3 --mem 2g
---
cpu_cores: 2
disk: 306M
memory: 2G

golemcli concent deposit - error on null deposit.

$ golemcli concent deposit 
ERROR [golem_rpc_api::rpc] on pay.deposit_balance unable to parse: [Null]: invalid type: null, expected struct DepositBalance
ERROR [golemcli] : invalid type: null, expected struct DepositBalance
DEBUG [actix_wamp::connection] send message [48, 6080252602300624, {}, "pay.deposit_balance"]
TRACE [actix_wamp::connection] got message =[50, 6080252602300624, {}, [nil]]

WASM task JSON template has incorrect structure

Template JSON:

{
  "type": "WASM",
  "compute_on": "cpu",
  "name": "simple wasm",
  "timeout": "0:10:00",
  "subtask_timeout": "0:06:40",
  "bid": 0.1,
  "resources": [],
  "concent_enabled": false,
  "subtasks_count": 1,
  "options": {
    "js_name": "",
    "wasm_name": "",
    "input_dir": "",
    "output_dir": "",
    "subtasks": [
      {
        "name": "",
        "exec_args": [],
        "output_file_paths": []
      }
    ]
  }
}

How it should like (ignore values):

{
    "type": "wasm",
    "name": "flite",
    "bid": 1,
    "subtask_timeout": "00:10:00",
    "timeout": "00:10:00",
    "options": {
        "js_name": "flite.js",
        "wasm_name": "flite.wasm",
        "input_dir": "<abs-path-to-wasm-store>/flite/in",
        "output_dir": "<abs-path-to-wasm-store>/flite/out",
        "subtasks": {
            "subtask1": {
                "exec_args": [
                    "intro.txt",
                    "intro.wav"
                ],
                "output_file_paths": [
                    "intro.wav"
                ]
            }
        }
    }
}

Under subtasks key there should be yet another object (not an array).

CLI envs section

Commands:

  • disable Disable environment
  • enable Enable environment
  • perf_mult Gets accepted performance multiplier
  • perf_mult_set Sets accepted performance multiplier
  • recount Recount performance for an environment
  • show Show environments

Group settings set/show

Group settings set into
It seems that num_cores max_memory_size and max_resource_size are not working as provider resources settings.
There should be added an option to change custom_preset values - it is currently unavailable
General
Provider
Requestor

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.