Getting Started
Installation
You can install the ritual-arweave
library via pip or by cloning the repository from GitHub.
Installing from source via GitHub
Usage Examples
Uploading a Repository
from ritual_arweave.repo_manager import RepoManager
repo_manager = RepoManager(wallet_path='./wallet.json')
upload_result = repo_manager.upload_repo(
name='my-repo',
path='/path/to/repo',
version_mapping_file='/path/to/version_mapping.json'
)
print(f"Uploaded repo with manifest URL: {upload_result.manifest_url}")
Downloading a Repository
Uploading a File
Downloading a File
Generic Blob Upload/Download
New: You can upload/download generic data blobs to/from Arweave using the
FileManager
class.
from ritual_arweave.file_manager import FileManager
file_manager = FileManager(wallet_path='./wallet.json')
data = "yooooo".encode()
tx = file_manager.upload_data(data)
print("tx: %s", tx.id)
Dictionary Upload/Download
New: Much like blobs, you can upload/download dictionaries to/from Arweave using the
FileManager
class.
from ritual_arweave.file_manager import FileManager
file_manager = FileManager(wallet_path='./wallet.json')
data = {"key": "value"}
tx = file_manager.upload_dict(data)
print("tx: %s", tx.id)
Large File Uploads/Downloads
Arweave transactions have a maximum size limit. To upload large files, this library splits the file into chunks and uploads them separately. The library automatically handles the chunking and reassembly of the file when downloading.
Parallel Workers: The library utilizes a QueueProcessor to perform uploads and downloads in parallel. For each Arweave gateway URL passed in, a separate worker is created to handle the requests.
Note: The chunk size is set to 5MB by default. You can adjust this value by passing
max_upload_size
as a parameter to the FileManager