github.com/diadata-org/diadata@v1.4.593/documentation/tutorials/nfttradescrapers.md (about)

     1  # Steps to run an nft trade scraper locally
     2  1. Navigate to the `deployments/local/exchange-scraper` directory of the project.
     3  2. Run the required services using `docker-compose up -d`. This command will run and prepare the PostgreSQL database.
     4  3. Set the required environment variables using the following commands:
     5  
     6  ```sh
     7  export USE_ENV=true
     8  export POSTGRES_USER=postgres
     9  export POSTGRES_PASSWORD=password
    10  export POSTGRES_HOST=localhost
    11  export POSTGRES_DB=postgres
    12  ```
    13  
    14  Or simply by sourcing the `local.env` inside the `deployments/local/exchange-scraper` directory.
    15  
    16  4. Execute `main.go` from `cmd/services/blockchainservice` to populate the PostgreSQL database with different blockchain configs:
    17  ```sh
    18  export DIA_CONFIG_DIR=./config
    19  go run ./cmd/services/blockchainservice/main.go
    20  ```
    21  
    22  5. Finally, run the scraping executable flagged as follows:
    23  
    24  ```sh
    25  cd cmd/nftTradescrapers
    26  export ETH_URI_REST=https://mainnet.infura.io/v3/xxxxx
    27  go run main.go -nftclass MyNftTradeScraper
    28  ```
    29  
    30  For an illustration of how to create an nft trade scraper, you can have a look at the `pkg/dia/nft/nftTrade-scrapers/opensea.go` file.
    31