Skip to content

Commit

Permalink
docs: Replace oasis-node CLI with oasis CLI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Apr 7, 2023
1 parent d8a3c46 commit e1f5eac
Show file tree
Hide file tree
Showing 12 changed files with 430 additions and 37 deletions.
2 changes: 1 addition & 1 deletion docs/general/manage-tokens/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For your own security and peace of mind, please only use wallets that are listed
findSidebarItem('/general/manage-tokens/terminology'),
findSidebarItem('/general/manage-tokens/staking-and-delegating'),
findSidebarItem('/general/manage-tokens/oasis-wallets/'),
findSidebarItem('/general/manage-tokens/advanced/oasis-cli-tools/'),
findSidebarItem('/general/manage-tokens/cli/'),
findSidebarItem('/general/manage-tokens/holding-rose-tokens/custody-providers'),
findSidebarItem('/general/manage-tokens/holding-rose-tokens/bitpie-wallet'),
findSidebarItem('/general/manage-tokens/holding-rose-tokens/ledger-wallet'),
Expand Down
5 changes: 1 addition & 4 deletions docs/general/manage-tokens/advanced/oasis-cli-tools/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ To run a command that requires a connection to an online Oasis node (i.e. the `s

Here are some examples of Oasis Node CLI commands that need a connection to an online Oasis node:

* `oasis-node stake info`: Shows general staking information.
* `oasis-node stake list`: Lists all accounts with positive balance.
* `oasis-node stake account info`: Shows detailed information for an account.
* `oasis-node consensus submit_tx`: Submits a pre-generated transaction to the network.


## Local commands

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Escrow Account:
...
```

We can observe that both, the general account and the escrow account (actively bounded and debonding), have a balance of 0 tokens.
We can observe that both, the general account and the escrow account (actively
bounded and debonding), have a balance of 0 tokens.

## Generate a Transfer Transaction

Expand Down
33 changes: 33 additions & 0 deletions docs/general/manage-tokens/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Oasis CLI

Oasis command-line interface (CLI) is a powerful all-in-one tool for
interacting with the Oasis Network. You can download the latest release
binaries from the [GitHub repository].

It boasts a number of handy features:

- Flexible setup:
- supports Mainnet, Testnet, Localnet or any other Oasis network deployment
- consensus layer configuration with arbitrary token
- configuration of custom ParaTimes with arbitrary token
- connecting to remote (via TCP/IP) or local (Unix socket) Oasis node
instance
- Powerful wallet features:
- standard token operations (transfers, allowances, deposits, withdrawals and
balance queries)
- file-based wallet with password protection
- full Ledger hardware wallet support
- address book
- generation, signing and submitting transactions in non-interactive mode
- offline transaction generation for air-gapped machines
- transaction encryption with Deoxys-II envelope
- Ed25519 and Ethereum-compatible Secp256k1 encryption schemes
- raw, BIP-44, ADR-8 and Ledger's legacy derivation paths
- Developer and devops features:
- Oasis node inspection and healthchecks
- official testing accounts for Oasis Localnet, test runners and debugging
- WebAssembly smart contract code deployment, instantiation, management and
calls
- debugging tools for deployed WebAssembly contracts

[GitHub repository]: https://github.com/oasisprotocol/cli/releases
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
import DocCard from '@theme/DocCard';
import {findSidebarItem} from '@site/src/sidebarUtils';

# Deposit/Withdraw Tokens to/from ParaTime
# Account transactions

To perform ParaTime deposits or withdrawals using a command line interface, you will need `oasis` executable which is part of the [Oasis CLI](https://github.com/oasisprotocol/oasis-sdk/tree/main/cli). `oasis` is supplemental to `oasis-node` and supports ParaTime-related operations such as deposits, withdrawals, transfers and manipulation of the smart contracts, in contrast to `oasis-node` which only supports consensus layer features.
## Transfer

We will assume that your already have an Oasis wallet with some ROSE and that you want to Deposit or Withdraw ROSE to or from Emerald ParaTime running on the Mainnet network.
TODO

:::info

At time of writing, no precompiled `oasis` binaries are available. You will need to clone the [`oasis-sdk` git repository](https://github.com/oasisprotocol/oasis-sdk/) and compile the tool yourself. The process is straight forward - just follow the [Readme](https://github.com/oasisprotocol/oasis-sdk/blob/main/cli/README.md).

:::

:::info

This chapter describes the command line interface for depositing and withdrawing ROSE which is tailored toward advanced users such as node operators. If you are interested in the end-user wallets with a graphical user interface, consult the [How to Transfer ROSE into a ParaTime](../../how-to-transfer-rose-into-paratime.mdx) chapter.

:::

## Import your wallet

To sign any transaction you will need to import an Oasis wallet. Prepare your base64-encoded private key or the BIP39 mnemonic of your Oasis account and run:

```
oasis wallet import <SOME_WALLET_NAME>
```

Follow the interactive instructions that will guide you through the import procedure. If this is the first time you are running `oasis`, the imported wallet will become your default wallet and transactions will be signed with the key stored in this wallet, if not otherwise specified with the `--wallet` parameter.

## Configure Allowance
## Allowance

In order to deposit ROSE to a ParaTime, you will first need to grant the ParaTime access to your Oasis account on the consensus layer. The following command allows Emerald to access up to 100 ROSE stored on your Oasis account which you will deposit afterwards:

Expand Down
96 changes: 96 additions & 0 deletions docs/general/manage-tokens/cli/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Setup

## Download and Run

Download the latest release [here][cli-releases] and extract it to your
favorite application folder.

:::info

Oasis is currently providing official builds for x86 Linux only. If you want
to run it on another platform, you will have to [build it from source][cli-source].

:::

:::info

We suggest that you update your system path to include a directory containing
`oasis` binary or create a symbolic link to `oasis` in your
system path, so you can access it globally.

:::

Run the Oasis CLI by typing `oasis`:

```
$ oasis
CLI for interacting with the Oasis network
Usage:
oasis [command]
Available Commands:
accounts Account operations
addressbook Manage addresses in the local address book
completion Generate the autocompletion script for the specified shell
contracts WebAssembly smart contracts operations
help Help about any command
inspect Inspect the network
network Manage network endpoints
paratime Manage paratimes
registry Registry operations
tx Raw transaction operations
wallet Manage accounts in the local wallet
Flags:
--config string config file to use
-h, --help help for oasis
-v, --version version for oasis
Use "oasis [command] --help" for more information about a command.
```

When running Oasis CLI for the first time, it will generate a configuration
file and populate it with the current Mainnet and Testnet networks. It will also
configure all [Oasis-supported ParaTimes][paratimes].

## Configuration

The configuration folder of Oasis CLI is located:

- on Windows:
- `%USERPROFILE%\AppData\Roaming\Oasis\`
- on macOS:
- `/Users/$USER/Library/Application Support/Oasis/`
- on Linux:
- `$HOME/.config/oasis/`

There, you will find `cli.toml` which contains configuration of the networks,
ParaTimes and your wallet. Additionally, each file-based account in your wallet
will have a separate, password-encrypted `.toml` file in the same folder named
after the name of the account and `.wallet` extension.

You can have multiple profiles of your wallet. To use a different profile, pass
`--config` parameter pointing to a specific `cli.toml` file.

```
$ oasis wallet create myaccount
$ oasis wallet list
ACCOUNT KIND ADDRESS
myaccount file (ed25519-adr8:0) oasis1qq59js97ytn2xcnscyx9n25z5y4dc6z6qcqsydyr
$ mv ~/.config/oasis ~/.config/oasis_work
$ oasis wallet list
ACCOUNT KIND ADDRESS
$ oasis wallet list --config ~/.config/oasis_work/cli.toml
ACCOUNT KIND ADDRESS
myaccount file (ed25519-adr8:0) oasis1qq59js97ytn2xcnscyx9n25z5y4dc6z6qcqsydyr
```

## Backing up your wallet

To back up your wallet, simply archive the folder containing `cli.toml` and
`.wallet` files.

[cli-releases]: https://github.com/oasisprotocol/cli/releases
[cli-source]: https://github.com/oasisprotocol/cli
[paratimes]: ../../../dapp/README.mdx
Loading

0 comments on commit e1f5eac

Please sign in to comment.