Subsocial full node with Substrate/Polkadot pallets for decentralized communities: blogs, posts, comments, likes, reputation.

Overview

Subsocial Node by DappForce

Subsocial is a set of Substrate pallets with web UI that allows anyone to launch their own decentralized censorship-resistant social network aka community. Every community can be a separate Substrate chain and connect with other communities via a Polkadot-based relay chain.

You can think of this as decentralized versions of Reddit, Stack Exchange or Medium, where subreddits or communities of Stack Exchange or blogs on Medium run on their own chain. At the same time, users of these decentralized communities should be able to share their reputation or transfer coins and other values from one community to another via Polkadot relay chain.

To learn more about Subsocial, please visit Subsocial Network.

Build

Build from scratch

Install Rust:

curl https://sh.rustup.rs -sSf | sh

Initialize your Wasm Build environment:

./scripts/init.sh

Build Wasm and native code:

cargo build --release

Build runtime WASM with SRTool

You need to have docker installed for this type of build.

Add SRTool alias:

export RUSTC_VERSION=nightly-2021-03-15; export PACKAGE=subsocial-runtime; alias srtool='docker run --rm -it -e RUNTIME_DIR=runtime -e PACKAGE=$PACKAGE -v $PWD:/build -v "$TMPDIR"/cargo:/cargo-home chevdor/srtool:$RUSTC_VERSION'

Run build:

srtool build

Run

Single Node Development Chain

Purge any existing developer chain state:

./target/release/subsocial-node purge-chain --dev

Start a development chain with:

./target/release/subsocial-node --dev

Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev.

Multi-Node Local Testnet

If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with testnet units.

Optionally, give each node a name and expose them so they are listed on the Polkadot telemetry site.

You'll need two terminal windows open.

We'll start Alice's substrate node first on default TCP port 30333 with her chain database stored locally at /tmp/alice. The bootnode ID of her node is QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR, which is generated from the --node-key value that we specify below:

cargo run -- \
  --base-path /tmp/alice \
  --chain=local \
  --alice \
  --node-key 0000000000000000000000000000000000000000000000000000000000000001 \
  --telemetry-url ws://telemetry.polkadot.io:1024 \
  --validator

In the second terminal, we'll start Bob's substrate node on a different TCP port of 30334, and with his chain database stored locally at /tmp/bob. We'll specify a value for the --bootnodes option that will connect his node to Alice's bootnode ID on TCP port 30333:

cargo run -- \
  --base-path /tmp/bob \
  --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR \
  --chain=local \
  --bob \
  --port 30334 \
  --telemetry-url ws://telemetry.polkadot.io:1024 \
  --validator

Additional CLI usage options are available and may be shown by running cargo run -- --help.

License

Subsocial is GPL 3.0 licensed.

Comments
  • can not sync block at 6600871

    can not sync block at 6600871

    no other detail log for info level, just like following:

    Nov 13 22:12:22 node3-SG subsocial-node[193229]: 2021-11-13 22:12:22.486   INFO tokio-runtime-worker substrate: 💤 Idle (4 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.1kiB/s ⬆ 1.2kiB/s
    Nov 13 22:12:27 node3-SG subsocial-node[193229]: 2021-11-13 22:12:27.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.2kiB/s ⬆ 1.2kiB/s
    Nov 13 22:12:32 node3-SG subsocial-node[193229]: 2021-11-13 22:12:32.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.8kiB/s ⬆ 2.1kiB/s
    Nov 13 22:12:37 node3-SG subsocial-node[193229]: 2021-11-13 22:12:37.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 2.9kiB/s ⬆ 1.5kiB/s
    Nov 13 22:12:42 node3-SG subsocial-node[193229]: 2021-11-13 22:12:42.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.5kiB/s ⬆ 1.8kiB/s
    Nov 13 22:12:47 node3-SG subsocial-node[193229]: 2021-11-13 22:12:47.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.1kiB/s ⬆ 1.8kiB/s
    Nov 13 22:12:52 node3-SG subsocial-node[193229]: 2021-11-13 22:12:52.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.6kiB/s ⬆ 1.7kiB/s
    Nov 13 22:12:57 node3-SG subsocial-node[193229]: 2021-11-13 22:12:57.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.3kiB/s ⬆ 1.5kiB/s
    Nov 13 22:13:02 node3-SG subsocial-node[193229]: 2021-11-13 22:13:02.486   INFO tokio-runtime-worker substrate: ⚙️  Syncing  0.0 bps, target=#6611542 (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.0kiB/s ⬆ 1.2kiB/s
    Nov 13 22:13:07 node3-SG subsocial-node[193229]: 2021-11-13 22:13:07.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 4.2kiB/s ⬆ 53.4kiB/s
    Nov 13 22:13:12 node3-SG subsocial-node[193229]: 2021-11-13 22:13:12.486   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 57.8kiB/s ⬆ 52.6kiB/s
    Nov 13 22:13:17 node3-SG subsocial-node[193229]: 2021-11-13 22:13:17.487   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 59.4kiB/s ⬆ 53.1kiB/s
    Nov 13 22:13:22 node3-SG subsocial-node[193229]: 2021-11-13 22:13:22.487   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 60.1kiB/s ⬆ 22.0kiB/s
    Nov 13 22:13:27 node3-SG subsocial-node[193229]: 2021-11-13 22:13:27.487   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 1.7kiB/s ⬆ 2.0kiB/s
    Nov 13 22:13:32 node3-SG subsocial-node[193229]: 2021-11-13 22:13:32.487   INFO tokio-runtime-worker substrate: 💤 Idle (3 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 0.8kiB/s ⬆ 1.1kiB/s
    Nov 13 22:13:37 node3-SG subsocial-node[193229]: 2021-11-13 22:13:37.487   INFO tokio-runtime-worker substrate: 💤 Idle (4 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 3.1kiB/s ⬆ 2.5kiB/s
    Nov 13 22:13:42 node3-SG subsocial-node[193229]: 2021-11-13 22:13:42.487   INFO tokio-runtime-worker substrate: 💤 Idle (4 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 0.8kiB/s ⬆ 176.0kiB/s
    Nov 13 22:13:47 node3-SG subsocial-node[193229]: 2021-11-13 22:13:47.487   INFO tokio-runtime-worker substrate: 💤 Idle (4 peers), best: #6600871 (0xaa1c…f582), finalized #6600871 (0xaa1c…f582), ⬇ 2.0kiB/s ⬆ 2.1kiB/s
    

    node version: subsocial-node 0.7.0-5c62197-x86_64-linux-gnu

    opened by atenjin 3
  • Error when build code

    Error when build code

    after launch cargo build --release appear the error:

    Compiling frame-support v2.0.0-rc4 (https://github.com/paritytech/substrate.git?tag=v2.0.0-rc4#00768a1f) error[E0424]: expected value, found module self --> /root/.cargo/git/checkouts/substrate-7e08433d4c370a21/00768a1/frame/support/src/traits.rs:1172:11 | 1170 | / bitmask! { 1171 | | /// Reasons for moving funds out of an account. 1172 | | #[derive(Encode, Decode)] | | ^^^^^^ self value is a keyword only available in methods with a self parameter 1173 | | pub mask WithdrawReasons: i8 where ... | 1188 | | } 1189 | | } | |_- this function has a self parameter, but a macro invocation can only access identifiers it receives from parameters | = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

    error: aborting due to previous error

    For more information about this error, try rustc --explain E0424. error: could not compile frame-support.

    opened by maxbitov 3
  • Do not lowercase a blog handle

    Do not lowercase a blog handle

    Do not lowercase a blog handle when storing it in a Blog struct. Lowercase only for storage item where we store a map of unique handles to resolve blog id.

    good first issue help wanted 
    opened by siman 2
  • Can not transfer SUB successfully: Bad Origin

    Can not transfer SUB successfully: Bad Origin

    I submit SUB transaction to the node, it has no error, but When I search it on chain , found it failed DispatchError BadOrigin, is SUB can transfer now? Or is there something wrong with my transaction body? How can I solve it? thanks a lot

    opened by Wangmmx 1
  • add rust version info for build

    add rust version info for build

    hi, Initialize Wasm Build environment

    ./scripts/init.sh
    

    then build

    cargo build --release
    

    will get error

    add specified version at rust-toolchain file maybe a good choice.

    I solve the compilation problem by specifying the version.

    rustup install nightly-2020-06-27
    rustup target add wasm32-unknown-unknown --toolchain nightly-2020-06-27
    

    then build

    cargo build --release
    
    opened by bingryan 1
  • [ Deprecated ] Add badges pallet

    [ Deprecated ] Add badges pallet

    Reopened #58


    • [X] Add events
    • [X] Add fixes after review
    • [ ] Finish TODOs in code

    From @siman:

    • [ ] create BadgesSettings per space: { accepting_badges: boolean = true, etc... }
    deprecated 
    opened by F3Joule 1
Releases(v0.4.0)
  • v0.4.0(Aug 23, 2020)

    Closed issues

    • Extract pallets: space-history, posts-history, profile-history #31
    • Clean up Cargo.toml-s after split-refactoring. There could be some unused dependencies #28
    • Update types.json after split of social pallet completed #25
    • Do full comparison of permissions in update_role() #24
    • Add parent_id to Space struct #23
    • Rename in SpacePermission enum: ***Any***s -> ***Any*** #17
    • Refactor ipfs_hash to Content enum #16
    • Move edit_history from structs to separate pallets #12
    • Create Roles pallet #6
    • Do not lowercase a blog handle #4

    Merged pull requests

    • Betanet (includes creation of 1k spaces) #50
    • Add session keys pallet #49
    • Implement permissions override feature for Spaces #47
    • Refactor Profile's username to a handle similar to Space's one #46
    • Slightly refactor Post pallet #45
    • Update Substrate version to v2.0.0-rc4 #43
    • Extract edit history to new pallets #42
    • Add parent_id to Space struct #37
    • Refactor IPFS hash to Content #36
    • Move tests from before the monolith pallet was split #29
    • Update types.json after split of social pallet #26
    • Split social pallet into smaller pallets #19
    • Split social's functions into more files #18
    • Loose coupling of pallets: Roles + Social #10
    • Add Subsocial pallets: social, permissions, roles, etc #9
    Source code(tar.gz)
    Source code(zip)
Owner
DappForce
Building a decentralized scalable protocol for social networks and marketplaces
DappForce
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
Implementation of Proof of Existence consensus using Substrate Framework, Frame, Pallets, RUST

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Vijayendra Gaur 1 Jun 8, 2022
A node and runtime configuration for polkadot node.

MANTA NODE This repo is a fresh FRAME-based Substrate node, forked from substrate-developer-hub/substrate-node-templte ?? It links to pallet-manta-dap

Manta Network 14 Apr 25, 2021
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

The Witnet Project 155 Nov 21, 2022
Polkadot Node Implementation

Polkadot Implementation of a https://polkadot.network node in Rust based on the Substrate framework. NOTE: In 2018, we split our implementation of "Po

Parity Technologies 6.5k Jan 6, 2023
Polkadex - An Orderbook-based Decentralized Exchange using the Substrate Blockchain Framework.

What is Polkadex? ?? Polkadex is a Open Source, Decentralized Exchange Platform made using Substrate Blockchain Framework that provides traders with t

Polkadex 243 Dec 16, 2022
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

Liam Parry 0 Nov 6, 2021
Basilisk node - cross-chain liquidity protocol built on Substrate

Basilisk node Local Development Follow these steps to prepare a local Substrate development environment ??️ Simple Setup Install all the required depe

Galactic Council 52 Dec 27, 2022
Substrate Node for Anmol Network

Anmol Substrate Node ?? ??️ ?? Anmol is the First Cross-Chain NFT Toolkit, on Polkadot. Introducing: Moulds NFT Breeding Multi-Chain NFT Migration ink

Anmol Network 12 Aug 28, 2022
Minimal Substrate node configured for smart contracts via pallet-contracts.

substrate-contracts-node This repository contains Substrate's node-template configured to include Substrate's pallet-contracts ‒ a smart contract modu

Parity Technologies 73 Dec 30, 2022
Substrate Node Template Generator

Substrate Node Template Generator A tool to generate stand-alone node templates of a customized Substrate clients used in "Substrate Library Extension

Parity Technologies 2 Feb 11, 2022
Node implementation for aleph blockchain built with Substrate framework

This repository contains the Rust implementation of Aleph Zero blockchain node based on the Substrate framework. Aleph Zero is an open-source layer 1

Aleph Zero Foundation 55 Dec 15, 2022
Multy-party threshold ECDSA Substrate node

Webb DKG ??️ The Webb DKG ??‍✈️ ⚠️ Beta Software ⚠️ Running the DKG Currently the easiest way to run the DKG is to use a 3-node local testnet using dk

webb 42 Dec 19, 2022
A Substrate-based PoA node supporting dynamic addition/removal of authorities.

Substrate PoA A sample Substrate runtime for a PoA blockchain that allows: Dynamically add/remove authorities. Automatically remove authorities when t

Gautam Dhameja 10 Jun 16, 2022
xx network Substrate based blockchain node

xx network Substrate based blockchain node Rust Setup First, complete the basic Rust setup instructions. MacOS users: setup to compile for Linux Befor

xx network 11 Dec 20, 2022
The Data Highway Substrate-based blockchain node.

DataHighway-Parachain, a parachain on the Polkadot network. Planned features include a decentralized LPWAN roaming hub for LoRaWAN IoT devices and network operator roaming agreements, participative mining, an inter-chain data market, and DAO governance.

DataHighway 11 Dec 2, 2022
This is a node implementation of Thippy, a Substrate parachain for smart contracts

Thippy ‒- A Smart Contracts Parachain This is a node implementation of Thippy, a Substrate parachain for smart contracts. Developing Smart Contracts f

Arthur·Thomas 15 Mar 16, 2022