GithubHelp home page GithubHelp logo

isabella232 / dai-plugin-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makerdao/dai-plugin-config

0.0 0.0 0.0 1.36 MB

A plugin for retrieving configuration objects to be used to create Dai.js Maker instances.

License: MIT License

Shell 8.47% JavaScript 91.53%

dai-plugin-config's Introduction

Dai Config Plugin

GitHub License NPM

Development

This plugin fetches configuration data from a testchain backend, and creates a config object to be provided to the Maker SDK so it can be used with a testchain. Add it to the end of the plugins array to ensure the options override the default config.

see Dai.js for more details

Example using the Maker SDK

import Maker from '@makerdao/dai';
import configPlugin from '@makerdao/dai-plugin-config';

const config = {
    plugins: [
        [configPlugin, { testchainId: '123abc', backendEnv: 'dev' }]
        ],
    log: false
  };

await Maker.create('http', config);

Details

testchainId: Must be a running testchain ID on the selected backend environment.

backendEnv: (optional) defaults to the 'prod' URL, which is http://18.185.172.121:4000/chain/. Options are prod, dev, or any user-specified URL.

In the beforeCreate block, the plugin will fetch testchain data from the URL. This includes the testchain RPC, all the deployed contracts, and required tokens. It will create a config object that looks like this:

config = {
        url: rpc_url,
        provider: {
          type: 'HTTP',
          network: chainConfig.type
        },
        smartContract: { addContracts },
        token: { erc20 }
      };

Code Style

We run Prettier on-commit, which means you can write code in whatever style you want and it will be automatically formatted according to the common style when you run git commit.

License

The dai config plugin is MIT licensed.

dai-plugin-config's People

Contributors

b-pmcg avatar dependabot[bot] avatar levity avatar padraic-o-mhuiris 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.