Mock data providers
All threads resolved!
All threads resolved!
@ABW @bwrona Please take a look:
- introduced two new classes: MockBlockProvider and MockVopsProvider
- possibility to inject artificial data to block and vops using data from mock providers
- data for mock providers is stored in json files, examples provided
- added command line options to set paths for mock json files
- provided path can also be a path to a directory. Direcotry will be scanned for json files and all json files from given directory will be loaded
I didn't want to mess with block streamer to much so:
- blocks in json file must be in sequence, starting with block next to last one synced from hived,
- json file must have three more blocks than required to fill the queue (just like in example file)
Edited by Dariusz Kędzierski
Merge request reports
Activity
Run example:
time hive sync --steemd-url '{"default":"http://127.0.0.1:8090"}' --database-url postgresql://hive@localhost:5432/hive4 --mock-block-data-path mock_block_data_example.json
After sync log into DB and check if there are accounts
tester1
andtester2
, also check if there is follow op with followertester1
followingtester2
.dariusz-work@asgard:~/Sources/hivemind(dk-mock-data-providers [+])$ psql -U hive -d hive4 psql (13.0 (Ubuntu 13.0-1.pgdg18.04+1), server 10.14 (Ubuntu 10.14-1.pgdg18.04+1)) Type "help" for help. hive4=# select id from hive_accounts where name='tester1'; id ------- 92465 (1 row) hive4=# select id from hive_accounts where name='tester2'; id ------- 92466 (1 row) hive4=# select * from hive_follows where follower=92465 and following=92466; id | follower | following | state | created_at | blacklisted | follow_blacklists | follow_muted | block_num --------+----------+-----------+-------+---------------------+-------------+-------------------+--------------+----------- 457074 | 92465 | 92466 | 1 | 2016-09-15 19:47:24 | f | f | f | 5000002 (1 row) hive4=#
Note artificial block with number
5000002
Edited by Dariusz Kędzierski- Resolved by Dariusz Kędzierski
- Resolved by Dariusz Kędzierski
added To Do label
added 1 commit
- 2cbc67e7 - Cleanup in mock classes, mock logic moved from block stream to client.py, mock...
added 24 commits
-
3938b0b8...ebdc2e99 - 23 commits from branch
develop
- 73e82d96 - Rebase to current develop
-
3938b0b8...ebdc2e99 - 23 commits from branch
added 1 commit
- d56addb4 - Minor cleanup: Removed unused imports/variables.
mentioned in commit d35621ee
Please register or sign in to reply