Git Product home page Git Product logo

hydra's Introduction

Hydra

Collective account pooling, fan out wallet, dao treasury, all of the things you need to FAN OUT

Setup && Development

To get started the basic steps are to install all the JS dependencies, cargo dependencies will be installed automatically when you run anchor build. This package uses the latest yarn, which is yarn 3 and I will accept no hate for using the latest yarn :)

yarn

There are three components in this repo..

  1. Program
  2. SDK
  3. Docs

Program Development

The Hydra smart contract is written with anchor but we have changed the development flow slightly to allow for what we think is a better SDK. Using anchor build you get the BPF so file and the IDL. You then run the following to generate the SDK and spin up a local validator when you want to test your changes.

yarn run api:gen
yarn run amman:start

Now you have a validator running your newly compiled SO file and any other programs you have listed in the .ammanrc.cjs.

Currently we require the local validator to have the Token Metadata program from Metaplex. We suggest you clone the Metaplex Program Library and put it in the same root folder as hydra like this:

 /root-folder
    /hydra
    /metaplex-program-library

To build the latest token metadata program you will need to do the following:

cd metaplex-program-library/token-metadata/program
cargo build-bpf --bpf-out-dir ../../target/deploy/

Now your top level MPL target folder will have the token metadata so file that amman can find and deploy to the local validator.

After accomplishing this your workflow to build new code will be:

anchor build //Optional as the next commant runs anchor build for you
yarn run api:gen
yarn run amman:start

SDK Development

Now that you know how to build the program, building the SDK is easy. All you need to do is run:

yarn run watch

This will watch your packages/sdk folder for any changes, which means it will build the SDK for use in apps or tests when the auto generated code from the api generator is saved in the folder.

Testing

Now that you have the ability to build the program, generated sdk and the rest of the sdk, running tests is a breeze. With the local validator up and running you can simply run.

yarn test

Using ts-node/register you can even setup breakpoints and debuggers on your IDE to debug your tests. If you dont have the local validator running do:

yarn run amman:start
yarn test

Or if you are like Noah or Will and are extremely lazy and can't be bothered to run more than one command run yarn run mega-test

Docs Development

cd packages/docs
yarn start

hydra's People

Contributors

aaronlinsky avatar austbot avatar chewingglass avatar jpbogle avatar

Watchers

 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.