support wasm (#163)

This commit is contained in:
reis
2025-01-02 21:42:04 +09:00
committed by GitHub
parent a7a66add61
commit 63919cf685
13 changed files with 167 additions and 7 deletions

View File

@@ -145,6 +145,14 @@ But to use it you need the host to have it installed as a shared library and CGO
To use it, use `-tags=libsecp256k1` whenever you're compiling your program that uses this library.
### Test for Wasm
Install [wasmbrowsertest](https://github.com/agnivade/wasmbrowsertest), then run tests:
```sh
TEST_RELAY_URL=<relay_url> GOOS=js GOARCH=wasm go test -short ./...
```
## Warning: risk of goroutine bloat (if used incorrectly)
Remember to cancel subscriptions, either by calling `.Unsub()` on them or ensuring their `context.Context` will be canceled at some point.