Skip to content

Commit

Permalink
Merge branch 'staging' into feature/hackdays-io#433
Browse files Browse the repository at this point in the history
  • Loading branch information
yu23ki14 authored Mar 16, 2024
2 parents d619d37 + 8e66d19 commit e893770
Show file tree
Hide file tree
Showing 107 changed files with 26,834 additions and 852 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ Solves the problem of organizers struggling with event retention rates.
- contract: Solidity, ERC721Enumerable, Hardhat, circom
- image: IPFS, Pinata

## Development
## Document

- [Frontend](docs/frontend.md)
- [Contract](docs/contract_en.md)
- [Run Localnode](docs/localnode.md)

## Deployment

- [Deploy](docs/deploy_en.md)
[https://mintrally-docs.vercel.app/](https://mintrally-docs.vercel.app/)
[Develop](http://localhost:3000/docs/developer/dev-env)
[Contribution Guide](/CONTRIBUTING.md)
69 changes: 0 additions & 69 deletions docs/devenv_mac_jp.md

This file was deleted.

20 changes: 20 additions & 0 deletions document/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions document/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions document/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
8 changes: 8 additions & 0 deletions document/docs/developer/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Developer",
"position": 2,
"link": {
"type": "generated-index",
"description": "Developer"
}
}
8 changes: 8 additions & 0 deletions document/docs/developer/dev-env/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Development Environment",
"position": 1,
"link": {
"type": "generated-index",
"description": "About Development Environment"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 1
---

# Setting Up Contract Development Environment (Until Test Code Execution)

## Installing Necessary Libraries
Expand Down Expand Up @@ -32,4 +36,4 @@ $ cp .env.example .env

```
$ yarn test
```
```
49 changes: 26 additions & 23 deletions docs/deploy_en.md → document/docs/developer/dev-env/deploy.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 3
---

# Deploy Contract on Testnet and Frontend on Vercel

## Deploy Contract
Expand Down Expand Up @@ -34,13 +38,13 @@ Enter the issued key into the frontend environment variables under the names OZ_

Set the following variables in your .env file. For deploying to Testnet, set variables starting with MUMBAI, and for Mainnet, set variables starting with POLYGON.

| Key | Value |
| --- | --- |
| MUMBAI_FORWARDER_ADDRESS | The Forwarder Address deployed to Mumbai testnet from Hardhat. For Mainnet deployment, set to `POLYGON_FORWARDER_ADDRESS`. |
| MUMBAI_RELAYER_ADDRESS | The Relayer Address obtained in 1.2. For Mainnet deployment, set to `POLYGON_RELAYER_ADDRESS`. |
| ETHERSCAN_API_KEY | Used for contract verification. Issue it from the scan service of the network you are deploying to. [Polygonscan](https://polygonscan.com/) |
| STAGING_ALCHEMY_KEY | Used to communicate with the blockchain during deployment. Issue from [Alchemy](https://www.alchemy.com/) by selecting the target network. For Mainnet deployment, set to `MAINNET_ALCHEMY_KEY`. |
| PRIVATE_KEY | Set the private key of the wallet that will be the contract creator. For Mainnet deployment, set to `MAINNET_PRIVATE_KEY`. |
| Key | Value |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| MUMBAI_FORWARDER_ADDRESS | The Forwarder Address deployed to Mumbai testnet from Hardhat. For Mainnet deployment, set to `POLYGON_FORWARDER_ADDRESS`. |
| MUMBAI_RELAYER_ADDRESS | The Relayer Address obtained in 1.2. For Mainnet deployment, set to `POLYGON_RELAYER_ADDRESS`. |
| ETHERSCAN_API_KEY | Used for contract verification. Issue it from the scan service of the network you are deploying to. [Polygonscan](https://polygonscan.com/) |
| STAGING_ALCHEMY_KEY | Used to communicate with the blockchain during deployment. Issue from [Alchemy](https://www.alchemy.com/) by selecting the target network. For Mainnet deployment, set to `MAINNET_ALCHEMY_KEY`. |
| PRIVATE_KEY | Set the private key of the wallet that will be the contract creator. For Mainnet deployment, set to `MAINNET_PRIVATE_KEY`. |

## 3. Deploy to Testnet

Expand Down Expand Up @@ -93,7 +97,6 @@ $ yarn build
$ yarn upload:stg
```


Use `yarn upload:prd` when deploying to the mainnet.

# Deploy Frontend
Expand Down Expand Up @@ -125,18 +128,18 @@ Set the following environment variables in the Environment Variables section. On

![env](documentImages/vercel5.png)

| Key | Value |
| --- | --- |
| NEXT_PUBLIC_FORWARDER_ADDRESS | The forwarder contract address created in step 3.1 |
| NEXT_PUBLIC_CONTRACT_EVENT_MANAGER | The event manager contract address created in step 3.1 |
| NEXT_PUBLIC_CONTRACT_MINT_NFT_MANAGER | The mint NFT manager contract address created in step 3.1 |
| NEXT_PUBLIC_WEBHOOK_URL | The webhook URL obtained in 1.3 |
| NEXT_PUBLIC_PROVIDER_RPC | Issue from [Alchemy](https://www.alchemy.com/) by selecting the target network. It can be the same one used during contract deployment |
| NEXT_PUBLIC_CHAIN_ID | `80001` for Testnet, `137` for Mainnet |
| NEXT_PUBLIC_CHAIN_NAME | `Polygon Testnet` or `Polygon Mainnet` |
| NEXT_PUBLIC_BLOCK_EXPLORER_URL | `https://mumbai.polygonscan.com/` for Testnet, `https://polygonscan.com` for Mainnet |
| NEXT_PUBLIC_METAMASK_RPC_URL | The RPC URL for the wallet: `https://matic-mumbai.chainstacklabs.com` for Testnet, `https://polygon-rpc.com` for Mainnet |
| NEXT_PUBLIC_PINATA_JWT | Follow the instruction describing how to get a Pinata JWT. [link](/docs/frontend.md#create-pinata-jwt) |
| NEXT_PUBLIC_PINATA_GATEWAY | The general gateway URI is `gateway.pinata.cloud`. If you want to use your own gateway, please refer to the Pinata documentation |
| OZ_RELAYER_API_KEYS | Insert the Openzeppelin Relayer API Keys obtained in step 1.3 as an array |
| OZ_RELAYER_API_SECRETS | Insert the Openzeppelin Relayer API Secrets obtained in step 1.3 as an array |
| Key | Value |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| NEXT_PUBLIC_FORWARDER_ADDRESS | The forwarder contract address created in step 3.1 |
| NEXT_PUBLIC_CONTRACT_EVENT_MANAGER | The event manager contract address created in step 3.1 |
| NEXT_PUBLIC_CONTRACT_MINT_NFT_MANAGER | The mint NFT manager contract address created in step 3.1 |
| NEXT_PUBLIC_WEBHOOK_URL | The webhook URL obtained in 1.3 |
| NEXT_PUBLIC_PROVIDER_RPC | Issue from [Alchemy](https://www.alchemy.com/) by selecting the target network. It can be the same one used during contract deployment |
| NEXT_PUBLIC_CHAIN_ID | `80001` for Testnet, `137` for Mainnet |
| NEXT_PUBLIC_CHAIN_NAME | `Polygon Testnet` or `Polygon Mainnet` |
| NEXT_PUBLIC_BLOCK_EXPLORER_URL | `https://mumbai.polygonscan.com/` for Testnet, `https://polygonscan.com` for Mainnet |
| NEXT_PUBLIC_METAMASK_RPC_URL | The RPC URL for the wallet: `https://matic-mumbai.chainstacklabs.com` for Testnet, `https://polygon-rpc.com` for Mainnet |
| NEXT_PUBLIC_PINATA_JWT | Follow the instruction describing how to get a Pinata JWT. [link](/docs/frontend.md#create-pinata-jwt) |
| NEXT_PUBLIC_PINATA_GATEWAY | The general gateway URI is `gateway.pinata.cloud`. If you want to use your own gateway, please refer to the Pinata documentation |
| OZ_RELAYER_API_KEYS | Insert the Openzeppelin Relayer API Keys obtained in step 1.3 as an array |
| OZ_RELAYER_API_SECRETS | Insert the Openzeppelin Relayer API Secrets obtained in step 1.3 as an array |
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
## Install the development platforms that are prerequisites for developing MintRally
---
sidebar_position: 5
---

# Prerequisites for developing for Mac

Install the following in order:

- Homebrew
- Node
- Yarn

## Install Homebrew
[Homebrew](https://brew.sh/index_ja "Link to the distribution site") is a package manager for macOS. Follow the instructions below to install Homebrew.

[Homebrew](https://brew.sh/index_ja 'Link to the distribution site') is a package manager for macOS. Follow the instructions below to install Homebrew.

1. Open the Terminal. Use Spotlight search (Cmd + Space) and type 'Terminal' to launch it.

Expand All @@ -18,16 +25,20 @@ Install the following in order:
3. Installation verification
```shell
brew --version
```
```
There's no specified version for Homebrew; if version information is displayed, then Homebrew is successfully installed, and you can proceed to the next step.
If no version information is displayed, there may be a typo in the install command or a network error, so please check the install log.

## Install Node

Node.js is a JavaScript runtime environment and platform for executing JavaScript on the server-side. Follow the instructions below to install Node.

1. Execute the following command in the Terminal to install Node.js.

```shell
brew install node@18
```

MintRally has been tested and confirmed to work with versions 16 and 18. Therefore, we specify version 18 for installation.

2. Since we've specified the Node version, it will be "keg-only" and not linked to the PATH, so execute the following command.
Expand All @@ -41,15 +52,17 @@ Node.js is a JavaScript runtime environment and platform for executing JavaScrip
node -v
```
If no version information is displayed, there may be a typo in the install command or a network error, so please check the install log.

## Install Yarn

Yarn is a package manager for JavaScript, a tool for managing dependencies and efficiently installing packages. Follow the instructions below to install Yarn.

1. Execute the following command in the Terminal to install Yarn.

```shell
npm install -g yarn
```

2. Installation verification
```shell
yarn --version
Expand All @@ -58,9 +71,10 @@ Yarn is a package manager for JavaScript, a tool for managing dependencies and e
If no version information is displayed, there may be a typo in the install command or a network error, so please check the install log.

## Note

While Node and Yarn are mandatory for MintRally, Homebrew is not.
Thus, it is possible to install Node without Homebrew, but managing Node with Homebrew is the de facto standard for development on Mac. Therefore, we also install Homebrew as per this standard in this guide.
Thus, it is possible to install Node without Homebrew, but managing Node with Homebrew is the de facto standard for development on Mac. Therefore, we also install Homebrew as per this standard in this guide.

To comply with the constraints listed in [MintRally's dependencies](https://github.com/hackdays-io/mint-rally/blob/main/docs/frontend.md#dependencies), we are installing Version 16 of Node instead of the latest version.
Next.js is incorporated via yarn commands according to the contents of package.json so it is not mentioned in these instructions.
Any source code editor is fine to use, but VSC (VisualStudioCode) is recommended.
Any source code editor is fine to use, but VSC (VisualStudioCode) is recommended.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 2
---

# Frontend develop environment

## Dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Use Localhost node in development
---
sidebar_position: 4
---

# Localhost Network

### 1. Run local node

Expand Down Expand Up @@ -30,7 +34,6 @@ Otherwise, please run this command.
$ yarn localchain
```


### 2. Setup localnetwork in metamask and add a local wallet address

_You need to do this step only once, if you are already done this, skip to step4_
Expand All @@ -39,8 +42,6 @@ _You need to do this step only once, if you are already done this, skip to step4

Go to add network page

<img src="https://github.com/hackdays-io/mint-rally/assets/18475563/7fd6966e-6f65-41af-9bd1-960137478e85" width="300px">

Add Localnetwork

<img src="./documentImages/addlocalnet2metamask.png" width="300px" />
Expand Down Expand Up @@ -117,4 +118,4 @@ The following command then creates one new event group and 150 event data in the

```
yarn create:testdata
```
```
8 changes: 8 additions & 0 deletions document/docs/developer/meta-transaction/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Meta Transaction",
"position": 2,
"link": {
"type": "generated-index",
"description": "About Meta Transaction"
}
}
Loading

0 comments on commit e893770

Please sign in to comment.