Rawrshak / Rawrshak

Rawrshak Smart Contracts and GraphNode Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rawrshak

This project will contain the implementation of the Rawrshak Smart Contracts

Token: Rawrshak Token [RAWR]

Rawrshak Token are the platform currency that will be used for Governance and transactions.

Tools

Node JS and NPM

Install [Node JS and NPM](https://nodejs.org/en/)
To update, run:
    npm install npm@latest -g

Yarn

Install:
    npm install --global yarn

Get all packages:
    yarn install

HardHat, Waffle, and Ethers.js

[Hardhat](https://hardhat.org/getting-started/)
[Waffle](https://ethereum-waffle.readthedocs.io/en/latest/getting-started.html)
[Ethers.js](https://docs.ethers.io/v5/getting-started/)
We're using Hardhat as the development framework for ethereum

Install:
    npm install --save-dev hardhat
    npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
Helpful standard solidity library

Install:
    npm install @openzeppelin/contracts-upgradeable
    npm install @openzeppelin/test-helpers

Visual Studio Code

This is lightweight IDE that I use.
Install: https://code.visualstudio.com/

Extensions

Install the following extensions on Visual Studio Code
Solidity - by juanblanco.solidity 
    Used for solidity code as well as generating the C# code for Unity
React Native Tools - by msjsdiag.vscode-react-native
    Used for the React Native Front-end Dapp
C# - ms-dotnettools.csharp
    For Unity Development
C/C++ - ms-vscode.cpptools
    For Unreal Engine Development

Unity Engine

Download and Install from: https://store.unity.com/download

Docker

Install: https://www.docker.com/products/docker-desktop
Used for the local Graph Node deployment

The Graph

This is used for indexing the ethereum database. Locally, we use it against a ganache instance.
More Info: https://thegraph.com/docs/quick-start#local-development
Install:
    npm install -g @graphprotocol/graph-cli
    or 
    yarn global add @graphprotocol/graph-cli

Inter-Planetary File System (IPFS)

Currently used to store asset data information in a decentralized manner.
Install: https://github.com/ipfs-shipyard/ipfs-desktop 
    Just running the IPFS desktop set up is good enough.

Json-Server

Used to host the Asset Info data that the NFT smart contract is pointing to
Instructions and quick tutorial: https://www.npmjs.com/package/json-server
Install:
    npm install -g json-server

Other Helpful tools

Displays the contract size for all or a selection of your smart contracts in kilobytes. The limit for a smart 
contract is roughly 24.5 kb, so this is a good tool to use to figure out if we need to cut down on the smart 
contract size. 
Install: yarn add --dev hardhat-contract-sizer

Quick-start Guide

Building the Smart Contracts

1. Clone the repo 
2. Download and install Node JS, NPM, yarn, Truffle, Ganache, OpenZeppelin, and Visual Studio Code
3. Install Solidity extension in Visual Studio Code

Everything should be configured properly. If you have any issues, contact [Christian](christian@rawrshak.io)

Hardhat Commands

npx hardhat compile
    - compiles the smart contracts
npx hardhat node
    - starts a local node
npx hardhat test
    - runs all tests in the test folder
npx hardhat test <specific test>
    - runs a specific test inside the test folder

To deploy to a local node

npx hardhat node
npx hardhat run --network localhost scripts/deploy.js

To deploy to a specific network

npx hardhat run --network <target network> scripts/deploy.js

To run a Deterministic Ganache ethereum blockchain

1. Open a new powershell/command prompt
2. run:
    ganache-cli -h 0.0.0.0 -m "violin couple forest beyond despair spray wide badge buddy thunder menu same"
    The seed phrase above is a test seed phrase that I use to make the first deployed contract addresses match
    the addresses in the graph node. Addresses need to be updated if you decide to use a different set of seed
    words.

To set up the local graph node:

1. refer to the [Rawrshak Graph Node project](https://github.com/rawrshak/subgraphs) for instructions

About

Rawrshak Smart Contracts and GraphNode Repository

License:GNU General Public License v3.0


Languages

Language:JavaScript 62.8%Language:Solidity 37.2%