This project is a WIP example implementation of a Stellar anchor server.
Its goal is to provide a community example implementation of SEP 6 (and the related SEP 10). We hope to make it easier for anchors to integrate with the Stellar network, as they can refer to this sample implementation in their own development. Note that this implementation itself should not be utilized directly (i.e., forked) for handling real amounts of real money.
Additionally, we want to enable wallets to seamlessly integrate with said anchor. This implementation will provide a reference server for wallets to implement their end of the above SEPs without having to collaborate with an anchor.
You can check the project's roadmap here.
This project was built using Pipenv.
- Install pipenv:
$ brew install pipenv
(on macOS) - Install redis:
$ brew install redis
(on macOS) - Inside the repo's root, install the project's dependencies:
$ pipenv install
- You'll need a
.env
file (or the equivalent env vars defined). We provide a sample one, which you can copy and modify:$ cp .env.example .env
- Modify the Stellar account in
.env
as below. - Set up the admin user:
$ pipenv run python src/manage.py createsuperuser
. Provide a username, email, and password of your choice. - Run the database migrations:
$ pipenv run python src/manage.py migrate
- Run the redis server in the background:
$ redis-server --daemonize yes
- Run celery:
$ pipenv run celery worker --app app --beat --workdir src -l info
- Run the project:
$ pipenv run python src/manage.py runserver
In your virtual environment .env
, create a minimally funded Stellar account and set it as an environment variable.
- Go to the Stellar laboratory account creator.
- Click the button to "Generate keypair."
- Fund the account: copy-paste the value of the Public Key (G...) into the Friendbot input box.
- Click "Get test network lumens."
- Open your virtual environment file,
stellar-anchor-server/.env
. - Set
STELLAR_ACCOUNT_ADDRESS
to the value ofPublic Key
that you just funded. - Set
STELLAR_ACCOUNT_SEED
to the value ofSecret Key
from the Keypair Generator.
Through Django's admin panel, you can create assets, monitor transaction status, and do other administrative tasks.
The above instructions for "Running the project locally" include the creation of an administrative user.
Once the project is running locally, navigate to https://localhost:8000/admin
in a browser. Enter the username and password you set for the superuser above. You should then see the admin panel.
To create an asset, click + Add
in the Assets
row of the INFO
table. You can then edit the fields of an asset (its name, deposit values, withdrawal values) and save it.