Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc updates #3540

Merged
merged 3 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user-guide/common-use-cases/TxMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 8

- [[how-to-start-wallet-server]]
- [[how-to-create-a-wallet]]
- In order to be able to send transactions we need funds on the wallet. In case of [Testnet](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).
- In order to be able to send transactions, our wallet must have funds. In case of `preview` and `preprod` [testnets](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).

## Transaction Metadata

Expand Down
20 changes: 12 additions & 8 deletions docs/user-guide/common-use-cases/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Managing native assets

- [[how-to-start-wallet-server]]
- [[how-to-create-a-wallet]]
- In order to be able to send transactions we need funds on the wallet. In case of [Testnet](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).
- In order to be able to send transactions, our wallet must have funds. In case of `preview` and `preprod` [testnets](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).

## Overview

Expand Down Expand Up @@ -62,18 +62,23 @@ You can also list assets that were ever associated with the wallet.

## Assets off-chain metadata

Issuers of native assets may put some metadata about them in the off-chain metadata server, like **Cardano Token Registry**.
Issuers of native assets may submit off-chain metadata relating to those assets to the **Cardano Token Registry**. There are separate instances of the token registry for `mainnet` and for each test network (e.g. `preview` or `preprod`). Metadata submitted to the registry will be then served via the corresponding server.

| | Mainnet | Testnets |
|--|--|--|
| **Repository** | https://github.com/cardano-foundation/cardano-token-registry | https://github.com/input-output-hk/metadata-registry-testnet |
| **Server** | https://tokens.cardano.org | https://metadata.cardano-testnet.iohkdev.io |

> :information_source: Read more: [Cardano Token Registry](https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry), [CIP26](https://cips.cardano.org/cips/cip26).

Cardano-wallet is capable of reading that metadata and serving it along while listing assets. All you have to do is to start wallet with `--token-metadata-server` parameter pointing to an off-chain metadata server.
Cardano-wallet is capable of reading that metadata and serving it when listing assets. All you have to do is to start the wallet with the `--token-metadata-server` option, specifying an off-chain metadata server that corresponds to your network.

For example on testnet that would be:
For example on `preview` or `preprod` that would be:

```bash
$ cardano-wallet serve --port 8090 \
--node-socket /path/to/node.socket \
--testnet testnet-byron-genesis.json \
--testnet byron-genesis.json \
--database ./wallet-db \
--token-metadata-server https://metadata.cardano-testnet.iohkdev.io/
```
Expand Down Expand Up @@ -142,8 +147,7 @@ $ curl -X POST http://localhost:8091/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfde
"policy_vk12d0gdel9u6px8wf3uv4z6m4h447n9qsad24gztaku8dzzdqfajzqfm3rr0"
```

Once we sort it out we are all set and we can proceed into minting an NFT from our wallet!

Once we have finished, we can proceed to minting NFTs from our wallet!

#### CIP-25 metadata

Expand Down Expand Up @@ -271,7 +275,7 @@ $ curl -X POST http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfde
```
That's it! I should now receive CBOR-encoded `transaction`, `fee` and `coin_selection` details in response.
I can now **sign** and **submit** such a transaction just like in [[how-to-make-a-transaction]].
Once submitted my freshly minted NFT should be added to my wallet balance!
After the transaction has been submitted, your freshly-minted NFT should appear in your wallet balance!

### Burning an NFT

Expand Down
7 changes: 4 additions & 3 deletions docs/user-guide/common-use-cases/delegation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Delegation

- [[how-to-start-wallet-server]]
- [[how-to-create-a-wallet]]
- In order to be able to send transactions we need funds on the wallet. In case of [Testnet](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).
- In order to be able to send transactions, our wallet must have funds. In case of `preview` and `preprod` [testnets](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).

## Overview

Expand Down Expand Up @@ -135,6 +135,7 @@ $ curl -X POST http://localhost:8090/v2/wallets/1b0aa24994b4181e79116c131510f2ab
-H "Content-Type: application/json"
```

> :information_source: Note that all rewards will be withdrawn only if you add {"withdrawal":"self"} to the payload. You can do it in a single transaction though as above.
After constructing a transaction that undelegates from a stake pool, I should receive a CBOR-encoded `transaction`, `fee`, and `coin_selection` in the response.
I can now **sign** and **submit** such a transaction just like in [[how-to-make-a-transaction]].

> :information_source: Refer to [[how-to-make-a-transaction]] for details on signing and submitting it to the network.
> :information_source: Note that all rewards will be withdrawn only if you add {"withdrawal":"self"} to the payload. You can achieve this with a single transaction, as shown above.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: How to make a transaction

- [[how-to-start-wallet-server]]
- [[how-to-create-a-wallet]]
- In order to be able to send transactions we need funds on the wallet. In case of [Testnet](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).
- In order to be able to send transactions, our wallet must have funds. In case of `preview` and `preprod` [testnets](https://testnets.cardano.org/en/testnets/cardano/overview/) we can request tADA from the [faucet](https://testnets.cardano.org/en/testnets/cardano/tools/faucet/).

## Old transaction workflow

Expand Down
36 changes: 26 additions & 10 deletions docs/user-guide/common-use-cases/how-to-start-wallet-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,49 @@ The easiest and most common way of managing your funds on the Cardano blockchain

Here we are going to start `cardano-wallet` in full node mode, meaning that we need to have also `cardano-node` running on the same machine. We can get binaries of `cardano-wallet` and compatible version of `cardano-node` from [cardano wallet release page](https://github.com/input-output-hk/cardano-wallet/releases). `Cardano-wallet` archives published for each release, besides `cardano-wallet` itself, include all the relevant tools like `cardano-node`, `cardano-cli`, `cardano-addresses` or `bech32`.

> :information_source: Alternatively one can use handy [docker-compose](https://github.com/input-output-hk/cardano-wallet#getting-started) to start wallet and the node.
> `$ NETWORK=testnet docker-compose up`
> :information_source: Alternatively one can use handy [docker-compose](https://github.com/input-output-hk/cardano-wallet#getting-started) to start wallet and the node on different networks:
> `$ NETWORK=mainnet docker-compose up`
> `$ NETWORK=preprod docker-compose up`
> `$ NETWORK=preview docker-compose up`

#### Pre-requisites
- Install cardano-wallet from [cardano wallet release page](https://github.com/input-output-hk/cardano-wallet/releases).
- Install cardano-node from [cardano wallet release page](https://github.com/input-output-hk/cardano-wallet/releases).
- Download up-to-date configuration files from [Cardano configurations](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1).
- Download up-to-date configuration files from [Cardano Book](https://book.world.dev.cardano.org/environments.html).

#### Start `cardano-wallet` in full node mode
We are going to use `testnet` configuration in this example.
> :information_source: Configuration files for all Cardano networks can be found in [Cardano Book](https://book.world.dev.cardano.org/environments.html).

1. Start node:
```bash
$ cardano-node run \
--config testnet-config.json \
--topology testnet-topology.json \
--config config.json \
--topology topology.json \
--database-path ./db \
--socket-path /path/to/node.socket
```
2. Start wallet:

When starting a wallet instance that targets a testing environment such as `preview` or `preprod`, we need to provide a `byron-genesis.json` file to the wallet:

```bash
$ cardano-wallet serve --port 8090 \
--node-socket /path/to/node.socket \
--testnet byron-genesis.json \
--database ./wallet-db \
--token-metadata-server https://metadata.cardano-testnet.iohkdev.io
```
In case of `mainnet` we simply replace `--testnet byron-genesis.json` with option `--mainnet`.

```bash
$ cardano-wallet serve --port 8090 \
--node-socket /path/to/node.socket \
--testnet testnet-byron-genesis.json \
--mainnet \
--database ./wallet-db \
--token-metadata-server https://metadata.cardano-testnet.iohkdev.io/
--token-metadata-server https://tokens.cardano.org
```
> :information_source: Notice that we use different URLs for mainnet and test networks with the --token-metadata-server option. These URLs point to [Cardano Token Registry](https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry) servers. See [[assets]] for more information.

That's it! We can basically start managing our wallets from this point onwards. See [[how-to-create-a-wallet]] and [[how-to-manage-wallets]].

However, in order to be able to make transactions, we still need to wait until `cardano-node` is synced fully with the Cardano blockchain. In case of `mainnet` it may take several hours, in case of `testnet` a bit less.
Expand All @@ -52,7 +68,7 @@ $ curl -X GET http://localhost:8090/v2/network/information | jq .sync_progress

## Light mode

> :warning: This mode is currently **under development**. Please note that some parts may be available only in `master` branch.
> :warning: This mode is currently **under development**. Please note that some parts may not work.

You can start your cardano-wallet server also in **light mode**. As opposed to full-node mode, in light-mode your wallet is not connected to a locally running instance of `cardano-node`. Instead it relays on external source of blockchain data. This significantly improves synchronization speed of the wallet and also removes the need to spend time synchronizing the node itself. The downside is that external source of data is obviously less trusted than the local one provided by your own `cardano-node` instance.

Expand All @@ -75,7 +91,7 @@ $ cardano-wallet serve \
--port 8091 \
--light \
--blockfrost-token-file blockfrost-testnet.key \
--testnet testnet-byron-genesis.json \
--testnet byron-genesis.json \
--database ./wallet-testnet-db-light \
```
##### Mainnet
Expand Down
4 changes: 3 additions & 1 deletion specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ info:
name: Apache-2.0
url: https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/LICENSE
description: |
<p align="right"><img style="position: relative; top: -10em; margin-bottom: -12em;" width="20%" src="https://cardanodocs.com/img/cardano.png"></img></p>
<p align="right">
<svg width="18%" style="position: relative; top: -10em; margin-bottom: -12em;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 375 346.51"><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path d="M102.76,172a25.31,25.31,0,0,0,23.78,26.65c.49,0,1,0,1.46,0A25.26,25.26,0,1,0,102.76,172Z" fill="#0033ad"/><path d="M8.62,165.5a8.16,8.16,0,1,0,7.69,8.61A8.15,8.15,0,0,0,8.62,165.5Z" fill="#0033ad"/><path d="M101.16,25.43a8.16,8.16,0,1,0-11-3.62A8.18,8.18,0,0,0,101.16,25.43Z" fill="#0033ad"/><path d="M126.78,70.1a12.61,12.61,0,1,0-16.94-5.59A12.62,12.62,0,0,0,126.78,70.1Z" fill="#0033ad"/><path d="M40.58,100.82a10.39,10.39,0,1,0-3-14.38A10.39,10.39,0,0,0,40.58,100.82Z" fill="#0033ad"/><path d="M55.93,161a12.62,12.62,0,1,0,11.88,13.31A12.62,12.62,0,0,0,55.93,161Z" fill="#0033ad"/><path d="M42,245.72a10.39,10.39,0,1,0,13.95,4.6A10.37,10.37,0,0,0,42,245.72Z" fill="#0033ad"/><path d="M91,134.89a14.84,14.84,0,1,0-4.27-20.55A14.83,14.83,0,0,0,91,134.89Z" fill="#0033ad"/><path d="M246.47,69.1a12.62,12.62,0,1,0-3.63-17.47A12.61,12.61,0,0,0,246.47,69.1Z" fill="#0033ad"/><path d="M272.35,24.57A8.16,8.16,0,1,0,270,13.26,8.16,8.16,0,0,0,272.35,24.57Z" fill="#0033ad"/><path d="M248.45,147.91a25.25,25.25,0,0,0-2.87,50.42c.49,0,1,0,1.45,0a25.25,25.25,0,0,0,1.42-50.46Z" fill="#0033ad"/><path d="M135.08,133.14A25.12,25.12,0,0,0,157.64,147a25.25,25.25,0,0,0,22.54-36.62,25.25,25.25,0,1,0-45.1,22.73Z" fill="#0033ad"/><path d="M333,100.79a10.39,10.39,0,1,0-14-4.6A10.4,10.4,0,0,0,333,100.79Z" fill="#0033ad"/><path d="M269,108.83a14.84,14.84,0,1,0,19.94,6.58A14.86,14.86,0,0,0,269,108.83Z" fill="#0033ad"/><path d="M186.55,20.76a10.39,10.39,0,1,0-9.79-11A10.38,10.38,0,0,0,186.55,20.76Z" fill="#0033ad"/><path d="M186.43,86.13a14.84,14.84,0,1,0-14-15.66A14.84,14.84,0,0,0,186.43,86.13Z" fill="#0033ad"/><path d="M106,237.68a14.84,14.84,0,1,0-19.93-6.58A14.85,14.85,0,0,0,106,237.68Z" fill="#0033ad"/><path d="M196,107.79a25.22,25.22,0,1,0,21.14-11.41A25.28,25.28,0,0,0,196,107.79Z" fill="#0033ad"/><path d="M239.92,213.37a25.26,25.26,0,1,0-11.18,33.91A25.11,25.11,0,0,0,239.92,213.37Z" fill="#0033ad"/><path d="M284,211.62a14.84,14.84,0,1,0,4.27,20.55A14.84,14.84,0,0,0,284,211.62Z" fill="#0033ad"/><path d="M332.38,173.68a12.62,12.62,0,1,0-13.31,11.88A12.62,12.62,0,0,0,332.38,173.68Z" fill="#0033ad"/><path d="M367.3,164.71a8.16,8.16,0,1,0,7.69,8.61A8.17,8.17,0,0,0,367.3,164.71Z" fill="#0033ad"/><path d="M334.42,245.68a10.39,10.39,0,1,0,3,14.39A10.39,10.39,0,0,0,334.42,245.68Z" fill="#0033ad"/><path d="M102.65,321.94a8.16,8.16,0,1,0,2.34,11.3A8.17,8.17,0,0,0,102.65,321.94Z" fill="#0033ad"/><path d="M273.83,321.08a8.16,8.16,0,1,0,11,3.62A8.16,8.16,0,0,0,273.83,321.08Z" fill="#0033ad"/><path d="M179,238.71a25.25,25.25,0,1,0-21.14,11.41A25.1,25.1,0,0,0,179,238.71Z" fill="#0033ad"/><path d="M128.53,277.41a12.62,12.62,0,1,0,3.63,17.47A12.62,12.62,0,0,0,128.53,277.41Z" fill="#0033ad"/><path d="M187.38,325.74a10.39,10.39,0,1,0,9.78,11A10.39,10.39,0,0,0,187.38,325.74Z" fill="#0033ad"/><path d="M187.49,260.37a14.84,14.84,0,1,0,14,15.67A14.85,14.85,0,0,0,187.49,260.37Z" fill="#0033ad"/><path d="M248.21,276.4a12.62,12.62,0,1,0,17,5.59A12.62,12.62,0,0,0,248.21,276.4Z" fill="#0033ad"/></g></g></svg>
</p>
externalDocs:
description: Need more? Click here to access our API guide and walkthrough.
url: https://input-output-hk.github.io/cardano-wallet/
Expand Down