在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:galtproject/geesome-node开源软件地址:https://github.com/galtproject/geesome-node开源编程语言:TypeScript 89.6%开源软件介绍:File Storage and Social Media Node
Current state: 0.3.0 - Beta
GeeSome NodeGeeSome Node allows you to run your own file storage with social media functional: make you own public or private group with posts and content. It's a Node on top of IPFS for define and manage data structure of files, users and groups. Node provides an UI and API for storing and accessing your saved data or remote data of other nodes: files, posts, groups. About GeeSome ProjectGeeSome protocol created to provide communication tool between communities of property owners in Galt Project. Galt Project team is aware of many cases of censorship and blocking in different social networks. These cases forced us to develop a new decentralized protocol and node application that would allow anyone to upload any content to his personal node and to share this content with the whole world without the risk of being blocked. Using the GeeSome protocol, communities in the Galt Project will be able to communicate in encrypted chat groups, share images, video, text or any data. We are sure that this tool should be used not only by the project's communities, but also by anyone who is concerned about the safety of their data, censorship and blocking in web. GeeSome ProtocolA new open protocol for unstopable social networking and communication on IPFS. It defines the structure of social network data to describe familiar to the modern user entities: content, posts, tags, groups. GeeSome UIGeeSome UI - it's Vue application, that using GeeSome node API for saving content and IPFS in-browser node for getting content. It's completly separated client from node and can be connected to any other GeeSome node. There are also many cases when it’s not necessary to use GeeSome UI. You can use GeeSome node API and GeesomeClient library in your project to build you own UI with some important features special for you. SummaryWith the help of GeeSome Node, anyone can create an instance of a decentralized social network, with groups like in YouTube, Instagram or Telegram but with content preservation and no locks or censorship thanks to the concept of personal GeeSome Node using IPFS Node to store content, access data and receive updates by libp2p. GeeSome Node can be used:
GeeSome SchemeYou can run personal or public GeeSome node. It used for storing files, manage entities and prepare content for publishing. Also because of IPNS updates issues - GeeSome node have IPNS caching based on signed PubSub events. Also there is an issue about IPNS keys of user. Currently its storing in GeeSome node, but need to improve it. UI ScreenshotsFile explorerTest groupEncrypted personal chatMobile version
Install with domain to your server
How to use gateway
Note: You can generate a static site from Geesome groups by UI and get IPNS or IPFS of static sites for the gateway using. Getting updates
Warning: above commands deletes all stopped containers, not used images and docker build cache. Also, it's reverting not commited local git changes. If you know more efficient way to update GeeSome container app - please, make a PR. Getting started with GeeSome Node API
or yarn:
const { GeesomeClient } = require('geesome-libs/src/GeesomeClient');
const geesomeClient = new GeesomeClient({
server: 'https://your-site.com:2053', // or 'http://localhost:2052',
// apiKey: '4J1VYKW-ZP34Y0W-PREH1Q2-DYN9Q8E' // if you paste your apiKey here, so no need to authorization by loginPassword function
});
geesomeClient.init().then(async () => {
await geesomeClient.loginPassword("username", "password");
console.log('Congrats! You successfully authorized, your session api key:', geesomeClient.apiKey);
}); Or you can generate apiKey from UI in User Profile section by "Add api key" button.
More safer to use
geesomeClient.init().then(async () => {
const contentObj = await geesomeClient.saveDataByUrl('https://picsum.photos/500/300.jpg');
console.log('content ipfs', contentObj.storageId);
console.log('content manifest ipld', contentObj.manifestStorageId);
});
geesomeClient.init().then(async () => {
const avatarPhoto = await geesomeClient.saveDataByUrl('https://picsum.photos/500/300.jpg');
const group = await geesomeClient.createGroup(testUser.id, { name: 'test', title: 'Test', avatarImageId: avatarPhoto.id });
const groupIpns = group.manifestStaticStorageId;
console.log('group manifest ipld', group.manifestStorageId);
console.log('group manifest ipns that points to ipld', groupIpns);
const postContent1 = await geesomeClient.saveContentData('My first post');
const postContent2 = await geesomeClient.saveDataByUrl('https://picsum.photos/1000/500.jpg');
await geesomeClient.createPost([postContent1.id, postContent2.id], { groupId: group.id, status: 'published' });
// get published group from IPFS with posts
// resolve IPNS first
const updatedGroupIpld = await geesomeClient.resolveIpns(groupIpns);
console.log('new group manifest ipld with first post', updatedGroupIpld);
// get JSON content of group by IPLD
const updatedGroupManifest = await geesomeClient.getObject(updatedGroupIpld);
console.log('fetched group manifest', updatedGroupManifest);
// or you can simply use geesomeClient.getGroup(groupIpns) for auto-resolve IPNS, get manifest with avatar and cover contents included
// get posts one by one from group's posts tree
geesomeClient.getGroupPostsAsync(
updatedGroupIpld,
{limit: 10, offset: 0, orderDir: 'desc'},
function onItemCallback(fetchedPost) {
console.log('fetchedPost', fetchedPost);
console.log('fetchedPost contents array', fetchedPost.contents);
},
function onFinishCallback(postList) {
console.log('postList', postList);
}
);
});
geesomeClient.init().then(async () => {
await geesomeClient.saveDataByUrl('https://picsum.photos/500/300.jpg', {path: '/my-site/image.jpg'});
await geesomeClient.saveContentData('<h1>Hello world!</h1> <img src="./image.jpg"/>', {path: '/my-site/index.html'});
const mySiteFolder = await geesomeClient.getFileCatalogItemByPath('/my-site/', 'folder');
const {storageId, staticId} = await geesomeClient.publishFolder(mySiteFolder.id);
console.log(`check out by IPFS hash: ${geesomeClient.server}/ipfs/${storageId}/`); // for example: https://your-site.com:7722/ipfs/QmbDxAcbnSc5bgX77MgqqZ9bPVcczv5McZAYrWXoRxExi8/
console.log(`check out by IPNS hash: ${geesomeClient.server}/ipns/${staticId}/`); // for example: https://your-site.com:7722/ipns/QmcqRcmu7p3UHkMPz8XJ886KPWbzxgpc9uNXy9GUDfUD87/
// resolve IPNS by api:
const resolvedStorageId = await geesomeClient.resolveIpns(staticId);
console.log(storageId === resolvedStorageId); // true
}); Current state and features:
TODO:
GeeSome ServicesYou can develop your own GeeSome service in any programming language for extend GeeSome node functional by communication by API with api keys. Service can communicate with GeeSome node by http requests and PubSub events(in future) for uploading content, managing users and groups. Existing services:
Minimal requirements
Dependencies
Local install and run
In another terminal tab:
Open UI page by url: http://localhost:1234 Api available by http://localhost:2052 endpoint. LinksArticles
Do you like the project? |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论