maxPriorityFeePerGas
to save money and inadvertently increase wait times.sniffer.py
app.py
http://xxxxxxxxx.herokuapp.com/
. We'll be using it since it's the URL of our sample dashboard!heroku create
alchemy_filteredNewFullPendingTransactions
method which allows you to receive notifications on pending asset transfers for a user-defined address.
sniffer.py
<TWILIO SID>
with the Twilio SID you grabbed in step 1(d)<TWILIO AUTH TOKEN>
with the Auth token you grabbed in step 1(d)<ALCHEMY KEY>
with the Alchemy key from your dashboardfor loop
that runs three times to help ensure that our WebSocket is properly connected upon script initiation.app.py
file<TWILIO SID>
with the Twilio SID you grabbed in step 1(d)<TWILIO AUTH TOKEN>
with the Auth token you grabbed in step 1(d)worker
and web
file should be running.heroku logs -t
and hit entersniffer.py
.sniffer.py
and can also be sent by your local systems by running the commandpython sniffer.py
requirements.txt
with the following items inside of it.sniffer.py
sniffer.py
:for loop
that runs three times to help ensure that our WebSocket is properly connected upon script initiation.alchemy_filteredNewFullPendingTransactions
method which allows us to receive notifications on pending asset transfers for a user-defined address.while true
loop to force our script to continuously listen for a response and wrap our parsing code within the loop so that we can interpret the notification. Here, we also use the json
package to allow us to read the information in a structured manner.sniffer.py
file to parse incoming JSON messages.sniffer.py
file within the while loop we started above, include the following lines. Make sure to replace the phone numbers in the Twilio script to reflect the Twilio phone number that you acquired previously in the from
field and your own phone number in the to
field!
from
and to
parameters must use E.164 formatting (+
and a country code, e.g., +16175551212
). Without the proper formatting, your message will not send properly!body
parameter, which contains the content of the SMS we’re going to send. In our example, we have a single string that we format and structure with numerous '\n'
to create a newline in our SMS so that our users can more easily understand the information presented.sniffer.py
we have created together:app.py
app.py
file:json
package to allow us to read the information in a structured manner. By decoding the JSON, we can pull out key pieces of information that users find most useful when tracking transactions- from_address,
_ to_address, blockNumber,
_and hash.
from
** field and your own phone number in the**to
**field! Add the following two lines after parsing the POST request.app.py
complete, here's the sample script that we wrote together:sniffer.py
and app.py
in the same environment or in two separate hosting platforms. Deploy both files in your desired environment!