Skip to content

Commit

Permalink
fix rendering on pypi by changing over to markdown from reStructuredT…
Browse files Browse the repository at this point in the history
…ext and bump version to 0.0.30

- flesh our help text for cli commands
  • Loading branch information
AustEcon committed Dec 31, 2020
1 parent 3176b13 commit 0b4ccba
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 216 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ElectrumSV SDK
==============

Licence: The Open BSV License
Maintainers: Roger Taylor, AustEcon
Project Lead: Roger Taylor
Language: Python (>=3.7)
Homepage: https://electrumsv.io/

[![PyPI version](https://badge.fury.io/py/electrumsv-sdk.svg)](https://badge.fury.io/py/electrumsv-sdk)
[![Build Status](https://dev.azure.com/electrumsv/ElectrumSV/_apis/build/status/electrumsv.electrumsv-sdk?branchName=master)](https://dev.azure.com/electrumsv/ElectrumSV/_apis/build/status/electrumsv.electrumsv-sdk?branchName=master)
[![Platforms](https://img.shields.io/badge/platforms-linux%20%7C%20windows%20%7C%20macos-blue)](https://img.shields.io/badge/platforms-linux%20%7C%20windows%20%7C%20macos-blue)
[![Platforms](https://img.shields.io/pypi/pyversions/electrumsv-sdk.svg?style=flat-square)](https://pypi.org/project/electrumsv-sdk)


Overview
========

The ElectrumSV SDK provides the command-line tool ``electrumsv-sdk`` to manage a local Bitcoin
development environment. As long as your Python installation places it's scripts on your path,
after you have installed the `ElectrumSV SDK <https://pypi.org/project/electrumsv-sdk/>`_
Python package, it should be available for you to use.
24 changes: 0 additions & 24 deletions README.rst

This file was deleted.

100 changes: 100 additions & 0 deletions electrumsv-sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
ElectrumSV Software Development Kit
===================================

This project provides a consolidated set of resources that together can allow a developer, whether
working on ElectrumSV directly or on an application based on ElectrumSV, to develop, run and test
while offline (and is especially aimed at facilitating rigourous CI/CD functional testing).

Licence: The Open BSV License
Maintainers: Roger Taylor, AustEcon
Project Lead: Roger Taylor
Language: Python (>=3.7)
Homepage: https://electrumsv.io/

[![PyPI version](https://badge.fury.io/py/electrumsv-sdk.svg)](https://badge.fury.io/py/electrumsv-sdk)
[![Build Status](https://dev.azure.com/electrumsv/ElectrumSV/_apis/build/status/electrumsv.electrumsv-sdk?branchName=master)](https://dev.azure.com/electrumsv/ElectrumSV/_apis/build/status/electrumsv.electrumsv-sdk?branchName=master)
[![Platforms](https://img.shields.io/badge/platforms-linux%20%7C%20windows%20%7C%20macos-blue)](https://img.shields.io/badge/platforms-linux%20%7C%20windows%20%7C%20macos-blue)
[![Platforms](https://img.shields.io/pypi/pyversions/electrumsv-sdk.svg?style=flat-square)](https://pypi.org/project/electrumsv-sdk)

Instructions
============
Official hosted documentation webpage coming soon...

To install from [pypi](https://pypi.org/project/electrumsv-sdk/) run (for general users):

> pip install --upgrade electrumsv-sdk

Now you have global access to a script called 'electrumsv-sdk.exe' from
any console window.

For help:

> electrumsv-sdk --help

If you want help for one of the subcommands (e.g. 'start') do:

> electrumsv-sdk start --help

Which will show:

usage: electrumsv-sdk start [-h] [--new] [--gui] [--background] [--inline] [--new-terminal] [--id ID] [--repo REPO] [--branch BRANCH] {electrumsv,electrumx,merchant_api,node,status_monitor,whatsonchain,whatsonchain_api} ...

positional arguments:
{electrumsv,electrumx,merchant_api,node,status_monitor,whatsonchain,whatsonchain_api}
subcommand
electrumsv start electrumsv
electrumx start electrumx
merchant_api start merchant_api
node start node
status_monitor start status_monitor
whatsonchain start whatsonchain
whatsonchain_api start whatsonchain_api

optional arguments:
-h, --help show this help message and exit
--new run a new instance with unique 'id'
--gui run in gui mode (electrumsv only)
--background spawn in background
--inline spawn in current shell
--new-terminal spawn in a new terminal window
--id ID human-readable identifier for component (e.g. 'worker1_esv')
--repo REPO git repo as either an https://github.com url or a local git repo path e.g. G:/electrumsv (optional)
--branch BRANCH git repo branch (optional)

NOTE1: The sdk tool only handles a single ``component_type`` at a time (i.e. for the ``start``,
``stop`` and ``reset`` commands).

NOTE2: The "optional arguments" above come **before** specifying the ``component_type`` e.g.:

> electrumsv-sdk start --new --id=myspecialnode node


Plugins
-------

The plugin model has three layers

- `builtin_components/` (located in site-packages/electrumsv_sdk/builtin_components
- `user_components/` (located in AppData/local/ElectrumSV-SDK/user_components
- `electrumsv_sdk_components` (local working directory)

Each layer overrides the one above it if there are any namespace clashes for a given ``component_type``

The rationale for using a plugin model is aimed at maintainability and extensibility.

To get a feel for the patterns and how to create your own plugin you can look at the ``'builtin_components/'``
as a template.

Disclaimer: Creating plugins is more the domain of software developers who are expected to have a
certain competency level and are willing to work through some technical challenges to get it working.

Most users of this SDK would be expected to merely make use of existing (built-in) plugins for the
ease of spinning up 1 or more RegTest instances of the offered component types and manipulating the
state of the RegTest environment via the provided tools (which may or may not make use of the
electrumsv wallet - which runs by default as a daemon process with a REST API (but can also be
run in the more familiar GUI mode).

Whatsonchain blockexplorer (localhost)
--------------------------------------
Please go to [whatsonchain setup guide](https://github.com/electrumsv/electrumsv-sdk/tree/master/electrumsv-sdk/contrib/whatsonchain/README.md) Whatsonchain setup guide

170 changes: 0 additions & 170 deletions electrumsv-sdk/README.rst

This file was deleted.

22 changes: 7 additions & 15 deletions electrumsv-sdk/contrib/whatsonchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,17 @@ open a terminal window and type:

> npm config set python /path/to/executable/python

# Step 3 (install the whatsonchain explorer package)
# Step 3 (use the sdk to install and run)
Clone this repository and install package:

> git clone https://github.com/AustEcon/woc-explorer.git
> cd woc-explorer
> npm install
> npm build

NOTE: I would like to continue using the main repository
at https://github.com/waqas64/woc-explorer at a later date. But this is
a short-term way to have everything pre-configured for our RegTest needs
(removes the step of editing configuration files is all).

Now you can start the explorer with:

> npm start
> electrumsv-sdk install whatsonchain
> electrumsv-sdk start node
> electrumsv-sdk start electrumx
> electrumsv-sdk start whatsonchain

Webpage is viewable at http://127.0.0.1:3002/

**You need to be running the node and ideally electrumx to have anything to look at.**
**You need to be running the node and ideally electrumx to have anything to look at.
Hence why the node and electrumx are also started here.**

The docker build for this explorer doesn't work for me at the moment. YMMV.
2 changes: 1 addition & 1 deletion electrumsv-sdk/electrumsv_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.29'
__version__ = '0.0.30'
13 changes: 8 additions & 5 deletions electrumsv-sdk/electrumsv_sdk/argparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,14 @@ def add_install_argparser(self, namespaces):

def add_start_argparser(self, namespaces):
start_parser = namespaces.add_parser("start", help="specify which servers to run")
start_parser.add_argument("--new", action="store_true", help="")
start_parser.add_argument("--gui", action="store_true", help="")
start_parser.add_argument("--background", action="store_true", help="")
start_parser.add_argument("--inline", action="store_true", help="")
start_parser.add_argument("--new-terminal", action="store_true", help="")
start_parser.add_argument("--new", action="store_true",
help="run a new instance with unique 'id'")
start_parser.add_argument("--gui", action="store_true",
help="run in gui mode (electrumsv only)")
start_parser.add_argument("--background", action="store_true", help="spawn in background")
start_parser.add_argument("--inline", action="store_true", help="spawn in current shell")
start_parser.add_argument("--new-terminal", action="store_true",
help="spawn in a new terminal window")
start_parser.add_argument("--id", type=str, default="", help="human-readable identifier "
"for component (e.g. 'worker1_esv')")
start_parser.add_argument("--repo", type=str, default="", help="git repo as either an "
Expand Down
3 changes: 2 additions & 1 deletion electrumsv-sdk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _locate_requirements():
version=version,
install_requires=_locate_requirements(),
description='ElectrumSV SDK',
long_description=open('README.rst', 'r').read(),
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
author='Roger Taylor',
author_email="[email protected]",
Expand Down Expand Up @@ -82,6 +82,7 @@ def _locate_requirements():
'Operating System :: Microsoft :: Windows :: Windows 10',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
],
include_package_data=True,
Expand Down

0 comments on commit 0b4ccba

Please sign in to comment.