pysigner
is a python package for submitting prices to TellorMesosphere. PySigner requests, standardizises, and signs price feeds.
Python 3.8 or higher is required, as is pipenv.
Clone the repository and install python dependencies:
git clone https://github.com/tellor-io/PySigner.git
cd ./Pysigner && pipenv install
TellorSigner reads api keys and other user secrets from a .env
file. Rename .env.example
to .env
and update the variables as follows:
PRIVATEKEY
is your ETH private key(s). You can supply more than one.POKT_POLYGON
is needed if submitting on polygon. Sign up for pokt here.POKT_RINKEBY
is needed if submitting on rinkeby. Sign up for pokt here.TG_TOKEN
andCHAT_ID
are needed if you want to receive error alerts to a Telegram chat group. Instructions for getting these strings are here.BOT_NAME
can be specified if using Telegram alerts.TEST_VAR
is for testing. Don't change it.
The main script for signing price data can be run with:
pipenv run python -m scripts.cron
To run the script continuously in the background, you can use a linux AWS instance and the built in screen utility.
Once connected to an EC2 instance, run the following in this repository's home directory:
screen
pipenv run python -m scripts.cron
Once the script is running, detach the screen session by pressing Ctrl+A
then D
. You can now close your connection to the AWS instance and the signer will continue to run.
You can verify transactions on your network's block explorer.
Most settings for the signer are located in config.yml
. network
, gasprice
, and receipt_timeout
are some commonly adjusted parameters.
The network can also be passed as a flag on the command line. For example:
pipenv run python -m scripts.cron -n rinkeby
OR
pipenv run python -m scripts.cron --network rinkeby
Test pysigner
package using pytest. Run the following from the top directory:
pipenv run pytest ./tests
Please format contributions to this project using tox. Our tox workflow integrates black, pytest and pre-commit For example, formatting all python files in ./pysigner
is as simple as running:
tox