Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stavares843/iridium
https://github.com/stavares843/iridium
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/stavares843/iridium
- Owner: stavares843
- Created: 2022-06-12T18:56:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-04T13:59:30.000Z (over 2 years ago)
- Last Synced: 2024-11-26T01:42:04.632Z (2 months ago)
- Size: 420 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Iridium Protocol
Iridium is a loosely defined protocol for peer to peer communication and storage for user application data (profile, friends, messages, files, etc...) leveraging IPFS and dag-jose.
## Create an Iridium Instance
```js
const iridum = Iridium.fromSeed(
uint8SeedBytes,
// IridiumConfig options
{ config: { bootstrap: bootstrapUrls, swarm: swarmUrls } }
);
```## Send a Message
```js
// messages are automatically signed and encrypted with a shared key
await iridium.send(someOtherDID, 'friend:request', {
displayName,
profilePicture,
});
```## Read Data
```js
// fetch the root level IPNS document
const profileData = await iridium.loadIPNS();// fetch a specific value from the root document using a string path
const doc = await iridium.loadEncrypted(someCID);// read a value from a document
const numFriends = await iridium.loadEncrypted(profileCID, {
path: 'friends/count',
});
const cid = await iridum.loadEncrypted(profileCID, { path: 'profile/0' });
```