- Install Rust. Using Rustup Run the following in your terminal, then follow the onscreen instructions:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Clone the repository.
$ git clone [email protected]:SugarFunge/sugarfunge-integration.git
- Compile the truffle contracts and copy the
build/contracts
folder to the root folder of this repository
$ cd sugarfunge-integration
$ cp $TRUFFLE_ROOT/build/contracts .
- Copy the environment file as .env and make the changes based on your needs
$ cp .env.example .env
- Start the API
# Normal run
$ cargo run
# Auto-reload
$ cargo watch -x 'run --bin sugarfunge-integration'
-
Install Docker
-
Install Docker-Compose
- Copy the environment file as .env and make the changes based on your needs (Optional if you already configured the API above)
$ cp .env.example .env
- Start the docker-compose file (Access Swagger UI) (Access Prometheus Server)
$ docker-compose up -d
- Stop the docker-compose file
$ docker-compose down
- Default environment file: .env
- Example environment file: .env.example
Variable Name | Description |
---|---|
RUST_LOG | Rust log level |
RUST_BACKTRACE | Show Rust backtrace (0 or 1) |
LISTEN_URL | API Listen URL |
INFURA_PROJECT_ID | Infura Project ID |
PRIVATE_KEY | Private Key used to interact with contracts |
CHAIN_ID | Chain ID (Default: 3 / Ropsten testnet) |
MORALIS_BASE_URL | Moralis API base URL |
MORALIS_API_KEY | Moralis API Key |
SWAGGER_JSON | Swagger json file path inside the container |