- Install Solidity compiler, required to generate Go bindings for .sol files. IMPORTANT: DO NOT use npm to install solc. Use apt-get/Homebrew instead.
- Install 'dep'
- 'dep ensure' all the dependencies
- Install 'abigen' tool. IMPORTANT: run 'go install' from vendor folder, not from %GOPATH/src
- Generate the bindings using 'abigen' by running 'go generate' command
- Fill config.yaml file with according info
- Start the server by running 'go run main.go'
- Alternatively run 'go build main.go' and run produced executable
- Interaction with server is performed by utilizing the API
- The endpoint is:
- GET /exchange/:ethereum_address - Send the request to server with ethereum address to which tokens will be sent. The response is Bitcoin address to which bitcoins must be sent to buy tokens.
-1 = An error occured. Please look at the 'error' column for details
0 = A purchase was requested, but the funds haven't arrived yet
1 = User has successfully purchased tokens using BTC