-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScoria AI Codebase
More file actions
148 lines (139 loc) · 6.43 KB
/
Scoria AI Codebase
File metadata and controls
148 lines (139 loc) · 6.43 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
scoria-ai/
│
├── contracts/ # Solana Smart Contracts
│ ├── Cargo.toml
│ ├── Anchor.toml
│ ├── programs/
│ │ ├── model_registry/
│ │ │ ├── Cargo.toml
│ │ │ ├── Xargo.toml # Cross-compilation config
│ │ │ ├── src/
│ │ │ │ ├── lib.rs # Program entry
│ │ │ │ ├── instructions/ # Instruction handlers
│ │ │ │ │ ├── register.rs # Model registration
│ │ │ │ │ ├── update.rs # Version control
│ │ │ │ │ └── delete.rs # Model removal
│ │ │ │ ├── state/
│ │ │ │ │ ├── model.rs # On-chain model state
│ │ │ │ │ └── version.rs # Metadata schema
│ │ │ │ ├── error.rs # Custom errors
│ │ │ │ └── utils.rs # Hash utilities
│ │ ├── inference_engine/ # AI processing core
│ │ │ └── ...
│ ├── migrations/
│ │ ├── 20240101000000_init.sql
│ │ └── 20240201000000_add_indexes.sql
│ └── scripts/
│ ├── deploy_mainnet.sh
│ └── verify_bytecode.sh
├── client/ # Local Execution Engine
│ ├── Cargo.toml
│ ├── .cargo/config.toml # Cross-platform build
│ ├── src/
│ │ ├── main.rs # CLI entry
│ │ ├── core/
│ │ │ ├── model_loader/
│ │ │ │ ├── aes.rs # AES-256-GCM
│ │ │ │ └── integrity.rs # BLAKE3 checks
│ │ │ ├── inference/
│ │ │ │ ├── onnx.rs # ONNX binding
│ │ │ │ └── tensorrt.rs # TensorRT optim
│ │ │ ├── zkp/ # Privacy modules
│ │ │ │ ├── circuits/ # ZK circuits
│ │ │ │ │ ├── inference_validator.circom
│ │ │ │ │ └── privacy_swap.circom
│ │ │ │ └── prover.rs # Proof generation
│ │ │ └── cache/
│ │ │ ├── lru.rs # Cache policy
│ │ │ └── redis.rs # Connection pool
│ │ ├── hardware/
│ │ │ ├── cuda/
│ │ │ │ ├── matrix_ops.cu # CUDA kernels
│ │ │ │ └── ffi.rs # Rust bindings
│ │ │ └── opencl/
│ │ │ └── kernels.cl # OpenCL code
│ │ └── config/
│ │ ├── dev.toml
│ │ └── prod.toml
│ ├── tests/
│ │ ├── model_loader_tests.rs
│ │ └── zkp_tests/
│ │ └── prover_tests.rs
├── sdk/ # Web3 Integration
│ ├── packages/
│ │ ├── core/
│ │ │ ├── package.json
│ │ │ ├── tsconfig.json
│ │ │ ├── src/
│ │ │ │ ├── client.ts # HTTP client
│ │ │ │ ├── types.ts # Interface defs
│ │ │ │ └── utils/
│ │ │ │ ├── crypto.ts # Browser crypto
│ │ │ │ └── solana.ts # Wallet adapter
│ │ ├── defi-plugin/ # DeFi integration
│ │ │ ├── src/
│ │ │ │ └── analytics.ts # Data analysis
│ │ │ └── test/
│ │ │ └── analytics.test.ts
│ ├── webpack/
│ │ ├── webpack.config.prod.js
│ │ └── webpack.config.dev.js
│ └── examples/
│ └── basic_usage.ts
├── indexer/ # Blockchain Processor
│ ├── Cargo.toml
│ ├── src/
│ │ ├── main.rs # Async runtime
│ │ ├── solana_listener.rs # Event listener
│ │ ├── model_updater.rs # FL logic
│ │ └── database/
│ │ ├── postgres.rs # Connection pool
│ │ └── migrations.rs # Schema migrations
│ ├── config/
│ │ ├── database.toml
│ │ └── solana_cluster.toml
│ └── scripts/
│ └── start_indexer.sh
├── oracles/ # External Data
│ ├── chainlink/
│ │ ├── contracts/
│ │ │ └── Adapter.sol # Oracle contract
│ │ ├── scripts/
│ │ │ ├── deploy.js
│ │ │ └── verify.js
│ │ └── test/
│ │ └── Adapter.test.js
│ └── pyth/
│ └── ...
├── governance/ # DAO Management
│ ├── proposal_contract/
│ │ ├── programs/
│ │ │ └── dao/
│ │ │ ├── src/
│ │ │ │ └── vote.rs # Voting logic
│ │ │ └── tests/
│ │ │ └── vote_tests.rs
│ └── interface/
│ └── IDaoGovernance.ts # TypeChain interface
├── tests/ # Quality Assurance
│ ├── load_test/
│ │ ├── locustfile.py # Load testing
│ │ └── report_template.html # HTML template
│ ├── security/
│ │ ├── audit_checklist.md # 100+ checks
│ │ └── slither_config.json # Static analysis
│ └── unit/
│ └── model_registry_tests/
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # System design
│ ├── API_REFERENCE.md # REST/SDK docs
│ └── CONTRIBUTING.md # Dev guide
├── .github/ # CI/CD
│ ├── workflows/
│ │ ├── ci.yml # Integration
│ │ ├── release.yml # Release pipeline
│ │ └── security_scan.yml # Security checks
│ └── dependabot.yml # Dependency updates
├── Dockerfile # Multi-stage build
├── docker-compose.yaml # Local services
└── Makefile # Build commands