|
|
# Preparing testing environment
|
|
|
1. Create directory in which you will store your testing environment, for simplicity I'll use `/tmp`
|
|
|
2. Enter your testing environment dir
|
|
|
|
|
|
## Preparing `hived` node
|
|
|
1. Clone latest sources of `hived` from https://gitlab.syncad.com/hive/hive
|
|
|
```bash
|
|
|
$ cd /tmp #note this should be your testing environment directory
|
|
|
$ git clone git@gitlab.syncad.com:hive/hive.git
|
|
|
```
|
|
|
|
... | ... | @@ -38,8 +38,57 @@ Example of `config.ini` is attached to this document, `block_log` file can be do |
|
|
|
|
|
Note that `block_log.5M` is a special block log, truncated to 5000 000 blocks.
|
|
|
|
|
|
5. Replay blockchain using prepared `block_log`. Enter `hive` build directory and issue command:
|
|
|
```bash
|
|
|
$ cd /tmp/hive/build
|
|
|
$ programs/hived/hived -d /tmp/ref-data/ --advanced-benchmark --force-replay --replay-blockchain
|
|
|
```
|
|
|
|
|
|
6. After replay leave `hived` instance working
|
|
|
|
|
|
## Preparing `postgresql` database
|
|
|
1. Install `postgresql` package
|
|
|
2. Configure and run `postgresql`
|
|
|
3. Create `user` and `database` to hold `hivemind` data (i.e. user `hive` database `hive`)
|
|
|
|
|
|
## Preparing `hivemind`
|
|
|
1. Clone latest sources of the `hivemind`
|
|
|
```bash
|
|
|
$ cd /tmp #note this should be your testing environment directory
|
|
|
$ git clone git@gitlab.syncad.com:hive/hivemind.git
|
|
|
$ cd hivemind
|
|
|
$ git checkout develop
|
|
|
$ git submodule update --init --recursive
|
|
|
```
|
|
|
|
|
|
2. Build and install your `hivemind`
|
|
|
```bash
|
|
|
$ python3 setup.py build
|
|
|
$ python3 setup.py install --user
|
|
|
```
|
|
|
|
|
|
3. Sync your `hivemind` service with running `hived` node
|
|
|
```bash
|
|
|
$ time hive sync --steemd-url '{"default":"http://127.0.0.1:8090"}' --database-url postgresql://hive@localhost:5432/hive --test-max-block 5000017 --exit-after-sync --mock-block-data-path mock_data/block_data/follow_op/mock_block_data_follow.json 2>&1 | tee -i hivemind-sync.log
|
|
|
```
|
|
|
|
|
|
4. After sync is done run `hivemind` server
|
|
|
```bash
|
|
|
$ hive server --steemd-url '{"default":"http://127.0.0.1:8090"}' --database-url postgresql://hive@localhost:5432/hive
|
|
|
```
|
|
|
|
|
|
5. Leave `hivemind` server working
|
|
|
|
|
|
# Running tavern tests
|
|
|
Enter `hivemind` source directory and run tests using `run_tests.sh` script
|
|
|
```bash
|
|
|
$ cd /tmp/hivemind
|
|
|
$ scripts/run_tests.sh 127.0.0.1 8080
|
|
|
```
|
|
|
|
|
|
# Running benchmarks
|
|
|
Enter `hivemind` source directory and run benchmarks using `ci_start_api_benchmarks.sh` script
|
|
|
```bash
|
|
|
$ cd /tmp/hivemind
|
|
|
$ scripts/ci_start_api_benchmarks.sh 127.0.0.1 8080 3
|
|
|
``` |
|
|
\ No newline at end of file |