Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kendricktan/heiswap-relayer
Heiswap Relayer for gasless withdrawals
https://github.com/kendricktan/heiswap-relayer
Last synced: 14 days ago
JSON representation
Heiswap Relayer for gasless withdrawals
- Host: GitHub
- URL: https://github.com/kendricktan/heiswap-relayer
- Owner: kendricktan
- License: mit
- Created: 2019-07-07T07:16:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T21:55:47.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T11:32:49.178Z (7 months ago)
- Language: JavaScript
- Size: 1.37 MB
- Stars: 1
- Watchers: 2
- Forks: 6
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# heiswap-relayer
Heiswap Relayer for gasless withdrawals---
| Branch | Status | URL |
|---|---|---|
|Master|![](https://travis-ci.org/kendricktan/heiswap-relayer.svg?branch=master)|https://relayer.heiswap.exchange|---
# Usage
Send a payload to https://relayer.heiswap.exchange (or whatever URL you've deployed it to) with the following structure:
```javascript
{
"message": string,
"signedMessage": string,
"receiver": address, // ethereum address
"ethAmount": number,
"ringIdx": number,
"c0": string,
"keyImage": (string, string),
"s": Array
}
```# DIY (Deploy-it-yourself)
## Dependencies
```
sudo apt-get update -y
sudo apt install docker.io -y
sudo systemctl start docker# So you don't need sudo to run docker
sudo groupadd docker
sudo usermod -aG docker $USER# Now relogin
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
```## Running the relayer
1. Clone the project and cd into it's root directory
```
git clone [email protected]:kendricktan/heiswap-relayer.git
cd heiswap-relayer
```2. Edit `docker-compose.yml` and edit the following environment variables to suit your site
**Note 1:** Make sure the Ethereum address associated with `ETH_SK` has some funds to start with (~0.5 ETH)
**Note 2:** You'll need to purchase a domain name if you want an SSL connection
```
INFURA_PROJECT_ID='project-id'
ETH_SK='ethereum-secret-key'ALLOWED_DOMAINS: 'yourdomain.com'
SITES: '*.yourdomain.com=yourapp:3000'
```3. Choose deployment method
### SSL Enabled Load Balancer (need custom domain) + multiple relayer backend
```bash
# Change relayer=2 to how many instances you want to run
docker-compose up --build --scale relayer=2 -d
```### Single relayer (runs on port 3000)
```
docker build -t heiswap-relayer .
docker run -e INFURA_PROJECT_ID=<> -e ETH_SK=<> heiswap-relayer
```