Getting Started with Wayfinder
Wayfinder provides decentralized and verified access to data stored on Arweave. This guide will help you get started with the core concepts and basic usage.
Installation
Choose the package that fits your project:
Core Library (JavaScript/TypeScript)
React Components
Quick Start
Basic Usage
The simplest way to get started is with the default configuration:
React Integration
For React applications, use the wayfinder-react package:
Wayfinder React automatically configures LocalStorageGatewaysProvider
with
NetworkGatewaysProvider
to avoid rate limits and provide optimal performance
for web applications.
Available Strategies
Routing Strategies
Strategy | Description | Use Case |
---|---|---|
FastestPingRoutingStrategy | Selects gateway with lowest latency | Performance-critical applications |
PreferredWithFallbackRoutingStrategy | Tries preferred gateway first, falls back to others | When you have a trusted primary gateway |
RoundRobinRoutingStrategy | Distributes requests evenly across gateways | Load balancing and fair distribution |
RandomRoutingStrategy | Randomly selects from available gateways | Simple load distribution |
PingRoutingStrategy | Wraps other strategies with health checks | Adding reliability to any routing strategy |
Verification Strategies
Verification strategies may be dependent on the gateway being used having the data indexed locally. A gateway cannot verify data it doesn't have access to or hasn't indexed yet.
Strategy | Description | Use Case |
---|---|---|
HashVerificationStrategy | Verifies data against trusted gateway hashes | Fast verification with trusted sources |
SignatureVerificationStrategy | Validates Arweave transaction signatures | Cryptographic proof of authenticity |
DataRootVerificationStrategy | Verifies against transaction data roots | Block-level verification |
Advanced Configuration
For production applications, you'll want to configure gateway providers, routing strategies, and verification:
Core Concepts
Gateway Providers
Gateway providers discover and manage the list of available AR.IO gateways:
- NetworkGatewaysProvider: Fetches gateways from the AR.IO Network
- StaticGatewaysProvider: Uses a predefined list of gateways
- SimpleCacheGatewaysProvider: Caches gateway lists for performance in-memory
- LocalStorageGatewaysProvider: Caches gateway lists for performance in
window.localStorage
(default for React applications)
Routing Strategies
Routing strategies determine which gateway to use for each request:
- FastestPingRoutingStrategy: Selects the gateway with lowest latency
- PingRoutingStrategy: Wraps other strategies with health checks
- PreferredWithFallbackRoutingStrategy: Tries a preferred gateway first
- RoundRobinRoutingStrategy: Distributes requests evenly
- RandomRoutingStrategy: Randomly selects gateways
Verification Strategies
Verification strategies ensure data integrity:
- HashVerificationStrategy: Verifies data against trusted gateway hashes
- SignatureVerificationStrategy: Validates Arweave transaction signatures
- DataRootVerificationStrategy: Verifies against transaction data roots