3 : Environment preparation
Last updated
Last updated
Check this guide in
Edit this guide in it's repo:
Contribute to this guide in the of the repo
In this chapte we will prepare our system in order to use this Playground. You need to have Docker installed in your system, configure at least 2 stellar accounts, and edit the settings.js
file.
Remember to follow the code in the . Also, you can clone the code by doing
Also you'll need to install the node packages:
Here we detail the steps to follow in order to configure your Docker envirenoment:
Install Docker in your system.
Create a common docker network
Run a docker container with the esteblock/soroban-preview image, that includes soroban cli, rust and other tools that this uses
Run a docker container with the stellar/quickstart image, that provides a local stellar and soroban node
Establishing a shared Docker network will enable seamless communication between the two Docker containers that we are about to create in the following steps.
Here we will name this network as soroban-network
, but you can choose the name you want. You can create this network by:
Here we used the flag --network soroban-network
, so any other container in the same network can call each other just using its name. In this case, this container's name is soroban-preview-10
Stellar provides a docker image that contains an stellar node including Soroban, an stellar core program and the horizon server. You can initialize the node as standalone (transactions will not be synced to the network), futurenet (transactions will be synced to futurenet network), or mainnet.
You can run this container by doing:
Then, if the soroban-preview-10
containter want's to call the RPC of the stellar
container, it can use the following RPC URL
You will need two stellar accounts to use this token playground. The first one will be the receiver address, responsible of creating and issuing Stellar Assets, the second one wiil be the destination address that will need to create a trustline to the asset and then will receive the tokens.
Here, you need to edit:
For the issuer account: issuerSecret
and issuerPublic
For the receiver account: receiverSecret
and receiverPublic
.
thirdParty
will be configured later... or you can leave it like this
Stellar accounts need to be funded wit at least 1 XLM before existing. Stellar provide the friendbot utility that can fund test networks like futurenet.
If you already have your stellar/quickstart
docker container, because it's sharing its 8000
port, you can call the Friendbot by doing
If you want to call this from the soroban-preview-10
docker container, be sure to change http://localhost:8000
to http://stellar:8000
because the two docker container are using the same docker network and can be called by their name. You can also use https://friendbot-futurenet.stellar.org/
in case your request is to the futurenet directly.
Follow the instructions from the
The allow developers to work in different projects that use different (with different versions of soroban-cli, rust and others).
The soroban-preview docker images are hosted in . In this example we will use the Soroban Preview Release #10, hence we will use the esteblock/soroban-preview:10
image. To run a container with this image, do:
Here we are using the stellar/quickstart:soroban-dev@sha256:8a99332f834ca82e3ac1418143736af59b5288e792d1c4278d6c547c6ed8da3b
beacuse this is the image used in the , and we are using the same network with the flag --network soroban-network
In this playground we prepared the scipt that will do steps 1.2, 1.3 and 1.4. Just do.
You can use to create the accounts.
The file include a set of variables required to run the different scripts of the token playground. Here you have a sample:
If you want to use our code, we prepared the script that can be called by the soroban-preview-10
docker container:
This script will take the issuer and receiver addresses from the file:
In the we will use this docker containers in order to issue and mint a new (classic) Stellar Asset
This Playgound has been developed by in collaboration with from