Skip to content

Commit

Permalink
removal of old indy-cli from docs
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Schlarb <[email protected]>
  • Loading branch information
pSchlarb committed May 11, 2023
1 parent d76e907 commit 175e44f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 141 deletions.
112 changes: 2 additions & 110 deletions docs/source/NewNetwork/CLIInstall.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,14 @@
# Installing the `indy-cli`

The `indy-cli` is developed under the [indy-sdk](https://github.com/hyperledger/indy-sdk). This documentation may be not up to date.
The `indy-cli` is developed under the [indy-cli-rs](https://github.com/hyperledger/indy-cli-rs). This documentation may be not up to date.

>As stated in [Installation and configuration of Indy-Node](../installation-and-configuration.md) `indy-cli` can be replaced with [`indy-cli-rs`](https://github.com/hyperledger/indy-cli-rs)
>This documentation describes the necessarry steps with `indy-cli`, keep in mind that everytime `indy-cli` is mentioned you can also use `indy-cli-rs`. Please refer to the corresponding documentation.

You will need to perform the following once for each `indy-cli` machine you would like to set up (only 1 is required).
It is recommended that you install the `indy-cli` in your native work environment if possible, so you always have it available even when traveling.

## Installing `indy-cli-rs`
To install `indy-cli-rs` simply donwload the latest release from its release pages and unpack it.
To install `indy-cli-rs` simply download the latest release from its release pages and unpack it.

## Containerized `indy-cli` Environment

The following sections describe how to install and configure the `indy-cli` directly on a machine or VM. However, possibly the most convenient option is to use a containerized `indy-cli` environment like the one included with [von-network](https://github.com/bcgov/von-network). For information on how to use the containerized `indy-cli` in `von-network`, refer to [Using the containerized indy-cli](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md)

## Windows:
To install the `indy-cli` on Windows 10 perform the following steps:
1. Download https://repo.sovrin.org/windows/indy-cli/stable/1.16.0/indy-cli_1.16.0.zip and unzip it.
If there is a newer version under https://repo.sovrin.org/windows/indy-cli/stable/ it instead.
2. Open a command prompt. (This will work differently if you use Windows Terminal).
3. `cd` to the directory where you unzipped the `indy-cli` package. For example, if you unzipped directly in your ‘downloads’ directory like I did you would type: `cd \Users\<Username>\Downloads\indy-cli_1.14.2`
4. Create a JSON Config file containing your taaAcceptanceMechanism in the directory where indy-cli.exe resides (I created \Users\<Username>\Downloads\indy-cli_1.14.2\cliconfig.json on my machine)
```json
{
"taaAcceptanceMechanism": "for_session"
}
```
5. Run `indy-cli.exe --config cliconfig.json` to verify proper installation. You should see a new window appear with an `indy>` prompt, (If you are double clicking to start `indy-cli`, you need to right click on the .exe in your window and add the --config parameter first.) If you get an error stating that it is missing vcruntime140.dll then do the following:
6. Download and install vc_redist.x64.exe from the Visual Studio 2017 section on the https://support.microsoft.com/en-ae/help/2977003/the-latest-supported-visual-c-downloads page, and then rerun indy-cli.exe to see if it works as described in previous step.
7. Type ‘exit’ in the `indy-cli`

## Ubuntu:
To install the `indy-cli` on Ubuntu, perform the following steps from the ubuntu command line:

1. `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88`
2. `sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"`
3. `sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial stable"`
4. `sudo apt-get update -y`
5. `sudo apt-get upgrade -y `
6. `sudo apt-get install -y indy-cli`
7. `cd ~`
8. Create a JSON Config file containing your taaAcceptanceMechanism in your home directory:
`vim ~/cliconfig.json`

Press the “i” key and paste the following into the file:
```json
{
"taaAcceptanceMechanism": "for_session"
}
```
Press the “esc” key then the following characters to write the file and quit
`:wq`
9. Run `indy-cli --config ~/cliconfig.json` to start the `indy-cli`

## Mac:

Since there is not a prepackaged version of the `indy-cli` prepared for the Mac, the following steps will help you to create an environment, build, and run the `indy-cli` in a Mac terminal.

Open a Terminal
Run the following commands in the terminal:

1. `cd ~`
2. `mkdir github`
3. `cd github`
4. `git clone https://github.com/hyperledger/indy-sdk.git`(might need xcode-select --install if error occurs)
5. `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
6. `curl https://sh.rustup.rs -sSf | sh`
7. Follow onscreen instructions to install rust
8. `brew install pkg-config libsodium automake autoconf cmake openssl zeromq zmq`
NOTE: the openssl path needs to match what you currently have on your system

9. Run > `ls /usr/local/Cellar/openssl/`
Note the name of the directory shown (the example below shows 1.0.2p but the latest version is 1.1.1l)

Use this directory in place of the one listed below in your .profile file

10. Add the following lines to your` ~/.profile file `(making the correction shown in the previous step if needed)
```
export PATH="$HOME/.cargo/bin:$PATH:~/github/indy-sdk/libindy/target/debug:~/github/indy-sdk/cli/target/debug"
export PKG_CONFIG_ALLOW_CROSS=1
export CARGO_INCREMENTAL=1
export RUST_LOG=indy=trace
export RUST_TEST_THREADS=1
export OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2p #use your path
export LIBRARY_PATH=~/github/indy-sdk/libindy/target/debug/
export LIBINDY_DIR=~/github/indy-sdk/libindy/target/debug/
```
11. Run the following commands from your terminal to build the `indy-cli`:
```
source ~/.profile
cd ~/github/indy-sdk/libindy
cargo build
cd ../cli
cargo build
```
12. Create a JSON Config file containing your taaAcceptanceMechanism in your home directory:
`vim ~/cliconfig.json`
Press the “i” key and paste the following into the file:
```json
{
"taaAcceptanceMechanism": "for_session"
}
```
Press the “esc” key then the following characters to write the file and quit
`:wq`
13. You can now run `indy-cli` from within a terminal by typing
`indy-cli --config ~/cliconfig.json`
`indy> exit` (To exit from the `indy-cli` prompt when you ar done)
If the above gives error regarding library not loaded libssl.1.0.0, you will probably need to run the following command (all in one line should work) to revert your version:
```
brew uninstall --ignore-dependencies openssl; brew uninstall openssl;
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
```
6 changes: 2 additions & 4 deletions docs/source/NewNetwork/CreateDID.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

You will need to perform the following commands once for each `indy-cli` machine that you want to run on. The following commands contain suggestions to save certain values in a secure place. Please do not share those values or that place with anyone.

>As stated in [Installation and configuration of Indy-Node](../installation-and-configuration.md) `indy-cli` can be replaced with [`indy-cli-rs`](https://github.com/hyperledger/indy-cli-rs)
>This documentation describes the necessarry steps with `indy-cli`, keep in mind that everytime `indy-cli` is mentioned you can also use `indy-cli-rs`. Please refer to the corresponding documentation.

_If you just need to quickly generate a set of secrets (Seed and wallet key), or a Seed, DID, and Verkey and do not have an `indy-cli` environment already setup, you can use the `indy-cli` features integrated into `von-network`. Refer to [Generate a set of Secrets](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md#generate-a-set-of-secrets), and [Generate your DID](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md#generate-your-did) for details._
_If you just need to quickly generate a set of secrets (Seed and wallet key), or a Seed, DID, and Verkey and do not have an `indy-cli-rs` environment already setup, you can use the `indy-cli` features integrated into `von-network`. Refer to [Generate a set of Secrets](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md#generate-a-set-of-secrets), and [Generate your DID](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md#generate-your-did) for details._


1. Start your `indy-cli` using the instructions from [Installing the `indy-cli`](./CLIInstall.md) for your platform.

All following commands are executing inside the `indy-cli`.
All following commands are executing inside the `indy-cli-rs`.

2. Create a wallet with:

Expand Down
37 changes: 13 additions & 24 deletions docs/source/installation-and-configuration.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Installation and configuration of Indy-Node

## 1. Introduction
The purpose of this document is to describe how to setup a production level Indy-Validator-Node and register it on an existing network using an `indy-cli` machine which you also configure along the way.
>Alternativly you can use [`indy-cli-rs`](https://github.com/hyperledger/indy-cli-rs), which is command for command compatible with the existing indy-cli (at least ATM).
>This documentation describes the necessarry steps with `indy-cli`, keep in mind that everytime `indy-cli` is mentioned you can also use `indy-cli-rs`. Please refer to the corresponding documentation.
The purpose of this document is to describe how to setup a production level Indy-Validator-Node and register it on an existing network using an `indy-cli-rs` machine which you also configure along the way.


This documentation is based heavily on the [Sovrin Steward Validator Preparation Guide v3](https://docs.google.com/document/d/18MNB7nEKerlcyZKof5AvGMy0GP9T82c4SWaxZkPzya4).

Expand Down Expand Up @@ -38,7 +37,7 @@ As you proceed through these steps, you will be generating data that will be nee
- A cryptographic check against certain forgeries that can be done with BLS keys.

### 2.1 Two Machines
You’ll need two machines: one is your Validator node and the other an `indy-cli` machine to run the `indy-cli` with which you will interact with the ledger. They can be physical machines, virtual machines, or a combination. The machine with the `indy-cli` can be turned on and off at your convenience (refer to [3.1. `indy-cli` Machine Installation](##3.1.-indy-cli-Machine-Installation) for more details), only the Validator node needs to be public and constantly running.
You’ll need two machines: one is your Validator node and the other an `indy-cli` machine to run the `indy-cli-rs` with which you will interact with the ledger. They can be physical machines, virtual machines, or a combination. The machine with the `indy-cli` can be turned on and off at your convenience (refer to [3.1. `indy-cli` Machine Installation](##3.1.-indy-cli-Machine-Installation) for more details), only the Validator node needs to be public and constantly running.

>Important: for security reasons, you must not use your Validator node as an `indy-cli` client. If you do, it could expose your Steward credentials needlessly.
Expand Down Expand Up @@ -73,22 +72,12 @@ Your Validator node will need to have an alias. This will be used later when we

Some instructions must be executed on the Validator node, and others on the `indy-cli` machine. The command line prompts in the instructions will help remind you which machine should be used for each command.

### 3.1. `indy-cli` Machine Installation

The following instructions describe how to install and configure the `indy-cli` directly on a machine or VM. The other, possibly more convenient, option is to use a containerized `indy-cli` environment like the one included with [von-network](https://github.com/bcgov/von-network). For information on how to use the containerized `indy-cli` in `von-network`, refer to [Using the containerized indy-cli](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md)
### 3.1. `indy-cli-rs` Machine Installation

#### 3.1.1. Install the `indy-cli`
On the machine you’ve chosen for the `indy-cli`, open a terminal and run the following lines to install the `indy-cli` package.
The following instructions describe how to install and configure the `indy-cli-rs` directly on a machine or VM. The other, possibly more convenient, option is to use a containerized `indy-cli` environment like the one included with [von-network](https://github.com/bcgov/von-network). For information on how to use the containerized `indy-cli` in `von-network`, refer to [Using the containerized indy-cli](https://github.com/bcgov/von-network/blob/main/docs/Indy-CLI.md)

```
ubuntu@cli$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
ubuntu@cli$ sudo apt-get install -y software-properties-common python-software-properties
ubuntu@cli$ sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
ubuntu@cli$ sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial stable"
ubuntu@cli$ sudo apt-get update -y
ubuntu@cli$ sudo apt-get upgrade -y
ubuntu@cli$ sudo apt-get install -y indy-cli
```
#### 3.1.1. Install the `indy-cli-rs`
On the machine you’ve chosen for the `indy-cli-rs` simply donwload the latest release from its release pages and unpack it.

#### 3.1.2. Add an Acceptance Mechanism
To write to an Indy Node Ledger, you’ll need to sign the Transaction Author Agreement (TAA). You can learn more about the TAA [here](https://github.com/hyperledger/indy-sdk/blob/master/docs/how-tos/transaction-author-agreement.md). This agreement is incorporated into the process of connecting to the node pool and requires an acceptance mechanism. For the `indy-cli`, the default mechanism is “For Session” and the following instructions are required to be able to use “For Session” for your `indy-cli`:
Expand All @@ -103,12 +92,12 @@ This example cliconfig.json file contains the line that sets the AML:
```

To start the `indy-cli` using your new config file, run the following:
`ubuntu@cli$ indy-cli --config <path_to_cfg>/cliconfig.json`
`ubuntu@cli$ indy-cli-rs --config <path_to_cfg>/cliconfig.json`

Now all of the appropriate transactions will have an “Agreement Accepted” authorization attached to them during this `indy-cli` session.

#### 3.1.3. Obtain the Genesis Files
Obtain the genesis transaction files for the Network with the following steps. For the sake of this documentation, we will use the genesis files from the Sovrin Networks. Information on how to create a genesis file can be found [here](./NewNetwork/NewNetwork.md). These files contain bootstrap information about some of the Validator nodes, which will be used by your `indy-cli` to connect to the networks.
Obtain the genesis transaction files for the Network with the following steps. For the sake of this documentation, we will use the genesis files from the Sovrin Networks. Information on how to create a genesis file can be found [here](./NewNetwork/NewNetwork.md). These files contain bootstrap information about some of the Validator nodes, which will be used by your `indy-cli-rs` to connect to the networks.

If you are at the `indy` prompt, please exit:

Expand Down Expand Up @@ -152,9 +141,9 @@ ShahXae2ieG1uibeoraepa4eyu6mexei
Keep this seed in a safe place, such as an encrypted password manager or other secure location designated by your organization. You will need it later in this guide, as well as in the future for other Steward interactions with the ledger.

##### Run the `indy-cli` and generate key
Next we run the `indy-cli` by entering:
Next we run the `indy-cli-rs` by entering:

`ubuntu@cli$ indy-cli --config <path_to_cfg>/cliconfig.json`
`ubuntu@cli$ indy-cli-rs --config <path_to_cfg>/cliconfig.json`

In the command line, enter the following to create your pool configuration and your wallet locally. In these instructions, we use "buildernet" for the pool name and "buildernet_wallet" for the wallet name, although you may use other names of your choosing, if desired. The encrypted wallet will be used to store important information on this machine, such as your public and private keys. When creating your wallet, you will need to provide a "key" that is any string desired. It will be the encryption key of your local wallet.

Expand Down Expand Up @@ -351,10 +340,10 @@ dpkg -l | grep indy
```

##### Add Validator Node to Ledger
On your `indy-cli` machine, if you are not still on the `indy-cli` prompt, you will need to return to it. To get back to where you were, type `indy-cli --config <path_to_cfg>/cliconfig.json`, connect to the network pool, designate the wallet to use (using the same wallet key as before), and enter the DID that was returned earlier, when you typed `did new seed` (then enter your seed) for your Steward user:
On your `indy-cli` machine, if you are not still on the `indy-cli-rs` prompt, you will need to return to it. To get back to where you were, type `indy-cli --config <path_to_cfg>/cliconfig.json`, connect to the network pool, designate the wallet to use (using the same wallet key as before), and enter the DID that was returned earlier, when you typed `did new seed` (then enter your seed) for your Steward user:

```
ubuntu@cli$ indy-cli --config <path_to_cfg>/cliconfig.json
ubuntu@cli$ indy-cli-rs --config <path_to_cfg>/cliconfig.json
indy> pool connect buildernet
indy> wallet open buildernet_wallet key=<wallet_key>
indy> did use <your_steward_DID>
Expand Down
4 changes: 1 addition & 3 deletions sample/Network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

This walkthrough goes through some of the detailed steps mentioned in [Setting up a New Network](../../docs/source/NewNetwork/NewNetwork.md)

>As stated in [Installation and configuration of Indy-Node](../../docs/source/installation-and-configuration.md) `indy-cli` can be replaced with [`indy-cli-rs`](https://github.com/hyperledger/indy-cli-rs)
>This documentation describes the necessarry steps with `indy-cli`, keep in mind that everytime `indy-cli` is mentioned you can also use `indy-cli-rs`. Please refer to the corresponding documentation.

For the sake of simplicity this walkthrough runs all of the nodes on the local machine. As a result it uses the local python install version of some of the commands rather than the production level Debian package install version of the commands documented in the [Setting up a New Network](../../docs/source/NewNetwork/NewNetwork.md) guide.

1. Open indy-cli by executing `indy-cli`
1. Open indy-cli by executing `indy-cli-rs`

Note that the command prompt changed to `indy>`.

Expand Down

0 comments on commit 175e44f

Please sign in to comment.