If you are not seeing the correct results when calling the services, double check that you are running all the services from the same relative path, (e.g.: cargo run vs ./target/debug/...)
The WORKSPACE_LOCAL_STORAGE variable is relative (./workshop_storage) and therefore depends on where you are running the executable.
Step 1 - Checking the services
Let's first make sure all our services are running and restart our reporting service.
In a new terminal, run the following command:
./rust-daas/target/debug/myapp_reporting
In another terminal, let's run the sourcing script.
./scripts/curl-sourcing.sh
You should see all the services printing to the console about the data they have touched.
Sourcing RESTful service
[2020-11-09T13:24:06Z INFO actix_web::middleware::logger] 127.0.0.1:33482 curl/7.61.1
[2020-11-09T13:24:06Z INFO actix_web::middleware::logger] 127.0.0.1:33482 "POST /order/clothing/iStore/5000 HTTP/1.1" 200 15 "-" "curl/7.61.1" 0.002745
Genesis service
[2020-11-09T13:24:06Z INFO daas::service::processor] Putting document order~clothing~iStore~5000 in S3
[2020-11-09T13:24:06Z INFO daas::service::processor] Brokering document order~clothing~iStore~5000 ...
Order Clothing service
ArchConfWorkshopUser:~/environment $ ./rust-daas/target/debug/myapp_order_clothing
Clothing Orders processor is running ...
Press [Enter] to stop the Clothing Orders processor.
Order Number 5000 from the iStore has a status of "new"...
Retreiving leather_jacket file
After you rerun the ./scripts/curl-sourcing.sh script, you should get a payload returned stating that the data cannot be processed.
{"error":"unable to process data"}
This is because the DaaS SDK automatically verifies that the data being sent is coming from the original source that created it. This is possible because of the Data Tracker Chain feature from the pbd.
Update the curl-sourcing.sh script to the following, which has a Data-Tracker-Chain value that matches the resource path order/clothing/myStore/5000:
You should be able to confirm the following items:
Sourcing
{"status":"ok"} response
./local_storage/clothing/myStore/5000 directory with a your DaaSDocument json file
Genesis Processor
[2020-11-09T19:52:44Z INFO daas::service::processor] Putting document order~clothing~myStore~5000 in S3
[2020-11-09T19:52:44Z INFO daas::service::processor] Brokering document order~clothing~myStore~5000 ...