@abmprotocl/dotbtc-plugin-governance 中文文档教程

发布于 4年前 浏览 21 项目主页 更新于 3年前

Dai Governance Plugin

GitHub 许可证NPMBuild Status

dai.js 交互插件MKR 治理系统。 该插件可以轻松地将 Dai 治理集成到前端应用程序中,例如 maker governace dashboard。 你可以用它来投票、投提案、查询投票合约、创建投票代理等等。

Installation

Dai 治理插件需要 dai.js 0.9.2 或更高版本。

$ npm install --save @makerdao/dai-plugin-governance

或者

$ yarn add @makerdao/dai-plugin-governance

Examples

一旦 api 更稳定,我们将有几个示例。 下面是一个让您了解如何使用此插件的示例:

import governancePlugin from '@makerdao/dai-plugin-governance';
import Maker from '@makerdao/dai';

(async () => {
  const maker = Maker.create('browser', {
    plugins: [governancePlugin]
  });
  await maker.authenticate();
  await maker.service('chief').lock(10);
})();

此示例将启动一个 MetaMask 交易以将 10 MKR 锁定到制造商投票系统中。

Development

Getting started

注意:此项目使用 yarn 包管理器

克隆此 repo & fetch submodules

$ git clone --recurse-submodules -j8 https://github.com/makerdao/dai-plugin-governance.git

安装项目依赖

$ yarn
$ yarn install --cwd "gov-testchain"

Running Tests

  1. Install dapptools
  2. yarn testnet --ci yarn test

Publishing

发布到 NPM

$ yarn deploy

Code Style

我们运行 Prettier on-commit,这意味着你可以写任何你想要的风格的代码,当你运行 git commit 时,它会根据通用风格自动格式化。

License

dai 治理插件是 MIT 许可的

Dai Governance Plugin

GitHub LicenseNPMBuild Status

A dai.js plugin for interacting with the MKR governance system. This plugin makes it easy to integrate dai governance into frontend applications such as the maker governace dashboard. You can use it to vote, cast proposals, query the voting contract, create a vote proxy, and much more.

Installation

The Dai Governance Plugin requires dai.js 0.9.2 or later.

$ npm install --save @makerdao/dai-plugin-governance

or

$ yarn add @makerdao/dai-plugin-governance

Examples

We will have several examples once the api is more stable. Here is one to give you some sense of how this plugin can be used:

import governancePlugin from '@makerdao/dai-plugin-governance';
import Maker from '@makerdao/dai';

(async () => {
  const maker = Maker.create('browser', {
    plugins: [governancePlugin]
  });
  await maker.authenticate();
  await maker.service('chief').lock(10);
})();

This example will initiate a MetaMask transaction to lock 10 MKR into the maker voting system.

Development

Getting started

Note: this project utilizes the yarn package manager

Clone this repo & fetch submodules

$ git clone --recurse-submodules -j8 https://github.com/makerdao/dai-plugin-governance.git

Install project dependencies

$ yarn
$ yarn install --cwd "gov-testchain"

Running Tests

  1. Install dapptools
  2. yarn testnet --ci yarn test

Publishing

Publish to NPM

$ yarn deploy

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 governance plugin is MIT licensed.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文