Socket
Socket
Sign inDemoInstall

@interplanetary-share/hooks.ipfs-client

Package Overview
Dependencies
34
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @interplanetary-share/hooks.ipfs-client

## Hello! 👋


Version published
Maintainers
1
Created

Readme

Source

🚧 Under Construction 🚧

Hello! 👋

Thank you for visiting this repository. We're currently hard at work building something amazing. Check back soon for updates!

Under Construction

📅 Upcoming Updates

  • Complete Documentation - We're in the process of drafting detailed documentation to get you started seamlessly.
  • Usage Examples - Practical examples will be provided soon to help you better understand the project.
  • Optimizations - We're working on enhancing efficiency and user experience.

🤝 Contributions

If you have ideas or suggestions, we'd love to hear them! Please consider opening an issue or making a pull request.

📬 Contact Us

If you have any questions or comments, feel free to send us a message.

🌌 ipfsGalactFetchClient - A React Hook for IPFS

A React Hook that connects to galacfetch IPFS nodes to manage files on the IPFS network

npm downloads license

🚀 Features

  • Connect to galacfetch IPFS nodes.
  • Manage files on the IPFS network.
  • Local cache to save bandwidth and improve performance.
  • Interact with the galacfetch IPFS nodes directly.

🏷️ Labels

hook, ipfs, galacfetch, react, interplanetary, file, storage, decentralized

📦 Installation

npm install ipfsgalactfetchclient

📖 Usage

Component usage

In this example, we use ipfsGalactFetchClient hook that interacts with useLocalIpfsStore and useRemoteIpfsStore hooks to manage files on the IPFS network.

// Main hook usage
const { status, init, getFile, getFiles, uploadFile, urlFileList } =
  ipfsGalactFetchClient()

// Interact with other hooks directly
const { localGetFile, localAddFile, localRemoveFile, localGetAllFiles } =
  useLocalIpfsStore()
const {
  servers,
  init,
  addNewBlobUrl,
  api,
  remoteCheckIntegrityFile,
  remoteGetFileInfo,
  remoteGetFilesInfo,
  remoteGetFile,
  remoteUploadFile,
  remoteRestoreIntegrityFile,
  remotegetFileExtraProps,
} = useRemoteIpfsStore()

Initialization

Initialize the hook by calling the init function. This will connect to the IPFS galacfetch nodes.

const api = 'ABC123'
const indexDbName = 'ExampleindexDbName'

useEffect(() => {
  init(api, indexDbName)
}, [])

File Management

Manage your files on the IPFS network with ease.

  • getFile: Retrieve a file from the IPFS network.
  • getFiles: Get a list of files from the IPFS network.
  • uploadFile: Upload a file to the IPFS network.
  • urlFileList: Get the list of files that are in memory and in the local IPFS node.
  • updateFile: Update the information or extra properties of a file.

📜 Documentation

For detailed documentation, examples, and API references, please visit our official documentation.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

📝 License

This project is MIT licensed.

TODOS:

Local:

  • Implement WebRTC to share data between nodes
  • Implement a garbage Collector to remove old data
  • set config on init Client (use local cache, max cache size, file size limit, etc)

Remote:

  • increase security allow tokens management and split enviroments. (dev/test, prod)

Client:

  • allow edit public and private files (only if you are the owner)

FAQs

Last updated on 08 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc