{"id":20200751,"url":"https://github.com/dapp-learning-dao/dapp-learning-sourcecred","last_synced_at":"2026-04-02T02:53:32.605Z","repository":{"id":37020285,"uuid":"411151355","full_name":"Dapp-Learning-DAO/Dapp-Learning-Sourcecred","owner":"Dapp-Learning-DAO","description":"Sourcecred","archived":false,"fork":false,"pushed_at":"2025-01-16T01:13:46.000Z","size":1603421,"stargazers_count":6,"open_issues_count":176,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T11:06:43.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rebase-network.github.io/Dapp-Learning-Sourcecred/","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dapp-Learning-DAO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-28T05:39:48.000Z","updated_at":"2022-06-10T07:18:40.000Z","dependencies_parsed_at":"2023-10-11T03:44:11.087Z","dependency_job_id":"612e6401-0b56-4653-96b6-142c16c723a3","html_url":"https://github.com/Dapp-Learning-DAO/Dapp-Learning-Sourcecred","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"sourcecred/template-instance","purl":"pkg:github/Dapp-Learning-DAO/Dapp-Learning-Sourcecred","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dapp-Learning-DAO%2FDapp-Learning-Sourcecred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dapp-Learning-DAO%2FDapp-Learning-Sourcecred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dapp-Learning-DAO%2FDapp-Learning-Sourcecred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dapp-Learning-DAO%2FDapp-Learning-Sourcecred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dapp-Learning-DAO","download_url":"https://codeload.github.com/Dapp-Learning-DAO/Dapp-Learning-Sourcecred/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dapp-Learning-DAO%2FDapp-Learning-Sourcecred/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260629748,"owners_count":23038980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:45:33.321Z","updated_at":"2026-04-02T02:53:32.307Z","avatar_url":"https://github.com/Dapp-Learning-DAO.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SourceCred Template Instance\n\nThis repository contains a template for running a SourceCred instance.\n\nNew users of SourceCred are encouraged to fork this repo to start their own\ninstance.\n\nThis repo comes with a GitHub action configured that will run SourceCred automatically\nevery 6 hours, as well as any time you change the configuration.\n\n# About SourceCred Instances\n\nSourceCred is organized around \"instances\". Every instance must have a\n`sourcecred.json` file at root, which specifies which plugins are active in the\ninstance. Config and permanent data (e.g. the Ledger) are stored in the master branch.\nAll output or site data gets stored in the `gh-pages` branch by the Github Action.\n\nConfiguration files:\n- `config/grain.json` specifies how much Grain to distribute every week. The `maxSimultaneousDistributions` parameter \ndetermines how many weeks of \"back-distributions\" to generate if the command hasn't been run in a while (or ever).\n- `config/currencyDetails.json` By default, SourceCred uses \"Grain\" as the name for the currency it distributes to participants.\nIf you would like to change it to something custom for your community, you can do so by editing this file.\n- `config/plugins/$PLUGIN_OWNER/$PLUGIN_NAME` stores plugin-specific data. Each\n  plugin has its own directory. See the plugin section below to learn how to configure them.\n\nPermanent Data:\n- `data/ledger.json` keeps a history of all grain distributions and transfers as well as identities added / merged.\n\nGenerated Data: \n\n- `cache/` stores intermediate produced by the plugins. This directory should\n  not be checked into Git at all.\n- `output/` stores output data generated by SourceCred, including the Cred\n  Graph and Cred Scores. This directory should be checked into Git; when\n  needed, it may be removed and re-generated by SourceCred.\n- `site/` which stores the compiled SourceCred frontend, which can display data\n  stored in the instance.\n\n\n# Setup and Usage\n\nUsing this instance as a starting point, you can update the config to include\nthe plugins you want, pointing at the data you care about. We recommend setting up\nyour instance locally first and make sure its working before pushing your changes\nto master and using the Github Action.\n\n1. Hit the big green \"Use this template\" button on github. (do not fork)\n\n1. Use a **git** client to clone your new repo locally.\n\n1. Get [Yarn], navigate to the cloned repo directory in a terminal, and then run `yarn` to install SourceCred and dependencies.\n\n2. Enable the plugins you want to use by updating the `sourcecred.json` file. e.g. \nto enable all the plugins:\n```json\n{\n  \"bundledPlugins\": [\"sourcecred/discourse\", \"sourcecred/discord\", \"sourcecred/github\"]\n}\n```\n\n3. If you are using the GitHub or Discord plugin, copy the `.env.example` file to a `.env` file:\n```shell script\ncp .env.example .env\n```\n\n4. Follow the steps in the [plugin guides below](#supported-plugins) to setup the config files and generate access tokens\nfor each plugin and then paste them into the `.env` file after the `=` sign.\n\n\n5. Use the following commands to run your instance locally:\n\n**Load Data**\n\n- `yarn load` loads the data from each plugin into the cache. Run this anytime you want to re-load the data from \nyour plugins.\n\n**Run SourceCred**\n- `yarn start` creates the cred graph, computes cred scores and runs the front end interface which you can access at `localhost:6006`\nin your browser.\n\nNOTE: this command will not load any new data from Discord / GitHub / Discourse, etc. If you want to re-load\nall the latest user activity, run `yarn load` again.\n\n**Clear Cache**\n\n\n- `yarn clean` will clear any cached data that was loaded by the plugins. You can run this if any plugins fail to load. Run `yarn load` after this to re-load the data.\n\nIf you want to restart from a clean slate and remove all the generated graphs, you can do so via:\n- `yarn clean-all` \n\nRun `yarn clean-all` if the `yarn start` command fails due to a change in the config or breaking changes in a new version of SourceCred.\n\n### Distributing Grain\n- `yarn grain` distributes Grain according to the current Cred scores, and the config in `config/grain.json`. \n\nThis repo also contains a GitHub action for automatically distributing grain. It will run every Sunday and create a Pull Request\nwith the ledger updated with the new grain balances based on the users Cred scores. The amount of grain to get distributed\nevery week can be defined in the `config/grain.json` file. \n\n\nThere are three different policies that can be used to control\nhow the grain gets distributed: `immediatePerWeek`, `balancedPerWeek`, and `recentPerWeek`. For info on what each policy does, how to choose the right policy for your community, and how Grain operates in general, see [How Grain Works](https://sourcecred.io/docs/beta/grain). \n\nBelow is an example `grain.json` file for a configuration that uses a combination of all three policies. Here we tell SourceCred to distribute 1,000 grain every week, with 25% (250 grain) distributed according to `immediatePerWeek`, 25% (250 grain) distributed according to `balancedPerWeek`, and 50% (500 grain) distributed according to `recentPerWeek`. \n\n```\n{\n \"immediatePerWeek\": 250,\n \"balancedPerWeek\": 250,\n \"recentPerWeek\": 500,\n \"recentWeeklyDecayRate\": 0.5,\n \"maxSimultaneousDistributions\": 100\n}\n```\n\n\n\n### Low-level CLI\nIf you want to go deeper, you can access lower-level commands in the sourcecred CLI in the form of: `yarn sourcecred \u003ccommand\u003e`. \nFor a list of what's available, and what each command does, run `yarn sourcecred help`.\n\n### Publishing on GitHub pages\n\nOnce you've got the instance configured to your satisfaction (see instructions on plugins below),\ncommit and push your changes to master (or make a pull request). The Github Action will then generate the frontend\nand deploy it to GitHub Pages. To enable GitHub Pages for your instance, check out [this guide](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).\nMake sure you select `gh-pages` as the branch to publish from.\n\n# Supported Plugins\n\n## GitHub\n\nThe GitHub plugin loads GitHub repositories.\n\nYou can specify the repositories to load in\n`config/plugins/sourcecred/github/config.json`.\n\nIn order for SourceCred to access your GitHub repos, \nyou must have a GitHub API key in your `.env` file as\n`SOURCECRED_GITHUB_TOKEN=\u003ctoken\u003e` (copy the `.env.example` file for reference). The key should be read-only without any special\nscopes or permissions (unless you are loading a private GitHub repository, in which case\nthe key needs access to your private repositories).\nYou will also need to add it to your GitHub Action secrets.\n\nYou can generate a GitHub API key [here](https://github.com/settings/tokens).\n\n## Discourse\n\nThe Discourse plugin loads Discourse forums; currently, only one forum can be loaded in any single instance. This does not require any special API\nkeys or permissions. You just need to set the server url in `config/plugins/sourcecred/discourse/config.json`.\n\n## Discord\n\nThe Discord plugin loads Discord servers, and mints Cred on Discord reactions. In order for SourceCred to\naccess your Discord server, you need to generate a \"bot token\" and paste it in the `.env` file as\n`SOURCECRED_DISCORD_TOKEN=\u003ctoken\u003e` (copy the `.env.example` file for reference). You will also need to add it\nto your GitHub Action secrets. \n\nThe full instructions for setting up the Discord plugin can be found in the [Discord plugin page](https://sourcecred.io/docs/beta/plugins/discord/#configuration)\n in the SourceCred documentation. \n\n# Removing plugins\n\nTo deactivate a plugin, just remove it from the `bundledPlugins` array in the `sourcecred.json` file.\nYou can also remove its `config/plugins/OWNER/NAME` directory for good measure.\n\n\n\n[Yarn]: https://classic.yarnpkg.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapp-learning-dao%2Fdapp-learning-sourcecred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapp-learning-dao%2Fdapp-learning-sourcecred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapp-learning-dao%2Fdapp-learning-sourcecred/lists"}