The current version of this code can be found at https://github.com/ethereum/pyethereum
This repository contains the implementation of the Ethereum blockchain protocol in Python. It includes the core components required to run an Ethereum node, such as block processing, transaction handling, and state management.
blocks.py
: Contains theBlock
class, which represents a block in the Ethereum blockchain.transactions.py
: Contains theTransaction
class, which represents a transaction in the Ethereum blockchain.trie.py
: Contains theTrie
class, which is used for state management in the Ethereum blockchain.manager.py
: Contains functions for managing the blockchain, such as generating addresses and receiving objects.processblock.py
: Contains functions for processing blocks and evaluating contracts.parser.py
: Contains theparse
function for parsing input data.rlp.py
: Contains functions for encoding and decoding data using Recursive Length Prefix (RLP) encoding.trietest.py
: Contains thetrie_test
function for testing theTrie
class.
To set up the development environment, follow these steps:
-
Clone the repository:
git clone https://github.com/ethereum/pyethereum.git cd pyethereum
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
To run the tests, follow these steps:
-
Ensure that the development environment is set up and activated.
-
Run the tests using
pytest
:pytest