Skip to content

Commit

Permalink
add docker compose file & section explaining testnet vs. mainnet usage (
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeUrban authored Aug 12, 2022
1 parent 7ea9268 commit 2386a9b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 25 deletions.
82 changes: 57 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# Stellar Demo Wallet

This Stellar Demo Wallet is our newly rebuilt application for interactively
testing anchor services. If you would like to automate testing of your anchor
service, check out the SDF's
The Stellar Demo Wallet is our newly rebuilt application for interactively
testing anchor services.

If you would like to automate testing of your anchor service, check out the SDF's
[anchor tests suite](https://github.com/stellar/stellar-anchor-tests) viewable
at [https://anchor-tests.stellar.org/](https://anchor-tests.stellar.org/).

This project was originally created for the
[Build a Stellar Wallet](https://developers.stellar.org/docs/building-apps/)
tutorial series.
([That repo has since moved over here](https://github.com/stellar/docs-wallet)).
This repository was originally created for the [Build a Stellar Wallet](https://developers.stellar.org/docs/building-apps/) tutorial series.
(That project has since moved over [here](https://github.com/stellar/docs-wallet)).

If you want to use parts or all of the project to kickstart your own wallet,
feel free to clone or copy any pieces that may be helpful.

## Mainnet vs. Testnet

This application defaults to using Stellar's testnet.

This application can be used on Stellar's mainnet by specifying the `REACT_APP_HORIZON_PASSPHRASE` & `REACT_APP_HORIZON_URL` environment variables when building the project.

**All accounts on mainnet that are used with this application should be considered compromised.** If you want to test services on mainnet with this tool, make sure to create a new account and fund it with the minimum assets required.

## Getting A Test Account Up and Running

You can use the demo wallet to test Regulated Assets ([SEP-8]), Hosted Deposit
and Withdrawal ([SEP-24]) and Cross-Border Payments ([SEP-31]) with any home
domain that has a Stellar Info File (also known as [SEP-1], or a stellar.toml
file). The instructions below are for demo-ing standard integrations supported
by Stellar test server, testanchor.stellar.org or by the [SEP-8] reference
You can use the demo wallet to interact with the following anchor services:

* Regulated Assets API ([SEP-8])
* Hosted Deposit and Withdrawals ([SEP-24])
* Deposit & Withdrawal API ([SEP-6])
* Cross-Border Payments API ([SEP-31])

You can connect to any domain that has a Stellar Info File (also known as [SEP-1], or a stellar.toml file).

The instructions below are for demo-ing standard integrations supported
by Stellar test server, testanchor.stellar.org, or by the [SEP-8] reference
server, sep8-server.dev.stellar.org. For these integrations, the logs to the
right of the screen will show every network call.

Expand Down Expand Up @@ -93,16 +106,18 @@ between the Sending and the Receiving anchors._
4. If the payment has been successfully sent you'll see "SEP-31 send payment
completed" in the logs.

### Using stellar.toml file from `localhost`
### Hosting Anchor Services Locally

You can serve asset `toml` files from `locahost`. When using locally hosted
You can serve `stellar.toml` files from `localhost`. When using locally hosted
stellar.toml files on demo-wallet.stellar.org, some browsers might block them
for security reasons, if you’re not using `https`. If you’re running demo wallet
for security reasons if you’re not using `https`. If you’re running the demo wallet
locally, this is not a problem.

## Getting Started Building A Wallet From This Demo
## Running the Demo Wallet Locally

You can run the demo wallet locally, either by installing the application on your machine or by using Docker.

To start building with this project clone this repo and install the deps:
### Local Installation

```bash
yarn install
Expand All @@ -117,9 +132,9 @@ _docker.for.mac.host.internal_, this will allow the anchor that's running in a
docker container to access the host network where the client domain (server
hosting the stellar.toml) is running. ex:

```
REACT_APP_CLIENT_DOMAIN = docker.for.mac.host.internal:7000
REACT_APP_WALLET_BACKEND_ENDPOINT = http://demo-wallet-server.stellar.org
```bash
REACT_APP_CLIENT_DOMAIN=docker.for.mac.host.internal:7000
REACT_APP_WALLET_BACKEND_ENDPOINT=http://demo-wallet-server.stellar.org
```

and run:
Expand All @@ -134,15 +149,30 @@ To build the app for production, run:
yarn build:client
```

NOTE: By default the demo wallet operates only on Stellar testnet network. To
use mainnet or any other Stellar network, add below to the client **.env**
(example for mainnet):
### Docker

If you want to run the demo wallet on testnet, building the project is easy.

```bash
docker compose build
```

If you're looking to use the demo wallet to interact with mainnet services, specify the following build args.

```bash
docker compose build \
--build-arg REACT_APP_HORIZON_PASSPHRASE="Public Global Stellar Network ; September 2015" \
--build-arg REACT_APP_HORIZON_URL="https://horizon.stellar.org"
```
REACT_APP_HORIZON_PASSPHRASE = "Public Global Stellar Network ; September 2015"
REACT_APP_HORIZON_URL = "https://horizon.stellar.org"

Then, launch the containers.

```bash
docker compose up
```

Note that the docker compose file defaults to using SDF's demo wallet server, but you are free to edit the compose file to use a local instance of the server.

---

## Release Notes
Expand Down Expand Up @@ -184,3 +214,5 @@ REACT_APP_HORIZON_URL = "https://horizon.stellar.org"
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md
[sep-31]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md
[sep-6]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'
services:
wallet-client:
build:
context: .
dockerfile: Dockerfile-client
args:
REACT_APP_CLIENT_DOMAIN: demo-wallet-server.stellar.org
REACT_APP_WALLET_BACKEND_ENDPOINT: https://demo-wallet-server.stellar.org
env_file:
- .env
ports:
- "8000:80"

0 comments on commit 2386a9b

Please sign in to comment.