This project enables Solana NFT project owners to assign custom Discord server roles to users holding their NFT. The Discord user navigates to a verification URL to submit their wallet for analysis, and the Discord role is immediately assigned if holding criteria is met. For any questions message me on twitter @NFT4Cause.
We offer this project as a free hosted service at https://verify.4cause.app. Feel free to register your project on our highly available deployment across IBM Cloud and Google Cloud.
Want to see it in action? There's a live demo on YouTube showing how our hosted service can be used to verify users for any Solana NFT project and assign Discord roles to a specified server.
Keep reading if you'd like to host this project yourself :)
- Discord knowledge
- Discord app and bot created and added to your server
- Proper .env file
I'll go over every parameter of .env.example and explain what it does and how to get it. Needless to say, rename .env.example to .env and update values as per instruction -
Service level NFT token update authority that will grant user premium access to features.
Additional SPL token that unlocks premium features (optional)
Interval at which revalidation is required for a project.
Boolean value indicating if service is running in user facing mode or revalidation mode. Revalidations must be performed by standalone offline processes for performance and scaling purposes.
Maximum number of verifications for a project with basic service.
The message text a user will sign to verify they own a wallet.
Base URL of your domain. For our hosted service this is https://verify.4cause.app.
Title of your service.
URL for your mint where user's can buy upgrade service.
URL to your main project website to get information about you.
Link to an image for the navigation banner.
OAUTH consumer key for connecting user's Twitter account.
OAUTH consumer secret for connecting user's Twitter account.
Any string of your choosing, used to secure user session cookie.
Configuration JSON for IBM Cloud Object Storage. If COS configuration is provided, files will be stored on IBM Cloud instead of the local filesystem.
The Solana environment. This can be devnet, testnet or mainnet-beta.
Url of your custom Solana RPC in case you are facing rate limiting on the public url.
Good news, it's free! There is great documentation with full details on how to register for IBM Cloud and get a Cloud Object Storage instance. High level steps are:
- Register for a new cloud.ibm.com account
- Navigate to the Cloud Object Storage console
- Create a COS service instance
- Create an API key to access the COS service instance
- Create a COS bucket in the COS service instance
Once you have those steps complete, just fill in the configuration template below. Note, I used the us-south
endpoint in the example below but you can use any of the global endpoints in the config.
If you want to use COS, use the following format but with your own data COS_CONFIG={"instanceID":"<your COS instance CRN>","apiKey":"<your COS API key>","bucket":"<your COS bucket name>","endpoint":"s3.us-south.cloud-object-storage.appdomain.cloud","storageClass":"us-south-standard"}
Our service is provisioned as a Docker container across IBM Cloud and Google Cloud for high availability. If you would like to roll your own deployment, feel free to choose your favorite cloud provider!
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn dev
# build for production and launch server
$ yarn build
$ yarn start
# generate static project
$ yarn generate
For detailed explanation on how things work, check out the documentation.
You can create the following extra directories, some of which have special behaviors. Only pages
is required; you can delete them if you don't want to use their functionality.
The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.
More information about the usage of this directory in the documentation.
The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.
More information about the usage of this directory in the documentation.
Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.
More information about the usage of this directory in the documentation.
This directory contains your application views and routes. Nuxt will read all the *.vue
files inside this directory and setup Vue Router automatically.
More information about the usage of this directory in the documentation.
The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use Vue.use()
, you should create a file in plugins/
and add its path to plugins in nuxt.config.js
.
More information about the usage of this directory in the documentation.
This directory contains your static files. Each file inside this directory is mapped to /
.
Example: /static/robots.txt
is mapped as /robots.txt
.
More information about the usage of this directory in the documentation.
This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.
More information about the usage of this directory in the documentation.