Skip to content
No description, website, or topics provided.
Go Other
  1. Go 99.3%
  2. Other 0.7%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
admin implement deputy Sep 26, 2019
common implement deputy Sep 26, 2019
config implement deputy Sep 26, 2019
deputy implement deputy Sep 26, 2019
executor implement deputy Sep 26, 2019
observer implement deputy Sep 26, 2019
spec implement deputy Sep 26, 2019
store implement deputy Sep 26, 2019
tools/test_client implement deputy Sep 26, 2019
util implement deputy Sep 26, 2019
.gitignore implement deputy Sep 26, 2019
Dockerfile implement deputy Sep 26, 2019
LICENSE implement deputy Sep 26, 2019
Makefile implement deputy Sep 26, 2019
go.mod update dependency Nov 20, 2019
go.sum update dependency Nov 20, 2019
main.go implement deputy Sep 26, 2019
readme.md implement deputy Sep 26, 2019

readme.md

Deputy

Deputy is responsible for handling swap requests from users automatically. It will monitor swap requests from both chain and react to these requests. If swap request from user is legal, deputy will send corresponding HTLT tx to other chain. When user claims tokens on other chain, deputy will claim tokens on the original chain.

Deputy will manage lifecycle of each swap request. It is supposed to handle normal cases or exceptional cases correctly and send corresponding txs timely util lifecycle of swap request is end.

But there are still some cases that deputy can not handle:

  • Insufficient tokens: either gas token or swap token
  • Errors on blockchain nodes: you may not be able to get blocks or send txs to blockchain node.

You may need to resend tx when you have deposit enough tokens to deputy address or fix your node issue. You can refer to admin doc for more detail.

Installation

Build

make build

Config

There is a config template in config directory, you should create your own config to run your deputy correctly. You can refer to config doc for more details. Please make sure you understand each config option in config file, and testing before open to public is recommended.

Start deputy

cd build
./deputy --bnb-network [0 for testnet, 1 for mainnet] --config-type [local or aws] --config-path config_file_path --aws-region [aws region or omit] --aws-secret-key [aws secret key for config or omit]

Docker

Docker build

$ docker build --tag deputy .

Docker run

For there is log file and database file(maybe if you are using sqlite), so you should mount a directory storing data files into container, so even if container disappeared, you will not lose your data.

$ docker run -it -v /your/data/path:/deputy -e BNB_NETWORK={0 or 1} -e CONFIG_TYPE="local" -e CONFIG_FILE_PATH=/your/config/file/path/in/container -d deputy

Contributing

You can refer to Developer guide for more details.

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Links

You can’t perform that action at this time.