#NodeCreation
Explore tagged Tumblr posts
guillaumelauzier · 2 years ago
Text
Fundamentals of Building a Blockchain
Tumblr media
The blockchain is a transformative technology that has had a profound impact on various sectors from finance to supply chain management. While the journey to master blockchain development is a complex one, understanding its fundamentals is the first step towards proficiency. This article delves into these essential building blocks of creating a blockchain.
1. Understanding Blockchain Basics
Before you build a blockchain, it's crucial to understand its core elements: - Blockchain Structure: A blockchain is a distributed ledger of transactions, organized into blocks. Each block contains a list of transactions, a reference to the previous block (through its hash), and the block's unique hash. This chain of blocks forms the blockchain. Creating a blockchain structure involves creating a data structure to store blocks, and each block will contain a set of transactions. For simplicity, we'll create a simple blockchain structure where each block stores a string as data. Also, we'll use the SHA-256 cryptographic hash function to create the hash for each block. Here's a simple C++ implementation: #include #include #include #include using namespace std; // Function to calculate SHA256 string calculateSHA256(string data) { unsigned char hash; SHA256_CTX sha256; SHA256_Init(&sha256); SHA256_Update(&sha256, data.c_str(), data.size()); SHA256_Final(hash, &sha256); stringstream ss; for(int i = 0; i < SHA256_DIGEST_LENGTH; i++) { ss - H is the current block's hash - PH is the previous block's hash - D is the current block's data - '+' indicates concatenation of the strings - Hash is the SHA-256 cryptographic hash function - Read the full article
0 notes
barki2016 · 8 years ago
Text
🌿 #ng2 #tree
ng2-tree is a simple #Angular 2 component for visualizing #data that can be naturally represented as a tree.
🎬 Usage 👀 Demo 🔧 API tree [tree] Load children asynchronously Configure node via TreeModelSettings [settings] Tree class events (nodeMoved, nodeSelected, nodeRenamed, nodeRemoved, nodeCreated) NodeSelectedEvent NodeMovedEvent NodeRemovedEvent NodeCreatedEvent NodeRenamedEvent Changes that…
View On WordPress
0 notes