Code Monkey home page Code Monkey logo

kleros-atq-trustless-retrieval's Introduction

Address Tags Query Submodule

This repository contains scripts and modules for the Address Tags Query submodule. Follow the instructions below to set up and run the scripts to fetch data from submodules and export tags to a CSV file.

Prerequisites

Before running the scripts, ensure you have the following installed:

  • Git
  • Node.js (Version 14 or higher recommended)
  • Yarn package manager

Getting Started

Clone this repository and navigate to the directory where the repository has been cloned.

Setting Up and Running the Scripts

  1. Create a .env file locally with the The Graph's API Key under the variable THEGRAPH_API_KEY.

  2. Make the Retrieve Script Executable:
    The retrieve.sh script is used to fetch submodule information and update them accordingly. First, you need to change the permissions of the script to make it executable. Run the following command in your terminal:

chmod +x 1_fetch.sh 2_pull_submodules.sh

  1. Run the Retrieve Script: Once the script is executable, you can run it to fetch and update the submodules. Execute the script by running:

./1_fetch.sh && ./2_pull_submodules.sh

This script will clone or pull the submodules and ensure they are checked out to the specified commit.

  1. Export Tags to CSV: After updating the submodules, run the export-to-csv.mjs script to process the submodule data and export the tags to a CSV file. Execute the script using Node.js.

For outputting the data in the format that Etherscan requires, use: yarn build && yarn start which will generate a tags-etherscan.csv file.

If you just want to repeat the pull of all the modules and data again, combine all steps together with:

./1_fetch.sh && ./2_pull_submodules.sh && yarn build && yarn start

  1. Counting number of entries If you want to find out the total number of contract tags that were retrieved by all the approved ATQ entries, run this (at the root directory).

find ./dist/exports -name "*.csv" -type f -exec sh -c 'total=0; for file do count=$(grep -c "" "$file"); echo "$file: $count lines"; total=$((total + count)); done; echo "Total: $total lines"' sh {} +

kleros-atq-trustless-retrieval's People

Contributors

gmkung avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.