Welcome to our Blockchain Prototype project
, a cutting-edge simulation that mirrors the foundational aspects of Bitcoin, but with a modern twist: it's built using TypeScript. This prototype aims to provide developers and enthusiasts alike with a hands-on experience of blockchain technology, including the creation, verification, and management of blocks in a decentralized environment.
- Introduction
- Installation
- Usage
- Features
- Dependencies
- Scripts
- Building the Project
- Testing
- Contributors
- License
# Clone the repository and install dependencies
git clone https://github.com/Reshzera/Protochain.git
cd protochain
npm install
To start the project, you can use the following commands:
- For development:
- API server:
npm run dev:api
- Miner client:
npm run dev:miner
- Wallet client:
npm run dev:wallet
- API server:
- To build the project:
npm run build
- To start the production server:
npm start
- Blockchain Core: Implementation of the blockchain data structure, enabling secure storage of blocks in a continuous and immutable chain.
- Transactions (TX): Development of a transaction system that allows users to securely send and receive digital values within the network.
- Transaction Inputs (TXI): Creation of transaction inputs, which are references to outputs from previous transactions, allowing the origin of values to be traced.
- Transaction Outputs (TXO): Implementation of transaction outputs, which determine how the values from transactions are distributed to new owners.
- Wallets: Development of digital wallets allowing users to manage their private and public keys, conduct transactions, and check their balances.
- Block: Implementation of the block structure, which includes a header containing metadata (such as proof of work) and a body composed of a set of transactions.
- Testing Framework: Use of
jest
andsupertest
to create and execute unit and integration tests, ensuring all components of the blockchain function correctly and securely. - Test Coverage: Implementation of tests to cover all essential functionalities, including generating and validating transactions, creating blocks, the mining process, and managing wallets.
- Wallet Client: Development of a client that allows users to create and manage their wallets, send and receive transactions through an intuitive user interface.
- Miner Client: Implementation of a mining client that allows users to participate in the transaction validation process and the creation of new blocks, receiving rewards in exchange for their computational power.
axios
: Promise based HTTP client for the browser and node.jscrypto-js
: JavaScript library of crypto standards.dotenv
: Loads environment variables from a.env
file.ecpair
: Library for elliptic curve pairs.express
: Fast, unopinionated, minimalist web framework for node.morgan
: HTTP request logger middleware for node.js.tiny-secp256k1
: A small and efficient JavaScript library for Secp256k1 signatures.
- TypeScript and various typings (
@types/*
) - Linting tools (
eslint
,eslint-config-prettier
, etc.) - Testing tools (
jest
,supertest
,ts-jest
) - Build tools (
tsc
,ts-node-dev
)
The scripts
section of the package.json
defines the following:
dev:api
: Runs the development server for the API.build
: Compiles TypeScript code to JavaScript.start
: Starts the compiled server.lint
: Runs ESLint to check for code quality issues.test
: Runs the test suite using Jest.dev:miner
: Runs the development server for the miner client.dev:wallet
: Runs the development server for the wallet client.
npm run build
This command compiles the TypeScript source files into JavaScript to the dist/
directory.
npm run test
This command runs the test suite defined with Jest.
This project is open-sourced software licensed under the MIT License.