
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
github.com/nuklai/nuklaivm-external-subscriber
Advanced tools
The NuklaiVM External Subscriber is an external data collector for the NuklaiVM blockchain. This application listens to blockchain events and saves block, transaction, and action data to a PostgreSQL database with TimescaleDB for efficient time-series data handling. It provides both a gRPC server to receive blockchain data in real time and a REST API for querying historical blockchain data.
git clone https://github.com/Nuklai/nuklaivm-external-subscriber
cd nuklaivm-external-subscriber
Set up environment variables:
cp .env.example .env
Modify any values within .env as per your own environment.
Note that if you modify the values of DB_USER, DB_PASSWORD, DB_NAME or GRPC_WHITELISTED_BLOCKCHAIN_NODES, make sure to also update your docker-compose.yml file accordingly under the environment and entrypoint section(if you plan on running the subscriber in docker).
By default, the subscriber rejects all connections. In order to add an IP address to a whitelist, you must put this in the GRPC_WHITELISTED_BLOCKCHAIN_NODES in your .env file and docker-compose.yml(if you plan on running with docker). If you're running the nuklaivm in docker, make sure to include the docker IP of that container in this environment variable as well.
Run the postgres in docker and subscriber natively:
./scripts/run.sh
Run the postgres in docker and subscriber in docker as well:
./scripts/run.sh -d
This script:
The REST API is available at http://localhost:8080.
The gRPC server listens on port 50051 and implements methods defined in the ExternalSubscriber service:
The database schema includes the following tables:
blocks: Stores block informationtransactions: Stores transaction detailsassets: Stores assets detailsactions: Stores actions within transactions, including action type and detailsgenesis_data: Stores the genesis data received during initializationTODO:
Unit tests are located in each package, and the command below will run all tests:
go test ./...
Mocking is used to simulate database connections for accurate testing without requiring a live database.
Contributions are welcome! To contribute:
git checkout -b feature-name).git commit -am 'Add new feature').git push origin feature-name).This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.