Skeleton for WorkLock guide

pull/1655/head
David Núñez 2020-02-10 13:49:45 +01:00 committed by Kieran R. Prasch
parent 80ff08a50f
commit 232a171506
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,62 @@
=======================
NuCypher WorkLock Guide
=======================
Overview
--------
TODO
To better understand the commands and their options, use the ``--help`` option.
Common CLI flags
----------------
All ``nucypher worklock`` commands share a similar structure:
.. code::
(nucypher)$ nucypher worklock <ACTION> [OPTIONS] --network <NETWORK> --provider <YOUR PROVIDER URI> --poa
TODO
Replace ``<YOUR PROVIDER URI>`` with a valid node web3 node provider string, for example:
- ``ipc:///home/ubuntu/.ethereum/goerli/geth.ipc`` - Geth Node on Görli testnet running under user ``ubuntu`` (most probably that's what you need).
Show current WorkLock information
---------------------------------
You can obtain information of current state of WorkLock by running:
.. code::
(nucypher)$ nucypher worklock status --network <NETWORK> --provider <YOUR PROVIDER URI> --poa
If you want to see detailed information of your current bid, you can also introduce your bidder address with the ``--bidder-address`` flag:
.. code::
(nucypher)$ nucypher worklock status --bidder-address <YOUR BIDDER ADDRESS> --network <NETWORK> --provider <YOUR PROVIDER URI> --poa
Place a bid
-----------
You can place a bid to WorkLock by running:
.. code::
(nucypher)$ nucypher worklock bid --network <NETWORK> --provider <YOUR PROVIDER URI> --poa
Cancel a bid
------------
You can cancel a bid to WorkLock by running:
.. code::
(nucypher)$ nucypher worklock cancel-bid --network <NETWORK> --provider <YOUR PROVIDER URI> --poa

View File

@ -89,6 +89,8 @@ def worklock():
@group_worklock_options
@group_general_config
def status(general_config, registry_options, worklock_options):
"""Show current WorkLock information"""
emitter = _setup_emitter(general_config)
registry = registry_options.get_registry(emitter, general_config.debug)
paint_worklock_status(emitter=emitter, registry=registry)
@ -107,6 +109,7 @@ def status(general_config, registry_options, worklock_options):
@click.option('--value', help="ETH value of bid", type=click.STRING)
def bid(general_config, worklock_options, registry_options,
force, hw_wallet, value):
"""Place a bid"""
emitter = _setup_emitter(general_config)
if not worklock_options.bidder_address:
@ -155,6 +158,7 @@ def bid(general_config, worklock_options, registry_options,
@option_force
@option_hw_wallet
def cancel_bid(general_config, registry_options, worklock_options, force, hw_wallet):
"""Cancel your bid"""
emitter = _setup_emitter(general_config)
if not worklock_options.bidder_address: # TODO: Consider bundle this in worklock_options
worklock_options.bidder_address = select_client_account(emitter=emitter,
@ -179,6 +183,7 @@ def cancel_bid(general_config, registry_options, worklock_options, force, hw_wal
@group_worklock_options
@group_general_config
def claim(general_config, worklock_options, registry_options, force):
"""Claim tokens for a successful bid, and start staking them"""
emitter = _setup_emitter(general_config)
if not worklock_options.bidder_address:
worklock_options.bidder_address = select_client_account(emitter=emitter,