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

Make Batch Requests for Token Data #3

Open
bh2smith opened this issue Jun 17, 2022 · 0 comments
Open

Make Batch Requests for Token Data #3

bh2smith opened this issue Jun 17, 2022 · 0 comments

Comments

@bh2smith
Copy link
Contributor

bh2smith commented Jun 17, 2022

This is analogous to what we have done here in the token allocation project (batching together our RPC requests)

https://github.com/cowprotocol/token-allocation/blob/b969f3e2ad48041f7459fed4d80527bb188f232f/src/fetch/contracts.py#L47-L75

With the most relevant block of code being:

        for index, eth_address in enumerate(addresses):
            request_data.append({
                "jsonrpc": "2.0",
                "method": "eth_getCode",
                "params": [eth_address, "latest"],
                "id": index
            })
        response = requests.post(self.node_url, json=request_data)
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