Transactions
All posts and spaces are associated with public key pairs called accounts. So, these structures can be created or updated via transactions. And you need to use a wallet / extension to sign these transactions. Therefore, Subsocial supports the Polkadot {.js} extension, which allows you to easily manage your keys in a browser.
#
Creating a SpaceYou need to add 2 more dependencies for this
Let's start with an example of creating a space:
Fist we created an instance of the Keyring class (lean more about keyrings here). In the next step we connected to the Substrate API using getSubstrateApi and the Substrate node URL, and we also connected to IPFS by flatApi. After that we used substrateAPI and IPFS for creating content. Then, we used the previously created content to create a space and then sign a transaction.
Learn more about transactions and mnemonics.
#
More examples#
Create a vote reaction#
Start following a spaceFor more convenient work with accounts and keys, use the polkadot.{js} extension.