GithubHelp home page GithubHelp logo

shadow-drive's Introduction

Shadow Drive

Docs

Typescript components for Shadow Drive.

Quick Setup

Install

Install these dependencies:

yarn add @shadow-drive/sdk

Setup (React)

import React, { useEffect } from "react";
import * as anchor from "@project-serum/anchor";
import {ShdwDrive} from "@shadow-drive/sdk";
import { AnchorWallet, useAnchorWallet, useConnection } from "@solana/wallet-adapter-react";

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

Setup (NodeJS)

import {ShdwDrive} from "@shadow-drive/sdk";
const drive = await new ShdwDrive(connection, wallet).init();

Examples

package description
node Using shadow-drive in a nodejs environment components
react Using shadow-drive in a react/browser environment

Build From Source

  1. Clone the project:
git clone https://github.com/genesysgo/shadow-drive.git
  1. Install dependencies:
cd shadow-drive
yarn install

Troubleshooting

Getting a 400 HTTP error code when performing POST requests

If you are getting a 400 HTTP error status code when using the POST ShdwDrive methods such as createStorageAccount, uploadFile, addStorage, etc.

Make sure to set your wallet adapter or connection commitment config to max.

<ConnectionProvider endpoint={network} config={{ commitment: 'max' }}>
  ...
</ConnectionProvider>
const connection = new solanaWeb3.Connection(
    "https://ssc-dao.genesysgo.net/",
	"max"
  );

shadow-drive's People

Contributors

21e8 avatar bntzio avatar cloakd avatar khaiilnafis avatar regonn avatar tracy-codes 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.