Pure Python 3 Merkle Patricia Trie implementation
Project description
In order to understand Ethereum’s core functionalities, I am implementing parts of it for myself. Here I am implementing the Merkle Patricia Trie (MPT) purely in Python 3.
## Install
`shell pip install ethereum-merkle-patricia-trie `
## Requirements
In order to use the package, you need to install LevelDb on your system.
## Tests
In order to run the tests, execute the following command: `bash $ python -m unittest ` ## Usage
Here an example on how to use the package:
from mpt.trie import Trie
t = Trie(‘./testdb’) t.update(b’abcd’, b’hello world’)
print(t.get_value(b’abcd’))
print(t.get_root_hash())
t.delete(b’abcd’)
## Upload to Pypi
Uploading and testing using test Pypi
python -m build python -m twine upload –repository testpypi dist/* pip install –index-url https://test.pypi.org/simple/ –no-deps merklePatriciaTrie
Uploading to Pypi
python -m build python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ethereum-merkle-patricia-trie-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9179ee1716f9b6b66b5559ac7964322c92dd41cc183a306a71c5377ebd053a46 |
|
MD5 | d52ad7f04b6e90a78d422baf7d640020 |
|
BLAKE2b-256 | 86f15cbde5ac1a930e5ea970877363dca6cc7e11d8f56bde04682373297470b1 |
Hashes for ethereum_merkle_patricia_trie-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859c7777ccb2bd58357885d25845f3ae0de544238e7f6f1661ef4506dd0a2250 |
|
MD5 | fb2e017fd8e695dc921e4a4f6a41b400 |
|
BLAKE2b-256 | d9d5e1a6c3ea6a6a9f2f91d0ad9aa46cd973580a55542815eda71d07e387a50b |