Get the most juice out of your machine by setting up the eWallet onto your base operating system.
Before we begin, be sure to have the following applications installed and running on your machine.
- PostgreSQL: PostgreSQL is used for storing most of the data for the eWallet and LocalLedger.
- ImageMagick: ImageMagick is used for formatting images in the Admin Panel. Tested with version
> 7.0.7-22
. - Elixir: Elixir is used as the primary language for the server components of the eWallet.
- Git: Git is used for downloading and synchronizing codebase with the remote code repository.
- NodeJS Node.js is used for building front-end code for the Admin Panel.
If you are on MacOS, you may install the above dependencies via Homebrew.
Now that you have the applications installed, proceed with 1.1 through 1.5 to setup the server.
Pull the eWallet code from our Git repository to a directory of your choice:
$ git clone https://github.com/omisego/ewallet && cd ./ewallet
Fetch the Elixir dependencies:
$ mix deps.get
Then, install the front-end dependencies:
$ (cd apps/frontend/assets/ && npm install)
The parentheses above forces the commands to be executed in a subshell, and returns to the current working directory after the execution.
Many configurations have default values pre-defined. If your environment requires different values, run export ENV=value
to set environment variables in the current session (or add them to whatever profile file you are using).
Environment variable | Description |
---|---|
PORT |
The internal listening port for the application Defaults to 4000 |
DATABASE_URL |
The URL where the eWallet database can be accessed. Defaults to postgres://localhost/ewallet_dev |
LOCAL_LEDGER_DATABASE_URL |
The URL where the LocalLedger database can be accessed. Defaults to postgres://localhost/local_ledger_dev |
Learn more about all the environment variables available at Environment Variables.
Run the following command to setup the databases:
$ mix do ecto.create, ecto.migrate
Also, you will need to setup the test database so tests can be run:
$ MIX_ENV=test mix do ecto.create, ecto.migrate
Run the tests to make sure that your setup is healthy:
$ mix test
Some initial data is required to start the server. Either run the seed or the sample seed below:
# Option 2a: Run this command to set up the initial data
$ mix seed
# Option 2b: Run this command to set up the initial data and populate the database with more sample data
$ mix seed --sample
Start the server using the following command:
$ mix omg.server
You should see the following output:
[info] Setting up websockets dispatchers...
[info] Running UrlDispatcher.Plug with Cowboy http on port 4000
You can now access your eWallet server using the available APIs:
$ curl http://localhost:4000
{"status": true}
Read the Documentation to learn more and start using your eWallet!
Having trouble setting up the eWallet? Check the Setup Troubleshooting Guide.