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.
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
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.
Kernel can be obtained and installed either through Docker or by building the application locally using Maven.
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.ymlfile associated with it - Set your
RIOT_API_KEYenvironment variable to your Riot API Key - Navigate to the directory where you downloaded
docker-compose.ymlon your local machine and open a terminal or command prompt- Run
docker-compose up -d --force-recreateto lanch Kernel in the background - Run
docker-compose downto shut down Kernel
- Run
- The default
docker-compose.ymlfiles 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
- Install JDK 8 or higher
- Install Maven
- Clone the Kernel source code locally & navigate to the folder
- Run
mvn clean packageto build the application. Some maven profiles are available to bundle datastore dependencies in with the application. Usemvn clean package -P some,profile,namesto activate them - From your Kernel source folder, copy
target/kernel-thorntail.jarwherever you'd like to serve Kernel from - From your Kernel source folder, copy
target/kernel-config.jsonwherever you'd like to serve Kernel from - Set your
KERNEL_CONFIGURATION_PATHenvironment variable to point at yourkernel-config.json - Set your
RIOT_API_KEYenvironment 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.jarto launch Kernel.
Feel free to send pull requests or to contact us via GitHub or Discord.
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.