fukuball / rarity-analyser

Cool Rarity is an open source package for easy rarity score calculation with ERC721 NFT metadata collection. It was born in punkscape 01 rarity analyser hackathon.
https://onedaypunk-rarity-tool.herokuapp.com/
85 stars 72 forks source link
erc721 nft rarity

Cool Rarity

Cool Rarity is an open source package for easy rarity score calculation.

Cool Rarity was born in a Hackathon hosted by PunkScape, made with love by Fukuball. It is easy to configure for developers and easy to use for users, any ERC721 NFT collection with OpenSea metadata stardard can use Cool Rarity as the rarity score calculation tool. If you have the collection metadata in hand, you can depoly Cool Rarity as your collection rarity tool in minues!

Here's the demo:

Prerequisites

Cool Rarity was built using Node.js, so you have to install:

I personally use Yarn and NVM, so you can consider install them too:

Run Cool Rarity locally

Step 1: Clone from GitHub

$ git clone https://github.com/fukuball/rarity-analyser.git

Step 2: Configure collection data

You should have the collection metadata on hand, or you can use the default collection.json provided by Cool Rarity, be sure your collection metadata is formated like the default collection.json.

Put your collection metadata json file (all token metadata in one json file!) in config folder, the same location as the default collection.json, then open the config.js in the folder, modify it for your collection.

Here's the content of config.js:

{
    app_name: 'Cool Rarity',
    app_description: 'A cool rarity tool.',
    collection_file_name: 'collection.json',
    collection_contract_address: '0x5537d90a4a2dc9d9b37bab49b490cf67d4c54e91',
    collection_name: '10k One Day Punks',
    collection_description: '10k "One Day I\'ll Be A Punk"-punks – a homage to the one and only CryptoPunks. Holding a OneDayPunk will give you early access to PunkScapes and reserve a profile on the PunkScape website.',
    sqlite_file_name: 'database.sqlite',
    ga: 'G-BW69Z04YTP',
    main_og_image: 'https://onedaypunk-rarity-tool.herokuapp.com/images/og.png'
}

Step 3: Install package

$ yarn install

When package installed, postinstall script will be tiggered, and the ./cmd/rarity_analyze.js will run for the first install. This will take some time for the rarity score calculation. (generally in minues)

Final Step: Run

$ DEBUG=rarity-analyser:* yarn start-dev

Then open: http://localhost:3000/ on your web browser. Yes! Now you see the rarity website of your NFT collection!

Extra

You can generate collection-rarities.json file by using this command:

yarn rarity-output-json

The collection-rarities.json file will store in config folder.

Deploy to Heroku

Step 1: Prerequisites

Step 2: Login and Create App

In your Cool Rarity folder:

$ heroku login
$ heroku create your_app_name

Final Step: Deploy

$ git push heroku main

If you have any update want to deploy to Heroku, just use this final step to deploy to Heroku.

Use One Click Heroku Deploy

Here you can deploy this rarity tool to Heroku in one click, just be sure you have the Heroku account.

Deploy

Tasks

Hackathon Tasks

Additional Tasks

Other Rarity Tools

Our Friends (One Day Punk) - Also making cool tools!

Other

Support

Thanks to [PunkScape](https://punkscape.xyz) Community for this initiative.