# Simple Node.js Blockchain
This project implements a simple blockchain using Node.js. It includes a blockchain client that can send transactions, mine blocks, and retrieve block data. It mines block on an average of 3 seconds.
It also include a module for issuing assets on stellar testnet
## Getting Started
1. Clone the repository:
```bash
git clone https://github.com/guudc/simple-blockchain.git
cd simple-blockchain-
Install dependencies:
npm install
-
Start the blockchain client:
npm start
const BlockchainClient = require("./src/controller/blockchain");
// Initialize a new blockchain client with a custom client ID
const client = new BlockchainClient(123);// Send a transaction
const transaction = {
timestamp: Date.now(),
data: "Date goes here"
};
client.sendTransaction(transaction);// Start mining
client.mine();
// Stop mining
client.mine(false);// Get the current block number
const blockNumber = client.getBlockNumber();
// Retrieve data of a specific block
const blockData = client.getBlockAt(blockNumber);
// Retrieve data of all blocks
const allBlocks = client.getAllBlocks();const { start } = require("./src/controller/stellar_asset")
// Issue a new asset
start("AssetName")This project is licensed under the GNU General Public License - see the LICENSE file for details.