Skip to content

Files

Latest commit

8ed0648 ยท Oct 31, 2022

History

History

server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 26, 2022
Sep 21, 2022
Oct 10, 2022
Sep 21, 2022
Sep 15, 2022
Sep 15, 2022
Sep 2, 2022
Sep 21, 2022
Sep 15, 2022
Oct 31, 2022
Sep 26, 2022
Sep 26, 2022
Oct 10, 2022
Sep 25, 2022
Oct 10, 2022

Backend

DB Schema

Vote

Server ์—ฐ๊ฒฐ

ํ”„๋กœ์ ํŠธ ์—ฐ๊ฒฐ

git clone https://github.com/codestates/BEB-05-Team-Vote.git
cd BEB-05-TEAM-VOTE
cd server

ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •

touch .env
vim .env
// .env ํŒŒ์ผ ๋‚ด์šฉ ์ž…๋ ฅ(PORT, DATABASE_URL, TOKEN_CA, BATCH_CA, PASS_CA, DEPLOY_ADDRESS, DEPLOY_PRIVATEKEY)

๊ถŒํ•œ ์ถ”๊ฐ€

sudo chmod 666 /var/run/docker.sock
chmod +x ./init-letsencrypt.sh

Docker Compose์— ์ •์˜๋˜์–ด ์žˆ๋Š” ์„œ๋น„์Šค ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ๋„์šฐ๊ธฐ

sudo docker compose up -d --build

Certbot์˜ nginx ์˜ต์…˜ ์ด์šฉํ•˜์—ฌ ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰๋ฐ›๊ณ  ์ ์šฉ(์„œ๋ฒ„์— https ์ ์šฉ)

./init-letsencrypt.sh
docker compose down

https ์ ์šฉ๋œ ์„œ๋ฒ„ ํ™œ์„ฑํ™”

sudo docker compose up -d --build

Token Batch Transfer

  1. UTC Timezone ๊ธฐ์ค€์œผ๋กœ ๋งค์ผ 0์‹œ 0๋ถ„ 0์ดˆ์— ํ•˜๋ฃจ ๋™์•ˆ ๋ฐœ์ƒํ•œ ๋ชจ๋“  ์ปค๋ฎค๋‹ˆํ‹ฐ ํ™œ๋™ ์กฐํšŒ. (์ปค๋ฎค๋‹ˆํ‹ฐ ๊ธ€, ๋Œ“๊ธ€, ์ข‹์•„์š”)

  2. ์ปค๋ฎค๋‹ˆํ‹ฐ ํ™œ๋™์œผ๋กœ ํ™œ๋™ ์ ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ•œ ํ›„, ์ ์ˆ˜๊ฐ€ ๋†’์€ ์ˆœ์œผ๋กœ ์ •๋ ฌ.
    (ํ™œ๋™ ์ ์ˆ˜ : ์ž‘์„ฑํ•œ ๊ธ€ ์ˆ˜ _ 3 + ์ž‘์„ฑํ•œ ๋Œ“๊ธ€ ์ˆ˜ _ 2 + ์ข‹์•„์š” ๋ˆ„๋ฅธ ์ˆ˜ * 1)

  3. ํ•˜๋ฃจ ํ† ํฐ ๋ฐœํ–‰๋Ÿ‰์€ 500๊ฐœ๋กœ ๊ณ ์ •.
    ํ™œ๋™ ์ ์ˆ˜ 1์  ๋‹น ํ† ํฐ 1๊ฐœ ์ง€๊ธ‰.
    ํ™œ๋™ ์ ์ˆ˜ ์ดํ•ฉ์ด 500์ ์„ ๋„˜์œผ๋ฉด ์ ์ˆ˜ ๋†’์€ ์ˆœ์œผ๋กœ 500๊ฐœ๊นŒ์ง€๋งŒ ์ง€๊ธ‰.

  4. batchTransfer Function์„ ์‚ฌ์šฉํ•˜์—ฌ ํ† ํฐ ์ผ๊ด„ ์ง€๊ธ‰.

NFT Minting

  1. ํด๋ผ์ด์–ธํŠธ์—์„œ Approve๋ฅผ ํ•œ ๋‹ค์Œ, ์„œ๋ฒ„์— NFT Minting ์š”์ฒญ.

  2. ์„œ๋ฒ„์—์„œ ์‚ฌ์šฉ์ž์˜ Token Balance ์กฐํšŒํ•˜๊ณ , NFT Price์™€ ๋น„๊ต.

  3. Token Balance๊ฐ€ NFT Price ๋ณด๋‹ค ๋งŽ๊ฑฐ๋‚˜ ๊ฐ™์œผ๋ฉด mintNFT Function์„ ์‚ฌ์šฉํ•˜์—ฌ NFT ๋ฐœ๊ธ‰.