<commit_before>.. _run:

Running the Examples
====================
Details about each app is documented under:

* :ref:`ontherecord`
* :ref:`sharetrader`


The Easy Way
------------

.. code-block:: bash

    $ docker-compose up

Or, if you're using docker-machine instances (ie. on OSX / Windows),

.. code-block:: bash

    $ DOCKER_MACHINE_IP=$(docker-machine ip) docker-compose up

You should be able to view the "On the record" app at
`<http://localhost:32800/ontherecord/>`_, and the "Share Trader" app at
`<http://localhost:32800/sharetrader/>`_ (replace ``localhost`` with your docker-machine ip as
necessary)


The Hard Way
------------
Have four terminal shells (in ``bigchaindb-examples/``)

Running the javascript client
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In one terminal, run ``npm start`` in ``client/`` to serve the client apps

.. code-block:: bash

    $ cd client
    $ npm start


Running BigchainDB
^^^^^^^^^^^^^^^^^^
Launch ``BigchainDB`` with ``RethinkDB`` in a separate terminal

.. code-block:: bash

    $ rethinkdb &   # skip this if RethinkDB is already running
    $ bigchaindb -c .bigchaindb_examples start


Running the App server
^^^^^^^^^^^^^^^^^^^^^^
In another terminal, launch the ``flask`` server

.. code-block:: bash

    $ python3 -m server.app

In (yet) another terminal, launch the ``tornado`` server

.. code-block:: bash

    $ python3 -m server.tornado_app

You should be able to view the "On the record" app at
`<http://localhost:8000/ontherecord/>`_, and the "Share Trader" app at
`<http://localhost:8000/sharetrader/>`_.
<commit_msg>fix the port for the webapp in the docs<commit_after>.. _run:

Running the Examples
====================
Details about each app is documented under:

* :ref:`ontherecord`
* :ref:`sharetrader`


The Easy Way
------------

.. code-block:: bash

    $ docker-compose up

Or, if you're using docker-machine instances (ie. on OSX / Windows),

.. code-block:: bash

    $ DOCKER_MACHINE_IP=$(docker-machine ip) docker-compose up

You should be able to view the "On the record" app at
`<http://localhost:32800/ontherecord/>`_, and the "Share Trader" app at
`<http://localhost:32800/sharetrader/>`_ (replace ``localhost`` with your docker-machine ip as
necessary)


The Hard Way
------------
Have four terminal shells (in ``bigchaindb-examples/``)

Running the javascript client
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In one terminal, run ``npm start`` in ``client/`` to serve the client apps

.. code-block:: bash

    $ cd client
    $ npm start


Running BigchainDB
^^^^^^^^^^^^^^^^^^
Launch ``BigchainDB`` with ``RethinkDB`` in a separate terminal

.. code-block:: bash

    $ rethinkdb &   # skip this if RethinkDB is already running
    $ bigchaindb -c .bigchaindb_examples start


Running the App server
^^^^^^^^^^^^^^^^^^^^^^
In another terminal, launch the ``flask`` server

.. code-block:: bash

    $ python3 -m server.app

In (yet) another terminal, launch the ``tornado`` server

.. code-block:: bash

    $ python3 -m server.tornado_app

You should be able to view the "On the record" app at
`<http://localhost:3000/ontherecord/>`_, and the "Share Trader" app at
`<http://localhost:3000/sharetrader/>`_.

{'fraction_non_alphanumeric': 0.18073047858942065, 'fraction_numerical': 0.012594458438287154, 'mean_word_length': 3.7066666666666666, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '765531', 'n_tokens_mistral': 1057, 'n_tokens_neox': 969, 'n_words': 348}