Skip to content

Commit

Permalink
FLA-297: Documenting how to deposit collateral with the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenflare authored and segfaultxavi committed Jul 16, 2024
1 parent ccf83f1 commit a4232fe
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 7 deletions.
74 changes: 74 additions & 0 deletions docs/user/fassets/depositing-collateral-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Depositing Collateral (CLI)
---

# Using the Command Line to Deposit Collateral

As a user of the [FAssets](../../tech//fassets/index.md) system, you can deposit collateral into an agent's [collateral pool](../../tech/fassets/collateral.md#pool-collateral) to provide additional financial backing for the agent.
In exchange for your collateral, you will earn shares of the agent's fees.
Additionally, you will receive [collateral pool tokens](../../tech/fassets/collateral.md#pool-collateral), which you will be able to redeem, transfer, or trade.

While the functionality to deposit collateral via a dapp is being developed, this guide is for users who have some experience using a terminal.
It provides the following information:

* How to set up the FAssets command-line tool
* How to get a list of available agents
* How to deposit collateral into a selected agent's collateral pool

--8<-- "./include/fassets/open-beta.md"

--8<-- "./include/fassets/setup-commandline.md"

### Configure User's Access Keys

The FAsset user operates with multiple keys for the Flare and underlying network chains.

1. Generate the user's secrets using this command:

```console
yarn key-gen generateSecrets --user -o secrets.json
```

--8<-- "./include/fassets/generate-keys-info.md"

2. Fund the user's FLR wallet with some CFLR to pay the gas fees.
You can find the user wallet's address in the `secrets.json` file under the `user.native.address` key.
You can get the CFLR tokens from the [Flare faucet](https://faucet.flare.network/).

3. Prevent other users from reading the `secrets.json` file:

```console
chmod 600 secrets.json
```

4. Fill the `indexer` field in the `secrets.json` file with the following values:

```json
"indexer": "123456",
```

!!! info

These values apply only to the [Coston Testnet](../../dev/reference/network-config.md) and will be different for other networks.

## Depositing Collateral into an Agent's Collateral Pool

The collateral pool can contain only `$CFLR`, so ensure you funded your wallet with tokens from the faucet, as described in step 2 above.

1. Use the command below to list all available agents:

```console
yarn user-bot --fasset FTestXRP agents
```

A list of agents is displayed.

2. Copy the address of an agent in the list.
3. Use the command below to send your collateral to the agent.
Replace `AGENT_ADDRESS` with the address you copied in the previous step, and replace `CFLR_AMOUNT` with a portion of the funds you received from the faucet.

```console
yarn agent-bot buyPoolCollateral AGENT_ADDRESS CFLR_AMOUNT --fasset FTestXRP
```

A message indicates the amount of collateral you successfully provided to the selected agent's collateral pool.
9 changes: 5 additions & 4 deletions docs/user/fassets/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Minting and Redeeming FAssets
# FAssets

The following guide explains how to mint and redeem [FAssets](../../tech/fassets/index.md).
The following guides explains how to manage [FAssets](../../tech/fassets/index.md).

* [Using the Command Line](./minting-redeeming-cli.md)
* [Using the FAssets Demo Dapp](./minting-redeeming-dapp.md)
* [Using the Command Line to Deposit Collateral](./depositing-collateral-cli.md)
* [Using the Command Line to Mint and Redeem FAssets](./minting-redeeming-cli.md)
* [Using the FAssets Demo Dapp to Mint and Redeem FAssets](./minting-redeeming-dapp.md)
9 changes: 8 additions & 1 deletion docs/user/fassets/minting-redeeming-cli.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
---
title: Minting and Redeeming (CLI)
---

# Using the Command Line to Mint and Redeem FAssets

Users of the [FAssets](../../tech//fassets/index.md) system can mint and redeem FAssets, allowing tokens on blockchains that do not support smart contracts to be used trustlessly with smart contracts on the Flare blockchain.

This guide provides the following information:
This guide is for advanced users who having some experiencing using a terminal.
It provides the following information:

* How to set up the FAssets command-line tool.
* How to convert testnet XRP to FAssets (FTestXRP) on the Flare test network (minting).
* How to convert FAssets (FTestXRP) from Flare test network back to testnet XRP Ledger network (redemption).

Alternatively, you can [use the dapp to mint and redeem FAssets](./minting-redeeming-dapp.md).

--8<-- "./include/fassets/open-beta.md"

--8<-- "./include/fassets/setup-commandline.md"
Expand Down
5 changes: 5 additions & 0 deletions docs/user/fassets/minting-redeeming-dapp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
title: Minting and Redeeming (Dapp)
---

# Using the FAssets Demo Dapp to Mint and Redeem FAssets

Users of the [FAssets](../../tech//fassets/index.md) system can use the FAssets Demo Dapp with their [Bifrost wallet](https://bifrostwallet.com/?utm_source=flare_network&utm_medium=blog&utm_campaign=fasset_open_beta) to mint and redeem FAssets, which allow tokens on blockchains that do not support smart contracts to be used trustlessly with smart contracts on the Flare blockchain.
Alternatively, you can [use the command line to mint and redeem FAssets](./minting-redeeming-cli.md).

In this guide you will deposit some test XRP tokens into an XRP account and use the FAssets system to mint them into FTestXRP FAsset tokens on the Coston network.
You will receive these tokens in a Coston account.
Expand Down
4 changes: 2 additions & 2 deletions include/fassets/setup-commandline.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Prerequisites

To participate in the open beta, you need a server with at least a minimum of 2 CPUs and 4GB RAM, or 2GB if the database is on a separate server.
You need a server with at least a minimum of 2 CPUs and 4GB RAM, or 2GB if the database is on a separate server.

You will need knowledge of the following tools:
You need knowledge of the following tools:

* [Git](https://git-scm.com/) version control system
* [Yarn](https://yarnpkg.com/) package manager
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ nav:
- user/automatic-claiming.md
- FAssets:
- user/fassets/index.md
- user/fassets/depositing-collateral-cli.md
- user/fassets/minting-redeeming-cli.md
- user/fassets/minting-redeeming-dapp.md
- Governance:
Expand Down

0 comments on commit a4232fe

Please sign in to comment.