|
58 | 58 |
|
59 | 59 | ## Run Example/Demo |
60 | 60 | This simple example can be run from the script [test_osexample.sh](scripts/test_osexample.sh) under `example/script` directory. |
| 61 | +Or, it can be directly run from python script [test_osexample.py](scripts/test_osexample.py.in). |
61 | 62 |
|
62 | 63 |
|
63 | 64 | ### Simple scenario (4 replicas and 1 client) |
64 | 65 | This demo can be run from inside the container once the build is finished. |
65 | 66 |
|
66 | | -Run the [test_osexample.sh](scripts/test_osexample.sh) script from the container's `build/example/scripts` directory. |
| 67 | +* Run the [test_osexample.sh](scripts/test_osexample.sh) script from the container's `build/example/scripts` directory. |
67 | 68 | ```sh |
68 | 69 | ./test_osexample.sh |
69 | 70 | ``` |
| 71 | +* Run the [test_osexample.py](scripts/test_osexample.py.in) script from the container's `build/example/scripts` directory with default commandline arguments `-bft n=4,cl=1`, where n is number of replicas and cl is number of client. |
| 72 | +It is a configurable script which can be configured according to the need. |
| 73 | +```sh |
| 74 | +./test_osexample.py -bft n=4,cl=1 |
| 75 | +``` |
70 | 76 |
|
71 | 77 |
|
72 | 78 | #### Explanation of the [test_osexample.sh](scripts/test_osexample.sh) |
73 | | -On our example, we will use the script [test_osexample.sh](scripts/test_osexample.sh) and this script is used for following things, |
| 79 | +On our example, we will use the script [test_osexample.py](scripts/test_osexample.py.in) and this script is used for following things, |
74 | 80 | * It is used to generate the keys for replica's. For more [refer](../tools/README.md) |
75 | | -``` |
76 | | -$scriptdir/../../tools/GenerateConcordKeys -f 1 -n 4 -o replica_keys_ |
77 | | -``` |
78 | | - |
79 | 81 | * It is used to generate TLS certificates used in for TLSTCP communication which we are using as a default mode of communication. For more [refer](../scripts/linux/create_tls_certs.sh) |
80 | | -``` |
81 | | -# Generate TLS certificates |
82 | | -$scriptdir/create_tls_certs.sh 10 |
83 | | -``` |
84 | | - |
85 | 82 | * Running multiple replica's. Here we are running 4 replica's. |
86 | | -``` |
87 | | -# run 4 replica's with unique replica id's |
88 | | -echo "Running replica 1..." |
89 | | -$scriptdir/../replica/test_replica -i 0 -a $scriptdir/replica_conf & |
90 | | -echo "Running replica 2..." |
91 | | -$scriptdir/../replica/test_replica -i 1 -a $scriptdir/replica_conf & |
92 | | -echo "Running replica 3..." |
93 | | -$scriptdir/../replica/test_replica -i 2 -a $scriptdir/replica_conf & |
94 | | -echo "Running replica 4..." |
95 | | -$scriptdir/../replica/test_replica -i 3 -a $scriptdir/replica_conf & |
96 | | -``` |
97 | | - |
98 | 83 | * Running client |
99 | | -``` |
100 | | -time $scriptdir/../client/test_client -f 1 -c 0 -i 4 -r 4 -e 0 -m $scriptdir/../msg-configs/msg-1 |
101 | | -``` |
102 | | - |
103 | 84 | * For resources cleanup. |
104 | 85 |
|
105 | 86 |
|
|
0 commit comments