Before getting started, ensure you have the following installed on your system:
- Node.js and npm
- Yarn - enabling corepack should be sufficient
To run the Livepeer Explorer application, follow these steps to set up your environment correctly. This involves installing Yarn, installing dependencies, and configuring environment variables.
With Yarn installed, navigate to the root directory of the project and install all runtime dependencies using:
yarn install
Before running the application, you must configure your environment variables:
-
Rename the Example Environment File:
Rename the
.env.example
file in the root of the project to.env
. -
Update Environment Variables:
Open the
.env
file and update the necessary environment variables. For a reference of key settings, see the Key Environment Variables section below.
To run the application in development mode, which enables hot-reloading (automatic server restarts upon code changes), use the following command:
yarn dev
This will start the application and deploy changes to your browser without needing to restart the server manually.
To run the application in production mode, follow these steps:
-
Build the Application:
Compile and optimize the application for production by running:
yarn build
-
Start the Production Server:
After building, start the application in production mode with:
yarn start
Environment Variable | Description |
---|---|
PINATA_JWT |
JWT token used to create Polls data in IPFS for LIPs. |
NEXT_PUBLIC_NETWORK |
The network/chain the Explorer will interact with. The default is ARBITRUM_ONE . |
NEXT_PUBLIC_INFURA_KEY |
The private API key used to interact with the Infura RPC endpoints. If you prefer to use your own RPC, you can ignore this and instead set the RPC URLs in NEXT_PUBLIC_L1_RPC_URL and NEXT_PUBLIC_L2_RPC_URL . |
NEXT_PUBLIC_L1_RPC_URL (Optional) |
The L1 RPC URL endpoint to use if not using Infura. |
NEXT_PUBLIC_L2_RPC_URL (Optional) |
The L2 RPC URL endpoint to use if not using Infura. |
NEXT_PUBLIC_SUBGRAPH_API_KEY |
The API key to interact with the Livepeer published subgraph. This is used for various functions such as displaying current round data. |
NEXT_PUBLIC_SUBGRAPH_ID |
The ID of the Livepeer published subgraph. This is used for various functions such as displaying current round data. |
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID |
WalletConnect (Reown) Cloud Project ID. Used to enhance wallet UX for users of Explorer. |
To develop on the Arbitrum Rinkeby network, set the NEXT_PUBLIC_NETWORK
variable to ARBITRUM_RINKEBY
in your .env
file:
NEXT_PUBLIC_NETWORK=ARBITRUM_RINKEBY
To test Livepeer Improvement Proposals (LIPs), follow these steps:
-
Set the GitHub Namespace:
In your
.env
file, set theNEXT_PUBLIC_GITHUB_LIP_NAMESPACE
variable to your GitHub username:NEXT_PUBLIC_GITHUB_LIP_NAMESPACE=your_github_username
-
Fork the LIPs Repository:
Fork the LIPs repository to your GitHub account.
-
Use Your Fork for Local Testing:
With the namespace and your forked repository, you can now test LIPs locally within the application.