From 51306bad1c0984842d0b72fe0e83440f042dc034 Mon Sep 17 00:00:00 2001 From: Michael Boyd Date: Mon, 24 Dec 2018 12:08:19 -0700 Subject: [PATCH] added requested changes for PR Signed-off-by: Michael Boyd --- README.md | 2 +- docs/source/cluster-simulation.md | 57 --------- docs/source/conf.py | 2 +- docs/source/index.rst | 18 ++- docs/source/indy-running-locally.md | 186 ---------------------------- 5 files changed, 10 insertions(+), 255 deletions(-) delete mode 100644 docs/source/cluster-simulation.md delete mode 100644 docs/source/indy-running-locally.md diff --git a/README.md b/README.md index 9f05bb93b..de183a304 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ If you made changes in both indy-plenum and indy-node, you need to do the follow - Indy-plenum is based on [RBFT](https://pakupaku.me/plaublin/rbft/5000a297.pdf) protocol - Please have a look at documents and diagrams in [docs/source](docs/source) folder -- Please have a look at documents and diagrams in Plenum's [docs](https://github.com/hyperledger/indy-plenum/tree/master/docs) folder: +- Please have a look at documents and diagrams in Plenum's [docs](https://github.com/hyperledger/indy-plenum/tree/master/docs) folder, or on https://indy.readthedocs.io/projects/plenum : - [Technical Overview of Plenum](https://github.com/hyperledger/indy-plenum/blob/master/docs/main.md) - [Plenum Consensus Algorithm Diagram](https://github.com/hyperledger/indy-plenum/blob/master/docs/diagrams/consensus-protocol.png) - [Glossary](https://github.com/hyperledger/indy-plenum/blob/master/docs/glossary.md) diff --git a/docs/source/cluster-simulation.md b/docs/source/cluster-simulation.md deleted file mode 100644 index 6d8a7c509..000000000 --- a/docs/source/cluster-simulation.md +++ /dev/null @@ -1,57 +0,0 @@ -# Running a Simulation of a Indy Cluster and Agents -One way to run through the [Indy Getting Started Guide](https://github.com/hyperledger/indy-node/blob/stable/getting-started.md) is to set up a simulation of a Indy Validator Cluster. This simulation resides in a single process on a single PC, but it sets up multiple asynchronous call-backs, one for each node being simulated. These call-backs are handled sequentially in an event loop. This gives the approximate performance of nultiple Indy Validator, Agent and CLI client nodes, but all running within a single process. These instructions will configure the simulation, leaving you at the end with a CLI command-line prompt that you can use to complete the Getting Started Guide. - -## Install the Indy Client Software - -``` -$ pip install -U --no-cache-dir indy-client -``` - -If you get any error, check out the info about [prerequisites](setup-dev.md); there are a few dominoes you might have to line up. - - -The install puts some python modules on your system. Most importantly, it gives you a command - line interface(CLI) to Indy. We are going to use that CLI to explore what Indy can do. (Indy also has a programmatic API, but it is not yet fully formalized, and this version of the guide doesn’t document it. See the [Indy roadmap](https://github.com/hyperledger/indy/wiki/Roadmap).) - -## Setup Environment -We will be doing this exercise in a Python Interactive Console. **_Indy must be run with Python 3._** So depending on your system setup, the next command could change. - -To launch Python Interactive Console, type this command: - -``` -$ python3 -``` -or -``` -$ python -``` - -### Imports -You now have a Python prompt. Using the prompt, only one import is required. This import will in turn import other modules and will provide helper functions for this exercise. Any function with the prefix 'demo' are defined in this import and are just functions to help with the exercise. - -``` ->>> from indy_client.test.training.getting_started import * -``` - -### Run the Indy Cluster Simulation - -Type this command: - -``` ->>> start_getting_started() -``` - -This command will start up a local pool of validator "nodes". This can take a few mintues and will produce a lot of console -output. This output contains the initial communication between 4 nodes. This output can be ignored for this exercise. - -After starting up the local indy pool, three agents will be launched in virtual "nodes". During this this exercise we will be interacting -with three agents, Faber Collage, Acme Corp and Thrift Bank. Again, launching these agents can take some time and a lot of -output. - -After these tasks are complete, you should see an interactive prompt, like this: - -``` -Indy - CLI version 1.17(c) 2016 Evernym, Inc. -Type 'help' for more information. -indy> -``` -You can now proceed with the Getting Started Guide, using this Indy client prompt. diff --git a/docs/source/conf.py b/docs/source/conf.py index 7657f6730..e1e43b05b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -220,7 +220,7 @@ def setup(app): if rtd_version not in ['stable', 'latest']: rtd_version = 'latest' try: - os.system("git clone https://github.com/michaeldboyd/indy-docs.git remote_conf") + os.system("git clone https://github.com/hyperledger/indy-docs.git remote_conf") os.system("mv remote_conf/remote_conf.py .") import remote_conf remote_conf.generate_sidebar(globals(), nickname) diff --git a/docs/source/index.rst b/docs/source/index.rst index 723ea019c..0ed49e8d7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,22 +10,20 @@ Welcome to Hyperledger Indy Node's documentation! .. toctree:: :maxdepth: 1 + transactions.md + requests.md + auth_rules.md + pool-upgrade.md start-nodes.md add-node.md - auth_rules.md - ci-cd.md - cluster-simulation.md helper-scripts.md - indy-file-structure-guideline.md - indy-running-locally.md + setup-iptables.md node-monitoring-tools-for-stewards.md node-state-diagnostic-tools.md - pool-upgrade.md - requests-new.md - setup-dev.md - setup-iptables.md - transactions.md + ci-cd.md + indy-file-structure-guideline.md write-code-guideline.md + setsup-dev.md 1.3_to_1.4_migration_guide.md diff --git a/docs/source/indy-running-locally.md b/docs/source/indy-running-locally.md deleted file mode 100644 index 3d739dc11..000000000 --- a/docs/source/indy-running-locally.md +++ /dev/null @@ -1,186 +0,0 @@ -# Indy – Running the Getting Started tutorial locally - -## Overview - -Currently, out of the box, the [Getting Started](https://github.com/hyperledger/indy-node/blob/stable/getting-started.md) tutorial uses externally running nodes and assumes that these are all up and running. -However, being test nodes, sometimes they aren’t, or sometimes you just want to see everything flowing through in a local environment. - -This guide describes the process of setting up a local 4 node cluster and attaching the 3 Agents required [use the Indy CLI](https://github.com/hyperledger/indy-node/blob/master/getting-started.md#using-the-indy-cli) and impersonate Alice. - -**WARNING:** This script is not intended way to start the pool. You can install a test network in one of several ways: - - - **Automated VM Creation with Vagrant** [Create virtual machines](environment/vagrant/training/vb-multi-vm/TestIndyClusterSetup.md) using VirtualBox and Vagrant. - - **Docker:** [Start Pool and Client with Docker](environment/docker/pool/StartIndyAgents.md). - - - -## Requirements - -It's recommended to use an Ubuntu Virtual Machine and virtual environment if possible. -Please follow the [setup-dev](https://github.com/hyperledger/indy-node/blob/master/docs/setup-dev.md) instruction for pre-requisites and dependencies. -As for installation of indy-node, it's recommended to create a separate virtual environment and install indy-node there as - -``` -pip install indy-node-dev -``` - -Finally make sure that `pytest` module is installed (it is required to run test-related functionality like Faber, Acme and ThriftBank test agents): - -``` -pip install pytest -``` - -## Initial setup - -In your home folder, create an Indy folder. In here we are going to put the scripts we will use to setup the environment. Then change into this folder. - -First of all we need to create basic folder structure. It could be done with the following command - -``` -create_dirs.sh -``` -Please note, that you need ```root``` privileges to run the script. the script will create directories and grant current user full access rights -``` -/etc/indy - main config directory -/var/lib/indy - main data directory -/var/log/indy - main log directory -``` - -Now we are ready to create our nodes. - -Create a script ```setupEnvironment.sh``` containing: - -``` -# Remove node data -rm -rf /var/lib/indy - - -# Create nodes and generate initial transactions -generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4 - - -echo Environment setup complete -``` - -This first clears out the ~/.indy folder (if it exists), creates 4 nodes and then generates all the necessary initial transactions and Stewards. - -Make the script executable (chmod +x setupEnvironment.sh). - -At this point you are ready to build your environment. - -## Start nodes - -So, if you run the setupEnvironent.sh script, you should see a whole lot of output of the nodes and transactions being created. - -At this point you are now ready to start the nodes. - -Open up 4 new terminal windows and in each one run one of the following commands (one in each window): -``` -start_indy_node Node1 0.0.0.0 9701 0.0.0.0 9702 -start_indy_node Node2 0.0.0.0 9703 0.0.0.0 9704 -start_indy_node Node3 0.0.0.0 9705 0.0.0.0 9706 -start_indy_node Node4 0.0.0.0 9707 0.0.0.0 9708 -``` - -This will start each node which should connect to each other, do their handshaking and will elect a master and backup. -At this point you have a nice 4 node Indy cluster running. - -## Attach Agents to the cluster - -Before we can connect the Faber, Acme and Thrift Agents to the cluster, we have to register (onboard) them with the cluster first. -To do this, we have to type the following commands using the Indy CLI tools started by typing ```indy```: - -1. Add the Steward key into the Keyring to assume the Steward role. Which is a trusted entity that was created earlier as part of the generate transactions process. Its key seed has been hardcoded into the test scripts at the moment so is pre-generated: -``` -new key with seed 000000000000000000000000Steward1 -``` -2. Connect to the cluster as this Steward to the test Indy cluster we are running locally: -``` -connect sandbox -``` -3. Register each Agent identifier (NYM) with the Trust Anchor role which allows to on-board other identifiers: -``` -send NYM dest=ULtgFQJe6bjiFbs7ke3NJD role=TRUST_ANCHOR verkey=~5kh3FB4H3NKq7tUDqeqHc1 -send NYM dest=CzkavE58zgX7rUMrzSinLr role=TRUST_ANCHOR verkey=~WjXEvZ9xj4Tz9sLtzf7HVP -send NYM dest=H2aKRiDeq8aLZSydQMDbtf role=TRUST_ANCHOR verkey=~3sphzTb2itL2mwSeJ1Ji28 -``` -4. Impersonate each Agent owner (using pre-generated key seeds like for the Steward) and register its endpoint as an attribute against the NYM. - -``` -new key with seed Faber000000000000000000000000000 -send ATTRIB dest=ULtgFQJe6bjiFbs7ke3NJD raw={"endpoint": {"ha": "127.0.0.1:5555", "pubkey": "5hmMA64DDQz5NzGJNVtRzNwpkZxktNQds21q3Wxxa62z"}} - -new key with seed Acme0000000000000000000000000000 -send ATTRIB dest=CzkavE58zgX7rUMrzSinLr raw={"endpoint": {"ha": "127.0.0.1:6666", "pubkey": "C5eqjU7NMVMGGfGfx2ubvX5H9X346bQt5qeziVAo3naQ"}} - -new key with seed Thrift00000000000000000000000000 -send ATTRIB dest=H2aKRiDeq8aLZSydQMDbtf raw={"endpoint": {"ha": "127.0.0.1:7777", "pubkey": "AGBjYvyM3SFnoiDGAEzkSLHvqyzVkXeMZfKDvdpEsC2x"}} -``` - -At this point we can start the Agents as follows, using separate sessions/windows (using [screen](https://www.gnu.org/software/screen/) for instance). - -``` -python /usr/local/lib/python3.5/dist-packages/indy_client/test/agent/faber.py --port 5555 --network -python /usr/local/lib/python3.5/dist-packages/indy_client/test/agent/acme.py --port 6666 --network -python /usr/local/lib/python3.5/dist-packages/indy_client/test/agent/thrift.py --port 7777 --network -``` -REM: you may have to change the path to your Python interpreter and the libraries according to your environment (i. e.: ```/bin/python3.5 ~/.virtualenvs/indy/lib/python3.5/site-packages/indy_client/test/agent/...```). - -Each Agent should then start up, connect to our test Indy cluster, handshake and be accepted as a Trust Anchor. - -## Run the Getting Started Guide - -At this point, you can follow the Getting Started Guide from [Using Indy CLI](https://github.com/hyperledger/indy-node/blob/master/getting-started.md#using-the-indy-cli). -I recommend you use a separate Indy CLI instance for this. - -Here are the resulting commands ready to copy/paste: - -``` -prompt Alice -connect test - -show sample/faber-invitation.indy -load sample/faber-invitation.indy -sync faber -show link faber -accept invitation from faber - -show claim Transcript -request claim Transcript -show claim Transcript - -show sample/acme-job-application.indy -load sample/acme-job-application.indy -sync acme -accept invitation from acme - -show proof request Job-Application -set first_name to Alice -set last_name to Garcia -set phone_number to 123-45-6789 -show proof request Job-Application -send proof Job-Application to Acme - -show link acme - -request claim Job-Certificate -show claim Job-Certificate - -show sample/thrift-loan-application.indy -load sample/thrift-loan-application.indy -sync thrift -accept invitation from thrift - -show proof request Loan-Application-Basic -send proof Loan-Application-Basic to Thrift Bank - -show proof request Loan-Application-KYC -send proof Loan-Application-KYC to Thrift Bank -``` - -# Resetting the Indy environment - -If you wish to reset your Indy environment and recreate it again, you can run ```clear_node.py --full```. - -Then, when you want to re-create your environment from scratch, ensure that all the nodes and agents are stopped and just run the setupEnvironment.sh script. -Then you can restart the Nodes, attach the agents, and away you go again.