Push based
Introduction
The idea of the push-based approach is that you will push a string, which we call an "action" together with the player's address, to our endpoint. This action should be something that can be done by the player in your game. An example action could be "Slay Zombie" or "Open Golden Chest". On the gg.xyz side, this action will be linked to a quest. A quest is a set of actions that the player needs to complete in order to get the reward. The quest can be customized in many ways with the quest-plugins (we call them quest-limitations). For example, we could build a quest where the player needs to complete the actions "Slay Zombie" 5 times and "Open Golden Chest" 3 times within 10 minutes after starting the quest.
More on quest creation can be found in STEP 3.
At the current stage of development, the gg.xyz team will create a game for you and you will be given the secret to the game that you should use in the endpoint. Further more, In accordance to your needs, the gg.xyz team will also create the actions, quests, subquests and quest-limitations for you.
Once you have the secret, you can proceed directly to STEP 4 to use the push-based endpoint.
1. Add game form:
First of all, a game needs to be created in the system with the questmaker: https://questmaker-testnet.gg.quest/
login: redacted
password: redacted
Fill in all the fields and click Submit game
After creating the game, You can find the secret in the game object game.secret
which will provided by the gg.xyz team.
2. Create a new action:
In the questmaker, go to the Actions
tab and click Add action
.
Fill in the action name and click
Submit
.
3. Create a new quest:
In the questmaker, go to the Quests
tab and click Add quest
.
Fill in the quest details, quest-limitations and first subquest then click Submit Quest
.
4. Push based endpoint:
With the public endpoint https://api.gg.quest/api/v2/action-dispatcher/dispatch/public
Header:
{
"secret": "string"
}
Body:
{
"actions": [
"string"
],
"playerAddress": "string"
}