Giter Site home page Giter Site logo

sol-vod's Introduction

Web3 VOD on Solana

This is an experiment in "gating" online videos with a Solana paywall. Users can unlock videos by paying the fee set by the video's creator.

The repo is broken up into two parts:

  1. Vue frontend in the /app directory
  2. Solana program in the /programs directory

Requirements

  • Anchor Framework (instructions include installing Solana and Rust)
  • NodeJS + Yarn/Npm

Building + Deplying program

Switch network

Right now this program can only be deployed on devnet because it uses a chainlink oracle that's on devnet.

$: solana config set --url https://api.devnet.solana.com

Generate CLI wallet

$: solana-keygen new

After generating a wallet, update Anchor.toml with the path to the generated wallet

Airdrop SOL to wallet

$: solana address // outputs wallet pubkey
$: solana airdrop 2 <SOLANA pubkey> // airdrop 2 SOL to address

Build program

$: anchor build

After building the program, run solana address -k target/deploy/sol_vod-keypair.json. This will generate the Program ID. Replace the above Program Id in these two files:

  • Anchor.toml (under programs.localnet)
  • /programs/sol-vod/src/lib.rs (inside declare_id!())

Building the program should also generate an IDL file in target/idl/sol_vod.json. It should have a metadata.address key with the value of the Program ID above. If not, add that key. E.g.:

// sol_vod.json
{
  ...
  "metadata": {
      "address": <PROGRAM ID>
  }
}

Deploy program

$: anchor deploy

// alternatively, to build + test + deploy in one command
$: anchor test

Running client

In a seperate terminal:

$: cd app/

// install dependencies
$ yarn

// run app
$ yarn serve

sol-vod's People

Contributors

hansy avatar

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.