Skip to content

Quickstart

Napse is still in early stage. You can only run it manually for now.

TL - DR
  1. make setup
  2. make up

  3. Clone django-napse repository

  4. Run tests/test_app/setup_secrets.sh and fill in secrets.json file
  5. make up
  6. Get master_key in secrets.json file
  7. Add localhost server into Napse's desktop app (with the master_key as API Token)

Prerequisites

Install nvm

To install nvm, download and install the nvm script from the project's GitHub page:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
nvm --version

Please follow this tutorial

Please follow this tutorial

Install Node.js

Now, you can install Node.js. The following command installs Node.js latest version :

nvm install --lts

Please follow this tutorial

Please follow this tutorial

Install yarn

Yarn is a Node package manager. Install it by running these commands

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

Please follow this tutorial

Please follow this tutorial


Run the desktop application

First, you need to install all dependencies.

make setup

Then, you can run the application.

make up

Yeah! Your desktop application is running. But you can't do anything with it for now. You need to run the server.


The server

The heart of Napse is the server. It's django-napse

Setup the server

Clone the project from github

First clone the repository to your local machine:

git clone git@github.com:napse-invest/django-napse.git

Build the virtual environment:

To setup the virtual environment, you can run the command:

make setup
Or run manually the following script depending on your operating system:

source setup/setup-unix.sh
source setup/setup-osx.sh
.\setup\setup-windows.ps1

Setup initial exchange accounts

To make full use of the project, we recommend that you fill in the API keys of at least one exchange (see django-napse documentation for more details).

At tests/test_app/, build a secret.json file (or run the ./setup_secrets.sh script). Here is an exemple with Binance:

{
    "Exchange Accounts": {
        "Binance EA_NAME": {
            "exchange": "BINANCE",     # Name of your exchange (BINANCE, DYDX, ...)
            "testing": true,
            "public_key": "YOUR_PUBLIC_KEY",
            "private_key": "YOUR_PRIVATE_KEY"
        }
    }
}

You can create this file with the commande:

make setup-testing-environment

Tip

Exchange API keys are required to communicate with the exchange. However, they are not required to test the application.

Run the server

make makemigrations
make migrate
make runserver

Connect the desktop app to the server

You've come this far! Congratulations!

Now all you have to do is the easy part:

  1. Retrieve your master_key from the secrets.json file
  2. Go to your desktop application
  3. Click on servers in the top right-hand corner, then + add new.
  4. Enter your master_key in the API Token field.
  5. Click on Connect.

That's it ! You can now use Napse !