Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ankushkun/gitar

Arweave project contribution reward platform
https://github.com/ankushkun/gitar

arweave bounty hackerhouse permaweb

Last synced: 6 days ago
JSON representation

Arweave project contribution reward platform

Awesome Lists containing this project

README

        

# GitAR 🎸

- [GitAR 🎸](#gitar-)
- [About](#about)
- [Setup and Installation](#setup-and-installation)
- [Requirements](#requirements)
- [Installation](#installation)
- [ARdrive setup](#ardrive-setup)
- [Manual deployment](#manual-deployment)
- [SmartWeave Contract](#smartweave-contract)
- [License](#license)
- [Contributing](#contributing)

# About

Got a product? 🤔 \
Need something to be fixed or a new feature to be added?\
A blog to be written? or any contribution towards your product?

Now you can setup bounties for people and reward them with AR or Atomic Assets for their contributions 🤩

This would encourage newcomers and more developers to contribute to the Arweave ecosystem in both code and non code forms _yay!_

# Setup and Installation

## Requirements

- NodeJS LTS
- An Arweave Wallet (better if funded)
- ARNS test tokens in you want to deploy to your own ARNS subdomain

## Installation

1. Fork the repository

2. Clone the repository

```bash
git clone https://github.com//GitAR.git
```

3. Install dependencies

```bash
cd GitAR
npm install
```

4. Create a .env file

```bash
cp .env.dev .env
```

5. Edit the .env file and add the variables

# ARdrive setup

Install the ardrive-cli globally

```bash
npm i -g ardrive-cli
```

Generate seedphrase and wallet through which we will create the drive and folder and upload our files

```bash
ardrive generate-seedphrase
export SEED="" # Output from previous command
```

```bash
ardrive generate-wallet -s "${SEED}" > wallet.json
```

Using the `--turbo` flag will allow us to upload files upto 500kb for free

```bash
ardrive create-drive -w wallet.json -n apps --turbo
```

Copy Drive entity id and root folder entity id from the output of above command and add them to the .env file

```bash
ardrive create-folder -w wallet.json -n "gitar" -F "" --turbo
```

Copy the gitar folder entity id from the output of above command and add it to the .env file

also run `export GITAR_FOLDER_EID=` to set the environment variable

**After this the uploading process will be taken care by the `deploy.js` script, make sure to update the `ANT TOKEN ADDRESS` and `SUBDOMAIN` if required.**

Github actions will automatically run the deploy script and upload the files to arweave on every push.

## Manual deployment

```bash
npm run build
cd ./dist
ardrive upload-file -s "${SEED}" -l ./ -F ${GITAR_FOLDER_EID} --turbo
ardrive create-manifest -s "${SEED}" -f ${GITAR_FOLDER_EID} --turbo --dry-run > out.json
```

- Open out.json and keep the manifest section and remove the rest of the contents
- set `index.path` to "index.html"
- Find and replace all occurrences of `./` with and empty string to avoid relative paths

Before

```json
{
"manifest": "arweave/paths",
"version": "0.1.0",
"index": {
"path": "./404.html"
},
"paths": {
"./404.html": {
"id": "j-0gtXjXZoql1skhD3HNUbCn6ze-VnXYIt6x0Gajtow"
},
"./assets/index-c5b8b06a.css": {
"id": "mY6nU2zuzMdDMADKybWkXb8WgJt-qdzi_lRH3O1Vxcg"
},
"./assets/wallet-f1ba16a9.svg": {
"id": "6YXrOjpwqdHdTxUm1dd3MmBVFyXGs-b_gkb52K7GSPE"
},
"./index.html": {
"id": "vNCT5Gv9YgC8TL6viN_t6zsDrR5Zdhoyp1AfQIuekUY"
}
}
}
```

After

```json
{
"manifest": "arweave/paths",
"version": "0.1.0",
"index": {
"path": "index.html"
},
"paths": {
"404.html": {
"id": "j-0gtXjXZoql1skhD3HNUbCn6ze-VnXYIt6x0Gajtow"
},
"assets/index-c5b8b06a.css": {
"id": "mY6nU2zuzMdDMADKybWkXb8WgJt-qdzi_lRH3O1Vxcg"
},
"assets/wallet-f1ba16a9.svg": {
"id": "6YXrOjpwqdHdTxUm1dd3MmBVFyXGs-b_gkb52K7GSPE"
},
"index.html": {
"id": "vNCT5Gv9YgC8TL6viN_t6zsDrR5Zdhoyp1AfQIuekUY"
}
}
}
```

```bash
ardrive upload-file -s "${SEED}" -l ./manifest.json --content-type application/x.arweave-manifest+json -F ${GITAR_FOLDER_EID} --turbo > ../out.json
```

Check out.json for a field called `dataTxId`, your website is now live at `https://arweave.net/` 🥳

This dataTxId can be used to register a custom subdomain on [Permapages ARNS](https://permapages.app/#/arns)

Once you get ARNS Test tokens and register a subdomain, you can check the transaction history to get your `ANT Contract Address`

# SmartWeave Contract

The smartweave contract is located in the `contract` folder.

To deploy the contract, run the following command

```bash
node contract/deploy.js
```

This will store the contract address in the deployment.json file.

# License

This project is licensed under the GNU GPL v3.0 License - see the [LICENSE](LICENSE) file for details

# Contributing

Feel free to open issues and pull requests. Both code and non code contributions are welcome 😊

If you need any assistance feel free to [email me](mailto:[email protected]) or ping me on [Discord @ankushkun](https://discord.gg/vFg3armSck)