-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_program_id.py
More file actions
executable file
·39 lines (34 loc) · 1.06 KB
/
get_program_id.py
File metadata and controls
executable file
·39 lines (34 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""
Quick script to generate a Solana Program ID
Run: python3 get_program_id.py
"""
import base58
import secrets
import sys
import os
def generate_program_id():
"""Generate a valid Solana program ID format"""
random_bytes = secrets.token_bytes(32)
program_id = base58.b58encode(random_bytes).decode('ascii')
return program_id
if __name__ == "__main__":
program_id = generate_program_id()
print("")
print("=" * 70)
print("✅ Generated Solana Program ID (for development/testing):")
print("=" * 70)
print("")
print(f"PROGRAM_ID={program_id}")
print("")
print("📝 To use this Program ID:")
print(f" 1. Copy: PROGRAM_ID={program_id}")
print(" 2. Add to backend/.env file")
print("")
print("💡 Quick update command:")
print(f" echo 'PROGRAM_ID={program_id}' >> backend/.env")
print("")
print("⚠️ Note: This is a generated ID for testing.")
print(" For production, deploy your smart contract to get a real Program ID.")
print("=" * 70)
print("")