This tutorial outlines the process of creating a blockchain-based supply chain tracking system using Ignite CLI. The system enables businesses to transparently track products from production to delivery.
Initiate your blockchain project with Ignite CLI:
Create modules for product management and audit:
Define data structures for products and their movements.
We're scaffolding a list for the products and map the movements with their productID accordingly.
Registering a Product
To register a product, you would use the create-product
message you've defined in Step 4. Here's how you could present it:
Show your product:
First input is the name
, second the description
, and third origin
correspond to the product's origin. --from
specifies the blockchain address of the user performing the registration (likely a manufacturer alice
in this context).
Recording Product Movement
To log a product's movement, the recordMovement
message comes into play:
Show the movement:
Clarify that productID
, first input, is the unique identifier of the product being moved, as well as ID. location
as third parameter specifies the new location of the product, and a timestamp recorded when the product arrived. --from
is the address of the user (probably a transporter or distributor).
Tracking Product Status
List all existing products with:
For tracking the current status or location of a product, a user would query the system using the productID:
This command retrieves details of the product, including its current status or location. It's a straightforward way for any stakeholder to check on a product.
Verifying Product Movement History
To verify a product's movement history, stakeholders can use the following command:
This command provides a history of all recorded movements for the specified product, offering transparency and traceability for audits or verification processes.
By following these steps, you'll create a robust supply chain tracking system, leveraging the power and versatility of Ignite CLI. This system will enhance transparency and efficiency in product tracking and verification.
Next steps are frontend development, testing, debugging, and deploying the network.