|
| 1 | +# Yearn metadata storage |
| 2 | + |
| 3 | +[](https://github.com/yearn/ydaemon/actions?query=workflow%3AValidation) |
| 4 | +[](https://prettier.io/) |
| 5 | + |
| 6 | +## What? |
| 7 | + |
| 8 | +This repo contains all the metadata of the yearn ecosystem. Contents of the |
| 9 | +[`meta`](./data/meta) directory are synced to IPFS for storage, accessible through |
| 10 | +our gateway [meta.yearn.network](https://meta.yearn.network). Consistency of |
| 11 | +the stored data is verified by smalls scripts and schemas. |
| 12 | + |
| 13 | +## Adding documents |
| 14 | + |
| 15 | +Any document can be added to the [`meta`](./data/meta) directory, but there are some |
| 16 | +special checks to ensure consistency and ease of accessibility: |
| 17 | + |
| 18 | +- All JSON files that share names with the files in the [`schema`](./data/meta/_config/schema) |
| 19 | + directory must follow the defined schema, otherwise verification will fail. |
| 20 | +- Any folder that begins with `0x` is considered as an address. The address must |
| 21 | + be checksummed, otherwise verification will fail. |
| 22 | +- All files named `index.json` will be ignored by git and will be |
| 23 | + overwritten by the indexing process. (see [indexing](#indexes)) |
| 24 | + |
| 25 | + |
| 26 | +## Adding schemas |
| 27 | + |
| 28 | +Schemas can be created in the root of the [`schema`](./data/meta/_config/schema) folder. For |
| 29 | +syntax you can take a look at the [JSON schema specs](https://json-schema.org). |
| 30 | +The [AJV](https://github.com/ajv-validator/ajv) library is used to validate the |
| 31 | +data with the provided schemas. |
| 32 | + |
| 33 | +## Syncing with IPFS |
| 34 | + |
| 35 | +After each commit to main, direct or as a result of a merged pull request, a |
| 36 | +sync to IPFS is triggered. |
| 37 | + |
| 38 | +## Indexes |
| 39 | + |
| 40 | +Before each deployment the [`meta`](./data/meta) directory is scanned and an |
| 41 | +`index.json` file is generated inside each directory (root included). The file |
| 42 | +follows the [`index.json` schema](./data/meta/_config/schema/index.json) and will contain |
| 43 | +information about the files and folders stored in that directory. For an example |
| 44 | +see [meta.yearn.network/index.json](https://meta.yearn.network/json) |
| 45 | + |
| 46 | +## Translations |
| 47 | + |
| 48 | +Anything under protocols, strategies, and tokens are able to be translated. In the json files listed, we have locale codes and the English text to be translated. The name (if applicable) and description are what should be translated. If you dont see your locale code, make an issue and it will be added manually. To update new json's with the locale information run the python script `toLocale.py` located in the scripts folder. |
| 49 | + |
| 50 | +## Helpful links |
| 51 | + |
| 52 | +- 🌐 [Live site](https://yearn.network) |
| 53 | +- ⚖️ [Governance forum](https://gov.yearn.finance) |
| 54 | +- 📑 [Documentation](https://docs.yearn.finance) |
| 55 | + |
| 56 | +## Contributing |
| 57 | + |
| 58 | +Code style follows prettier conventions (`yarn format`). Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). |
0 commit comments