0.0.12 • Published 5 months ago

@intershare/hooks.ipfs-client v0.0.12

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
5 months ago

🚧 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)
0.0.12

5 months ago

0.0.11

5 months ago

0.0.10

5 months ago