Awesome
Kernel - A plug & play Riot API proxy server
Kernel is built on top of orianna, a Riot API wrapper and framework for working with API data. The API Kernel provides mirrors the Riot API, and allows users to proxy their API calls through Kernel to avoid "leaking" their Riot API key to end users.
Kernel is built using the Thorntail application server with JAX-RS and RestEasy.
Kernel is licensed under the MIT License.
Features
Kernel also includes the following built-in features:
- Automatic rate limit handling for the Riot API
- Configurable strategies for handling Riot API errors (retry, expontential backoff, return null, etc)
- A configurable pipeline for automatic caching of API results
- Plug & Play support for several common databases in the works here
- Support for MessagePack serialization in addition to JSON
API Differences from Riot API
Kernel is intended to mirror the Riot API exactly. The Riot API, however, is distributed accross regional platform domains to split computation load and localize content distribution (e.g. na1.api.riotgames.com or euw1.api.riotgames.com). Kernel supports serving all platforms from a single server instance using the platform
query parameter, which is available for every API endpoint in Kernel. All Riot API platforms are supported by this feature. A default platform can be configured to direct requests without a platform
query parameter to that platform.
Example: the Riot API call https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/FatalElement
becomes http://localhost/lol/summoner/v4/summoners/by-name/FatalElement?platform=NA1
for Kernel.
How to get it
Kernel can be obtained and installed either through Docker or by building the application locally using Maven.
Docker
Kernel docker images are available on Docker Hub. If you're unfamiliar with docker, here's how to run them on your local machine:
- Install & Configure Docker
- Windows 10 Professional (or other windows version with Hyper-V support)
- Other Windows
- Ubuntu
- Debian
- CentOS
- Fedora
- Mac
- Install Docker Compose
- Choose an off-the-shelf configuration of Kernel to use and download the
docker-compose.yml
file associated with it - Set your
RIOT_API_KEY
environment variable to your Riot API Key - Navigate to the directory where you downloaded
docker-compose.yml
on your local machine and open a terminal or command prompt- Run
docker-compose up -d --force-recreate
to lanch Kernel in the background - Run
docker-compose down
to shut down Kernel
- Run
- The default
docker-compose.yml
files will start Kernel on port 80, as well as launching a Swagger UI on port 12357 to explore the API.
If you want to change some configuration settings in Kernel, you can edit the kernel-config.json
file from the configuration you chose, then add a volume entry to the docker-compose.yml
file to load your config into the container.
Example: original compose file | compose file with custom kernel-config.json
Building Locally with Maven
- Install JDK 8 or higher
- Install Maven
- Clone the Kernel source code locally & navigate to the folder
- Run
mvn clean package
to build the application. Some maven profiles are available to bundle datastore dependencies in with the application. Usemvn clean package -P some,profile,names
to activate them - From your Kernel source folder, copy
target/kernel-thorntail.jar
wherever you'd like to serve Kernel from - From your Kernel source folder, copy
target/kernel-config.json
wherever you'd like to serve Kernel from - Set your
KERNEL_CONFIGURATION_PATH
environment variable to point at yourkernel-config.json
- Set your
RIOT_API_KEY
environment variable to your Riot API Key - Run
java -D"swarm.http.port=8080" -D"java.net.preferIPv4Stack=true" -D"java.net.preferIPv6Stack=true" -D"java.awt.headless=true" -jar kernel-thorntail.jar
to launch Kernel.
Questions & Contributions
Feel free to send pull requests or to contact us via GitHub or Discord.
Disclaimer
Kernel isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.