Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.76 KB

File metadata and controls

63 lines (51 loc) · 1.76 KB

Streamlit NFT sales dashboard

collections dashboard

Prerequisites

Install requirements

We recommend to create a separate virtual environment for this project and install the requirements there:

virtualenv env && source env/bin/activate
pip install -r requirements.txt

Ingest sample data

  1. Download sample NFT data:

    wget https://assets.timescale.com/docs/downloads/nft_sample.zip
  2. Unzip the file

    unzip nft_sample.zip
  3. Insert the content of the CSV files into the database using psql:

    psql -x "postgres://tsdbadmin:{YOUR_PASSWORD_HERE}@{YOUR_HOSTNAME_HERE}:{YOUR_PORT_HERE}/tsdb?sslmode=require"

    If you're using Timescale Cloud, the instructions under How to Connect provide a customized command to run to connect directly to your database.

    \copy accounts FROM 001_accounts.csv CSV HEADER;
    \copy collections FROM 002_collections.csv CSV HEADER;
    \copy assets FROM 003_assets.csv CSV HEADER;
    \copy nft_sales FROM 004_nft_sales.csv CSV HEADER;

Modify database secrets

  1. Open the .streamlit/secrets.toml file
  2. Modify the secrets so Streamlit can connect to your database
    [NFT_DATABASE]
    dbname="tsdb"    
    host="xxxxxxxxxxxxxx.tsdb.cloud.timescale.com"
    user="tsdbadmin"
    password="xxxxxxx"
    port=33333    
    

Run the app

streamlit run app.py