-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #555 Should be tested with https://github.com/tahowallet/contracts/pull/427 To be able to work with very large XP claim files we need to split them into multiple files. This code assumes that - we have a `XP_HOSTING_BASE_URL` env variable that will be used as a base to fetch xp drop files and leaderboard files - in the `assets/xp-data.json` file we will store second part of the urls like: ``` XP_HOSTING_BASE_URL="app.taho.xyz" { "4": { "rootFolder": ""/assets/xp/realm-name", "claimsFolder": "/assets/xp/realm-name/claims", "xpGlossary": ["0xmerkleroot.json", "0xmerkleroot.json"], "leaderboard": "leaderboard.json" }, } ``` - each xp drop is one glossary file in a format: ```json { "totalAmount": "0x", "merkleRoot": "0x", "merkleDistributor": "0x", "glossary": [ { "startAddress": "0x1", "file": "0xmerkleroot-0.json" }, { "startAddress": "0x2", "file": "0xmerkleroot-1.json" } ] } ``` - start address is included in the file it is linking to - claim files look like: ```json { "0xaddress": { "index": "", "amount": "", "proof": [] } } ``` For further information please read the[ process documentation](https://github.com/tahowallet/dapp/blob/068296a8eedb9f89ec5de5c0c9f13441c48ccf2b/docs/xp-distribution.md)
- Loading branch information
Showing
11 changed files
with
212 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# XP distribution | ||
|
||
### On chain allocation | ||
|
||
Allocation is done using the script from the [contracts](https://github.com/tahowallet/contracts) repository, please use [documentation](https://github.com/tahowallet/contracts/blob/main/merkle/README.adoc) written for the script there. This documentation assumes you've already generated all the files and the drop already happened. The only thing left to do is to provide the dapp source merkle tree data for given allocation. | ||
|
||
### Providing XP data in the dapp | ||
|
||
1. In the `src/assets/xp-data.json` find out where is the folder for the realm that you did the XP drop on. Should be `assets/xp/<realm-name>/` | ||
|
||
Update leaderboard | ||
|
||
2. Copy the `leaderboard.json` file from `contracts` repo that was just created by the allocation script. | ||
|
||
3. If we already had leaderbord file (`assets/xp/<realm-name>/leaderboard.json`) then let's replace the leaderboard file with the new one. Leaderboard data will sum xp amounts from previous drops so it should be replaced with updated data. | ||
|
||
4. In the `src/assets/xp-data.json` make sure leaderboard file name got updated if needed. If this is the first drop on a given realm then please update it to (`leaderboard` field): | ||
```json | ||
"<realm-id>": { | ||
"rootFolder": "/assets/xp/<realm-name>", | ||
"claimsFolder": "/assets/xp/<realm-name>/claims", | ||
"xpGlossary": [], | ||
"leaderboard": "leaderboard.json" | ||
}, | ||
``` | ||
|
||
Upload XP drop glossary | ||
|
||
5. Copy the main file with XP drop data from the contracts. Make sure this is correct file - it should contain `glossary` field and `merkleDistributor` | ||
|
||
6. Paste that file into `assets/xp/<realm-name>/` folder | ||
|
||
7. Update `src/assets/xp-data.json` with the glossary file name (`xpGlossary` field). If this is first drop then the `xpGlossary` array will be empty, if not then add new file name to the end of the array. Each file is named with the merkle root value. | ||
```json | ||
"<realm-id>": { | ||
"rootFolder": "/assets/xp/<realm-name>", | ||
"claimsFolder": "/assets/xp/<realm-name>/claims", | ||
"xpGlossary": ["0x<merkle-root>.json", "0x<merkle-root>.json"], | ||
"leaderboard": "leaderboard.json" | ||
}, | ||
``` | ||
|
||
Upload XP claim files | ||
|
||
8. Copy all files from the `contracts` repo that were created in the `claims` folder for a given XP drop | ||
9. Paste them into the `"src/assets/xp/<realm-name>/claims` folder. Don't remove existing files if this is not the first drop. | ||
10. Look into the glossary file (`/assets/xp/<realm-name>/0x<merkle-root>.json`) and confirm it is referring to the same files you just pasted into the `claims` folder. | ||
|
||
Testing | ||
|
||
11. Run app locally or build it on Netlify PR preview to make sure you can see correct XP values in the claim banner and XP leaderboard. Confirm you are able to claim XP if possible on a given environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
{ | ||
"4": { | ||
"xp": [], | ||
"leaderboard": null | ||
}, | ||
"7": { | ||
"xp": [], | ||
"leaderboard": null | ||
}, | ||
"9": { | ||
"xp": [], | ||
"leaderboard": null | ||
}, | ||
"19": { | ||
"xp": [], | ||
"leaderboard": null | ||
}, | ||
"22": { | ||
"xp": [], | ||
"leaderboard": null | ||
} | ||
} | ||
"4": { | ||
"rootFolder": "/assets/xp/gitcoin", | ||
"claimsFolder": "/assets/xp/gitcoin/claims", | ||
"xpGlossary": [], | ||
"leaderboard": null | ||
}, | ||
"7": { | ||
"rootFolder": "/assets/xp/cyberconnect", | ||
"claimsFolder": "/assets/xp/cyberconnect/claims", | ||
"xpGlossary": [], | ||
"leaderboard": null | ||
}, | ||
"9": { | ||
"rootFolder": "/assets/xp/arbitrum", | ||
"claimsFolder": "/assets/xp/arbitrum/claims", | ||
"xpGlossary": [], | ||
"leaderboard": null | ||
}, | ||
"19": { | ||
"rootFolder": "/assets/xp/galxe", | ||
"claimsFolder": "/assets/xp/galxe/claims", | ||
"xpGlossary": [], | ||
"leaderboard": null | ||
}, | ||
"22": { | ||
"rootFolder": "/assets/xp/frax", | ||
"claimsFolder": "/assets/xp/frax/claims", | ||
"xpGlossary": [], | ||
"leaderboard": null | ||
} | ||
} |
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters