# Vault Subscription - CLI Guide

{% stepper %}
{% step %}

### Download The CLI File <a href="#step-1-download-the-cli-file" id="step-1-download-the-cli-file"></a>

* Visit the Prodigy.Fi CLI repository: <https://github.com/prodigyfi/dci-cli>
* Click the green **Code** button in the top-right corner.
* Select **Download ZIP** and save the file to your computer (eg; in your Downloads folder).
* Unzip the file to access the dci-cli-main folder.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FGyHBWGYVZ2sYphjwrfhm%2Fimage.png?alt=media&#x26;token=87a4616e-4d32-4707-afeb-b2e44eb72588" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Install A Code Editor <a href="#step-2-install-a-code-editor" id="step-2-install-a-code-editor"></a>

* Download and install a code editor, such as Visual Studio Code, if you don’t have one.
* Open the dci-cli-main folder in your code editor:
* In Visual Studio Code, click **File** > **Open Folder** and select the dci-cli-main folder.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FRyPBOURLVC093EfLLfX6%2Fimage.png?alt=media&#x26;token=78c4d75b-9766-4e6e-a2ac-9979fc770c04" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Rename Your Files <a href="#step-3-rename-your-files" id="step-3-rename-your-files"></a>

* In the dci-cli-main folder, locate the files `config.example.json` and `create-vaults.example.csv`.
* Create copies of these files and rename them:
  * `config.example.json` → `config.json`
  * `create-vaults.example.csv` → `create-vaults.csv`
* To rename:
  * Alternatively, in Finder (Mac) or File Explorer (Windows), right-click, select **Duplicate** or **Copy/Paste**, and rename.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FjPY7NlidnuzNcgppbjGt%2Fimage.png?alt=media&#x26;token=255a5feb-3669-455d-aab8-2f2c9ca75abc" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure The RPC Node URL <a href="#step-4-configure-the-rpc-node-url" id="step-4-configure-the-rpc-node-url"></a>

* Open config.json in your code editor.
* Fill in the `rpcNode` parameter with the RPC node URL for your chosen blockchain network. This connects the CLI tool to the network. You can find the list of RPC nodes available [here](https://chainlist.org/).
* Copy any one of the link shown on the website

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2F6Azcw820oqORhM5KImdi%2Fimage.png?alt=media&#x26;token=fa48ba51-e99a-4369-965b-7bcba7daafa1" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Fill In The `rpcNode` Section

* Input the copied link into the rpcNode section

{% hint style="info" %}
*Note: Fill the config file under the network that you are running your CLI tool on. For example, if you trying to run the CLI tool on Base testnet, fill up the file under "Base Testnet" as shown in the example below.*
{% endhint %}

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2F7JtIKX2fYqNYznEaxebl%2Fimage.png?alt=media&#x26;token=7c880435-1160-4699-9319-f03891076522" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Configure Wallet <a href="#step-5-configure-wallet" id="step-5-configure-wallet"></a>

* Add the `account` parameter with your wallet address.
* Replace the placeholder, `lp_account` , with your wallet address.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2F572Y2xUWcYdKwoKElEqI%2Fimage.png?alt=media&#x26;token=eb0b6804-b236-46a3-a23d-9c97fe89479a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Obtain Json Wallet & Passphrase <a href="#step-6-obtain-json-wallet-and-passphrase" id="step-6-obtain-json-wallet-and-passphrase"></a>

To obtain the `JSON wallet` and `passphrase`, follow these steps:

* Open your folders, and go to the file you downloaded in Step 1.
* Right-click on the folder (the unzipped version), and click Copy (**Cmd + C** or **Ctrl + C**).

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FuJv1MJw4xcAl25pnsTpa%2Fimage.png?alt=media&#x26;token=47a1d044-3e35-4312-bcd0-3705393b1753" alt=""><figcaption></figcaption></figure>

* Open your terminal (Mac) or command prompt (Windows), type `cd`, press the spacebar, and paste the folder path (**Cmd + V** or **Ctrl + V**).
* It should look something like: `cd /Users/username/Downloads/dci-cli-main`.
  * “username” is your Mac username (type whoami in terminal to check).
  * “Downloads” is where your file is stored.
  * “dci-cli-main” is the name of your folder.

{% hint style="info" %}
**Note**: If you stored or renamed your folder, the folder path may look different
{% endhint %}

* **Run this command:**&#x20;
  * **`npm i`**
* If it shows an error, follow the instructions and run the fix comman&#x64;**:**
  * **`npm audit fix --force`**
* Once all the issues are fixed, run this command:&#x20;
  * **`npx ts-node src/encrypt_wallet.ts`**
* Enter the private key of the wallet you are trying to create your vaults with.
* Set your `passphrase`
* After you have done so, a new keystore should be generated. It should look something like this: keystore/0xXXXXXXXXX.json. This will be your `JSON wallet.`
* Copy the `Json wallet` and `passphrase` into the config.json file.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2F8xlc7sfv9s6AjMaucI6N%2Fimage.png?alt=media&#x26;token=b91a5ecb-9ec8-457b-95d9-674ec140543c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Obtain Vault Address

* Head over to the Subscribe & Earn section on Prodigy.Fi
* Select that vault you want to subscribe to by clicking on the "Subscribe" button

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FDhWwnmEyet65IbVr4tvX%2Fimage.png?alt=media&#x26;token=c6750f08-c711-4553-a65f-0ecea359a7e1" alt=""><figcaption></figcaption></figure>

* On the bottom right hand corner, you will find the vault's address. Copy the vault address

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2F1FVhSKWHpMobZLn8swGB%2Fimage.png?alt=media&#x26;token=8e116eb1-7e91-4a49-b061-b8274b268923" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure The Vault Subscription Command

* Now that you have copied the vault address, paste it in this program:

{% code overflow="wrap" %}

```
npx ts-node ./src/main.ts "<Blockchain>" subscribeVault --vault <vault address> --amount <amount>.
```

{% endcode %}

* Replace the `<vault address>` with the vault address you copied in step 8
* Replace `<amount>` with your desired subscription amount (eg; 100).
* Replace `<Blockchain>`  with the network you are subscribing to vaults on via Prodigy.Fi, (eg; Base Mainnet, Base Testnet)
* It should look something like this:

  <pre data-overflow="wrap"><code>npx ts-node ./src/main.ts "Base Mainnet" subscribeVault --vault 0x1a1f9604eab571b98adeb2c63fe11cc923c8f6d9 --amount 100.
  </code></pre>

{% hint style="info" %}
The vault address varies depending on the specific vault you choose to subscribe to.
{% endhint %}
{% endstep %}

{% step %}

### Run The Command

* Run the command from step 9 in your terminal or command prompt.
* Once the vault is created, you will see the message “Vault \<vault address> subscribed successfully”.

<figure><img src="https://1498879445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0xUM1AtBZof4xC0ubVWO%2Fuploads%2FTIVXcZsiwUXwDc6My4CM%2Fimage.png?alt=media&#x26;token=ce40f04b-1f50-4871-a735-035b49671053" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
