/social

Primary LanguageRust

Social Protocol

Docs Version Downloads License

Spling social protocol for building a solana on-chain social media platform.

Quick Setup

Install

Install these dependencies over:

npm:

npm install @spling/social-protocol

yarn:

yarn add @spling/social-protocol

Setup (React Example)

import React, { useEffect } from "react";
import * as anchor from "@project-serum/anchor";
import { SplingProtocol } from "@spling/social-protocol";
import {
  AnchorWallet,
  useAnchorWallet,
  useConnection,
} from "@solana/wallet-adapter-react";

export default function SplingProtocol() {
  const { connection } = useConnection();
  const wallet = useAnchorWallet();
  useEffect(() => {
    (async () => {
      if (wallet?.publicKey) {
        const splingProtocol = await new SplingProtocol(
          connection,
          wallet
        ).init();
      }
    })();
  }, [wallet?.publicKey]);
  return <div></div>;
}

Setup (NodeJS Example)

import { SplingProtocol } from "@spling/social-protocol";
const splingProtocol = await new SplingProtocol(connection, wallet).init();

Examples

package description
node Using @spling/protocol in a nodejs environment components
react Using @spling/protocol in a react/browser environment

Build From Source

  1. Clone the project:
git clone https://github.com/spling-protocol/social.git
  1. Install dependencies:
cd social
npm install