Getting Started

🚀 Getting Started with Openfiles

Welcome to Openfiles! This guide provides an introduction to Openfiles, explains TON Storage, and outlines essential information to get you started effectively.

Introduction to Openfiles

Openfiles is an easy-to-use and reliable file storage management platform integrated with TON Storage. It simplifies the management and sharing of your files, making them easily accessible within web3 applications and services.

Currently, Openfiles stores files on a centralized node, making your data quickly and reliably available. However, files are accessible via TON Storage, which allows cached access and seamless integration with web3.

In the future, Openfiles plans to fully decentralize by distributing files across multiple decentralized nodes operated by the community.

Why Use TON Storage?

TON Storage provides a robust infrastructure that supports easy integration with web3 applications, enabling:

  • Fast and Cached Access: Rapid file retrieval due to efficient caching mechanisms.
  • Ease of Integration: Simplifies file usage within blockchain-based apps and services.
  • Future Decentralization: Prepares infrastructure for fully decentralized storage.

Basic Workflow

Follow these steps to begin:

Step 1: Create an Account

Visit the Openfiles Dashboard (opens in a new tab) and sign up for an account. Once registered, you can access your personal dashboard.

Step 2: Generate an API Token

Log into your dashboard and navigate to API Tokens to create a new token. Keep this token secure as it's essential for programmatic interaction with Openfiles.

Step 3: Upload and Manage Files

Easily manage your files through the dashboard:

  • Upload Files: Drag and drop functionality for quick file uploads.
  • Organize Files: Use folders to structure your files clearly.
  • Import by Bag ID: Import existing bags from TON Storage using their ID.
  • Track Storage Usage: Monitor your storage usage and manage your available capacity.

Uploading Folders

Folders in Openfiles are single entities, similar to files. You cannot modify or add to existing folders once uploaded. Instead, folders are uploaded as complete entities. This approach makes folders ideal for static site hosting through TON Proxy, allowing easy deployment and access to complete static websites and applications.

Using Openfiles

You can manage files using multiple interfaces:

  • Dashboard: A straightforward graphical interface for file management.
  • SDK and API: Automate and customize file management using our SDKs and APIs.

Install the Python SDK

Install the Python SDK easily:

pip install openfiles

Example: Your First File Upload

Use the Python SDK to upload your first file:

from openfiles import OpenfilesClient
 
client = OpenfilesClient(api_token="your_api_token")
response = client.upload_file(file_path="path/to/file.txt", description="My first upload")
 
print("File uploaded successfully! Bag ID:", response.bag_id)

Next Steps & Further Reading

Explore Openfiles further with these detailed resources:

Happy developing with Openfiles! 🚀