mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
* Add gRPC, REST, and gRPC-Web clients for server access This commit introduces clients for gRPC, REST, and gRPC-Web to access the server. - gRPC client: Includes additional argument opts ...grpc.CallOption in the interface for future extensibility. - REST client: Factory function accepts http.Client as an argument to allow user customization. - gRPC-Web client: Added a Log method for fast debugging in JavaScript. The decision to use different interfaces for each client type is to accommodate specific features and extensibility requirements for each protocol. * remove grpc web * generate rest * use grpc sdk in CLI * temp wasm * ark sdk * renaming * pr review refactor * pr review refactor * walletStore & configStore * ark sdk wasm wrapper * handle event stream with rest * wip on supporting rest * store init * simulate event stream with rest * fix rest sdk wip * Fix returning forfeit txs in round event * wasm first working e2e example * pr review refactor * pr review refactor * pr review refactor * Fixes --------- Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
25 lines
533 B
Markdown
25 lines
533 B
Markdown
## USAGE
|
|
|
|
This example demonstrates how to compile ARK Go SDK to WebAssembly and use it in a web page.
|
|
|
|
1. Create a Go file with the main package, check [main.go](main.go).
|
|
|
|
2. Copy `wasm_exec.js`:
|
|
|
|
```bash
|
|
cp $(go env GOROOT)/misc/wasm/wasm_exec.js .
|
|
```
|
|
|
|
3. Build the Go code to WebAssembly:
|
|
|
|
```bash
|
|
GOOS=js GOARCH=wasm go build -o main.wasm main.go
|
|
```
|
|
|
|
4. Load the WebAssembly module in a web page, check [index.html](index.html).
|
|
|
|
5. Serve the files:
|
|
|
|
```bash
|
|
python3 -m http.server 8000
|
|
``` |