Coder Social home page Coder Social logo

aj07 / relayer-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andr11111/relayer-starter-kit

0.0 2.0 0.0 2.05 MB

Start your own crypto business with the Dharma Relayer Kit

Home Page: https://relayer.dharma.io/

License: MIT License

JavaScript 97.57% HTML 1.43% CSS 1.00%

relayer-kit's Introduction

Dharma Relayer Kit

The Dharma Relayer Kit is the definitive starting point for building a business on top of Dharma Protocol.

The Relayer Kit lets anyone become a crypto entrepreneur in just a few steps. No bank account required.

Getting started is simple:

  • 👩‍💻 Fork the repo
  • 🎨 Define your own style with our unopinionated React components
  • 🚀 Deploy to Heroku
  • 💸 Collect real cryptocurrency through relayer fees

The Dharma Relayer Kit allows you — the entrepreneur — to focus on your business, and not the blockchain.

Table of Contents

Getting Started

We made getting started fast, simple and fun.

Clone

Clone the repo to your workstation:

git clone https://github.com/dharmaprotocol/relayer-starter-kit.git

Dependencies

To run the project, you'll first need to install the dependencies:

yarn

Blockchain

And launch a local blockchain via:

yarn blockchain

Backend

And launch the server via:

yarn server

Frontend

And launch the React frontend via:

yarn start

Running on the Kovan Testnet

Kovan is a test blockchain (referred to as a "testnet") for Ethereum smart contracts.

The Dharma team has deployed our contracts to the Kovan testnet so developers building on top of Dharma can simulate their apps running in production — without the need to use real tokens.

Securing dummy tokens

You can secure dummy tokens for use on the Kovan testnet via https://wallet.dharma.io. Be sure to set your MetaMask to Kovan.

Build your app

First, build a "production" version of your app:

yarn build

Understand the NETWORK environment variable

We use an environment variable to allow the server to specify a different database for your Kovan Loan Requests - since Loan Requests for one blockchain will not be valid for another (e.g., addresses will differ).

The environment variable we modify is NETWORK=kovan (and likewise NETWORK=mainnet for mainnet).

Run the app

Run your app by specifying the Kovan network before initiating the server:

NETWORK=kovan yarn server

This will run a server on port 8000, alongside your frontend application.

Visit your app on this server by visiting http://localhost:8000.

Note: Changes you make to your app won't be reflected immediately when developing in this state. You'll need to rebuild your app and then restart your server to see changes.

Deployment

Everything you need to deploy to Heroku is baked into this repo.

In your command line, make sure you're logged into heroku, and then enter the following commands:

Create a new Heroku app

If you are logged into Heroku on your command line, you can simply run:

heroku create

Otherwise, follow the instructions Heroku provides for creating a new Heroku app.

Push your repo to Heroku

git push -f heroku master

Open your new relayer on Heroku

heroku open

Troubleshooting

You can use this section to debug any problems you might run into while setting up your relayer.

I'm getting an error that blockchain failed to start

In order to run a local blockchain (via yarn blockchain), we use a tool called Ganache-CLI.

This requires that we install Ganache-CLI first, which sometimes requires extra permissions (depending on your computer's setup).

Note: There is no strict requirement to use our blockchain setup - if you like, you can do all of your development against the Kovan testnet, where our contracts are deployed. The preconfigured local blockchain is just for quicker development.

If you're having trouble with running the local blockchain, we recommend you consult the Ganache-CLI setup page (https://github.com/trufflesuite/ganache-cli) and try to get that running first, and then try running yarn blockchain in your relayer project again.

If you're comfortable doing so, then to get around the permissions problem you might end up using your computer's "root" permissions to install Ganache-CLI, by running:

sudo npm install -g [email protected]

FAQ

What is Dharma?

Dharma is a suite of developer tools and infrastructure that make it easy to build blockchain-based lending applications. Read more here.

What is a Dharma Relayer?

A Relayer is a source of liquidity on the Dharma network. It connects borrowers with lenders.

You can think of it as a bulletin board where individuals connected on the Internet can post requests to borrow money.

Why start a Dharma Relayer?

We imagine a world in which the majority of financial transactions occur on globally accessible blockchains.

In this new world, being a Relayer is akin to an early internet entrepreneur, providing a valuable service on the frontiers of the new economy.

How does a Dharma Relayer make money?

Relayers earn a fee every time a loan is filled on their site. The fee is some percentage of the principal amount as determined by the Relayer. Once the transaction has been recorded on the blockchain, the Dharma protocol automatically transfers the fee to the Relayer's address.

Are there existing Dharma Relayers?

While starting a Relayer is an intrepid task, you won't be alone. Bloqboard launched earlier this year and has since gone on to raise a round of financing from esteemed investors in the crypto space.

Are all Dharma Relayers the same?

We envision the Dharma ecosystem supporting many relayers — with individual relayers developing brands associated with their particular area of focus or domain expertise.

For example, a Relayer could specialize in micro-finance, venture debt, or margin trading.

While these markets might be modest today — over time, more and more financial transactions will take place on the blockchain, offering more and more opportunity for Relayers to grow their businesses.

What is the approval process for becoming a Dharma Relayer?

There is no approval process for launching a Dharma Relayer. You can launch whenever you want. Dharma is live on the Ethereum mainnet today.

What technical skills are required to operate a Dharma Relayer?

To build a Relayer, the only programming language necessary is JavaScript.

Do I need to conform to any specific branding when launching a Dharma relayer?

In designing the Relayer Kit, we intentionally left out any opinionated branding so that you, the entrepreneur, can conceive of and implement your own brand.

We imagine there being many relayers, each differentiated by the market they serve and the brand they build.

relayer-kit's People

Contributors

saturnial avatar graemecode avatar

Watchers

James Cloos avatar aj07 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.