@ar.io/wayfinder-core 0.0.3-alpha.1 → 0.0.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Wayfinder Core
|
|
2
2
|
|
|
3
|
-
`@ar.io/wayfinder` is the core library for the Wayfinder project. It provides the core functionality for routing and verifying data through the ar.io network.
|
|
3
|
+
`@ar.io/wayfinder-core` is the core library for the Wayfinder project. It provides the core functionality for routing and verifying data through the ar.io network.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
### Installation
|
|
8
8
|
|
|
9
|
-
`@ar.io/wayfinder` is currently available as
|
|
9
|
+
`@ar.io/wayfinder-core` is currently available as an alpha release. To install the latest version, run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @ar.io/wayfinder
|
|
12
|
+
npm install @ar.io/wayfinder-core
|
|
13
13
|
# or
|
|
14
|
-
yarn add @ar.io/wayfinder
|
|
14
|
+
yarn add @ar.io/wayfinder-core
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
### Basic Usage
|
|
@@ -35,6 +35,9 @@ Example:
|
|
|
35
35
|
> _Wayfinder client that caches the top 10 gateways by operator stake from the ARIO Network for 1 hour and uses the fastest pinging routing strategy to select the fastest gateway for requests._
|
|
36
36
|
|
|
37
37
|
```javascript
|
|
38
|
+
import { Wayfinder, NetworkGatewaysProvider, SimpleCacheGatewaysProvider, FastestPingRoutingStrategy, HashVerificationStrategy } from '@ar.io/wayfinder-core';
|
|
39
|
+
import { ARIO } from '@ar.io/sdk';
|
|
40
|
+
|
|
38
41
|
const wayfinder = new Wayfinder({
|
|
39
42
|
// cache the top 10 gateways by operator stake from the ARIO Network for 1 hour
|
|
40
43
|
gatewaysProvider: new SimpleCacheGatewaysProvider({
|
|
@@ -157,7 +160,6 @@ Selects the fastest gateway based simple HEAD request to the specified route.
|
|
|
157
160
|
```javascript
|
|
158
161
|
const routingStrategy = new FastestPingRoutingStrategy({
|
|
159
162
|
timeoutMs: 1000,
|
|
160
|
-
probePath: '/ar-io/info',
|
|
161
163
|
});
|
|
162
164
|
|
|
163
165
|
// will select the fastest gateway from the list based on the ping time of the /ar-io/info route
|
|
@@ -174,7 +176,7 @@ Wayfinder includes verification mechanisms to ensure the integrity of retrieved
|
|
|
174
176
|
| ------------------------------- | ---------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------ |
|
|
175
177
|
| `HashVerificationStrategy` | Low | High | Low | Verifies data integrity using SHA-256 hash comparison of the returned data |
|
|
176
178
|
| `DataRootVerificationStrategy` | Medium | Medium | Low | Verifies data using Arweave by computing the data root for the transaction (most useful for L1 transactions) |
|
|
177
|
-
| `SignatureVerificationStrategy` | Medium | Medium | Medium | Verifies signature of an Arweave transaction or data item using signature data provided by the Arweave network, or trusted gateways|
|
|
179
|
+
| `SignatureVerificationStrategy` | Medium | Medium | Medium | Verifies signature of an Arweave transaction or data item using signature data provided by the Arweave network (L1 transactions), or trusted gateways (ANS-104 data items)|
|
|
178
180
|
|
|
179
181
|
### HashVerificationStrategy
|
|
180
182
|
|
package/package.json
CHANGED