Open the terminal app (Note: it could be that you are asked for your password which is your login-password. MacOS hides your password and does not even show that you are inserting any characters. Simply type your password and press enter):
Install the Brew package manager by copy&paste the following command (this will take a while)
The files should be cloned (downloaded) into a new folder called "staking-rewards-collector".
Initialize packages
This has only to be done once and directly after you downloaded the script.
Open the terminal in the newly cloned folder "staking-rewards-collector"
Windows: Shift + right click on the folder and open in the powershell.
MacOS: Right click and "New terminal at folder"
Insert yarn into the terminal and press enter.
This should download all the necessary packages.
Usage
Adjust userInput.json
Rename userInput.json.sample file in the config folder to userInput.json.
Right-click and open the userInput.json file (inside the config-folder) with any text-editor (code editor is preferred). Here you can specify the necessary information (see for more info the README in GitHub).
Input your addresses. Make sure that a new address is added in the following format:
{
name: "NAME 1",
address: "Address either of Polkadot / Kusama",
startBalance: some number (can be set to 0 for most cases),
network: "Polkadot" / "Kusama" / "Moonriver"
},
{
name: "NAME 2",
address: "Address either of Polkadot / Kusama",
startBalance: some number (can be set to 0 for most cases),
network: "Polkadot" / "Kusama" / "Moonriver"
},
{
name: "NAME 3",
address: "Address either of Polkadot / Kusama",
startBalance: some number (can be set to 0 for most cases),
network: "Polkadot" / "Kusama" / "Moonriver"
} <- NO comma if it is the last entry of your addresses
NOTE The last entry should not end with a comma and the very last row of the file should end with ]}
Run the script
After you installed everything and set-up your config file, you can run the script to collect your rewards.
Open the terminal pointing to your "staking-rewards-collector" folder
Type yarn start and press enter.
Updating
In the case a new version of the script is available run the git pull command in your terminal (being in the script's folder).
This might overwrite your userInput.json file so it is best to give it a new name, run git pull and then replace the downloaded file.
Import the data to Excel
Most users are mainly interested in the .csv output files. Those can be imported to Excel as follows:
Double click the .csv file to open.
Most likely, the data is all pushed into the first column of excel.
Select the whole column and go to "Data" on the top and select "Text to Columns"
Select "delimited", press next.
Only select "Comma" as delimiter, press next.
(Only if your operating system uses "," as a decimal delimiter):
Go into the "advanced" tab and specify the "." as decimal delimiter and "," as thousand delimiter.
Press finish.
The data should now be in order and distributed across the columns.