swap

command module
v0.0.0-...-fc630f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 19 Imported by: 0

README

Swap - open currency exchange spot software

This projects provides access to self hosted exchange spot which can be configured under your personal needs.

Locally from repository

  1. In repository build npm source files into dist.
npm run build
  1. Build go source binaries (you have to have go installed on your machine):
go install github.com/go-bindata/go-bindata/go-bindata@latest
go-bindata -pkg web -o gen/web/web.go -fs -prefix "dist/" dist/...
go-bindata -pkg migr -o gen/migr/migr.go -fs -prefix "db/migrations/" db/migrations/...
  1. Run project locally (with database in compose):
docker compose up
go run . --port 8080 --admin "email@example.com:password" --database "postgresql://user:password@localhost:5432/db?sslmode=disable" --telegram "@test" --email-creds "mail@example.com:password"

Run as go CLI

Installation:

go install github.com/d1nch8g/swap@latest

Configuration flags:

--port             - Port on which to run application on
--host             - Hostname, should be inintialized on production runs
--database         - database connection string
--bestchange-token - token to access bestchange API
--admin            - admin creds "email:password"
--email-addr       - email client address
--email-port       - email client port
--email-creds      - email "login:password"
--telegram         - telegram link
--cert-file        - Cert file path (should be used for TLS)
--key-file         - Key file path (should be used for TLS)
-h --help          - Show this help message and exit

Minimal example (requires active postgresql database, can be started):

swap --port

Run with docker

Image:

Configuration:

  • PORT - port on which program will run
  • DATABASE - database connection string
  • BESTCHANGE_TOKEN - token to call bestchange api to receive exchanger rates info
  • ADMIN - user:password of main admin account
  • API_ADDR - link to api should be self referenced api address
  • EMAIL_ADDRESS - host of email address
  • EMAIL_CREDS - creds for email
  • TELEGRAM - telegram link @tlg
  • CERT_FILE - certificate file
  • KEY_FILE - key file

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
gen
migr
Code generated for package migr by go-bindata DO NOT EDIT.
Code generated for package migr by go-bindata DO NOT EDIT.
web
Code generated for package web by go-bindata DO NOT EDIT.
Code generated for package web by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL