Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
chainode
Advanced tools
Readme
Chainode is a private blockchain designed to be fast, lightweight, and highly scalable. The network allows to exchange data (i.e. transactions) between trusted participants. These transactions are stored as blocks in a distributed ledger.
Chainode is written in pure Javascript for Node.js, and it is based on Kafka as communication system and block order. It is a work in progress.
The main features are:
Every participant is a network's node that is defined by:
Currently, there are three types of peer node:
Kafka peers are mainly communication nodes. There can only be one Kafka cluster for every single blockchain network.
A Kafka peer tasks are:
Chainode peers are simple chainode instances that propose, receive, and validate new blocks.
A chainode peer tasks are:
The storage peers are distributed database clusters (Couchbase cluster) that holds the ledger.
A storage peer tasks are:
The network steps are the followings:
Chainode application is based on:
Chainode Web Console is based on:
The Kafka cluster is shared between organizations, while every organization holds its own cluster of Chainode peers and Storage peers.
Below there is the architecture of a generic chainode blockchain.
To install chainode with npm package manager:
npm install chainode
To run the chainode peer, the Kafka peers and the Storage peers must be running and available.
Create the Kafka topic (if not exist):
/confluent/bin/kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic blockchain.blocks.pending --if-not-exists
To start a peer use a configuration file:
CONFIGS=/app/test/configs/generic.json npm start
The configurations can be overwritten like the following examples:
CONFIGS=/app/test/configs/generic.json BLOCKCHAIN=blockchain PEER_ID=000 DB_HOST=172.25.255.20 WEBUI_PORT=8080 npm start
CONFIGS=/app/test/configs/generic.json BLOCKCHAIN=blockchain PEER_ID=001 DB_HOST=172.25.255.21 WEBUI_PORT=8081 npm start
The configurations are loaded by a json file. An example of configuration can be found here: test/configs/generic.json
The fields are the followings:
Field | Optional | Type | Description |
---|---|---|---|
blockchain | no | string | The name of the blockchain |
organization | no | string | The organization to which the peer belongs |
role | no | enum(peer) | The role of the peer (currently allowed only "peer") |
id | no | string | The id of the peer |
db.hosts | no | [string] | The list of database hosts |
db.bucket | no | string | Database bucket |
db.username | no | string | Database username |
db.password | no | string | Database password |
kafka.hosts | no | [string] | The list of Kafka broker hosts |
kafka.topics.pending | no | string | The name of the topic for the new proposed blocks |
kafka.consumer.groupId | no | string | The Kafka consumer group id to use |
kafka.consumer.fromOffset | yes | boolean | If set true, Kafka consumer will fetch message from the given offset in the payloads |
kafka.consumer.autoCommit | yes | boolean | The consumed messages are acked automatically by the Kafka consumer |
kafka.consumer.encoding | yes | string | Kafka message encoding (utf8 ) |
kafka.consumer.keyEncoding | yes | string | Kafka key message encoding (utf8 ) |
kafka.producer.partitionerType | yes | integer | Partitioner type (default = 0, random = 1, cyclic = 2, keyed = 3, custom = 4), default 0 |
webconsole.enabled | yes | boolean | Enable/disable the web console |
webconsole.host | no | string | The ip address or the hostname of the web console server |
webconsole.port | yes | integer | The web console server port |
logs.level | yes | enum(debug, info, warn, error) | The log level to use |
logs.console | yes | boolean | To show logs on the console too |
logs.path | no | string | The path for .log files |
Every peer exposes a REST API service. For a detailed documentation, read the wiki page.
At first, is required to start a dockerized environment for testing. To do this, run:
git clone https://github.com/davidemiceli/chainode.git
cd chainode/
DB=couchbase npm run start-dev-env
docker exec -it nodejs npm install
npm run create-dev-topics
npm run init-db
To close the dockerized environment:
npm run stop-dev-env
After dockerized environment is started, run unit tests:
docker exec -it nodejs npm test
docker exec -it nodejs /bin/bash -c "CONFIGS=/app/test/configs/generic.json npm start"
The first time, install all required packages:
docker exec -it nodejs /bin/bash -c "cd web-console/frontend && npm install"
Then, to build the frontend type:
for development mode
docker exec -it nodejs build-webconsole-dev
for production
docker exec -it nodejs build-webconsole-prod
Chainode is licensed under the terms of the GNU Affero General Public License Version 3 (AGPL).
Documentation is licensed under CC BY 4.0.
FAQs
A private blockchain network based on node.js
The npm package chainode receives a total of 8 weekly downloads. As such, chainode popularity was classified as not popular.
We found that chainode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.