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

New implementation #1

Merged
merged 7 commits into from
Jan 12, 2022
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
62 changes: 62 additions & 0 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
spec:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
name: safe-nft-metadata-provider
region: fra
services:
- environment_slug: php
envs:
- key: APP_ENV
scope: RUN_AND_BUILD_TIME
value: prod
- key: COLLECTION_MAX_SUPPLY
scope: RUN_TIME
value: "10000"
- key: COLLECTION_ASSETS_EXTENSION
scope: RUN_TIME
value: png
- key: COLLECTION_HIDDEN_ASSET_EXTENSION
scope: RUN_TIME
value: gif
- key: CACHE_EXPIRATION
scope: RUN_TIME
value: "600"
- key: S3_FS_DRIVER_REGION
scope: RUN_TIME
value: fra1
- key: S3_FS_DRIVER_ENDPOINT_URL
scope: RUN_TIME
value: https://fra1.digitaloceanspaces.com
- key: S3_FS_DRIVER_ACCESS_KEY
scope: RUN_TIME
type: SECRET
value: YOUR_ACCESS_KEY
- key: S3_FS_DRIVER_SECRET_KEY
scope: RUN_TIME
type: SECRET
value: YOUR_SECRET_KEY
- key: S3_FS_DRIVER_BUCKET_NAME
scope: RUN_TIME
value: my-bucket
- key: S3_FS_DRIVER_OBJECTS_KEY_PREFIX
scope: RUN_TIME
- key: WEB3_SMART_CONTRACT_ADDRESS
scope: RUN_TIME
value: 0xaDC28cac9c1d53cC7457b11CC9423903dc09DDDc
- key: WEB3_HTTP_ENDPOINT
scope: RUN_TIME
type: SECRET
value: https://mainnet.infura.io/v3/YOUR_PROJECT_ID_HERE
github:
branch: main
deploy_on_push: false
repo: liarco-network/safe-nft-metadata-provider
http_port: 8080
instance_count: 1
instance_size_slug: basic-xxs
name: metadata-provider
routes:
- path: /
run_command: heroku-php-apache2 public/
source_dir: /
18 changes: 17 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,32 @@
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

# General collection settings
COLLECTION_MAX_SUPPLY=300
COLLECTION_ASSETS_EXTENSION=png
COLLECTION_HIDDEN_ASSET_EXTENSION=gif

# Used for TotalSupplyProviers and HTTP headers (default: 10 minutes)
CACHE_EXPIRATION=600

# Local filesystem settings (LocalFilesystemDriver)
LOCAL_FS_DRIVER_COLLECTION_PATH=%kernel.project_dir%/collection

# AWS S3 filesystem settings (S3FilesystemDriver)
S3_FS_DRIVER_REGION=fra1
S3_FS_DRIVER_ENDPOINT_URL=https://fra1.digitaloceanspaces.com
S3_FS_DRIVER_ACCESS_KEY=YOUR_ACCESS_KEY
S3_FS_DRIVER_SECRET_KEY=YOUR_SECRET_KEY
S3_FS_DRIVER_BUCKET_NAME=my-bucket
S3_FS_DRIVER_OBJECTS_KEY_PREFIX=

# Used by the EnvVarProvider
ENV_TOTAL_SUPPLY=8

# Used by the OpenSeaStatsProvider
OPEN_SEA_COLLECTION_SLUG=sketchy-ape-book-club

# Used by the InfuraProvider
# Used by the Web3Provider
WEB3_SMART_CONTRACT_ADDRESS=0xaDC28cac9c1d53cC7457b11CC9423903dc09DDDc
WEB3_HTTP_ENDPOINT=https://mainnet.infura.io/v3/YOUR_PROJECT_ID_HERE

Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: heroku-php-apache2 public/
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

Hi! This project implements a basic HTTP metadata (and assets) provider using [Symfony](https://www.symfony.com).

## Dependencies
This project uses PHP `8.1`, but unfortunately the `sc0vu/web3.php` package doesn't support it yet (officially), so you
have to skip the PHP platform requirement when running composer commands until it gets updated.
```bash
composer install --ignore-platform-req=php
```

## YouTube tutorial
Coming soon...

## Deployment suggestion
I suggest deploying this app using [DigitalOcean](https://m.do.co/c/bcc172152095), behind a strong CDN network like
[CloudFlare](https://www.cloudflare.com).

By using my link you will be given a 100$ credit on DigitalOcean: https://m.do.co/c/bcc172152095
By using my link you will be given a 100$ credit on DigitalOcean: https://m.do.co/c/bcc172152095

You can also do a one-click deployment on DigitalOcean:
[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/liarco-network/safe-nft-metadata-provider/tree/main)
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.209",
"composer/package-versions-deprecated": "1.11.99.4",
"digitaldonkey/ethereum-php": "dev-master",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.5",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.10",
"nette/utils": "^3.2",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.2",
"sc0vu/web3.php": "dev-master",
"sensio/framework-extra-bundle": "^6.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.4.*",
Expand Down
Loading