Showrunners scaffold overview
The showrunners framework is a scaffold that developers can use to build out notifications for their use cases.
Showrunners framework provides the tools and helpers required for constructing the payload and sending the notification using the Push protocol infrastructure.
Out-of-the-box showrunners provide the developer with a scheduling engine and libraries and helpers for easy access to blockchain data as well as web2 data sources.
Setup showrunner
Pre-requisites
You should have the following installed on your system:
- Docker
- Node JS
- NPM
Clone showrunners scaffold repo
The initial step in setting up the showrunners is cloning the showrunners repo
git clone https://github.com/push-protocol/push-showrunners-framework
This repository will contain the showrunner framework that you require to instantly build your channels logic.
Now in order to run this showrunner, we will need .env file which will contain your credentials that are required for fetching data from blockchains (for example, Infura).
For creating this .env
file, simply copy the .env.sample
file present in the root of the folder and replace the fields with valid credentials for each field.
# MAKE A COPY OF THIS AND FILL WITH YOUR CREDENTIALS AND NAME IT .env (Remove .sample Part)
# SHOWRUNNERS ENVIRONMENT: prod or staging or dev
SHOWRUNNERS_ENV=staging
## NORMAL CONFIG
# DEBUG | CAN BE 'debug' or 'prod'
LOG_LEVEL=debug_or_prod # 'debug' or 'prod'
# WEB3 ENDPOINTS | NEED ATLEAST INFURA OR ETHERSCAN OR ALCHEMY, REST CAN BE NULL
INFURA_PROJECT_ID=your_infura_project_id
INFURA_PROJECT_SECRET=your_infura_project_secret
## ADVANCED CONFIG
# WEB3 ENDPOINTS | OPTIONAL IF YOU FILLED INFURA_PROJECT AND INFURA_PROJECT_SECRET, CAN SET IT TO NULL IF YOU WANT TO
ETHERSCAN_API=your_etherscan_api_key_or_null
ALCHEMY_API=your_alchemy_api_key_or_null
Param | Valid Values | Comment |
---|---|---|
SHOWRUNNERS_ENV | prod or staging | Describes the Push Network you are targeting. If you deployed your channel on staging then this will be staging else if you deployed on mainnet (even multi-chain channel) then this will be prod . |
LOG_LEVEL | debug or prod | Changes the amount of log generated, recommended to use debug until you are sure of the logic. |
INFURA_PROJECT | your_infura_project_id or null | Head to infura.io to generate one, required to query data of blockchain. |
INFURA_PROJECT_SECRET | your_infura_project_secret or null | Need at least one (Infura, Etherscan or Alchemy) to operate correctly. |
ETHERSCAN_API | your_etherscan_api_key or null | Head to etherscan.io to generate one, required to query data of blockchain. |
ALCHEMY_API | your_alchemy_api_key or null | Head to alchemy.com to generate one, required to query data of blockchain. |
At least INFURA_PROJECT, INFURA_PROJECT_SECRET or ETHERSCAN_API or ALCHEMY_API key is required to correctly operate showrunners. Recommended to put all as the data fetching becomes more decentralised.
Install dependancies
Now that you have set up the showrunners .env
file, you are all set to run the showrunners. Ensure that all dependencies are installed, open the terminal (or command prompt), and go to the root of the cloned repo, npm install
or yarn install
to install dependencies.
- npm
- yarn
npm install
yarn install