Skip to content

Commit

Permalink
Merge pull request #1412 from OneOf-Inc/docs/tezos_tutorial
Browse files Browse the repository at this point in the history
Documentation for working with the Tezos Blockchain
  • Loading branch information
nguyer authored Oct 23, 2023
2 parents f92b532 + 342bab6 commit 43dff8f
Show file tree
Hide file tree
Showing 9 changed files with 725 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/_i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ pages:
xdc_testnet: XDC Testnet
zksync_testnet: zkSync Testnet
rotate_dx_certs: Rotate Data Exchange Certificates
tezos_testnet: Tezos Testnet
Binary file added docs/tutorials/chains/images/tezos_explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/chains/images/tezos_faucet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions docs/tutorials/chains/tezos_testnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
layout: i18n_page
title: pages.tezos_testnet
parent: pages.chains
grand_parent: pages.tutorials
nav_order: 6
---

# {%t pages.tezos_testnet %}
{: .no_toc }

1. TOC
{:toc}

---

This guide will walk you through the steps to create a local FireFly development environment and connect it to the public Tezos Ghostnet testnet.

## Previous steps: Install the FireFly CLI

If you haven't set up the FireFly CLI already, please go back to the Getting Started guide and read the section on how to [Install the FireFly CLI](../../gettingstarted/firefly_cli.md).

[← ① Install the FireFly CLI](../../gettingstarted/firefly_cli.md){: .btn .btn-purple .mb-5}

## Set up the transaction signing service <a name="signatory"></a>

[Signatory](https://signatory.io/) service allows to work with many different key-management systems.
You should choose and set up an appropriate one.
For development/prototyping purposes the easiest way is to use the [local signing](https://signatory.io/docs/file_based) option.
Note: Tezos accounts (private/public keys) should be generated by chosen KMS.

## Create a `tezosconnect.yml` config file

In order to connect to the Tezos testnet, you will need to set a few configuration options for the tezosconnect blockchain connector. Create a text file called `tezosconnect.yml` with the following contents:

```yml
connector:
blockchain:
rpc: https://rpc.ghost.tzstats.com
network: ghostnet
signatory: http://127.0.0.1:6732 # tx signing service address
```
For this tutorial, we will assume this file is saved at `~/Desktop/tezosconnect.yml`. If your path is different, you will need to adjust the path in the next command below.

## Creating a new stack

To create a local FireFly development stack and connect it to the Tezos Ghostnet testnet, we will use command line flags to customize the following settings:

- Create a new Tezos based stack named `tezos` with `1` member
- Disable `multiparty` mode. We are going to be using this FireFly node as a Web3 gateway, and we don't need to communicate with a consortium here
- Merge the custom config created above with the generated `tezosconnect.yml` config file

To do this, run the following command:

```
ff init ethereum tezos 1 \
--multiparty=false \
--connector-config ~/Desktop/tezosonnect.yml
```

## Start the stack

Now you should be able to start your stack by running:

```
ff start tezos
```

After some time it should print out the following:

```
Web UI for member '0': http://127.0.0.1:5000/ui
Sandbox UI for member '0': http://127.0.0.1:5109
To see logs for your stack run:
ff logs tezos
```

## Get some XTZ

At this point you should have a working FireFly stack, talking to a public chain. However, you won't be able to run any transactions just yet, because you don't have any way to pay transaction fee. A testnet faucet can give us some XTZ, the native token for Tezos.

First, you need to get an account address, which was created during [signer set up](#signatory) step.

After that, go to [Tezos Ghostnet Faucet](https://faucet.ghostnet.teztnets.xyz/) and paste the address in the form and click the **Request** button.

![Tezos Faucet](images/tezos_faucet.png)

### Confirm the transaction on TzStats
You should be able to go lookup your account on [TzStats for the Ghostnet testnet](https://ghost.tzstats.com/) and see that you now have a balance of 100 XTZ (or 2001 XTZ accordingly). Simply paste in your account address to search for it.

On the **Transfers** tab from you account page you will see the actual transfer of the XTZ from the faucet.

![TzStats](images/tezos_explorer.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/tutorials/custom_contracts/pinning.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: default
title: Pinning Data
parent: pages.custom_smart_contracts
grand_parent: pages.tutorials
nav_order: 3
nav_order: 4
---

# Pin off-chain data to a custom blockchain transaction
Expand Down
Loading

0 comments on commit 43dff8f

Please sign in to comment.