The Supermarket runs on port 3000. For a full list of all available CLI options on the Supermarket run --help:
cargo run -- --helpsupermarket [OPTIONS] -m <marketUrl>
--marketUrl / -m: required - The url of the adex-market
--config / -c: optional - If set it will use custom config file path, otherwise it will use prod.toml (production) or dev.toml (development), see the ENV environment variable for more details.
ENV- default:development-productionordevelopmentPORT- default:3000- the port on which the API will be accessible
You can use the included Dockerfile to run the Supermarket in a container.
- Build the image:
docker build -t adex-supermarket .- After building the image you can start a container (
production):
- with production
https://market.adex.network:
docker run --detach -e ENV=production -p 3000:3000 -e MARKET_URL=https://market.adex.network/ adex-supermarket
- with locally running
adex-market(onhttps://localhost:4000):
docker run --detach -e ENV=production -e MARKET_URL=https://localhost:4000 adex-supermarketWhen running a container you can use the same environment variables, except PORT which is set to the default 3000 and exposed by the Dockerfile.
You can also set the CLI option of the Supermarket using the following environment variables:
MARKET_URL: required - sets the--marketUrl/-mCONFIG: optional - if set, it will pass the--config/-coption with the specified configuration file path inside the containerIP_ADDR: optional, default:127.0.0.1- IP address to which the web server to be bound This is useful when running inDockerand sometimes we need to change the IP to0.0.0.0PORT: optional, default:3000- the port to which the web server to be bound
For development purposes, all you have to do is format your code with Rustfmt, fix any Clippy warnings & make sure that all the tests pass:
cargo fmt
cargo clippy
cargo test --all-features-
In
adex-marketrunnpm run units-for-slot-test-output -
Run
cargo test get_sample_units_for_slot_output -- --show-output --ignored
The supported Rust version is 1.48.0, which can be found in the rust-toolchain file.
This project is licensed under the AGPL-3.0 License.