This repository contains the recipes managed by the C–ATTS project. Feel free to use them as a starting point for your own recipes or to contribute to this repository.
C–ATTS, or Composite Attestations, is a new type of attestation that combines data from multiple sources to form a unified and verifiable credential.
A recipe is a set of queries that fetch attestations and process them to produce a JSON-formatted attestation that can be minted as an onchain composite attestation by the C–ATTS service. C–ATTS supports any data source that can be queried using GraphQL.
Recipes are stored in the recipes
folder of this repository.
The processing logic is made up of a JavaScript file that is executed by the C–ATTS service, onchain in a secure environment.
To learn more, see the C–ATTS website.
Clone this repository and install the dependencies:
git clone https://github.com/c-atts/catts-recipes.git
cd catts-recipes
The only dependency needed is the C–ATTS SDK, packaged as a CLI tool. Install it globally:
npm install -g catts-sdk
C–ATTS supports dynamic variables in the queries and the query endpoints. The following variables are supported:
{api-key}
: For querying The Graph endpoints only. C–ATTS manages an API key and will automatically inject it into the query. See for instance the ENS name holder recipe.
{user_eth_address}
: The Ethereum address of the current user.{user_eth_address_lowercase}
: The Ethereum address of the current user, lowercased.
To fetch query results from a recipe, use the query
command:
catts query <recipeFolder>
The query
command will fetch the query results from the specified recipe and print them to the console. You can optionally specify the index of the query to run:
catts query <recipeFolder> -i <index>
To get more detailed output, including verbose logging, use the -v or --verbose option:
catts query <recipeFolder> -v
To run a recipe, use the run
command:
catts run <recipeFolder>
The run
command will fetch the query results from the specified recipe, run the processor script, validate the schema items against the recipe's schema, and print the results to the console.
To get more detailed output, including verbose logging, use the -v
or --verbose
option:
catts run <recipeFolder> -v
The CLI needs to know a user address to fetch query results. By default, the SDK uses the USER_ETH_ADDRESS
environment variable to fetch query results. If you want to use a different address, you can pass the -e
or --eth-address
option to the query
or run
commands. Alternatively, you can create a .env
file in the root of your project with the USER_ETH_ADDRESS
variable set to the desired address.
catts query <recipeFolder> -e <address>
catts run <recipeFolder> -e <address>
- kristofer@kristoferlund.se
- Twitter: @kristoferlund
- Discord: kristoferkristofer
- Telegram: @kristoferkristofer
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.