Push protocol is evolving to Push Chain, a shared-state L1 designed to deliver universal app experiences (Any Chain. Any User. Any App).🚀
Archival nodes store and stream all transaction data on the Push Network, supporting full transaction history access and real-time data streaming.
Archival nodes on the Push Network maintain a comprehensive log of all processed transactions, enabling users to access the complete transaction history and utilize web socket functionality for real-time streaming of transaction data. These nodes are crucial for applications like blockchain explorers and scenarios where an entire network's activity needs to be retrieved.
To operate an archival node, participants must stake a certain amount of tokens. This staking process serves as a security deposit, ensuring that storage nodes act in the network's best interest.
In the network, once blocks are processed by validator nodes, archival nodes index the block and transaction data for quick retrieval. The diagram below illustrates the interaction between the nodes in the network:
Indexing transaction and block data is crucial for quick retrieval and efficient querying. The tables below represents a proposed structure for block & transaction indexation:
Block Hash | Block Data | Timestamp |
---|---|---|
b0249fbb-a03d-4292-9599-042c6993958e | Packed Block Data | epoch |
Tx Hash | Block Hash | Category | Tx Data | Timestamp |
---|---|---|---|---|
b0249fbb-a03d-4292-9599-042c6993958e | 2608d687-fe55-4fe9-9fa5-1f782dcebb34 | protobuf_serialized_data | epoch |
Note: The above table example is a simplified representation of the transaction indexation structure. The actual implementation may include additional fields based on the requirements of the network.
This project is currently a work in progress. Please be aware that things might break, and the installation process might change as we improve and dockerize it completely for public running of the node. Proceed with caution and check back frequently for updates.
- Node.js (>= 20)
- PostgewaSQL (>= 16)
- Docker ((optional, for running the database in a container))
-
Clone the repository:
git clone https://github.com/push-protocol/push-anode.git cd push-anode
-
Starting node using Docker
docker compose up
-
Starting node without Docker
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add your environment variables. Here’s an example:DATABASE_URL=postgres://user:password@localhost:5432/push-anode
-
Run the database migrations:
npx prisma migrate deploy
-
Generate Prisma client:
npx prisma generate
-
Usage: To start the server, use:
npm run start
-
-
Testing:
npm run test
-
Linting:
npm run lint
-
Migrations:
To create a new migration
npx prisma migrate dev --name migration_name
To apply migrations
npx prisma migrate deploy
We welcome contributions from the community! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature-name
). - Open a pull request.
Please ensure your code adheres to our coding standards and includes appropriate tests.
All crates of this repository are licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.