lunalib 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lunalib-1.1.0/PKG-INFO +283 -0
- lunalib-1.1.0/README.md +224 -0
- lunalib-1.1.0/lunalib/__init__.py +19 -0
- lunalib-1.1.0/lunalib/cli.py +18 -0
- lunalib-1.1.0/lunalib/core/__init__.py +0 -0
- lunalib-1.1.0/lunalib/core/blockchain.py +451 -0
- lunalib-1.1.0/lunalib/core/crypto.py +32 -0
- lunalib-1.1.0/lunalib/core/mempool.py +340 -0
- lunalib-1.1.0/lunalib/core/wallet.py +635 -0
- lunalib-1.1.0/lunalib/gtx/__init__.py +0 -0
- lunalib-1.1.0/lunalib/gtx/bill_registry.py +122 -0
- lunalib-1.1.0/lunalib/gtx/digital_bill.py +273 -0
- lunalib-1.1.0/lunalib/gtx/genesis.py +349 -0
- lunalib-1.1.0/lunalib/luna_lib.py +77 -0
- lunalib-1.1.0/lunalib/mining/__init__.py +0 -0
- lunalib-1.1.0/lunalib/mining/cuda_manager.py +137 -0
- lunalib-1.1.0/lunalib/mining/difficulty.py +106 -0
- lunalib-1.1.0/lunalib/mining/miner.py +107 -0
- lunalib-1.1.0/lunalib/requirements.txt +44 -0
- lunalib-1.1.0/lunalib/storage/__init__.py +0 -0
- lunalib-1.1.0/lunalib/storage/cache.py +148 -0
- lunalib-1.1.0/lunalib/storage/database.py +222 -0
- lunalib-1.1.0/lunalib/storage/encryption.py +105 -0
- lunalib-1.1.0/lunalib/transactions/__init__.py +0 -0
- lunalib-1.1.0/lunalib/transactions/security.py +172 -0
- lunalib-1.1.0/lunalib/transactions/transactions.py +583 -0
- lunalib-1.1.0/lunalib/transactions/validator.py +71 -0
- lunalib-1.1.0/lunalib.egg-info/PKG-INFO +283 -0
- lunalib-1.1.0/lunalib.egg-info/SOURCES.txt +33 -0
- lunalib-1.1.0/lunalib.egg-info/dependency_links.txt +1 -0
- lunalib-1.1.0/lunalib.egg-info/entry_points.txt +2 -0
- lunalib-1.1.0/lunalib.egg-info/requires.txt +19 -0
- lunalib-1.1.0/lunalib.egg-info/top_level.txt +1 -0
- lunalib-1.1.0/setup.cfg +4 -0
- lunalib-1.1.0/setup.py +65 -0
lunalib-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lunalib
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A Complete Cryptocurrency Wallet and Mining System
|
|
5
|
+
Home-page: https://github.com/taellinglin/LunaLib
|
|
6
|
+
Author: Ling Lin
|
|
7
|
+
Author-email: taellinglin@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/taellinglin/LunaLib/issues
|
|
10
|
+
Project-URL: Documentation, https://linglin.art/docs/luna-lib
|
|
11
|
+
Project-URL: Source Code, https://github.com/taellinglin/LunaLib
|
|
12
|
+
Keywords: cryptocurrency,blockchain,wallet,mining,bitcoin,ethereum,crypto
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Topic :: Security :: Cryptography
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
26
|
+
Requires-Python: >=3.7
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
Requires-Dist: requests>=2.31.0
|
|
29
|
+
Requires-Dist: cryptography>=41.0.0
|
|
30
|
+
Requires-Dist: qrcode[pil]>=7.4.0
|
|
31
|
+
Requires-Dist: Pillow>=10.0.0
|
|
32
|
+
Requires-Dist: pytest>=7.4.0
|
|
33
|
+
Requires-Dist: pytest-cov>=4.1.0
|
|
34
|
+
Requires-Dist: pytest-mock>=3.11.0
|
|
35
|
+
Requires-Dist: coverage>=7.0.0
|
|
36
|
+
Requires-Dist: black>=23.0.0
|
|
37
|
+
Requires-Dist: flake8>=6.0.0
|
|
38
|
+
Requires-Dist: mypy>=1.5.0
|
|
39
|
+
Requires-Dist: isort>=5.12.0
|
|
40
|
+
Requires-Dist: bandit>=1.7.0
|
|
41
|
+
Requires-Dist: build>=0.10.0
|
|
42
|
+
Requires-Dist: twine>=4.0.0
|
|
43
|
+
Requires-Dist: sphinx>=7.0.0
|
|
44
|
+
Requires-Dist: sphinx-rtd-theme>=1.3.0
|
|
45
|
+
Requires-Dist: types-requests>=2.31.0
|
|
46
|
+
Requires-Dist: typing-extensions>=4.8.0
|
|
47
|
+
Dynamic: author
|
|
48
|
+
Dynamic: author-email
|
|
49
|
+
Dynamic: classifier
|
|
50
|
+
Dynamic: description
|
|
51
|
+
Dynamic: description-content-type
|
|
52
|
+
Dynamic: home-page
|
|
53
|
+
Dynamic: keywords
|
|
54
|
+
Dynamic: license
|
|
55
|
+
Dynamic: project-url
|
|
56
|
+
Dynamic: requires-dist
|
|
57
|
+
Dynamic: requires-python
|
|
58
|
+
Dynamic: summary
|
|
59
|
+
|
|
60
|
+
# Luna Library
|
|
61
|
+
|
|
62
|
+
**A Complete Cryptocurrency Wallet and Mining System**
|
|
63
|
+
*Developed by Ling Lin • [LingLin.Art](https://linglin.art) • LingLin.Art, LLC*
|
|
64
|
+
|
|
65
|
+
[](https://opensource.org/licenses/MIT)
|
|
66
|
+
[](https://www.python.org/downloads/)
|
|
67
|
+
[]()
|
|
68
|
+
|
|
69
|
+
## 🌟 Overview
|
|
70
|
+
|
|
71
|
+
Luna Library is a comprehensive cryptocurrency system featuring secure wallet management, GTX Genesis digital bill mining, and blockchain transaction processing. Built with security and performance in mind, it provides the foundation for cryptocurrency applications including wallets, casinos, nodes, and treasury systems.
|
|
72
|
+
|
|
73
|
+
## 🚀 Features
|
|
74
|
+
|
|
75
|
+
### 💰 Wallet Management
|
|
76
|
+
- **Secure Key Generation**: Cryptographically secure private/public key pairs
|
|
77
|
+
- **Encrypted Storage**: AES-256 encrypted wallet files with password protection
|
|
78
|
+
- **Multi-Wallet Support**: Manage multiple wallets with individual labels
|
|
79
|
+
- **Import/Export**: Backup and restore wallets using private keys
|
|
80
|
+
- **Transaction History**: Complete transaction tracking and balance management
|
|
81
|
+
|
|
82
|
+
### ⛏️ GTX Genesis Mining
|
|
83
|
+
- **Digital Bill Mining**: Mine GTX Genesis bills with denomination-based difficulty
|
|
84
|
+
- **Proof-of-Work**: Configurable difficulty (2-10 leading zeros) based on bill value
|
|
85
|
+
- **CUDA Acceleration**: GPU-accelerated mining for improved performance
|
|
86
|
+
- **Bill Registry**: Track mined bills with verification URLs and metadata
|
|
87
|
+
- **1:1 Luna Value**: Each GTX bill denomination equals equivalent Luna value
|
|
88
|
+
|
|
89
|
+
### 🔗 Blockchain Integration
|
|
90
|
+
- **Network Connectivity**: Connect to Luna blockchain nodes
|
|
91
|
+
- **Transaction Broadcasting**: Send signed transactions to the network
|
|
92
|
+
- **Blockchain Scanning**: Efficient blockchain scanning for address activity
|
|
93
|
+
- **Mempool Monitoring**: Real-time transaction pool monitoring
|
|
94
|
+
- **Caching System**: Optimized caching for improved performance
|
|
95
|
+
|
|
96
|
+
### 🔒 Security & Validation
|
|
97
|
+
- **Cryptographic Signing**: Secure transaction signing with ECDSA
|
|
98
|
+
- **Transaction Validation**: Comprehensive security validation for all transaction types
|
|
99
|
+
- **Anti-Spam Protection**: Rate limiting and blacklisting capabilities
|
|
100
|
+
- **Risk Assessment**: Transaction risk level evaluation
|
|
101
|
+
- **Network Security**: Protection against malicious activities
|
|
102
|
+
|
|
103
|
+
## 📦 Installation
|
|
104
|
+
|
|
105
|
+
### Prerequisites
|
|
106
|
+
- Python 3.7 or higher
|
|
107
|
+
- pip (Python package manager)
|
|
108
|
+
|
|
109
|
+
### Install from Source
|
|
110
|
+
|
|
111
|
+
1. **Clone the repository**:
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/linglin-art/luna_lib.git
|
|
114
|
+
cd luna_lib
|
|
115
|
+
```
|
|
116
|
+
2. **Install Requirements**
|
|
117
|
+
```bash
|
|
118
|
+
pip install -r requirements.txt
|
|
119
|
+
```
|
|
120
|
+
3. **Install with Pip**
|
|
121
|
+
```bash
|
|
122
|
+
pip install -e .
|
|
123
|
+
```
|
|
124
|
+
Optional: **CUDA Support**
|
|
125
|
+
```bash
|
|
126
|
+
Optional: CUDA Support
|
|
127
|
+
|
|
128
|
+
For GPU-accelerated mining, install CUDA dependencies:
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
## Basic Usage:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from luna_lib import LunaWallet, GenesisMiner, GTXGenesis
|
|
136
|
+
|
|
137
|
+
# Create a new wallet
|
|
138
|
+
wallet = LunaWallet()
|
|
139
|
+
wallet_data = wallet.create_wallet("My Wallet", "secure_password")
|
|
140
|
+
|
|
141
|
+
print(f"Wallet created: {wallet_data['address']}")
|
|
142
|
+
|
|
143
|
+
# Initialize miner
|
|
144
|
+
miner = GenesisMiner()
|
|
145
|
+
|
|
146
|
+
# Mine a GTX $1000 bill
|
|
147
|
+
bill = miner.mine_bill(1000, wallet_data['address'])
|
|
148
|
+
|
|
149
|
+
if bill['success']:
|
|
150
|
+
print(f"✅ Mined GTX ${bill['denomination']:,} bill!")
|
|
151
|
+
print(f"💰 Luna value: {bill['luna_value']:,}")
|
|
152
|
+
print(f"🔗 Verification: {bill.get('verification_url', 'N/A')}")
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Advanced Usage
|
|
156
|
+
```python
|
|
157
|
+
from luna_lib import GTXGenesis, BlockchainManager
|
|
158
|
+
from luna_lib.gtx.bill_registry import BillRegistry
|
|
159
|
+
|
|
160
|
+
# Check GTX portfolio
|
|
161
|
+
gtx = GTXGenesis()
|
|
162
|
+
portfolio = gtx.get_user_portfolio(wallet_data['address'])
|
|
163
|
+
|
|
164
|
+
print(f"Total GTX bills: {portfolio['total_bills']}")
|
|
165
|
+
print(f"Total Luna value: {portfolio['total_luna_value']:,}")
|
|
166
|
+
|
|
167
|
+
# Scan blockchain for transactions
|
|
168
|
+
blockchain = BlockchainManager()
|
|
169
|
+
transactions = blockchain.scan_transactions_for_address(wallet_data['address'])
|
|
170
|
+
|
|
171
|
+
print(f"Found {len(transactions)} transactions")
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
## Project Structure
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
luna_lib/
|
|
178
|
+
├── core/ # Core wallet and blockchain functionality
|
|
179
|
+
│ ├── wallet.py # Wallet management
|
|
180
|
+
│ ├── blockchain.py # Blockchain interactions
|
|
181
|
+
│ └── crypto.py # Cryptographic operations
|
|
182
|
+
├── mining/ # Mining-related components
|
|
183
|
+
│ ├── miner.py # Genesis bill miner
|
|
184
|
+
│ ├── difficulty.py # Difficulty calculations
|
|
185
|
+
│ └── cuda_manager.py # GPU acceleration
|
|
186
|
+
├── gtx/ # GTX Genesis system
|
|
187
|
+
│ ├── genesis.py # Main GTX manager
|
|
188
|
+
│ ├── digital_bill.py # Digital bill representation
|
|
189
|
+
│ └── bill_registry.py # Bill database
|
|
190
|
+
├── transactions/ # Transaction processing
|
|
191
|
+
│ ├── transaction.py # Transaction creation
|
|
192
|
+
│ ├── security.py # Security validation
|
|
193
|
+
│ └── validator.py # Transaction validation
|
|
194
|
+
└── storage/ # Data storage
|
|
195
|
+
├── database.py # Wallet database
|
|
196
|
+
├── cache.py # Blockchain cache
|
|
197
|
+
└── encryption.py # Encryption utilities
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
# **API Reference**
|
|
202
|
+
Core Classes
|
|
203
|
+
|
|
204
|
+
LunaWallet: Main wallet management class
|
|
205
|
+
|
|
206
|
+
GenesisMiner: GTX Genesis bill mining
|
|
207
|
+
|
|
208
|
+
GTXGenesis: GTX bill management and verification
|
|
209
|
+
|
|
210
|
+
BlockchainManager: Blockchain interactions
|
|
211
|
+
|
|
212
|
+
TransactionManager: Transaction creation and signing
|
|
213
|
+
|
|
214
|
+
## ***Key Methods***
|
|
215
|
+
### **Wallet Management**
|
|
216
|
+
```python
|
|
217
|
+
wallet.create_wallet(label, password) # Create new wallet
|
|
218
|
+
wallet.unlock_wallet(address, password) # Unlock existing wallet
|
|
219
|
+
wallet.export_private_key(address, password) # Export private key
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## ***Mining***
|
|
223
|
+
```python
|
|
224
|
+
miner.mine_bill(denomination, address) # Mine single bill
|
|
225
|
+
miner.start_auto_mining(denominations, address) # Auto-mine multiple bills
|
|
226
|
+
miner.stop_mining() # Stop mining operations
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## **GTX Management**
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
gtx.verify_bill(bill_serial) # Verify bill authenticity
|
|
233
|
+
gtx.get_user_portfolio(address) # Get user's GTX portfolio
|
|
234
|
+
gtx.transfer_bill(bill_serial, from_addr, to_addr, priv_key) # Transfer bill
|
|
235
|
+
```
|
|
236
|
+
# Configuration
|
|
237
|
+
## **Environment Variables**
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
export LUNA_ENDPOINT_URL="https://bank.linglin.art" # Blockchain endpoint
|
|
241
|
+
export LUNA_DATA_DIR="$HOME/.luna_wallet" # Data directory
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## **Bill Denominations**
|
|
245
|
+
|
|
246
|
+
Supported GTX Genesis bill denominations:
|
|
247
|
+
```bash
|
|
248
|
+
$1 (Difficulty: 2 zeros)
|
|
249
|
+
$10 (Difficulty: 3 zeros)
|
|
250
|
+
$100 (Difficulty: 4 zeros)
|
|
251
|
+
$1,000 (Difficulty: 5 zeros)
|
|
252
|
+
$10,000 (Difficulty: 6 zeros)
|
|
253
|
+
$100,000 (Difficulty: 7 zeros)
|
|
254
|
+
$1,000,000 (Difficulty: 8 zeros)
|
|
255
|
+
$10,000,000 (Difficulty: 9 zeros)
|
|
256
|
+
$100,000,000 (Difficulty: 10 zeros)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### **Contributing**
|
|
260
|
+
|
|
261
|
+
We welcome contributions! Please see our Contributing Guidelines for details.
|
|
262
|
+
|
|
263
|
+
- Fork the repository
|
|
264
|
+
|
|
265
|
+
- Create a feature branch (git checkout -b feature/amazing-feature)
|
|
266
|
+
|
|
267
|
+
- Commit your changes (git commit -m 'Add amazing feature')
|
|
268
|
+
|
|
269
|
+
- Push to the branch (git push origin feature/amazing-feature)
|
|
270
|
+
|
|
271
|
+
- Open a Pull Request
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
275
|
+
|
|
276
|
+
### Support
|
|
277
|
+
|
|
278
|
+
Email: taellinglin@gmail.com
|
|
279
|
+
Website: LingLin.Art
|
|
280
|
+
|
|
281
|
+
Built with ❤️ by Ling Lin and the LingLin.Art, LLC team
|
|
282
|
+
|
|
283
|
+
Luna Library • Empowering the future of digital currency • LingLin.Art
|
lunalib-1.1.0/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Luna Library
|
|
2
|
+
|
|
3
|
+
**A Complete Cryptocurrency Wallet and Mining System**
|
|
4
|
+
*Developed by Ling Lin • [LingLin.Art](https://linglin.art) • LingLin.Art, LLC*
|
|
5
|
+
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.python.org/downloads/)
|
|
8
|
+
[]()
|
|
9
|
+
|
|
10
|
+
## 🌟 Overview
|
|
11
|
+
|
|
12
|
+
Luna Library is a comprehensive cryptocurrency system featuring secure wallet management, GTX Genesis digital bill mining, and blockchain transaction processing. Built with security and performance in mind, it provides the foundation for cryptocurrency applications including wallets, casinos, nodes, and treasury systems.
|
|
13
|
+
|
|
14
|
+
## 🚀 Features
|
|
15
|
+
|
|
16
|
+
### 💰 Wallet Management
|
|
17
|
+
- **Secure Key Generation**: Cryptographically secure private/public key pairs
|
|
18
|
+
- **Encrypted Storage**: AES-256 encrypted wallet files with password protection
|
|
19
|
+
- **Multi-Wallet Support**: Manage multiple wallets with individual labels
|
|
20
|
+
- **Import/Export**: Backup and restore wallets using private keys
|
|
21
|
+
- **Transaction History**: Complete transaction tracking and balance management
|
|
22
|
+
|
|
23
|
+
### ⛏️ GTX Genesis Mining
|
|
24
|
+
- **Digital Bill Mining**: Mine GTX Genesis bills with denomination-based difficulty
|
|
25
|
+
- **Proof-of-Work**: Configurable difficulty (2-10 leading zeros) based on bill value
|
|
26
|
+
- **CUDA Acceleration**: GPU-accelerated mining for improved performance
|
|
27
|
+
- **Bill Registry**: Track mined bills with verification URLs and metadata
|
|
28
|
+
- **1:1 Luna Value**: Each GTX bill denomination equals equivalent Luna value
|
|
29
|
+
|
|
30
|
+
### 🔗 Blockchain Integration
|
|
31
|
+
- **Network Connectivity**: Connect to Luna blockchain nodes
|
|
32
|
+
- **Transaction Broadcasting**: Send signed transactions to the network
|
|
33
|
+
- **Blockchain Scanning**: Efficient blockchain scanning for address activity
|
|
34
|
+
- **Mempool Monitoring**: Real-time transaction pool monitoring
|
|
35
|
+
- **Caching System**: Optimized caching for improved performance
|
|
36
|
+
|
|
37
|
+
### 🔒 Security & Validation
|
|
38
|
+
- **Cryptographic Signing**: Secure transaction signing with ECDSA
|
|
39
|
+
- **Transaction Validation**: Comprehensive security validation for all transaction types
|
|
40
|
+
- **Anti-Spam Protection**: Rate limiting and blacklisting capabilities
|
|
41
|
+
- **Risk Assessment**: Transaction risk level evaluation
|
|
42
|
+
- **Network Security**: Protection against malicious activities
|
|
43
|
+
|
|
44
|
+
## 📦 Installation
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
- Python 3.7 or higher
|
|
48
|
+
- pip (Python package manager)
|
|
49
|
+
|
|
50
|
+
### Install from Source
|
|
51
|
+
|
|
52
|
+
1. **Clone the repository**:
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/linglin-art/luna_lib.git
|
|
55
|
+
cd luna_lib
|
|
56
|
+
```
|
|
57
|
+
2. **Install Requirements**
|
|
58
|
+
```bash
|
|
59
|
+
pip install -r requirements.txt
|
|
60
|
+
```
|
|
61
|
+
3. **Install with Pip**
|
|
62
|
+
```bash
|
|
63
|
+
pip install -e .
|
|
64
|
+
```
|
|
65
|
+
Optional: **CUDA Support**
|
|
66
|
+
```bash
|
|
67
|
+
Optional: CUDA Support
|
|
68
|
+
|
|
69
|
+
For GPU-accelerated mining, install CUDA dependencies:
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Basic Usage:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from luna_lib import LunaWallet, GenesisMiner, GTXGenesis
|
|
77
|
+
|
|
78
|
+
# Create a new wallet
|
|
79
|
+
wallet = LunaWallet()
|
|
80
|
+
wallet_data = wallet.create_wallet("My Wallet", "secure_password")
|
|
81
|
+
|
|
82
|
+
print(f"Wallet created: {wallet_data['address']}")
|
|
83
|
+
|
|
84
|
+
# Initialize miner
|
|
85
|
+
miner = GenesisMiner()
|
|
86
|
+
|
|
87
|
+
# Mine a GTX $1000 bill
|
|
88
|
+
bill = miner.mine_bill(1000, wallet_data['address'])
|
|
89
|
+
|
|
90
|
+
if bill['success']:
|
|
91
|
+
print(f"✅ Mined GTX ${bill['denomination']:,} bill!")
|
|
92
|
+
print(f"💰 Luna value: {bill['luna_value']:,}")
|
|
93
|
+
print(f"🔗 Verification: {bill.get('verification_url', 'N/A')}")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Advanced Usage
|
|
97
|
+
```python
|
|
98
|
+
from luna_lib import GTXGenesis, BlockchainManager
|
|
99
|
+
from luna_lib.gtx.bill_registry import BillRegistry
|
|
100
|
+
|
|
101
|
+
# Check GTX portfolio
|
|
102
|
+
gtx = GTXGenesis()
|
|
103
|
+
portfolio = gtx.get_user_portfolio(wallet_data['address'])
|
|
104
|
+
|
|
105
|
+
print(f"Total GTX bills: {portfolio['total_bills']}")
|
|
106
|
+
print(f"Total Luna value: {portfolio['total_luna_value']:,}")
|
|
107
|
+
|
|
108
|
+
# Scan blockchain for transactions
|
|
109
|
+
blockchain = BlockchainManager()
|
|
110
|
+
transactions = blockchain.scan_transactions_for_address(wallet_data['address'])
|
|
111
|
+
|
|
112
|
+
print(f"Found {len(transactions)} transactions")
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
## Project Structure
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
luna_lib/
|
|
119
|
+
├── core/ # Core wallet and blockchain functionality
|
|
120
|
+
│ ├── wallet.py # Wallet management
|
|
121
|
+
│ ├── blockchain.py # Blockchain interactions
|
|
122
|
+
│ └── crypto.py # Cryptographic operations
|
|
123
|
+
├── mining/ # Mining-related components
|
|
124
|
+
│ ├── miner.py # Genesis bill miner
|
|
125
|
+
│ ├── difficulty.py # Difficulty calculations
|
|
126
|
+
│ └── cuda_manager.py # GPU acceleration
|
|
127
|
+
├── gtx/ # GTX Genesis system
|
|
128
|
+
│ ├── genesis.py # Main GTX manager
|
|
129
|
+
│ ├── digital_bill.py # Digital bill representation
|
|
130
|
+
│ └── bill_registry.py # Bill database
|
|
131
|
+
├── transactions/ # Transaction processing
|
|
132
|
+
│ ├── transaction.py # Transaction creation
|
|
133
|
+
│ ├── security.py # Security validation
|
|
134
|
+
│ └── validator.py # Transaction validation
|
|
135
|
+
└── storage/ # Data storage
|
|
136
|
+
├── database.py # Wallet database
|
|
137
|
+
├── cache.py # Blockchain cache
|
|
138
|
+
└── encryption.py # Encryption utilities
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
# **API Reference**
|
|
143
|
+
Core Classes
|
|
144
|
+
|
|
145
|
+
LunaWallet: Main wallet management class
|
|
146
|
+
|
|
147
|
+
GenesisMiner: GTX Genesis bill mining
|
|
148
|
+
|
|
149
|
+
GTXGenesis: GTX bill management and verification
|
|
150
|
+
|
|
151
|
+
BlockchainManager: Blockchain interactions
|
|
152
|
+
|
|
153
|
+
TransactionManager: Transaction creation and signing
|
|
154
|
+
|
|
155
|
+
## ***Key Methods***
|
|
156
|
+
### **Wallet Management**
|
|
157
|
+
```python
|
|
158
|
+
wallet.create_wallet(label, password) # Create new wallet
|
|
159
|
+
wallet.unlock_wallet(address, password) # Unlock existing wallet
|
|
160
|
+
wallet.export_private_key(address, password) # Export private key
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## ***Mining***
|
|
164
|
+
```python
|
|
165
|
+
miner.mine_bill(denomination, address) # Mine single bill
|
|
166
|
+
miner.start_auto_mining(denominations, address) # Auto-mine multiple bills
|
|
167
|
+
miner.stop_mining() # Stop mining operations
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## **GTX Management**
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
gtx.verify_bill(bill_serial) # Verify bill authenticity
|
|
174
|
+
gtx.get_user_portfolio(address) # Get user's GTX portfolio
|
|
175
|
+
gtx.transfer_bill(bill_serial, from_addr, to_addr, priv_key) # Transfer bill
|
|
176
|
+
```
|
|
177
|
+
# Configuration
|
|
178
|
+
## **Environment Variables**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
export LUNA_ENDPOINT_URL="https://bank.linglin.art" # Blockchain endpoint
|
|
182
|
+
export LUNA_DATA_DIR="$HOME/.luna_wallet" # Data directory
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## **Bill Denominations**
|
|
186
|
+
|
|
187
|
+
Supported GTX Genesis bill denominations:
|
|
188
|
+
```bash
|
|
189
|
+
$1 (Difficulty: 2 zeros)
|
|
190
|
+
$10 (Difficulty: 3 zeros)
|
|
191
|
+
$100 (Difficulty: 4 zeros)
|
|
192
|
+
$1,000 (Difficulty: 5 zeros)
|
|
193
|
+
$10,000 (Difficulty: 6 zeros)
|
|
194
|
+
$100,000 (Difficulty: 7 zeros)
|
|
195
|
+
$1,000,000 (Difficulty: 8 zeros)
|
|
196
|
+
$10,000,000 (Difficulty: 9 zeros)
|
|
197
|
+
$100,000,000 (Difficulty: 10 zeros)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### **Contributing**
|
|
201
|
+
|
|
202
|
+
We welcome contributions! Please see our Contributing Guidelines for details.
|
|
203
|
+
|
|
204
|
+
- Fork the repository
|
|
205
|
+
|
|
206
|
+
- Create a feature branch (git checkout -b feature/amazing-feature)
|
|
207
|
+
|
|
208
|
+
- Commit your changes (git commit -m 'Add amazing feature')
|
|
209
|
+
|
|
210
|
+
- Push to the branch (git push origin feature/amazing-feature)
|
|
211
|
+
|
|
212
|
+
- Open a Pull Request
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
216
|
+
|
|
217
|
+
### Support
|
|
218
|
+
|
|
219
|
+
Email: taellinglin@gmail.com
|
|
220
|
+
Website: LingLin.Art
|
|
221
|
+
|
|
222
|
+
Built with ❤️ by Ling Lin and the LingLin.Art, LLC team
|
|
223
|
+
|
|
224
|
+
Luna Library • Empowering the future of digital currency • LingLin.Art
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Luna Library - Complete cryptocurrency wallet and mining system
|
|
3
|
+
"""
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from .core.wallet import LunaWallet
|
|
7
|
+
from .mining.miner import GenesisMiner
|
|
8
|
+
from .gtx.genesis import GTXGenesis
|
|
9
|
+
from .transactions.transactions import TransactionManager
|
|
10
|
+
from .core.blockchain import BlockchainManager
|
|
11
|
+
|
|
12
|
+
__version__ = "1.0.0"
|
|
13
|
+
__all__ = [
|
|
14
|
+
'LunaWallet',
|
|
15
|
+
'GenesisMiner',
|
|
16
|
+
'GTXGenesis',
|
|
17
|
+
'TransactionManager',
|
|
18
|
+
'BlockchainManager'
|
|
19
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# lunalib/cli.py
|
|
2
|
+
import argparse
|
|
3
|
+
from .luna_lib import LunaLib
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
"""Command line interface for LunaLib"""
|
|
7
|
+
parser = argparse.ArgumentParser(description="LunaLib Cryptocurrency Wallet")
|
|
8
|
+
parser.add_argument('--version', action='store_true', help='Show version')
|
|
9
|
+
|
|
10
|
+
args = parser.parse_args()
|
|
11
|
+
|
|
12
|
+
if args.version:
|
|
13
|
+
print(f"LunaLib v{LunaLib.get_version()}")
|
|
14
|
+
else:
|
|
15
|
+
print("LunaLib - Use 'luna-wallet --help' for options")
|
|
16
|
+
|
|
17
|
+
if __name__ == "__main__":
|
|
18
|
+
main()
|
|
File without changes
|