GithubHelp home page GithubHelp logo

dappforce / subsocial-parachain Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 16.0 6.49 MB

The Subsocial parachain, built with the Substrate framework, provides the blockspace and social primitives needed to build a decentralized social graph.

Home Page: https://subsocial.network

License: GNU General Public License v3.0

Rust 98.87% Shell 0.54% Dockerfile 0.08% Handlebars 0.51%
substrate subsocial blockchain parachain polkadot kusama social-network social-media protocol social-protocol web3-social

subsocial-parachain's Introduction

Subsocial parachain node

The Subsocial parachain is our custom built Kusama blockchain, based on the Substrate framework.

Build

For Linux, FreeBSD, OpenBSD, and macOS:

git clone https://github.com/dappforce/subsocial-parachain
cd subsocial-parachain/
sh scripts/init.sh
cargo build --release

Run

Take into account that you need to build a binary as described in the previous step.

Simply run and join the network:

./target/release/subsocial-collator \
--name=your-node-name \
-- \
--execution=wasm \
--chain=kusama

Run as an archive node (store all blocks state):

./target/release/subsocial-collator \
--name=your-node-name \
--pruning=archive \
-- \
--execution=wasm \
--chain=kusama

Using docker

Official Docker Hub image of the Subsocial parachain: https://hub.docker.com/r/dappforce/subsocial-parachain

Simply run and join the network with docker:

docker run -d -v node-data:/data dappforce/subsocial-parachain:latest subsocial-collator \
--name=your-node-name \
-- \
--execution=wasm \
--chain=kusama

Run a local testnet using parachain-launch

Note:

  • You may need to build docker image if the one in registry is outdated.
  • To build latest docker image, compatible with parachain-launch, run exactly:
    docker build . -f docker/Dockerfile -t dappforce/subsocial-parachain:rococo

subsocial-parachain's People

Contributors

bolajahmad avatar f3joule avatar omidasadpour avatar siman avatar subsocialdev avatar tarekkma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

subsocial-parachain's Issues

Data migration beetween solo and parachain

Before data migration:

  • Do runtime upgrade on solochain to disable social extrinsics.

Migration scripts:

  • Spaces
  • SpaceFollows
  • Posts
  • Reactions
  • Roles
  • ProfileFollows
  • Profiles (need to access to IPFS)

After data migration:

  • Release commission config and benchmarks (?)
  • Set x5 coefficient for energy
  • Release sub.id w/ migration fixes
  • Update faucet bot
  • Set new correct value for TX_PER_SUB on UI
  • Release web app
  • Announce article about migrations

Broken runtime-benchmarks

cargo build --release --feature runtime-benchmarks fails, because of missing polkadot-cli/runtime-benchmarks in node/Cargo.toml.

Output log:

error[E0046]: not all trait items implemented, missing: `successful_origin`
    --> /home/f3joule/.cargo/git/checkouts/substrate-7e08433d4c370a21/4aeb95f/frame/collective/src/lib.rs:991:1
     |
991  | / impl<
992  | |         O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
993  | |         AccountId: Default,
994  | |         I,
...    |
1008 | |     }
1009 | | }
     | |_^ missing `successful_origin` in implementation
     |
     = help: implement the missing item: `fn successful_origin() -> OuterOrigin { todo!() }`

error[E0046]: not all trait items implemented, missing: `successful_origin`
    --> /home/f3joule/.cargo/git/checkouts/substrate-7e08433d4c370a21/4aeb95f/frame/collective/src/lib.rs:1012:1
     |
1012 | / impl<
1013 | |         O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
1014 | |         N: U32,
1015 | |         AccountId,
...    |
1030 | |     }
1031 | | }
     | |_^ missing `successful_origin` in implementation
     |
     = help: implement the missing item: `fn successful_origin() -> OuterOrigin { todo!() }`

error[E0046]: not all trait items implemented, missing: `successful_origin`
    --> /home/f3joule/.cargo/git/checkouts/substrate-7e08433d4c370a21/4aeb95f/frame/collective/src/lib.rs:1036:1
     |
1036 | / impl<
1037 | |         O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
1038 | |         N: U32,
1039 | |         D: U32,
...    |
1055 | |     }
1056 | | }
     | |_^ missing `successful_origin` in implementation
     |
     = help: implement the missing item: `fn successful_origin() -> OuterOrigin { todo!() }`

error[E0046]: not all trait items implemented, missing: `successful_origin`
    --> /home/f3joule/.cargo/git/checkouts/substrate-7e08433d4c370a21/4aeb95f/frame/collective/src/lib.rs:1061:1
     |
1061 | / impl<
1062 | |         O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
1063 | |         N: U32,
1064 | |         D: U32,
...    |
1080 | |     }
1081 | | }
     | |_^ missing `successful_origin` in implementation
     |
     = help: implement the missing item: `fn successful_origin() -> OuterOrigin { todo!() }`

For more information about this error, try `rustc --explain E0046`.
error: could not compile `pallet-collective` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0046]: not all trait items implemented, missing: `successful_origin`
    --> /home/f3joule/.cargo/git/checkouts/substrate-7e08433d4c370a21/4aeb95f/frame/society/src/lib.rs:1268:1
     |
1268 | impl<T: Config> EnsureOrigin<T::Origin> for EnsureFounder<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `successful_origin` in implementation
     |
     = help: implement the missing item: `fn successful_origin() -> OuterOrigin { todo!() }`

error: build failed

Split tests and write benchmarks

Tests

Move integration-test from Solochain

First, we will add integration-test to the parachain and make sure it passes with no issues.

Extract tests from integration-tests to pallets

❕NOTE❕ Because tests have some cyclic dependencies, I've made a sub-create inside each pallet to house the tests, later on, we can refactor tests to remove cyclic dependencies and have the tests in the same pallet.

  • Posts tests #83
  • Reactions tests #84
  • Spaces tests #80
  • Space follows tests #81
  • Space ownership tests #82

Benchmarking

❕NOTE❕ since tests lives in another create I can't include tests via impl_benchmark_test_suite! macro.

  • Posts benchmarks #100
  • Spaces benchmarks #96
  • Space follow benchmarks #113
  • Space ownership benchmarks #121
  • Reactions benchmarks #98
  • Roles benchmarks #126

Add expireable proxy, that spends from the main account.

  • Specify the max tokens that can be spent by the proxy
  • Set a time to live for the proxy, beyond this time, the proxy will lose access.

Alex:
We should allow a proxy to spend tokens of the main account to pay txs fees.
We can implement a transaction extension that will handle this.
An important thing here is to specify the maximum amount of tokens per a certain period (a day?) that can be spent by your proxy accounts.

Bryan:
a quota could be enough. the fee is usually relatively cheap, and the user should rotate this proxy every few days, so I don't think a cap per day is needed

Alex:
Ok, then the dapp should ask a user to create a new proxy for example every week.


Related issue: https://github.com/dappforce/private-subsocial-web-app/issues/245

Sponsored txs

Delegate payment of tx fees to another account (UX).

Usecase:

A dapp buys tons of energy, adds accounts of their users, and then users can ask dapp's account to pay fees of users' txs.

More details

Get inspiration from the faucets pallet.
There could be a storage where a dapp specifies all accounts that are allowed to ask dapp's account to pay their txs fees.

Prepare functions for migration

What to do?

Write sudo extrinsics to migrate all the data from solochain to parachain.

Progress

  • Spaces and Space follows: #119

#124:

  • Roles
  • Posts
  • Reactions
  • Profiles
  • Account follows

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.