Mining for SearchSECO
Overview
The Miner functionality of the DAO WebApp is designed to extract relevant metadata from Github repositories and upload it to the application's database. It involves several components working together: The Crawler, the Spider, the Miner itself, and the Parser.
Spider
The Spider is responsible for crawling individual Github repositories, extracting metadata such as the author and blame data. The Spider returns data about each commit and code block, along with information about any detected vulnerabilities.
Crawler
The Crawler uses the Github API to traverse the list of Github repositories. In addition, the Crawler retrieves metadata related to each project, such as the project owner's name and email.
Parser
The Parser's role is to parse the repository's code and convert methods into hashes. These hashes are then uploaded to the database by the Miner.
Miner
The Miner is the key component that connects all these functionalities. It controls and executes commands for the Crawler and Spider to perform their tasks, and it uploads all of the data (including parsed hashes) to the database.
Running a Mining node
Users who run a mining node contribute to the extraction and uploading of metadata. In return, they are rewarded based on the amount of hashes they upload to the SearchSECO database. This is a great way to contribute to the growth and data richness of the SecureSECO DAO while also earning rewards.
Make sure your Github Access Token has the necessary permissions to access and interact with the repositories you wish to mine. Your token scope needs to include at least full control of private repositories.
Setting up and running a Mining node
Download the SearchSECO Miner repository here (opens in a new tab).
Make a .env file, fill in the relevant variables and run the following commands to install the miner:
npm i
git submodule update --init --recursive
Then use the following command to run the miner for Windows:
npm run start-win
For Unix:
npm run start-unix
Please refer to the SearchSECO Miner repository (opens in a new tab) for a more detailed installation guide.
Claiming rewards
Before you can can claim rewards for running a mining node, you need to have connected your wallet and have joined the DAO.
Navigate to the SearchSECO Mining page (opens in a new tab).
In the "Miners" section of the page, you can verify that your mining nodes are connected to your account and also check the status of your nodes.
The "Claim rewards" section of the page provides the option to claim your rewards as either SECOREP or SECOIN. The amount of your reward is based on the amount of claimable hashes you have available. You can set the percentage of the reward you want to claim as SECOREP or SECOIN with the slider.
Pressing the "Claim reward" button sets sets the claimable hashes to zero and adds the tokens to your wallet.