Demo project for pypi/dimp packages.
Source codes:
pip3 install -r requirements.txt
1.0. Usages
tests/register.py help generate
tests/register.py help modify
1.1. Create station account (define your ID.seed)
tests/register.py generate STATION --seed="gsp-s001"
copy the new ID (e.g.: "gsp-s001@x5Zh9ixt8ECr59XLye1y5WWfaX4fcoaaSC")
tests/register.py modify {NewID} --name="Station1" --host="{WAN_IP}" --port=9394
1.2. Create group assistant
tests/register.py generate BOT --seed="assistant"
tests/register.py modify {NewID} --name="GroupBot1"
1.3. Create search bot
tests/register.py generate BOT --seed="archivist"
tests/register.py modify {NewID} --name="SearchEngine1"
"stations": [
//
// 2.1. Add your new station ID with host & port here
//
{"ID": "gsp-s001@x5Zh9ixt8ECr59XLye1y5WWfaX4fcoaaSC", "host": "106.52.25.169", "port": 9394}
],
"assistants": [
//
// 2.2. Add your new assistant ID here
//
"assistant@2PpB6iscuBjA15oTjAsiswoX9qis5V3c1Dq"
],
"archivists": [
//
// 2.3. Add your new archivist ID here
//
"archivist@2Ph6zsUBL8rbimRArb2f539j64JUJJQoDpZ"
]
#
# 2.3. Replace your new station ID here
#
station_id = 'gsp-s001@x5Zh9ixt8ECr59XLye1y5WWfaX4fcoaaSC'
#
# 2.4. Replace your new bots ID here
#
assistant_id = 'assistant@2PpB6iscuBjA15oTjAsiswoX9qis5V3c1Dq'
archivist_id = 'archivist@2Ph6zsUBL8rbimRArb2f539j64JUJJQoDpZ'
#
# 2.5. Set to your data directory
#
base_dir = '/data/.dim'
chmod a+x *.sh
./start_all.sh
python3 tests/client.py
/----------------\ /----------------\
| User1 (moki) | | User2 (hulk) |
\----------------/ \----------------/
| ^
| |
============|======================================|=============
| |
V |
..................... .....................
: RequestHandler1 : ---+ +--> : RequestHandler2 :
..................... | | .....................
| V | |
| /-------------\ |
.............. | TCPServer | ..............
: Session1 : >...........< : Session2 :
.............. | Station | ..............
| \-------------/ |
| | |
| /---------------------\ |
| | Database | |
| >...................< |
| | Barrack, KeyStore | |
| \---------------------/ |
| |
| /-----------------\ |
\----------> | Session Server | <---------/
\-----------------/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DIMP
(DKD, MKM)