Lynx Blockchain
  • Welcome
  • Technical Evolution and Architecture Overview
  • History of Lynx
    • Evolution of a Blockchain
    • Hybrid Proof of Work (HPoW) Protocol
    • Pioneering Blockchain Data Storage
    • Evolution to Proof of Stake
    • Next Generation Data Storage Architecture
    • Preserving Knowledge
  • Lynx Core
    • Hardware and System Requirements
    • Lynx Dynamics
    • Open Source
    • Core Parameters and Strategy
    • Sustainability
    • Circulating Supply Analysis
    • Locked Addresses
    • Data Storage
      • auth
      • fetch
      • fetchall
      • store
      • status
      • list
    • Understanding the Encryption Option
    • Understanding Lynx Staking Wait Times
    • Understanding Asset Retrieval Times
    • Understanding Block Time Targeting in the Lynx Blockchain
    • Understanding the Lynx Blockchain Statistics Report
  • Lynx Administration
    • Public Peer Nodes
    • Understanding Blockchain Bootstrap Files
      • Bootstrap Extraction Script
      • Bootstrap Creation Script
    • How to Sweep a Lynx Wallet
    • Enable/Disable Staking
  • Clevver
    • Revolutionizing Digital Preservation
    • Permanent Storage for Digital Assets
    • Permanent Digital Archives for Journalism
    • How did Clevver originate?
    • Shortened URL Support
    • Assigning Tags to Assets
    • How to delete content
    • Clevver Terms of Service Agreement
  • Clevver API
    • Public Methods
      • Batches
      • Files
      • User
  • ElectrumX
    • Lynx ElectrumX nodes
    • Build Script Details
  • External Links
    • Lynx Explorer
    • Lynx Github
    • Lynx Uptime Report
    • Clevver Website
  • Lynx Bootstraps
  • Wallet Links
    • Komodo Wallet
    • Wally.id Wallet
    • Lynx Paper Wallet
  • Social Links
    • Lynx Discord
    • Lynx on Bluesky
    • Clevver on Bluesky
  • Exchange Links
    • FreiXLite (LYNX/LTC)
  • FreiExchange (LYNX/BTC)
  • Komodo Wallet (SWAP)
  • XredX (LYNX/LTC)
  • XredX (LYNX/DOGE)
  • XredX (LYNX/IL8P)
Powered by GitBook
On this page
  • fetch
  • Overview
  • Syntax
  • Description
  • Parameters
  • Returns
  • Examples
  • Error Handling
  1. Lynx Core
  2. Data Storage

fetch

Published: March 2025 | Last updated: March 2025

fetch

Overview

The fetch RPC method allows you to retrieve files that have been stored on the Lynx blockchain. It provides a mechanism for accessing data by its unique identifier (UUID) and saving it to a specified location on your filesystem. No authentication is required prior to using this function.

Syntax

fetch <uuid> <path> [pubkeyflag]

Description

When you invoke the fetch method, the Lynx daemon searches the blockchain for the specified file and downloads it to your designated location. This method is part of the core functionality that enables Lynx to serve as a decentralized data storage solution.

Parameters

Parameter
Type
Required
Description

uuid

string

Yes

The unique identifier of the file you want to retrieve. This is a 64-character hexadecimal string (e.g., 2cf6eabc7af83152d5ad7d4ff9aeeb66f81dde70731b800bb0cd18300d9cb402).

path

string

Yes

The full filesystem path where the retrieved file should be stored (e.g., /home/username/downloads). This path must exist before calling the method.

pubkeyflag

string

No

Optional parameter that controls tenant public key inclusion in the response. Enter 0 to omit the tenant information. Default is 1 (include tenant information).

Returns

The method returns an array containing a single object with the following fields:

Field
Type
Description

result

string

Indicates whether the operation succeeded (success) or failed (failure).

message

string

Provides additional information about the result. For successful operations, returns n/a. For failures, indicates the reason (e.g., Invalid path /path/to/directory., Invalid UUID length., UUID not found.).

tenant

string/number

When authentication is active and pubkeyflag is set to 1, displays the tenant public key associated with the file. Otherwise returns n/a.

Examples

Retrieve a specific file

Retrieve the file with UUID 2cf6eabc7af83152d5ad7d4ff9aeeb66f81dde70731b800bb0cd18300d9cb402 and store it in the /home/username/downloads directory:

lynx-cli fetch 2cf6eabc7af83152d5ad7d4ff9aeeb66f81dde70731b800bb0cd18300d9cb402 /home/username/downloads

Or using JSON-RPC:

curl --user username --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "fetch", "params": ["2cf6eabc7af83152d5ad7d4ff9aeeb66f81dde70731b800bb0cd18300d9cb402", "/home/username/downloads"]}' -H 'content-type: text/plain;' http://127.0.0.1:9332/

Retrieve a file without tenant verification

This method is significantly faster. Retrieve a file without performing tenant verification:

lynx-cli fetch 2cf6eabc7af83152d5ad7d4ff9aeeb66f81dde70731b800bb0cd18300d9cb402 /home/username/downloads 0

Error Handling

The method will return a failure result in the following scenarios:

  • The specified path doesn't exist on the filesystem

  • The UUID has an invalid length (must be 64 characters for a specific file)

PreviousauthNextfetchall

Last updated 2 months ago

Page cover image