@genobank/biofs 2.4.1 → 2.5.1
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.
- package/CHANGELOG.md +2 -0
- package/LICENSE +37 -0
- package/README.md +2 -1
- package/bin/biofs.js +2 -1
- package/contracts/ClaraJobNFT.sol +101 -0
- package/dist/commands/agent/health.js +1 -1
- package/dist/commands/agent/health.js.map +1 -1
- package/dist/commands/agent/list.d.ts +14 -0
- package/dist/commands/agent/list.d.ts.map +1 -0
- package/dist/commands/agent/list.js +101 -0
- package/dist/commands/agent/list.js.map +1 -0
- package/dist/commands/agent/register.d.ts +18 -0
- package/dist/commands/agent/register.d.ts.map +1 -0
- package/dist/commands/agent/register.js +120 -0
- package/dist/commands/agent/register.js.map +1 -0
- package/dist/commands/agent/status.d.ts +14 -0
- package/dist/commands/agent/status.d.ts.map +1 -0
- package/dist/commands/agent/status.js +151 -0
- package/dist/commands/agent/status.js.map +1 -0
- package/dist/commands/annotate/status.d.ts +11 -0
- package/dist/commands/annotate/status.d.ts.map +1 -0
- package/dist/commands/annotate/status.js +123 -0
- package/dist/commands/annotate/status.js.map +1 -0
- package/dist/commands/annotate/submit.d.ts +23 -0
- package/dist/commands/annotate/submit.d.ts.map +1 -0
- package/dist/commands/annotate/submit.js +296 -0
- package/dist/commands/annotate/submit.js.map +1 -0
- package/dist/commands/family-status.d.ts +12 -0
- package/dist/commands/family-status.d.ts.map +1 -0
- package/dist/commands/family-status.js +220 -0
- package/dist/commands/family-status.js.map +1 -0
- package/dist/commands/job/status.d.ts +1 -0
- package/dist/commands/job/status.d.ts.map +1 -1
- package/dist/commands/job/status.js.map +1 -1
- package/dist/commands/link-clara.d.ts +20 -0
- package/dist/commands/link-clara.d.ts.map +1 -0
- package/dist/commands/link-clara.js +234 -0
- package/dist/commands/link-clara.js.map +1 -0
- package/dist/commands/mount-remote.d.ts +1 -1
- package/dist/commands/mount-remote.js +1 -1
- package/dist/commands/payment/balance.d.ts +12 -0
- package/dist/commands/payment/balance.d.ts.map +1 -0
- package/dist/commands/payment/balance.js +101 -0
- package/dist/commands/payment/balance.js.map +1 -0
- package/dist/commands/payment/faucet.d.ts +11 -0
- package/dist/commands/payment/faucet.d.ts.map +1 -0
- package/dist/commands/payment/faucet.js +92 -0
- package/dist/commands/payment/faucet.js.map +1 -0
- package/dist/commands/payment/history.d.ts +27 -0
- package/dist/commands/payment/history.d.ts.map +1 -0
- package/dist/commands/payment/history.js +162 -0
- package/dist/commands/payment/history.js.map +1 -0
- package/dist/commands/payment/pricing.d.ts +12 -0
- package/dist/commands/payment/pricing.d.ts.map +1 -0
- package/dist/commands/payment/pricing.js +65 -0
- package/dist/commands/payment/pricing.js.map +1 -0
- package/dist/commands/payment/setup.d.ts +25 -0
- package/dist/commands/payment/setup.d.ts.map +1 -0
- package/dist/commands/payment/setup.js +155 -0
- package/dist/commands/payment/setup.js.map +1 -0
- package/dist/commands/tokenize-biosample.d.ts +19 -0
- package/dist/commands/tokenize-biosample.d.ts.map +1 -0
- package/dist/commands/tokenize-biosample.js +253 -0
- package/dist/commands/tokenize-biosample.js.map +1 -0
- package/dist/index.js +281 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/api/bionft-client.d.ts +35 -7
- package/dist/lib/api/bionft-client.d.ts.map +1 -1
- package/dist/lib/api/bionft-client.js +106 -16
- package/dist/lib/api/bionft-client.js.map +1 -1
- package/dist/lib/kite/agent.d.ts +85 -0
- package/dist/lib/kite/agent.d.ts.map +1 -0
- package/dist/lib/kite/agent.js +332 -0
- package/dist/lib/kite/agent.js.map +1 -0
- package/dist/lib/kite/index.d.ts +9 -0
- package/dist/lib/kite/index.d.ts.map +1 -0
- package/dist/lib/kite/index.js +25 -0
- package/dist/lib/kite/index.js.map +1 -0
- package/dist/lib/kite/passport.d.ts +69 -0
- package/dist/lib/kite/passport.d.ts.map +1 -0
- package/dist/lib/kite/passport.js +312 -0
- package/dist/lib/kite/passport.js.map +1 -0
- package/dist/lib/x402/client.d.ts +78 -0
- package/dist/lib/x402/client.d.ts.map +1 -0
- package/dist/lib/x402/client.js +298 -0
- package/dist/lib/x402/client.js.map +1 -0
- package/dist/lib/x402/index.d.ts +9 -0
- package/dist/lib/x402/index.d.ts.map +1 -0
- package/dist/lib/x402/index.js +37 -0
- package/dist/lib/x402/index.js.map +1 -0
- package/dist/lib/x402/middleware.d.ts +37 -0
- package/dist/lib/x402/middleware.d.ts.map +1 -0
- package/dist/lib/x402/middleware.js +220 -0
- package/dist/lib/x402/middleware.js.map +1 -0
- package/dist/types/kite.d.ts +157 -0
- package/dist/types/kite.d.ts.map +1 -0
- package/dist/types/kite.js +107 -0
- package/dist/types/kite.js.map +1 -0
- package/dist/types/x402.d.ts +78 -0
- package/dist/types/x402.d.ts.map +1 -0
- package/dist/types/x402.js +79 -0
- package/dist/types/x402.js.map +1 -0
- package/docs/AI_AGENT_MCP_MANUAL.md +1029 -0
- package/docs/USER_MANUAL.md +603 -0
- package/docs/technical-details.html +555 -0
- package/lib/bionfs-client.js +2 -0
- package/lib/consent-manager.js +2 -0
- package/lib/consent-prompt.js +2 -0
- package/package.json +9 -3
- package/presentation/biofs-x402-kite-presentation.html +813 -0
- package/scripts/build_annotator_dictionary.py +1 -0
- package/scripts/deploy-clara-nft.js +37 -0
- package/test-complete-flow.sh +1 -1
- package/test.vcf +1 -0
- package/test_23andme.txt +1 -0
- package/ADMIN_REGISTER_LAB.md +0 -252
- package/ANNOTATOR_RECOMMENDATIONS_API.md +0 -490
- package/BIOFS_QUICK_START.md +0 -200
- package/BIOFS_TOKENIZE_COMPLETE.md +0 -541
- package/BIOFS_V1.2.7_PUBLISHED.md +0 -317
- package/BIOFS_V1.2.9_FIXES.md +0 -306
- package/BIOFS_V1.3.0_DIRECT_GRANT.md +0 -381
- package/BIOFS_V1.3.1_GRANTED_FILES.md +0 -328
- package/BIONFS_DEPLOYMENT_GUIDE.md +0 -408
- package/BIONFS_MOUNT_INTEGRATION_PLAN.md +0 -415
- package/BIONFS_PROTOCOL_SPECIFICATION.md +0 -688
- package/BIONFS_SEQUENTIAS_INTEGRATION.md +0 -457
- package/BIONFT_GATED_REMOTE_MOUNTING.md +0 -1260
- package/BIONFT_NFS_PROTOCOL_ARCHITECTURE.md +0 -583
- package/BIOOS_CLI_IMPLEMENTATION_COMPLETE.md +0 -422
- package/BIOOS_JOB_MANAGEMENT.md +0 -681
- package/BUGFIX_V2.1.3.md +0 -72
- package/CHANGELOG_V2.1.0.md +0 -386
- package/CHANGELOG_V2.2.0.md +0 -284
- package/ENHANCEMENT_DOCUMENTATION.md +0 -218
- package/GDPR_BIONFS_CONSENT_ARCHITECTURE.md +0 -798
- package/GDPR_BIONFS_IMPLEMENTATION_STATUS.md +0 -462
- package/INSTALL_V1.2.7_ON_MAC.md +0 -306
- package/LABNFT_BIOFS_INTEGRATION.md +0 -396
- package/OPENCRAVAT_ANNOTATORS_REFERENCE.md +0 -340
- package/OPENCRAVAT_ANNOTATOR_INTELLIGENCE_COMPLETE.md +0 -479
- package/QUICK_START_V2.1.0.md +0 -116
- package/RELEASE_SUMMARY_V1.2.7.md +0 -479
- package/RELEASE_SUMMARY_V1.3.0.md +0 -324
- package/SEQUENTIAS_PROTOCOL_ARCHITECTURE.md +0 -880
- package/SEQUENTIA_MIGRATION_GUIDE.md +0 -337
- package/SESSION_SUMMARY_DIRECT_GRANT.md +0 -321
- package/ULTRATHINK_BIONFS_COMPLETE.md +0 -458
- package/WEB3FUSE_LICENSE_TOKEN_ANALYSIS.md +0 -494
- package/WHERE_PERMISSIONS_LIVE.md +0 -165
- package/config.json +0 -21
- package/opencravat_annotators_dictionary.json +0 -2356
- package/package.json.working.v1.9.2.20251105_023952 +0 -48
package/CHANGELOG_V2.2.0.md
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
# BioFS-CLI v2.2.0 Changelog
|
|
2
|
-
|
|
3
|
-
## Release Date: November 12, 2025
|
|
4
|
-
|
|
5
|
-
## 🎯 Major Features
|
|
6
|
-
|
|
7
|
-
### LabNFT Integration Complete
|
|
8
|
-
|
|
9
|
-
Fully integrated LabNFT smart contract with BioFS-CLI and GenoBank API for unified lab registration and verification.
|
|
10
|
-
|
|
11
|
-
#### New LabNFT Module
|
|
12
|
-
|
|
13
|
-
- **File:** `/src/lib/sequentia/LabNFT.ts`
|
|
14
|
-
- **Features:**
|
|
15
|
-
- Full Sequentia LabNFT contract integration
|
|
16
|
-
- EIP-55 checksummed addresses
|
|
17
|
-
- GDPR consent hash generation
|
|
18
|
-
- Lab type enums (LAB, RESEARCHER, INSTITUTION)
|
|
19
|
-
- Access level management (Research, Clinical, Commercial)
|
|
20
|
-
- GA4GH compliance levels
|
|
21
|
-
|
|
22
|
-
#### New Commands
|
|
23
|
-
|
|
24
|
-
1. **`biofs admin register-lab`** (Updated)
|
|
25
|
-
- Now calls unified GenoBank `/register_lab` API
|
|
26
|
-
- Automatic LabNFT minting on registration
|
|
27
|
-
- Supports custodial wallet generation
|
|
28
|
-
- Website information extraction
|
|
29
|
-
- Stores in unified `labs` MongoDB collection
|
|
30
|
-
|
|
31
|
-
2. **`biofs admin verify-lab`** (New)
|
|
32
|
-
- Verify LabNFT ownership on-chain
|
|
33
|
-
- Display complete lab information
|
|
34
|
-
- Check verification and active status
|
|
35
|
-
- Show GDPR consent hashes
|
|
36
|
-
- Display access control settings
|
|
37
|
-
|
|
38
|
-
## 🔧 Breaking Changes
|
|
39
|
-
|
|
40
|
-
### Lab Registration Flow
|
|
41
|
-
|
|
42
|
-
**Before (v2.1.11):**
|
|
43
|
-
- Registered in `lab_wallets` collection
|
|
44
|
-
- No LabNFT minting
|
|
45
|
-
- Placeholder BioPIL DAO integration
|
|
46
|
-
- Manual serial number assignment
|
|
47
|
-
|
|
48
|
-
**After (v2.2.0):**
|
|
49
|
-
- Registers via unified `/register_lab` API
|
|
50
|
-
- Automatic LabNFT minting
|
|
51
|
-
- Stores in `labs` collection
|
|
52
|
-
- Blockchain-verified serial numbers
|
|
53
|
-
|
|
54
|
-
### MongoDB Schema Changes
|
|
55
|
-
|
|
56
|
-
**Old Collections (Deprecated):**
|
|
57
|
-
- `lab_wallets` - Replaced by `labs`
|
|
58
|
-
- Manual permittee tracking
|
|
59
|
-
|
|
60
|
-
**New Collection:**
|
|
61
|
-
- `labs` - Unified lab registry with LabNFT integration
|
|
62
|
-
|
|
63
|
-
**Migration:** All existing labs have been migrated to the new system with LabNFTs minted.
|
|
64
|
-
|
|
65
|
-
## 🚀 API Integration
|
|
66
|
-
|
|
67
|
-
### New API Endpoint
|
|
68
|
-
|
|
69
|
-
**`POST /register_lab`**
|
|
70
|
-
- URL: `https://genobank.app/register_lab`
|
|
71
|
-
- Generates custodial wallets or accepts user wallets
|
|
72
|
-
- Mints LabNFTs automatically
|
|
73
|
-
- Returns complete registration details including private keys (custodial only)
|
|
74
|
-
|
|
75
|
-
### Updated Commands
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Register with custodial wallet
|
|
79
|
-
biofs admin register-lab https://novogene.com --yes
|
|
80
|
-
|
|
81
|
-
# Register with custom details
|
|
82
|
-
biofs admin register-lab https://example.edu \
|
|
83
|
-
--name "Example Genomics Lab" \
|
|
84
|
-
--email contact@example.edu \
|
|
85
|
-
--specialization "cancer genomics" \
|
|
86
|
-
--location "Boston, MA" \
|
|
87
|
-
--lab-type RESEARCHER
|
|
88
|
-
|
|
89
|
-
# Verify lab registration
|
|
90
|
-
biofs admin verify-lab 0x9346be6aD3384EB36c172F8B2bB4b7C9d8afFc07
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## 📋 Smart Contract Details
|
|
94
|
-
|
|
95
|
-
**LabNFT Contract:**
|
|
96
|
-
- Address: `0x24f42752F491540e305384A5C947911649C910CF`
|
|
97
|
-
- Network: Sequentia L1
|
|
98
|
-
- Chain ID: `15132025`
|
|
99
|
-
- RPC: `http://52.90.163.112:8545`
|
|
100
|
-
|
|
101
|
-
**Features:**
|
|
102
|
-
- ERC-721 compliant
|
|
103
|
-
- GDPR consent management (Article 17)
|
|
104
|
-
- Four access levels
|
|
105
|
-
- GA4GH compliance tracking
|
|
106
|
-
- Lab verification status
|
|
107
|
-
- Active/inactive toggle
|
|
108
|
-
|
|
109
|
-
## 🔐 Security Enhancements
|
|
110
|
-
|
|
111
|
-
### GDPR Compliance
|
|
112
|
-
|
|
113
|
-
- **Biodata consent hash:** Stored on-chain as bytes32
|
|
114
|
-
- **Commercial consent hash:** Separate tracking
|
|
115
|
-
- **Right to erasure:** Supported via ConsentManager
|
|
116
|
-
|
|
117
|
-
### Access Control
|
|
118
|
-
|
|
119
|
-
**Access Levels:**
|
|
120
|
-
- Level 0: Research Only
|
|
121
|
-
- Level 1: Clinical Non-Critical
|
|
122
|
-
- Level 2: Clinical Critical
|
|
123
|
-
- Level 3: Commercial
|
|
124
|
-
|
|
125
|
-
**GA4GH Compliance:**
|
|
126
|
-
- Level 0: None
|
|
127
|
-
- Level 1: Basic
|
|
128
|
-
- Level 2: Lite
|
|
129
|
-
- Level 3: Full
|
|
130
|
-
|
|
131
|
-
### Wallet Security
|
|
132
|
-
|
|
133
|
-
- **Custodial wallets:** Private keys encrypted in MongoDB
|
|
134
|
-
- **Claiming workflow:** Labs can claim via email verification
|
|
135
|
-
- **EIP-55 checksumming:** All addresses validated
|
|
136
|
-
|
|
137
|
-
## 📊 Migration Statistics
|
|
138
|
-
|
|
139
|
-
**Completed Migration:**
|
|
140
|
-
- Total labs: 63
|
|
141
|
-
- Labs with LabNFTs: 63 (100%)
|
|
142
|
-
- Custodial wallets: 28
|
|
143
|
-
- User-provided wallets: 35
|
|
144
|
-
- LabNFT serials: #1 - #61
|
|
145
|
-
|
|
146
|
-
## 🐛 Bug Fixes
|
|
147
|
-
|
|
148
|
-
### Fixed Issues
|
|
149
|
-
|
|
150
|
-
1. **Duplicate Collections**
|
|
151
|
-
- Consolidated `lab_wallets`, `permittees`, and `researchers` into single `labs` collection
|
|
152
|
-
- Fixed inconsistent wallet tracking
|
|
153
|
-
|
|
154
|
-
2. **Missing LabNFT Verification**
|
|
155
|
-
- All labs now have LabNFTs minted
|
|
156
|
-
- Blockchain verification enabled
|
|
157
|
-
|
|
158
|
-
3. **Inconsistent Lab Types**
|
|
159
|
-
- Standardized to LAB, RESEARCHER, INSTITUTION enum
|
|
160
|
-
|
|
161
|
-
## 📖 Documentation
|
|
162
|
-
|
|
163
|
-
### New Documentation Files
|
|
164
|
-
|
|
165
|
-
1. **`LABNFT_BIOFS_INTEGRATION.md`**
|
|
166
|
-
- Complete integration guide
|
|
167
|
-
- API usage examples
|
|
168
|
-
- Testing procedures
|
|
169
|
-
- Migration summary
|
|
170
|
-
|
|
171
|
-
2. **`ADMIN_REGISTER_LAB.md`** (Updated)
|
|
172
|
-
- Updated to reflect v2.0 unified API approach
|
|
173
|
-
- New CLI command examples
|
|
174
|
-
- MongoDB schema documentation
|
|
175
|
-
|
|
176
|
-
## 🔄 Dependencies
|
|
177
|
-
|
|
178
|
-
### Updated Packages
|
|
179
|
-
|
|
180
|
-
- `ethers`: ^6.9.0 (LabNFT integration)
|
|
181
|
-
- `axios`: ^1.6.0 (API calls)
|
|
182
|
-
- `@types/node`: ^20.0.0
|
|
183
|
-
|
|
184
|
-
### New Environment Variables Required
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# LabNFT Contract (Sequentia)
|
|
188
|
-
SEQUENTIA_RPC_URL=http://52.90.163.112:8545
|
|
189
|
-
SEQUENTIA_CHAIN_ID=15132025
|
|
190
|
-
SEQUENTIA_EXECUTOR_KEY=0xfaa...
|
|
191
|
-
|
|
192
|
-
# GenoBank API
|
|
193
|
-
GENOBANK_API_URL=https://genobank.app
|
|
194
|
-
ADMIN_SIGNATURE=0xa51...
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## 🚧 Known Issues
|
|
198
|
-
|
|
199
|
-
### Limitations
|
|
200
|
-
|
|
201
|
-
1. **File Sharing Verification**
|
|
202
|
-
- LabNFT verification not yet enforced in `share_file()` endpoint
|
|
203
|
-
- Planned for v2.3.0
|
|
204
|
-
|
|
205
|
-
2. **Lab Claiming Workflow**
|
|
206
|
-
- Email verification for custodial wallets not implemented
|
|
207
|
-
- Planned for v2.3.0
|
|
208
|
-
|
|
209
|
-
3. **Admin Dashboard Integration**
|
|
210
|
-
- LabNFT viewing in admin dashboard pending
|
|
211
|
-
- Planned for v2.3.0
|
|
212
|
-
|
|
213
|
-
## 🎯 Roadmap
|
|
214
|
-
|
|
215
|
-
### v2.3.0 (Planned)
|
|
216
|
-
|
|
217
|
-
1. **File Sharing Integration**
|
|
218
|
-
- Enforce LabNFT verification in file sharing
|
|
219
|
-
- Add access level checks
|
|
220
|
-
- Implement GA4GH compliance validation
|
|
221
|
-
|
|
222
|
-
2. **Lab Claiming Workflow**
|
|
223
|
-
- Email verification system
|
|
224
|
-
- Wallet claiming via dashboard
|
|
225
|
-
- Private key secure transfer
|
|
226
|
-
|
|
227
|
-
3. **Enhanced CLI Commands**
|
|
228
|
-
- `biofs lab list` - List all registered labs
|
|
229
|
-
- `biofs lab update` - Update lab information
|
|
230
|
-
- `biofs lab deactivate` - Deactivate lab
|
|
231
|
-
|
|
232
|
-
4. **Admin Dashboard**
|
|
233
|
-
- View all LabNFTs
|
|
234
|
-
- Approve/verify labs
|
|
235
|
-
- Monitor activity
|
|
236
|
-
|
|
237
|
-
## 🧪 Testing
|
|
238
|
-
|
|
239
|
-
### Test Commands
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
# Build CLI
|
|
243
|
-
cd /home/ubuntu/biofs-cli
|
|
244
|
-
npm run build
|
|
245
|
-
|
|
246
|
-
# Test lab registration
|
|
247
|
-
biofs admin register-lab https://novogene.com --yes
|
|
248
|
-
|
|
249
|
-
# Test verification
|
|
250
|
-
biofs admin verify-lab <wallet_address>
|
|
251
|
-
|
|
252
|
-
# Test API endpoint
|
|
253
|
-
curl -X POST https://genobank.app/register_lab \
|
|
254
|
-
-H "Content-Type: application/json" \
|
|
255
|
-
-d '{"name": "Test Lab", "lab_type": "LAB", "mint_nft": true}'
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
### MongoDB Verification
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
# Check labs collection
|
|
262
|
-
mongosh "mongodb+srv://..." --eval "db.labs.countDocuments()"
|
|
263
|
-
|
|
264
|
-
# Check LabNFT registrations
|
|
265
|
-
mongosh "mongodb+srv://..." --eval "db.labs.countDocuments({'sequentia.registered': true})"
|
|
266
|
-
|
|
267
|
-
# Find lab by wallet
|
|
268
|
-
mongosh "mongodb+srv://..." --eval "db.labs.findOne({owner_wallet: '<wallet>'})"
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
## 👥 Contributors
|
|
272
|
-
|
|
273
|
-
- GenoBank.io Development Team
|
|
274
|
-
- Claude AI (Development Assistant)
|
|
275
|
-
|
|
276
|
-
## 📝 License
|
|
277
|
-
|
|
278
|
-
GenoBank.io - Proprietary
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
**For complete integration details, see `LABNFT_BIOFS_INTEGRATION.md`**
|
|
283
|
-
|
|
284
|
-
**Support:** support@genobank.io | https://github.com/Genobank/biofs-cli
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
# BioFS CLI v1.6.0 - Programmatic Authentication Enhancement
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
BioFS v1.6.0 introduces programmatic authentication via command-line parameters, enabling server-side and CI/CD workflows while maintaining full NFT-gated security.
|
|
6
|
-
|
|
7
|
-
## New Features
|
|
8
|
-
|
|
9
|
-
### Direct Authentication with Wallet & Signature
|
|
10
|
-
|
|
11
|
-
Previously, `biofs login` required interactive browser authentication. Now you can authenticate directly:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
biofs login --wallet <WALLET_ADDRESS> --signature <SIGNATURE>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Use Cases
|
|
18
|
-
|
|
19
|
-
1. **Server-Side Scripts**: Authenticate BioFS in production APIs without browser interaction
|
|
20
|
-
2. **CI/CD Pipelines**: Automated genomic data processing workflows
|
|
21
|
-
3. **Batch Processing**: Process multiple BioFiles programmatically
|
|
22
|
-
4. **API Integration**: Integrate BioFS with backend services
|
|
23
|
-
|
|
24
|
-
## Installation
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install -g @genobank/biofs@1.6.0
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
### Method 1: Direct Authentication (New in v1.6.0)
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Authenticate with wallet and signature
|
|
36
|
-
biofs login --wallet 0x5f5a60eaef242c0d51a21c703f520347b96ed19a \
|
|
37
|
-
--signature 0xa5141ae955bba91ad46a940aefc3b05120489b8b776a180668e5b849f16254d44982fb867724390b388ea3bbc606ab4128e264c7b4d3de4082aeb63c3144af501c
|
|
38
|
-
|
|
39
|
-
# Verify authentication
|
|
40
|
-
biofs whoami
|
|
41
|
-
|
|
42
|
-
# List your BioFiles (NFT-gated)
|
|
43
|
-
biofs files
|
|
44
|
-
|
|
45
|
-
# Download a specific file
|
|
46
|
-
biofs download <biocid> ./output.vcf
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Method 2: Browser Authentication (Still Supported)
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# Traditional browser-based flow
|
|
53
|
-
biofs login # Opens auth.genobank.app in browser
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Environment Variable Pattern
|
|
57
|
-
|
|
58
|
-
For production deployments, store credentials in environment variables:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
# .env file
|
|
62
|
-
BIOFS_WALLET=0x5f5a60eaef242c0d51a21c703f520347b96ed19a
|
|
63
|
-
BIOFS_SIGNATURE=0xa5141ae955bba91ad46a940aefc3b05120489b8b776a180668e5b849f16254d44982fb867724390b388ea3bbc606ab4128e264c7b4d3de4082aeb63c3144af501c
|
|
64
|
-
|
|
65
|
-
# Script usage
|
|
66
|
-
biofs login --wallet $BIOFS_WALLET --signature $BIOFS_SIGNATURE
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Integration Example: Claude AI API with BioFS
|
|
70
|
-
|
|
71
|
-
```python
|
|
72
|
-
# api_claude_ia_researcher_web3.py
|
|
73
|
-
import os
|
|
74
|
-
import subprocess
|
|
75
|
-
|
|
76
|
-
class ClaudeGenomicAPI:
|
|
77
|
-
def __init__(self):
|
|
78
|
-
self.wallet = os.environ['BIOFS_WALLET']
|
|
79
|
-
self.signature = os.environ['BIOFS_SIGNATURE']
|
|
80
|
-
self._authenticate()
|
|
81
|
-
|
|
82
|
-
def _authenticate(self):
|
|
83
|
-
"""Authenticate BioFS with wallet/signature"""
|
|
84
|
-
subprocess.run([
|
|
85
|
-
'biofs', 'login',
|
|
86
|
-
'--wallet', self.wallet,
|
|
87
|
-
'--signature', self.signature
|
|
88
|
-
], check=True)
|
|
89
|
-
|
|
90
|
-
def load_sqlite_from_biofs(self, biocid):
|
|
91
|
-
"""Download SQLite DB from BioFS (NFT-gated)"""
|
|
92
|
-
output_path = f'/tmp/{biocid}.sqlite'
|
|
93
|
-
subprocess.run([
|
|
94
|
-
'biofs', 'download', biocid, output_path
|
|
95
|
-
], check=True)
|
|
96
|
-
return output_path
|
|
97
|
-
|
|
98
|
-
def analyze_variants(self, biocid):
|
|
99
|
-
"""Analyze variants from BioFS-gated SQLite"""
|
|
100
|
-
sqlite_path = self.load_sqlite_from_biofs(biocid)
|
|
101
|
-
# Load into SQLite and query variants
|
|
102
|
-
# Send to Claude AI for analysis
|
|
103
|
-
# Return insights
|
|
104
|
-
pass
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Security Considerations
|
|
108
|
-
|
|
109
|
-
### NFT-Gated Access Control
|
|
110
|
-
- Direct authentication maintains the same BioNFT permission model
|
|
111
|
-
- Only files owned by the authenticated wallet are accessible
|
|
112
|
-
- All access is logged on-chain via Story Protocol
|
|
113
|
-
|
|
114
|
-
### Credential Validation
|
|
115
|
-
- Wallet address: Validated as 40-character hex Ethereum address
|
|
116
|
-
- Signature: Validated as 130-character hex (65-byte) signature
|
|
117
|
-
- Invalid credentials are rejected before any API calls
|
|
118
|
-
|
|
119
|
-
### Credential Storage
|
|
120
|
-
- Stored in `~/.genobank/credentials.json`
|
|
121
|
-
- File permissions: Read/write for owner only
|
|
122
|
-
- 30-day expiration by default
|
|
123
|
-
|
|
124
|
-
## Migration Guide
|
|
125
|
-
|
|
126
|
-
### From v1.5.2 to v1.6.0
|
|
127
|
-
|
|
128
|
-
No code changes required! The enhancement is fully backward compatible.
|
|
129
|
-
|
|
130
|
-
**Option A: Keep Using Browser Auth**
|
|
131
|
-
```bash
|
|
132
|
-
biofs login # Works exactly as before
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**Option B: Upgrade to Programmatic Auth**
|
|
136
|
-
```bash
|
|
137
|
-
# Generate signature once via browser
|
|
138
|
-
biofs login # Opens browser, sign with MetaMask
|
|
139
|
-
|
|
140
|
-
# Extract credentials for reuse
|
|
141
|
-
cat ~/.genobank/credentials.json
|
|
142
|
-
|
|
143
|
-
# Use extracted credentials in scripts
|
|
144
|
-
biofs login --wallet <WALLET> --signature <SIGNATURE>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Troubleshooting
|
|
148
|
-
|
|
149
|
-
### Invalid Wallet Format
|
|
150
|
-
```
|
|
151
|
-
Error: Invalid wallet address format. Expected Ethereum address (0x...)
|
|
152
|
-
```
|
|
153
|
-
**Solution**: Ensure wallet starts with `0x` and contains exactly 40 hexadecimal characters
|
|
154
|
-
|
|
155
|
-
### Invalid Signature Format
|
|
156
|
-
```
|
|
157
|
-
Error: Invalid signature format. Expected 65-byte signature (0x...)
|
|
158
|
-
```
|
|
159
|
-
**Solution**: Ensure signature starts with `0x` and contains exactly 130 hexadecimal characters (65 bytes)
|
|
160
|
-
|
|
161
|
-
### NFT Access Denied
|
|
162
|
-
```
|
|
163
|
-
Error: Access denied. BioNFT ownership verification failed.
|
|
164
|
-
```
|
|
165
|
-
**Solution**: Verify you own the BioNFT for the requested file. Check ownership on Story Protocol.
|
|
166
|
-
|
|
167
|
-
## Technical Implementation
|
|
168
|
-
|
|
169
|
-
### Modified Files
|
|
170
|
-
1. **src/commands/login.ts**
|
|
171
|
-
- Added `wallet` and `signature` to `LoginOptions` interface
|
|
172
|
-
- Implemented direct authentication flow
|
|
173
|
-
- Added validation logic for wallet/signature formats
|
|
174
|
-
|
|
175
|
-
2. **src/index.ts**
|
|
176
|
-
- Registered `--wallet` and `--signature` CLI options
|
|
177
|
-
- Updated command description
|
|
178
|
-
|
|
179
|
-
3. **package.json**
|
|
180
|
-
- Version bump: 1.5.2 → 1.6.0
|
|
181
|
-
|
|
182
|
-
### Code Flow
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
biofs login --wallet 0x... --signature 0x...
|
|
186
|
-
↓
|
|
187
|
-
LoginOptions interface validates parameters
|
|
188
|
-
↓
|
|
189
|
-
Wallet format validation (^0x[a-fA-F0-9]{40}$)
|
|
190
|
-
↓
|
|
191
|
-
Signature format validation (^0x[a-fA-F0-9]{130}$)
|
|
192
|
-
↓
|
|
193
|
-
CredentialsManager.saveCredentials()
|
|
194
|
-
↓
|
|
195
|
-
Credentials stored in ~/.genobank/credentials.json
|
|
196
|
-
↓
|
|
197
|
-
Success message with available commands
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Version History
|
|
201
|
-
|
|
202
|
-
- **v1.6.0** (2025-10-16): Programmatic authentication via `--wallet` and `--signature`
|
|
203
|
-
- **v1.5.2** (Previous): Browser-based authentication only
|
|
204
|
-
|
|
205
|
-
## Support
|
|
206
|
-
|
|
207
|
-
- GitHub Issues: https://github.com/genobank/biofs-cli/issues
|
|
208
|
-
- Documentation: https://docs.genobank.io/biofs
|
|
209
|
-
- Email: tech@genobank.io
|
|
210
|
-
|
|
211
|
-
## License
|
|
212
|
-
|
|
213
|
-
MIT License - See LICENSE file for details
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
**Built with ❤️ by GenoBank.io**
|
|
218
|
-
*Empowering genomic data ownership through blockchain technology*
|