Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Nov 26, 2024
1 parent c7f42a1 commit 809cad8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"cSpell.words": [
"Alamofire",
"Arie",
"boundwitness",
"keccak",
"Keychain",
"Protobuf",
"secp",
"Trouw",
"unkeyed"
]
}
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
- [Description](#description)
- [Instructions](#instructions)
- [Add Package](#add-package)
- [Configure Api](#configure-api)
- [Configure API](#configure-api)
- [Configure Witnesses](#configure-witnesses)
- [Configure Panel](#configure-panel)
- [Generate BoundWitness report](#generate-boundwitness-report)
- [Maintainers](#maintainers)
- [License](#license)
Expand All @@ -31,25 +33,69 @@ Primary SDK for using the XYO Protocol 2.0 from Swift. Designed to work in both

```swift
dependencies: [
.package(url: "https://github.com/XYOracleNetwork/sdk-xyo-client-swift.git", .upToNextMajor(from: "2.0.3")),
.package(url: "https://github.com/XYOracleNetwork/app-ios-witness-demo-swiftui.git", .upToNextMajor(from: "3.0.0")),
],
```

### Configure Api
### Configure API

Setup which network you'd like to write to by configuring the Domain & Archivist Module Name

```swift
let apiDomain = "https://beta.api.archivist.xyo.network"
let archive = "Archivist"
```

### Configure Witnesses

Configure your desired witnesses (Basic, System Info, Location, etc.)

```swift
let basicWitness = BasicWitness {
Payload("network.xyo.basic")
}
let systemInfoWitness = SystemInfoWitness(allowPathMonitor: true)
let locationWitness = LocationWitness()
```

### Configure Panel

Use the Witnesses & Archivist config to create a Panel

```swift
let panel = XyoPanel(archive: 'test', apiDomain: "https://api.archivist.xyo.network", witnesses: [XyoSystemInfoWitness()])
let panel = XyoPanel(
account: self.panelAccount,
witnesses: [
basicWitness,
systemInfoWitness,
locationWitness
],
apiDomain: apiDomain,
apiModule: apiModule
)
```

### Generate BoundWitness report

Call `.report()` to return the witnessed Payloads

```swift
let payloads = await panel.report()
```

or, for more detailed information, call `.reportQuery()` to return a `ModuleQuery` result containing the `BoundWitness`, `Payloads`, & any `Errors` (if present)

```swift
panel.report(nil, nil)
let result = await panel.reportQuery()
let bw = result.bw
let payloads = result.payloads
let errors = result.errors
```

## Maintainers

- Arie Trouw
- [Arie Trouw](https://arietrouw.com/)
- [Joel Carter](https://joelbcarter.com)

## License

Expand Down

0 comments on commit 809cad8

Please sign in to comment.