Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: seed data #760

Merged
merged 3 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,20 @@ prisma
# misc
*.pem

# Seed data
seed-data/**
!seed-data/assets
!seed-data/assets/myriad_circle.png
!seed-data/assets/myriad_with_text.png
!seed-data/testnet
!seed-data/testnet/default-network-currencies.json
!seed-data/testnet/default-user-wallet.json
!seed-data/mainnet
!seed-data/mainnet/default-network-currencies.json
!seed-data/mainnet/default-user-wallet.json

# Storage
storages

# Seed data
seed-data/*
!seed-data/default-network-currencies.json
!seed-data/default-user-wallet.json
!seed-data/server.json
!seed-data/assets
seed-data/assets/*
!seed-data/assets/myriad.png
!seed-data/assets/near.png
!seed-data/assets/profile.png
!seed-data/assets/banner.svg
# The cache for data in container
.local
3 changes: 2 additions & 1 deletion .maintain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ RUN yarn build \

# Production image, copy all the files and run
FROM node:14.18.0-buster-slim AS runner
LABEL social.myriad.image.authors="myriad.dev@blocksphere.id"
LABEL social.myriad.image.authors="dev@myriad.social"
# Create user and set ownership and permissions as required
RUN useradd -m -u 1001 -U -s /bin/sh -d /home/myriad myriad
WORKDIR /app
# Copy from builder stage
COPY --from=builder /app/public ./public
COPY --from=builder /app/seed-data ./seed-data
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
Expand Down
9 changes: 3 additions & 6 deletions .maintain/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
version: '3'

services:
web:
api:
container_name: myriad-api
image: myriadsocial/myriad-api
build:
context: ../../
dockerfile: .maintain/docker/Dockerfile
env_file:
- ../../.env
environment:
- HOST=0.0.0.0
- PORT=3000
ports:
- 3001:3000
- 3003:3000
networks:
myriad:
ipv4_address: 172.27.1.3
ipv4_address: 172.27.3.3
aliases:
- myriad-api

Expand Down
1 change: 0 additions & 1 deletion seed-data/assets/banner.svg

This file was deleted.

File renamed without changes
Binary file added seed-data/assets/myriad_with_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed seed-data/assets/near.png
Binary file not shown.
Binary file removed seed-data/assets/profile.png
Binary file not shown.
57 changes: 0 additions & 57 deletions seed-data/default-network-currencies.json

This file was deleted.

21 changes: 21 additions & 0 deletions seed-data/mainnet/default-network-currencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"network": {
"id": "myriad",
"rpcURL": "wss://ws-rpc.myriad.social",
"explorerURL": "https://polkadot.js.org/apps/?rpc=wss://ws-rpc.myriad.social#/explorer/query",
"blockchainPlatform": "substrate",
"sourceImageFileName": "myriad_circle"
},
"currencies": [
{
"name": "myria",
"symbol": "MYRIA",
"decimal": 18,
"native": true,
"exchangeRate": false,
"sourceImageFileName": "myriad_circle"
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"user": {
"name": "Myriad Official",
"username": "myriad_official",
"sourceImageFileName": "myriad"
"sourceImageFileName": "myriad_circle"
},
"wallet": {
"id": "0xecfeabd53afba60983271c8fc13c133ae7e904ba90a7c5dee1f43523559fee5f",
Expand Down
15 changes: 0 additions & 15 deletions seed-data/server.json

This file was deleted.

21 changes: 21 additions & 0 deletions seed-data/testnet/default-network-currencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"network": {
"id": "myriad",
"rpcURL": "wss://ws-rpc.testnet.myriad.social",
"explorerURL": "https://polkadot.js.org/apps/?rpc=wss://ws-rpc.testnet.myriad.social#/explorer/query",
"blockchainPlatform": "substrate",
"sourceImageFileName": "myriad_circle"
},
"currencies": [
{
"name": "myria",
"symbol": "MYRIA",
"decimal": 18,
"native": true,
"exchangeRate": false,
"sourceImageFileName": "myriad_circle"
}
]
}
]
14 changes: 14 additions & 0 deletions seed-data/testnet/default-user-wallet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"user": {
"name": "Myriad Official",
"username": "myriad_official",
"sourceImageFileName": "myriad_circle"
},
"wallet": {
"id": "0x22968e3881c9eb2625cf0d85a05f7d7ea4b542f000821ab185ce978b6da6081b",
"blockchainPlatform": "substrate",
"networkId": "myriad"
}
}
]
Loading