2024-12-21 23:43:56 -05:00
|
|
|
# `onsonr/motr`
|
|
|
|
|
|
|
|
[](https://godoc.org/github.com/onsonr/motr)
|
|
|
|
[](https://goreportcard.com/report/github.com/onsonr/motr)
|
|
|
|
|
|
|
|
`onsonr/motr` is the implementation of the Decentralized Web Node for the Sonr Blockchain.
|
|
|
|
|
|
|
|
## Install
|
|
|
|
```bash
|
|
|
|
go get github.com/onsonr/motr
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
2025-01-04 17:06:08 -05:00
|
|
|
|
|
|
|
#### Example: As a library
|
|
|
|
|
2024-12-21 23:43:56 -05:00
|
|
|
```go
|
|
|
|
package main
|
|
|
|
import (
|
|
|
|
"github.com/onsonr/motr"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// Create a new decentralized web node
|
|
|
|
node := motr.NewNode()
|
|
|
|
|
|
|
|
// Start the decentralized web node
|
|
|
|
node.Start()
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-01-04 17:06:08 -05:00
|
|
|
#### Example: As a Service Worker
|
|
|
|
|
|
|
|
```sh
|
|
|
|
GOOS=js GOARCH=wasm go build -o app.wasm ./cmd/vault/main.go
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Example: Via Cloudflare Workers
|
|
|
|
|
|
|
|
```sh
|
|
|
|
GOOS=js GOARCH=wasm go build -o app.wasm ./cmd/proxy/main.go
|
|
|
|
```
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome!
|
|
|
|
|
2024-12-21 23:43:56 -05:00
|
|
|
## License
|
|
|
|
[MIT](LICENSE)
|
|
|
|
|
|
|
|
Copyright (c) 2024, diDAO
|