This project showcases the functionality of the L2Vista-db-server. It is designed to store events originating from the CCIP and Hyperlane contracts on various Ethereum layer2 chains, including mode, zora, optimism, and base.
- Database Initialization: Automatic creation of the 'exployer' database.
- Table Structures: Automated generation of 'fromTx', 'toTx', and 'lastBlocks' tables.
- Mode & Zora Event Storage: Retrieval and storage of past events from mode and zora chains.
- thegraph Integration: Utilization of thegraph for event storage on optimism and base chains.
blockNumber INT,
blockTimestamp INT,
messageId VARCHAR(255) NOT NULL UNIQUE,
chain VARCHAR(255) NOT NULL,
hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
blockNumber INT,
tableName VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
- Review the
.example.env
file. - Create a
.env
file based on the example. Adjust the values as
For Linux or macOS:
cp .example.env .env
For Windows:
copy .example.env .env
- Install Dependencies:
npm install
- Compile Contracts:
npx hardhat compile
- Launch the Project:
npm start
Dropping the Database If you need to reset the database, you can use the following command to drop it:
npm run drop
Warning: Be cautious when using this command, as it will permanently delete all the data in your 'exployer' database.
If you'd like to contribute to the project, please fork the repository, make your changes, and submit a pull request. We appreciate all contributions and feedback!