de-centrailized git
Project description
De-Github
Setup
We are using Python 3.8 for development.
Install required packages by running
pip install -r requirements.txt
We are using Ganache to create a blockchain network at local environment for development and testing.
Please head to the Ganache website and download it.
Once you have installed Ganache, you can simple click on quickstart and you should be able to call degit functions.
Remember to define the RPC_SERVER environment variable, by default the value is http://127.0.0.1:7545 which is the default network of Ganache.
Also please put your private key in the .key file. Degit will automatically load the key and use it for git operations.
How to run tests
We have prepare a test.py for your convenient.
Before you run the tests, you must put in two different private key to .key and .second_user_key (you can randomly pick 2 from Ganache).
Then run:
python test.py
You should obtain a console output similar to this one:
Owner's Log:
File last modified time on Owner machine: 2022-05-08 12:25:00
Initialized Repository. State file created in current directory.
Committed files:
Staged files:
test.txt
Commit 076bb1b40881a287b47ca56d7d17d2c54815dd36 was successful.
Contract deployed to chain, contract address: 0x7B9ef343909fD32b8Ad7c9667Dc49Dd4034e4742.
Pushed commits "076bb1b40881a287b47ca56d7d17d2c54815dd36" to repository "test".
Whitelisted user of address: 0xbe2545A975e8A6Efd0BA5c4600aE4CfA228DA8b5
Dumped repository config to ./repo_config.pkl.
Friend's Log:
Loaded repository config from ./repo_config.pkl
Replace your repository by commit 076bb1b40881a287b47ca56d7d17d2c54815dd36
File last modified time on friend machine: 2022-05-08 12:25:07
Process finished with exit code 0
This test.py mimic two users (1 owner and 1 collaborator):
- The owner has written some code in
test.txt - The owner runs
degit init test(testis the repository name) - The owner runs
degit add test.txt - The owner runs
degit commit - The owner runs
degit pushto pushtest.txtto the blockchain network - The owner gets his friend account address and runs
degit whitelist_add_user <friend_address> - The owner runs
degit dump_repository_config - The friend runs
degit load_repository_config - The friend runs
degit pull - The friend now has the
test.txtin his machine
The printed file last modified time shows that the file is truly replaced by the one pulled from the repository.
FileStorage
At the moment we are using HKUST provided endpoint to upload file and download file.
In the future, we might deploy a smart contract ourselves as a decentralized filestorage.
Smart Contract
At the moment we have ./contracts/Repository.sol only.
This is the template repository we defined to allow user to create repository with access control.
Limited Functions
It is unfortunate that due to limited time and team members, we are unable to replicate git fully.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file degit-0.0.1.tar.gz.
File metadata
- Download URL: degit-0.0.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f24c63f9d4a5a55b4da2232f93d48f41685b490cdb8a08712ea4d855d04a4eea
|
|
| MD5 |
9a024edc842f486404e748815aed7e4e
|
|
| BLAKE2b-256 |
cb89b49c374ec9c057eea3e953a583ce6ee3781a926e2842342144cdc56de539
|
File details
Details for the file degit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: degit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b3c21912777529b0c88183bafe73563fe3b8b8d04d77b5926d4226a771ade07
|
|
| MD5 |
01fb36be4da88db3f82dae5cbda2f80e
|
|
| BLAKE2b-256 |
24a8af137c237ba97f88616d25fd7ca1807d50c65ad82c2008fab512601a3892
|