This project is designed to extract PKP (Public Key Pair) addresses from the Lit Protocol on specified networks and chains. It allows you to extract information from multiple chains and networks, or just from specific ones as per your requirements.
- Node.js (version 14.x or higher)
- NPM (comes with Node.js)
-
Clone the repository:
git clone https://github.com/marco12369/PKP-addresses-extraction-script.git cd PKP-addresses-extraction-script
-
Install dependencies:
npm install
-
Create a
.env
file in the root of the project with the following content:BLOCKCHAIN=all NETWORK=all BLOCK_INTERVAL=25000 START_BLOCK=0 END_BLOCK=latest CHRONICLE_RPC_URL=https://chain-rpc.litprotocol.com/replica-http YELLOWSTONE_RPC_URL=https://yellowstone-rpc.litprotocol.com/
-
Ensure you are in the project directory:
cd PKP-addresses-extraction-script
-
Run the script:
npm start
- If
BLOCKCHAIN
andNETWORK
are not specified, the script will process all networks on both blockchains. - If
BLOCKCHAIN
is specified butNETWORK
is not, the script will process all networks on the specified blockchain. - If both
BLOCKCHAIN
andNETWORK
are specified, the script will process the specified network on the specified blockchain.
- If
The script uses environment variables to configure which blockchains and networks to extract data from. These variables should be defined in a .env
file in the root directory of the project.
- BLOCKCHAIN: Specifies which blockchain to extract data from. Options are
chronicle
andyellowstone
. If not set, both blockchains will be processed. - NETWORK: Specifies which network to extract data from. Options are
cayenne
,habanero
,manzano
,serrano
, anddatil
. If not set, all networks will be processed. - START_BLOCK: The starting block number for extracting events.
- END_BLOCK: The ending block number for extracting events.
- BLOCK_INTERVAL: The interval of blocks to process in each query.
Example .env
file:
BLOCKCHAIN=chronicle # Options: chronicle, yellowstone
NETWORK=serrano # Optional, set this if you want to process a specific network
BLOCK_INTERVAL=25000
START_BLOCK=0
END_BLOCK=latest
CHRONICLE_RPC_URL=https://chain-rpc.litprotocol.com/replica-http
YELLOWSTONE_RPC_URL=https://yellowstone-rpc.litprotocol.com/
The results will be saved in a results.csv
file in the project directory, containing the following columns:
- Blockchain
- Network
- Token ID
- ETH Address
- Ensure you have the correct Node.js version: The script requires Node.js version 14.x or higher.
- Check your environment variables: Make sure your
.env
file is correctly configured. - Review error messages: Any errors encountered during execution will be logged to the console. Review these messages for hints on what might be wrong.
This project is licensed under the MIT License - see the LICENSE file for details.