# How to use Presto with ethers.py

1. Create your rollup ([How to Create a Rollup](https://docs-presto.gateway.fm/overview/main-functionality/how-to-create-a-rollup)), open it and get the RPC url ([What Is RPC](https://docs-presto.gateway.fm/overview/features-for-developers/what-is-rpc))<br>

   <figure><img src="https://1439499438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fti15D1ubA4vJmpJV8XEc%2Fuploads%2Fo3JlP11g34wgw3TpDhWG%2Frpc-link.png?alt=media&#x26;token=1cf3f06c-c8cf-4a24-8159-442d63bab23f" alt=""><figcaption></figcaption></figure>
2. Set up a custom RPC endpoint:

To use Presto with [ethers.py](https://pypi.org/project/ethers/), you can set up a custom RPC endpoint using the following code:

```python
from ethers.providers import HTTPProvider

url = "<L2 RPC URL>"

gatewayHttpProvider = HTTPProvider(url)

block_number = await gatewayHttpProvider.get_block_number()

```
