# Project Name
## Description
This project implements a ticket-based system using the Substrate framework. Each ticket issued is registered on the blockchain, and only authorized accounts can change the ticket state. Once a ticket is used, the authorized account can change the ticket state to "consumed". The logic for this functionality is implemented in a Substrate pallet named "useonce".
## Features
- Ticket registration on the blockchain.
- Authorization mechanism to control ticket state changes.
- State transition from "registered" to "consumed" upon ticket usage.
## Installation
To install and run this project, follow these steps:
-
Clone the repository:
git clone https://github.com/zeel991/substrate-node-template.git
-
Navigate to the project directory:
cd substrate-node-template
-
Install dependencies:
npm install
-
Build the Pallet:
cargo build --release
-
Start the local node:
./target/release/node-template --dev
-
In a second terminal, navigate to the
substrate-demo
directory:cd substrate-demo
-
Build Yarn:
yarn build
-
Run the demo script:
yarn demo
To interact with and demonstrate the functionality of the "useonce" pallet, follow these steps:
- Import the necessary modules and functions.
- Initialize the Substrate client.
- Connect to the Substrate node.
- Use the provided TypeScript code to perform ticket-related tasks, such as issuing tickets, changing ticket states, and querying ticket information.
- Run the TypeScript code to execute the tasks and observe the results.