Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of how to filter the requests from mainnets #4

Open
danbryan opened this issue Aug 31, 2023 · 0 comments
Open

Add example of how to filter the requests from mainnets #4

danbryan opened this issue Aug 31, 2023 · 0 comments
Assignees

Comments

@danbryan
Copy link
Contributor

Add example of how to filter the requests from mainnets

# Define an array of networks you care about
networks=("network1" "network2" "network3" ... "network15")

# Construct the jq filter dynamically
jq_filter='.[] | select(.network | IN('
for network in "${networks[@]}"; do
    jq_filter+='"'$network'",'
done
jq_filter=${jq_filter%,}'))'  # Remove the trailing comma and close the parenthesis

# Use the constructed filter with curl and jq
curl -s -X GET \
  -H "Content-Type: application/json" \
  http://localhost:5000/mainnets | jq "$jq_filter"
@danbryan danbryan self-assigned this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant