go-dex-client

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 18 Imported by: 0

README

go-dex-client

License Codacy Badge PRs Welcome

A client implementation for Stakenet's XSN DexAPI (Decentralized Exchange) written in golang.

The official XSN DexAPI with a trading bot example written in Scala can be found here: github.com/X9Developers/DexAPI. It also has an extensive documentation how to set up all the required components on your machine which is mandatory to get this bot running, since this repository only provides an alternative trading bot implementation.

Components

alt text

In order to setup all mandatory components on your VM, have a look infrastructure.md which is a step by step installation guide.

Run the bot

  1. Download the UNIX bot binary for your from the release
  2. Create a directory certs and paste all the lnd's tls.cert files
  3. Copy the default cfg.json from the repository and modify it based on your setup.
  4. Execute the binary ./bot
Examples to place orders, deal with the orderbook

To interact with the bot you can send HTTP requests to fetch orderbook data, place orders, cancel orders or to retrieve your wallet LND's balance. Have a look in examples directory that contains example curl requests that interact with your local web server.

Create stub via protoc (if not up-to-date)

Use the following link to install the prerequisites (https://grpc.io/docs/quickstart/go/):

  1. install protoc compiler (3.6.1+)
  2. install protoc-gen-go compiler plugin
Generate a stub by using the lssdrpc.proto file

The latest lssdrpc.proto file can be found on: github.com/X9Developers/DexAPI/releases

This lssdrpc.proto has to be copied to the lssdrpc directory and the following commands have to be executed.

Go to the project root, execute the following command to generate a go client for the lssdrpc API:

  1. cd lssdrpc/
  2. protoc -I . lssdrpc.proto --go_out=plugins=grpc:.

which will output a lssdrpc.rb.go that has client and server connectors automatically generated.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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