The Basics
#
Flat APIFlat API creates a new connection to the Flat Subsocial API (with a wrapper which returns flat structs). Thus, using the Flat, we abstract from the blockchain and can use the usual JavaScript types.
๐ NewSubsocialApiProps: Omit<SubsocialApiProps, 'substrateApi'> & { substrateNodeUrl: string, substrateApi?: ApiPromise }
#
SubsocialApiSubsocialApi creates a new connection to the Subsocial API (includes Substrate and IPFS connections).
Using this class, you can get all the data of posts, spaces and profiles from IPFS and the blockchain's storage with appropriate methods.
๐ SubsocialApiProps: SubsocialContext & { ipfsNodeUrl: string, offchainUrl: string, substrateApi: SubstrateApi }
#
SubsocialSubstrateApiSubsocialSubstrateApi is a wrapper for connecting to a Subsocial Node with functions from Subsocial Pallets wrapped in convenient methods to call.
๐ SubstrateApiProps: SubsocialContext & { api: SubstrateApi }
#
SubsocialIpfsApiAggregated API to work with IPFS: This gets the contents of spaces, posts, and profiles.
๐ SubsocialIpfsProps: SubsocialContext & { ipfsNodeUrl: IpfsUrl; offchainUrl: string }
#
Off-chainOff-chain is a storage where data is built on the basis of blockchain events. This allows you to conveniently perform work that the blockchain itself does not allow.
It saves text data of blogs, posts and comments to IPFS, builds user feeds and notifications in Postgres, and supports full text search by indexing text data into an ElasticSeach database.
#
IPFSThe InterPlanetary File System (IPFS) is a decentralized storage network commonly used by blockchain projects looking for a storage solution. It is similar to a torrent network where users download content to their machines, and upload it to people that wish to access it. IPFS node operators are able to choose what content they host on their node. Subsocial uses IPFS for multimedia storage.