Skip to content

Commit

Permalink
Merge pull request #47 from ConsenSys/fix/replace-pythx-cli
Browse files Browse the repository at this point in the history
Replace PythX entry, add new CLI and Brownie
  • Loading branch information
dmuhs committed Sep 23, 2019
2 parents f06b1a4 + 1e52e24 commit 4deb9be
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 203 deletions.
18 changes: 14 additions & 4 deletions docs/source/SDK/armlet.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
JavaScript Library
==================
Armlet
======

Armlet is a thin wrapper around the `MythX API <https://mythx.io/v1/openapi>`_
written in JavaScript which simplifies interaction with MythX. For example,
the library wraps API analysis requests into a promise.


.. warning::

Please note that as of August 2019 the Armlet library has been
**deprecated** in favour of the newer and more advanced
``mythxjs`` library whose documentation can be found
:ref:`here <tools.mythxjs>`.

Armlet is a thin wrapper around the `MythX API <https://mythx.io/v1/openapi>`_ written in JavaScript which simplifies interaction with MythX.
For example, the library wraps API analysis requests into a promise.


Installation
Expand Down
File renamed without changes.
42 changes: 39 additions & 3 deletions docs/source/SDK/pythx.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Python Library
==============
=====
PythX
=====

PythX is a Python library for the `MythX API <https://mythx.io/v1/openapi>`_.
PythX is a Python library for the MythX API.

Its goal is to facilitate development of use cases that go beyond bare API
interaction by making it easy for developers to hook into high-level
Expand All @@ -22,10 +23,26 @@ To get started, simply run
$ pip3 install pythx
Alternatively, clone the repository and run

.. code-block:: console
$ pip3 install .
Or directly through Python's :code:`setuptools`:

.. code-block:: console
$ python3 setup.py install
Example
-------

PythX aims to provide an easy-to-use interface to the official MythX API.
Its goal is to turbocharge tool development and make it easy to deal with
even complex use cases.

.. code-block:: python3
from pythx import Client
Expand All @@ -50,6 +67,25 @@ Example
# Undefined - MythX API trial mode.
The PythX CLI has now become the MythX CLI!
-------------------------------------------

Originally, the PythX CLI was a proof of concept to display to interested
developers what can be done using the library. The interest in the CLI grew
so large that a lot of developers contacted me and asked for support and
new features.

This is the PSA that **I will no longer maintain the PythX CLI**. But wait!
There's more!

Because a PoC is not exactly what you would call future-proof and maintainable
software, I have decided to do a complete revamp. It is called `mythx-cli` and
incorporates all feature requests I have gotten so far. Check it out
:ref:`here <tools.mythx-cli>` and let me know what you think!

Enjoy! :)


Check out the `repository <https://github.com/dmuhs/pythx>`_, read through our
`documentation <https://pythx.readthedocs.io/en/latest/>`_, and hit us up on
`Discord <https://discord.gg/hkuxns2>`_ if you have any issues, feedback, or
Expand Down
61 changes: 0 additions & 61 deletions docs/source/SDK/shard.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/building-security-tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ interacting with MythX.
.. toctree::
:maxdepth: 1

../SDK/armlet
../SDK/mythxjs
../SDK/pythx
../SDK/shard
../SDK/armlet


API Walkthrough
Expand Down
Binary file added docs/source/tools/brownie/gui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/source/tools/brownie/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. _tools.brownie:

Brownie
=======

Brownie is a Python framework for Ethereum smart contract testing,
interaction and deployment.

* **Testing**: Unit test your project with ``pytest``, and evaluate test
coverage through stack trace analysis. We make *no promises*.
* **Debugging**: Get detailed information when a transaction reverts, to
help you locate and solve the issue quickly.
* **Interaction**: Write scripts or use the console to interact with your
contracts on the main-net, or for quick testing in a local environment.
* **Deployment**: Automate the deployment of many contracts onto the
blockchain, and any transactions needed to initialize or integrate the
contracts.


Scanning for Security Vulnerabilities
-------------------------------------

To prevent vulnerabilities from being introduced to the code base, Brownie
includes a plugin that integrates automated security scans using the MythX
analysis API. Simply run :code:`brownie analyze` on your compiled project
directory. This will send the compiled build artifacts to MythX for
analysis. By default no login is required and the analysis is going to be
executed as a trial user. To access more vulnerability information, register
for free on the MythX website and pass your login data via environment
variables or command line arguments.

.. code-block::
Brownie v1.0.0b12 - Python development framework for Ethereum
Usage: brownie analyze [options] [--async | --interval=<sec>]
Options:
--gui Launch the Brownie GUI after analysis
--full Perform a full scan (MythX Pro required)
--interval=<sec> Result polling interval in seconds [default: 3]
--async Do not poll for results, print job IDs and exit
--access-token The JWT access token from the MythX dashboard
--eth-address The address of your MythX account
--password The password of your MythX account
--help -h Display this message
Use the analyze command to submit your project to the MythX API for smart
contract security analysis.
To authenticate with the MythX API, it is recommended that you provide
the MythX JWT access token. It can be obtained on the MythX dashboard
site in the profile section. They should be passed through the environment
variable "MYTHX_ACCESS_TOKEN". If that is not possible, it can also be
passed explicitly with the respective command line option.
Alternatively, you have to provide a username/password combination. It
is recommended to pass them through the environment variables as
"MYTHX_ETH_ADDRESS" and "MYTHX_PASSWORD".
You can also choose to not authenticate and submit your analyses as a free
trial user. No registration required! To see your past analyses, get access
to deeper vulnerability detection, and a neat dashboard, register at
https://mythx.io/. Any questions? Hit up dominik.muhs@consensys.net or contact
us on the website!
Once the analysis is done, the vulnerabilities are stored in the
:code:`reports/` directory. With :code:`brownie analyze --gui` the GUI can
be started automatically once the analysis has finished.

.. image:: gui.png
:alt: Security Report GUI

.. note::
Head to the `Brownie documentation <https://eth-brownie.readthedocs.io/>`_
to get more information on how to use it in your smart contract
development workflow!
17 changes: 12 additions & 5 deletions docs/source/tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ Current tools
:maxdepth: 1

truffle/index
mythx-cli/index
remix/index
guardrails/index
mythxjs/index
mythos/index
pythx/index
brownie/index


New tools wanted
----------------

Are you working on an integration with an IDE, a web interface, or something else that's super useful? If you are building on MythX, we want to know about it!
Are you working on an integration with an IDE, a web interface, or something
else that's super useful? If you are building on MythX, we want to know about
it!

Please join our community on `Discord <https://discord.gg/kktn8Wt>`_ and
reach out to the team for more information.

Please join our community on `Discord <https://discord.gg/kktn8Wt>`_ and reach out to the team for more information.
.. note::

.. note:: We plan to offer a revenue sharing system for qualifying tools. More details will be announced soon.
We plan to offer a revenue sharing system for qualifying tools. More
details will be announced soon.
83 changes: 83 additions & 0 deletions docs/source/tools/mythx-cli/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.. _tools.mythx-cli:

=========
MythX CLI
=========

The `MythX CLI <https://github.com/dmuhs/mythx-cli/>`_ Python package aims to
provide a simple to use command line interface for the MythX API. It's main
purpose is to demonstrate how advanced features can be implemented using the
`PythX <https://github.com/dmuhs/pythx/>`_ Python language bindings for MythX
to simplify API interaction.


Usage
-----

.. code-block:: console
$ mythx
Usage: mythx [OPTIONS] COMMAND [ARGS]...
Your CLI for interacting with https://mythx.io/
Options:
--debug / --no-debug Provide additional debug output
--access-token TEXT Your access token generated from the MythX
dashboard
--eth-address TEXT Your MythX account's Ethereum address
--password TEXT Your MythX account's password as set in the
dashboard
--format [simple|json|json-pretty]
The format to display the results in
--help Show this message and exit.
Commands:
analyze Analyze the given directory or arguments with MythX.
list Get a list of submitted analyses.
report Fetch the report for a single or multiple job UUIDs.
status Get the status of an already submitted analysis.
version Display API version information.
Installation
------------

The MythX CLI runs on Python 3.6+, including 3.8-dev and pypy.

To get started, simply run

.. code-block:: console
$ pip install mythx-cli
Advanced Usage
--------------

For in-depth details on how to use the MythX CLI, alternative ways to install
it, as well as helpful documentation about authentication, analyzing complex
projects and more, head over to the
`MythX CLI documentation <https://mythx-cli.readthedocs.io>`_.


The MythX CLI project is MIT-licensed and contributions are always welcome!
For more information on how to get involved, check out our
`Contribution guidelines <https://mythx-cli.readthedocs.io/en/latest/contributing.html>`_.


Useful Links
------------

.. list-table::

* - Github repository
- https://github.com/dmuhs/mythx-cli/
* - Documentation
- https://mythx-cli.readthedocs.io/
* - Python Package Index
- https://pypi.org/project/mythx-cli/
* - Current CI builds
- https://travis-ci.org/dmuhs/mythx-cli/
* - Test coverage
- https://coveralls.io/github/dmuhs/mythx-cli

0 comments on commit 4deb9be

Please sign in to comment.