Fula Client
The Fula library abstracts away the protocols and `libp2p` connection, and exposes APIs similar to MongoDB
for data persistence and S3 for file storage
Built With
(back to top)
Getting Started
Use Server with caution and know the risk's because we are at development stage and the identity and encryption is
not available, so you become public node that can accessed from anywhere.
Installation
Install NPM package
npm install @functionland/fula --save
or using CDN
<script src="https://cdn.jsdelivr.net/npm/@functionland/fula/dist/web/index.js"></script>
(back to top)
Usage
Start fula and use file storage of fula-server
import {Fula, createClient} from '@functionland/fula'
const fulaClient = await createClient();
await fulaClient.connect(serverId)
const FileCid = await fulaClient.sendStreamFile(selectedFile,meta);
const data = await fulaClient.receiveMeta(fileId);
const data = await fulaClient.receiveFile(FileCid);
let reader = new FileReader();
reader.readAsDataURL(data);
reader.onloadend = (e) => setContent(reader.result)
For using it With private network:
import {Fula, createClient} from '@functionland/fula'
const privateKey = await key_file.arrayBuffer()
const fulaClient = await createClient({},privateKey);
await fulaClient.connect(serverId)
const FileCid = await fulaClient.sendStreamFile(selectedFile,meta);
const data = await fulaClient.receiveMeta(fileId);
const data = await fulaClient.receiveFile(FileCid);
let reader = new FileReader();
reader.readAsDataURL(data);
reader.onloadend = (e) => setContent(reader.result)
For more examples, please refer to the Examples
(back to top)
Roadmap
See the open issues for a full list of proposed features (and known issues).
(back to top)
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
(back to top)
License
See LICENSE
for more information.
(back to top)