Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions examples/hello_genlayer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Simple Hello GenLayer Contract
# This is a beginner-friendly example for GenLayer Boilerplate

from genlayer import *

class HelloGenLayer(gl.Contract):
message: str

def __init__(self):
self.message = "Hello GenLayer!"

@gl.public.view
def get_message(self) -> str:
return self.message

@gl.public.write
def set_message(self, new_message: str):
self.message = new_message
20 changes: 20 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,23 @@ Accounts are stored in browser's localStorage for development convenience.
- **Player Stats**: View your points and ranking in the community
- **Glass-morphism UI**: Premium dark theme with OKLCH colors, backdrop blur effects, and smooth animations
- **Real-time Updates**: Automatic data fetching with 3-second polling intervals via TanStack Query

## Beginner Example: Hello GenLayer Contract

A minimal beginner-friendly GenLayer contract example added to the boilerplate.

File:
examples/hello_genlayer.py

What it does:
- Stores a simple message string
- Allows reading the message using get_message()
- Allows updating the message using set_message()

Purpose:
This example helps new developers quickly understand:
- Basic GenLayer contract structure
- How to define state variables
- How to create read and write functions
- How to deploy and interact using GenLayer Studio