You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Read this book: https://www.marabu.dev/blockchain-foundations.pdf
84
83
85
-
* Bonus task: add smart contracts to the blockchain.
84
+
---
86
85
87
-
Candidates are expected to refine these tasks in their GSoC proposals.
88
-
It is encouraged that you develop an initial prototype during the application phase.
86
+
## Getting Started
89
87
90
-
### Requirements
88
+
### Prerequisites
91
89
92
-
* Use [PyNaCl](https://pynacl.readthedocs.io/en/latest/) library for hashing, signing transactions and verifying signatures.
93
-
* Use [Py-libp2p](https://github.com/libp2p/py-libp2p/tree/main) for p2p networking.
94
-
* Implement Proof-of-Work as the consensus protocol.
95
-
* Use accounts (instead of UTxO) as the accounting model for the ledger.
96
-
* Use as few lines of code as possible without compromising readability and understandability.
97
-
* For the bonus task, make Python itself be the language used for smart contracts, but watch out for security concerns related to executing arbitrary code from untrusted sources.
90
+
- Python 3.10+
91
+
- Install dependencies:
92
+
```bash
93
+
pip install -r requirements.txt
94
+
```
95
+
96
+
### 1. Creating a New MiniChain
97
+
To bootstrap a brand new blockchain network from scratch, simply start a node. By default, this creates a new Genesis block.
98
+
```bash
99
+
python main.py --port 9000 --datadir ./node1_data
100
+
```
101
+
*Note: Keep this terminal open to interact with the node via the CLI.*
102
+
103
+
### 2. Connecting to an Existing Chain
104
+
To connect a secondary node to the network, start a new instance on a different port and point it to the seed node using the `--connect` flag.
The node will automatically sync the blockchain state via the P2P network using the Fork-Choice rule.
109
+
110
+
### 3. Mining Blocks
111
+
To confirm pending transactions, you need to mine blocks. In the interactive CLI of your node, simply type:
112
+
```text
113
+
minichain> mine
114
+
```
115
+
This runs the Proof-of-Work algorithm, validates transactions, computes the new state root, updates your wallet with the block reward + fees, and broadcasts the block to all connected peers.
98
116
99
-
### Resources
117
+
---
100
118
101
-
* Read this book: https://www.marabu.dev/blockchain-foundations.pdf
119
+
## Basic Operations (Interactive CLI)
120
+
121
+
Once your node is running, you can perform basic blockchain operations directly in your terminal.
MiniChain automatically spins up a JSON-RPC 2.0 server alongside the P2P node. By default, it binds to `port 8545` (the standard EVM RPC port). External wallets and dApps can use this to interact with the chain asynchronously.
0 commit comments