docs(readme): update build and test commands for Go 1.25+ and TinyGo removal
This commit is contained in:
29
README.md
29
README.md
@@ -1,6 +1,6 @@
|
||||
# Motr Enclave
|
||||
|
||||
Motr Enclave is an [Extism](https://extism.org) plugin that provides encrypted key storage for the Nebula wallet. Built with Go and compiled with TinyGo for the `wasip1` target, it embeds a SQLite database for managing sensitive identity and cryptographic material.
|
||||
Motr Enclave is an [Extism](https://extism.org) plugin that provides encrypted key storage for the Nebula wallet. Built with Go 1.25+ and compiled for the `wasip1` target, it embeds a SQLite database for managing sensitive identity and cryptographic material.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -15,7 +15,7 @@ The enclave runs as a portable WASM plugin with an embedded SQLite database. All
|
||||
│ │
|
||||
│ ┌──────────────────────┐ ┌──────────────────────────────────┐ │
|
||||
│ │ Extism Plugin │ │ API Clients (Live Data) │ │
|
||||
│ │ (TinyGo/wasip1) │ │ │ │
|
||||
│ │ (Go/wasip1) │ │ │ │
|
||||
│ ├──────────────────────┤ ├──────────────────────────────────┤ │
|
||||
│ │ • WebAuthn Creds │ │ • Token Balances │ │
|
||||
│ │ • MPC Key Shares │ │ • Transaction History │ │
|
||||
@@ -93,35 +93,46 @@ motr-enclave/
|
||||
├── db/
|
||||
│ ├── schema.sql # Database schema (12 tables)
|
||||
│ └── query.sql # SQLC query definitions
|
||||
├── example/
|
||||
│ ├── index.html # Browser test UI
|
||||
│ └── test.js # Extism JS SDK test harness
|
||||
├── sqlc.yaml # SQLC configuration
|
||||
├── Makefile # Build commands
|
||||
└── main.go # Plugin entry point (TBD)
|
||||
└── main.go # Plugin entry point
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Go](https://go.dev/doc/install) 1.21+
|
||||
- [TinyGo](https://tinygo.org/getting-started/install/) 0.30+
|
||||
- [Go](https://go.dev/doc/install) 1.25+
|
||||
- [SQLC](https://sqlc.dev/) for database code generation
|
||||
- [Extism CLI](https://extism.org/docs/install) (optional, for testing)
|
||||
|
||||
### Building
|
||||
|
||||
```bash
|
||||
make build # Build with TinyGo for wasip1
|
||||
make build # Build WASM for wasip1
|
||||
make generate # Regenerate SQLC database code
|
||||
make test # Run tests (requires Go, not TinyGo)
|
||||
make test # Run tests
|
||||
```
|
||||
|
||||
### Testing the Plugin
|
||||
|
||||
**CLI Testing:**
|
||||
```bash
|
||||
extism call ./build/enclave.wasm generate --input '{"credential": "..."}'
|
||||
extism call ./build/enclave.wasm query --input 'did:sonr:abc123'
|
||||
extism call ./build/enclave.wasm generate --input '{"credential": "dGVzdA=="}' --wasi
|
||||
extism call ./build/enclave.wasm query --input '{"did": "did:sonr:abc123"}' --wasi
|
||||
```
|
||||
|
||||
**Browser Testing:**
|
||||
```bash
|
||||
make serve
|
||||
# Open http://localhost:8080/example/ in your browser
|
||||
```
|
||||
|
||||
The browser test UI provides interactive testing of all plugin functions with real-time output.
|
||||
|
||||
## Tables
|
||||
|
||||
| Table | Description |
|
||||
|
||||
Reference in New Issue
Block a user