This version is experimental, it may not work properly at this stage. Use at your own risk!
During this beta stage I won't provide any support for customizations. I have to finalize this implementation first and release the stable version before I can focus on custom features.
Why?
version 1 was based on Symfony because I know (and love) that framework, but I think it is not the best choice for this type of project. NodeJs (TypeScript) is probably a better option
the new architecture works in a completely different way, files are not served by the app anymore so you can handle a huge traffic with extremely low resources (e.g. previously a full production setup would cost a least 40$/month, up to 160$ in extreme cases... now any traffic can be managed with a 5$/month droplet on DigitaOcean)
the new design will serve the files using the S3 storage directly, so advanced features like CORS policies and CDNs will be supported by default
fixes #33
it is extremely flexible so you can extend it or customize the behavior completely
closes #34 (start token ID is now customizable)
fixes #35 (requires customization)
fixes #39 (requires customization)
fixes #42 (requires customization)
fixes #46 (requires customization)
fixes #47 (requires customization)
the default configuration supports "on mint" token reveal, as well as a scheduled check every N seconds to keep everything in sync
fixes #36 (even if I've never been able to reproduce that exact issue)
Deprecated features
shuffling utilities: we hope that collection owners won't need this anymore, in case you really need it it can always be added as a plugin later (or you can use version 1)
How it works
This version works in a completely different way compared to version 1. With version 1 the app was serving the file directly, with version 2 the app is simply updating the files on the S3 storage, the files will be served by the S3 storage itself.
All your files will be stored on an S3 bucket inside a /private folder and your URI prefix will point to the public URL of a /public folder at the same level of your private one.
Example:
If you have your assets on a DigitalOcean space called my-bucket, on region FRA1, then the URL of the metadata for token 1 will be https://fra1.digitaloceanspaces.com/my-bucket/public/metadata/1.json. Your URI prefix for this setup would be https://fra1.digitaloceanspaces.com/my-bucket/public/metadata/.
You won't have to put anything into the /public folder, the app will create it for you and copy all the data whenever a new token has to be revealed. It's extremely important that you make sure your files in the /private folder are not publicly accessible (you can set file permissions on your file manager of choice).
How to use it
The following instructions take into consideration a basic deployment using the default configuration.
Requirements
you must have an S3 bucket (e.g. DigitalOcean's space) configured properly (file listing disabled, all files private, CDN is optional but highly recommended, with a cache time of at least 1 minute)
you have to upload your files to your bucket inside a dedicated private folder (/private) and they must not be publicly readable (that's usually the default policy on DigitalOcean, but make sure you can't access them using the direct URL). The private folder must contain both the assets and metadata folders with all your files in it. (hidden metadata and mapping files are not needed anymore)
set the values for the environment variables in your worker's settings:
RPC_ENDPOINT: an RPC endpoint for your chain (e.g. use Infura or a public node of your choice)
CONTRACT_ADDRESS: the contract address
START_TOKEN_ID: ID of the first token of your collection (default: 1)
PRIVATE_ASSETS_PATH: private path of your assets (default: /private/assets)
PUBLIC_ASSETS_PATH: public path of your assets (default: /public/assets)
ASSETS_EXTENSION: the default project supports standard collections only, so here you can specify only one extension (you can override this behavior with custom code)
PRIVATE_METADATA_PATH: private path of your metadata (default: /private/metadata)
PUBLIC_METADATA_PATH: public path of your metadata (default: /public/metadata)
PUBLIC_ASSETS_URI_TEMPLATE: all token files will be "revealed" by copying them over to a /public folder at the same level of your /private one. This URL template should point to the public URL of your S3 storage (you can use the {{TOKEN_ID}} placeholder as the file name)
S3_ACCESS_KEY: S3 bucket access key
S3_SECRET_KEY: S3 bucket secret key
S3_ENDPOINT_URL: S3 API endpoint URL (please make sure to specify the correct region if you are using DigitalOcean)
S3_BUCKET_NAME: S3 bucket name
S3_PATH_PREFIX: you can leave this blank if you uploaded your files to the root path of your bucket
FULL_REFRESH_DELAY: number of seconds to wait before doing a full collection refresh (default: 1800, 30 minutes). Please remember that tokens will be automatically revealed on each mint, so there is no need to run this too often. It's purpose is to keep everything in sync after network issues occur or the if app crashes for any reason
Once the deployment is ready you should start seeing something happening in the "Runtime Logs" section of your app. Your metadata and images should appear in the /public folder automatically as soon as they are revealed.
This new implementation is a complete redesign of the whole app which is based on the new @hashlips-lab/collection-data-updater library.
⚠️ Disclaimer ⚠️
This version is experimental, it may not work properly at this stage. Use at your own risk!
During this beta stage I won't provide any support for customizations. I have to finalize this implementation first and release the stable version before I can focus on custom features.
Why?
N
seconds to keep everything in syncDeprecated features
How it works
This version works in a completely different way compared to version 1. With version 1 the app was serving the file directly, with version 2 the app is simply updating the files on the S3 storage, the files will be served by the S3 storage itself. All your files will be stored on an S3 bucket inside a
/private
folder and your URI prefix will point to the public URL of a/public
folder at the same level of your private one.Example: If you have your assets on a DigitalOcean space called
my-bucket
, on regionFRA1
, then the URL of the metadata for token1
will behttps://fra1.digitaloceanspaces.com/my-bucket/public/metadata/1.json
. Your URI prefix for this setup would behttps://fra1.digitaloceanspaces.com/my-bucket/public/metadata/
.You won't have to put anything into the
/public
folder, the app will create it for you and copy all the data whenever a new token has to be revealed. It's extremely important that you make sure your files in the/private
folder are not publicly accessible (you can set file permissions on your file manager of choice).How to use it
The following instructions take into consideration a basic deployment using the default configuration.
Requirements
/private
) and they must not be publicly readable (that's usually the default policy on DigitalOcean, but make sure you can't access them using the direct URL). The private folder must contain both theassets
andmetadata
folders with all your files in it. (hidden metadata and mapping files are not needed anymore)Deployment steps
v2
branch page on GitHub and click on the "Deploy to DigitalOcean" buttonRPC_ENDPOINT
: an RPC endpoint for your chain (e.g. use Infura or a public node of your choice)CONTRACT_ADDRESS
: the contract addressSTART_TOKEN_ID
: ID of the first token of your collection (default:1
)PRIVATE_ASSETS_PATH
: private path of your assets (default:/private/assets
)PUBLIC_ASSETS_PATH
: public path of your assets (default:/public/assets
)ASSETS_EXTENSION
: the default project supports standard collections only, so here you can specify only one extension (you can override this behavior with custom code)PRIVATE_METADATA_PATH
: private path of your metadata (default:/private/metadata
)PUBLIC_METADATA_PATH
: public path of your metadata (default:/public/metadata
)PUBLIC_ASSETS_URI_TEMPLATE
: all token files will be "revealed" by copying them over to a/public
folder at the same level of your/private
one. This URL template should point to the public URL of your S3 storage (you can use the{{TOKEN_ID}}
placeholder as the file name)S3_ACCESS_KEY
: S3 bucket access keyS3_SECRET_KEY
: S3 bucket secret keyS3_ENDPOINT_URL
: S3 API endpoint URL (please make sure to specify the correct region if you are using DigitalOcean)S3_BUCKET_NAME
: S3 bucket nameS3_PATH_PREFIX
: you can leave this blank if you uploaded your files to the root path of your bucketFULL_REFRESH_DELAY
: number of seconds to wait before doing a full collection refresh (default:1800
, 30 minutes). Please remember that tokens will be automatically revealed on each mint, so there is no need to run this too often. It's purpose is to keep everything in sync after network issues occur or the if app crashes for any reasonOnce the deployment is ready you should start seeing something happening in the "Runtime Logs" section of your app. Your metadata and images should appear in the
/public
folder automatically as soon as they are revealed.