Giter VIP home page Giter VIP logo

mosaic-tbd's Introduction

Install Package

npm install mosaic-tbd
//TBD: change require below.
MosaicTbd = require('./index');

Abi Bin Provider Usage

abiBinProvider = new MosaicTbd.AbiBinProvider();
jsonInterface = abiBinProvider.getABI('Organization');
contractBin = abiBinProvider.getBIN('Organization');

Using Setup Script

Please follow these steps in sequence.

Create setup instance

let originWeb3 = new Web3('http://127.0.0.1:8545');
let auxiliaryWeb3 = new Web3('http://127.0.0.1:8546');
let helper = new ChainSetup(originWeb3, auxiliaryWeb3);
let simpleToken = "0x..."; /* SimpleToken Contract Address deployed on origin chain */

Create configurations.

Make sure all deployer addresses, organization owner addresses and chainOwner have sufficient gas and are added to web3.eth.accounts.wallet of respective chains.

Define origin chain setup config

let originConfig = {
  gasPrice: '0x5B9ACA00',
  tokenOrganization: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    owner: "0x...", /* Address of owner key of Organization */
    admin: "0x...", /* Address of admin key of Organization */
    workers: ["0x..."] /* Address for Organized Workers */
  },
  anchorOrganization: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    owner: "0x...", /* Address of owner key of Organization */
    admin: "0x...", /* Address of admin key of Organization */
    workers: ["0x..."] /* Address for Organized Workers */
  },
  libs: {
    "deployer": "0x...",
  },
  anchor: {
    remoteChainId: '12345',
    "deployer": "0x...", /* Address of key that will deploy the contract */
    "organizationOwner": "0x..." /* Address of owner/admin key of Organization */
  },
  gateway: {
    "deployer": "0x...",
    "bounty": '1000000000000000000'
  }
};

Define auxiliary chain setup config.

let auxiliaryConfig = {
  gasPrice: '0',
  tokenOrganization: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    owner: "0x...", /* Address of owner key of Organization */
    admin: "0x...", /* Address of admin key of Organization */
    workers: ["0x..."] /* Address for Organized Workers */
  },
  ostPrime: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    chainOwner: config.chainOwner
  },
  anchorOrganization: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    owner: "0x...", /* Address of owner key of Organization */
    admin: "0x...", /* Address of admin key of Organization */
    workers: ["0x..."] /* Address for Organized Workers */
  },
  anchor: {
    remoteChainId: '12345', /* Origin chain-id */
    "deployer": "0x...", /* Address of key that will deploy the contract */
    organizationOwner: "0x..." /* Address of owner/admin key of Organization */
  },
  libs: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
  },
  cogateway: {
    "deployer": "0x...", /* Address of key that will deploy the contract */
    "bounty": '1000000000000000000'
  }
};

Executing setup. This may some time.

helper.setup(simpleToken, originConfig, auxiliaryConfig)
.then(function (output) {
  console.log("output", output);
})

mosaic-tbd's People

Contributors

abhayks1 avatar ashutoshlodhi avatar bitsnacker avatar puneet-khushwani-eth avatar

Watchers

 avatar  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.