Skip to content

A new FRAME-based Substrate node, ready for hacking.

License

Notifications You must be signed in to change notification settings

zeel991/UseOnce-Pallet-Demo

 
 

Repository files navigation

# 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:
  1. Clone the repository:

    git clone https://github.com/zeel991/substrate-node-template.git
  2. Navigate to the project directory:

    cd substrate-node-template
  3. Install dependencies:

    npm install
  4. Build the Pallet:

    cargo build --release
  5. Start the local node:

    ./target/release/node-template --dev
  6. In a second terminal, navigate to the substrate-demo directory:

    cd substrate-demo
  7. Build Yarn:

    yarn build
  8. Run the demo script:

    yarn demo

Usage

To interact with and demonstrate the functionality of the "useonce" pallet, follow these steps:

  1. Import the necessary modules and functions.
  2. Initialize the Substrate client.
  3. Connect to the Substrate node.
  4. Use the provided TypeScript code to perform ticket-related tasks, such as issuing tickets, changing ticket states, and querying ticket information.
  5. Run the TypeScript code to execute the tasks and observe the results.

About

A new FRAME-based Substrate node, ready for hacking.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 83.4%
  • JavaScript 8.7%
  • TypeScript 3.8%
  • Nix 2.4%
  • Dockerfile 1.3%
  • Shell 0.4%