Code Monkey home page Code Monkey logo

aragen's Introduction

AraGen Build Status npm

Generate an Aragon environment

Requirements

  • npm
  • git

How to

npm i
npm run gen
npm start

Yes, you are done. Happy hacking πŸ”₯πŸ¦…!

If you happen to stop ganache, just:

npm run start-ganache

Using snapshots

The Aragen package published to NPM contains a ganache snapshot that can be used to quickly start a chain with the entire Aragon system ready.

By default it has set up:

  • ENS: 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1
  • DAO_FACTORY: 0x5d94e3e7aec542ab0f9129b9a7badeb5b3ca0f77
  • MINIME_FACTORY: 0xd526b7aba39cccf76422835e7fd5327b98ad73c9
  • FIFResolvingRegistrar: 0xf1f8aac64036cdd399886b1c157b7e3b361093f3
  • APM: ens.addr('aragonpm.eth')
  • AragonID: ens.owner('aragonid.eth')
  • Aragon apps: As APM repos, e.g. apm.getLatest('voting.aragonpm.eth')
  • Templates: As APM repos, e.g. apm.getLatest('democracy-template.aragonpm.eth')

To use directly with ganache-cli:

npm install @aragon/aragen
npx aragen start

If you wish to access from code, for example to run ganache-core directly:

const aragonSnapshot = path.resolve(
  require.resolve("@aragon/aragen"),
  "../aragon-ganache"
);

CI

If you need to trigger the CI so a new snapshot is generated and publish to NPM, you need to tag the release by bumping the NPM version and commit to master.

npm version [major, minor, patch]

Getting help

If you need help, please reach out to Aragon core contributors and community members on Spectrum. We'd love to hear from you and know what you're working on!

aragen's People

Contributors

0xgabi avatar ewingrj avatar fabriziovigevani avatar greenkeeper[bot] avatar izqui avatar john-light avatar kernelwhisperer avatar macor161 avatar sohkai avatar topocount avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aragen's Issues

Display snapshot information

New Feature

As a: developer
I want: know what information is on the snapshot I will replay
So that: my own environment have the relevant information

MVP

aragen info <snapsho> should show the information contained in the snapshot

TypeError: Cannot read property 'pop' of undefined

πŸ› Bug Report

realisations-MacBook-Pro:etude realisation$ aragon devchain --debug 
Starting a local chain from snapshot [started]
Local chain started at port 8545 [title changed]

/Users/realisation/.nvm/versions/node/v11.12.0/lib/node_modules/@aragon/cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:360
  var lastNode = stack.pop()
                       ^
TypeError: Cannot read property 'pop' of undefined
    at CheckpointTrie.Trie._updateNode (/Users/realisation/.nvm/versions/node/v11.12.0/lib/node_modules/@aragon/cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:360:24)
    at /Users/realisation/.nvm/versions/node/v11.12.0/lib/node_modules/@aragon/cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:107:16

Ganache issue with transaction pathing

Hey !

There is an issue with the latest version of @aragon/cli because of @aragon/aragen. The way ganache informs the Aragon Client about the gas cost of failing transactions is weird so the client believes that anyone is always allowed to initiate a transaction and does not trigger transaction forwarding ... [making the transaction fail in the end].

Maybe it would be worth reverting to an old version of ganache ...

aragen refactor

πŸš€ Feature

I think it would make sense if the aragen scripts (which generate a new environment) would become a command: aragon env deploy that would install an Aragon environment to a new testnet/ mainnet instance/ sidechain, etc. (xDAI, Flora)

For a performance improvement, we can go from "cloning, building, compiling the repos" to "download the packages from mainnet APM, deploy". This should also make a deployment easier to maintain because they will have the same hashes and same versions.

aragon env deploy could take a list of apps to be deployed as well as their versions.

aragon env inspect could display the status of a deployment (versions, addresses, ens domains, etc.) (something like https://github.com/aragon/deployments but more dynamic)

The aragon devchain command could instead do:

  1. Check if an eth chain is running at the supplied port
  • if yes, check the deployment
    • if already deployed return
    • otherwise run aragon env deploy
  • if no then start ganache and then run aragon env deploy

Note: The ipfs command also depend on aragen for the ipfs-cache.


What would be really useful for this feature is "deterministic deployments". I believe you cannot deploy any version you like to APM. E.g: Deploy 2.0.0 without deploy 1.0.0 first. Are there security concerns for not allowing this? cc: @sohkai

Script to inject stuff in a chain

New Feature

As a: developer
I want: to fetch information from aragonPM on an specific environment
So that: I can customize my own environment and reuse existing apps

MVP

aragen fetch <environment> <registry|apps..> should fetch the whole registry or list of apps from aragonPM on the environment and generate a snapshot ready to be replay on different environments.

aragen replay <environment> <snapshot> should replay a snpahot into the environment. Related to dapplion/aragen-replay

Aragen across environments

aragen as a deployer across environments. Related to #95

aragen script env-origin env-destination <registry|apps..> start a script that fetch the whole registry or list of apps from the env-origin and proceed to replay those to the env-destination

An in-range update of @aragon/cli is breaking the build 🚨

The devDependency @aragon/cli was updated from 5.9.5 to 5.9.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@aragon/cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Publish survey kit

deploy-beta and deploy-survey should be updated to use last kits from DAO-kits after upgrade to aragonOS 4

Discussion: Move aragen to aragonCLI monorepo

Open discussion about pros and cons of migrating this repo as a new package in aragonCLI. If we decide to migrate, what are the best strategy to maintain releases automated.

Quote of @sohkai about this topic:

aragen would make sense to include in the repo, however its problem is that it has a fairly involved installation phase as well an automated release strategy through merges to master.

`npm start` fails because of survey app

Not sure if the bug belongs to aragon-apps or here, but this is what I get after npm start:

@aragon/apps-survey: Aragon UI assets copied to public/aragon-ui
@aragon/apps-survey: β†’ npm run build: 
@aragon/apps-survey: > [email protected] build:script /home/bingen/workspace/aragen/repos/aragon-apps/apps/survey/app
@aragon/apps-survey: > parcel build src/script.js --out-dir build/
@aragon/apps-survey: β†’ npm run build: ✨  Built in 12.59s.
@aragon/apps-survey: β†’ npm run build: build/script.map    ⚠️  1.23 MB     135ms
@aragon/apps-survey: build/script.js      339.64 KB    12.21s
@aragon/apps-survey: β†’ npm run build: 🚨  /home/bingen/workspace/aragen/repos/aragon-apps/apps/survey/app/src/components/VotingPanel/VotingPanel.js:3:15: Cannot resolve dependency 'BN.js'
@aragon/apps-survey: β†’ npm run build:   1 | import React from 'react'
@aragon/apps-survey:   2 | import styled from 'styled-components'
@aragon/apps-survey: > 3 | import BN from 'BN.js'
@aragon/apps-survey:     |                ^
@aragon/apps-survey:   4 | import {
@aragon/apps-survey:   5 |   theme,
@aragon/apps-survey:   6 |   Button,
@aragon/apps-survey: Building frontend [failed]
@aragon/apps-survey: β†’ Command failed: npm run build
@aragon/apps-survey: npm ERR! code ELIFECYCLE
@aragon/apps-survey: npm ERR! errno 1
@aragon/apps-survey: npm ERR! [email protected] build: `npm run sync-assets && npm run build:script && parcel build index.html --out-dir build/ --public-url "."`
@aragon/apps-survey: npm ERR! Exit status 1
@aragon/apps-survey: npm ERR! 
@aragon/apps-survey: npm ERR! Failed at the [email protected] build script.
@aragon/apps-survey: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@aragon/apps-survey: npm ERR! A complete log of this run can be found in:
@aragon/apps-survey: npm ERR!     /home/bingen/.npm/_logs/2019-12-05T09_45_35_833Z-debug.log
@aragon/apps-survey: npm ERR! code ELIFECYCLE
@aragon/apps-survey: npm ERR! errno 1
@aragon/apps-survey: npm ERR! @aragon/[email protected] build: `cd app && npm run build`
@aragon/apps-survey: npm ERR! Exit status 1
@aragon/apps-survey: npm ERR! 
@aragon/apps-survey: npm ERR! Failed at the @aragon/[email protected] build script.
@aragon/apps-survey: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@aragon/apps-survey: npm ERR! A complete log of this run can be found in:
@aragon/apps-survey: npm ERR!     /home/bingen/.npm/_logs/2019-12-05T09_45_35_847Z-debug.log

`repos/aragon` not found

If clone the repo and do npm i && npm start (as stated in the README), I get:

scripts/publish/client: line 10: cd: repos/aragon: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @aragon/[email protected] publish-client: `scripts/publish/client`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @aragon/[email protected] publish-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bingen/.npm/_logs/2019-12-03T17_52_52_818Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @aragon/[email protected] deploy: `npm run deploy-base && npm run publish-client && npm run publish-core-apps && npm run publish-dao-templates && npm run publish-fundraising && npm run publish-open-enterprise`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @aragon/[email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bingen/.npm/_logs/2019-12-03T17_52_52_838Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @aragon/[email protected] start: `npm run start-ganache-bg && npm run deploy`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @aragon/[email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bingen/.npm/_logs/2019-12-03T17_52_52_851Z-debug.log

Deploy Agent and Vault apps correctly

Both Vault and Agent apps were published using the script for apps without UI. As default aragon apm publish will assign [' . '] to the --file option. So the whole folder was copied to the publish directory. This included the package.json that it happens to have a rule to only include some of the files to npm when publish πŸ˜“ Then ipfs-cache for both apps was not published correctly

New package including only snapshots

In some cases it would be useful to have a package @aragon/aragon-snapshot that only includes the chain snapshots and the ipfs cache without needing to import dependency like ganach-core as a consequence.

Deploy old versions of core apps to mimic mainnet deployment

Now that we have multiple live versions of the core Aragon apps' contracts, it would be nice for aragen to also deploy older versions in case someone needed to use an older version than latest.

This should be fairly trivial to achieve; we can use git tags to move the aragon-apps repo to different release tags (correlated with actual mainnet releases) and just release a major version of the apps on each release that had contract changes.

Spin devchain with npx

New Feature

As a: developer
I want: a devchain with the Aragon bases already deployed
So that: I can develop and test Aragon stack

MVP

npx aragen should start a ganache-cli process with the basic bases already deployed.

npx aragen <registry|apps..> should start a ganache-cli process with the basic bases and start a script that deploy the whole registry or the list of apps. Related to #99

Publish wrapper in gen

This will allow us to remove this logic from the cli, which could just run the wrapper from IPFS rather than starting building and starting a server every time.

We might need to run it from apm-serve so the URL is cleaner.

Couldn't compile the Vault app

i tried to run npm start and got this error ,@aragon/apps-vault/contracts/Vault.sol:31:30: TypeError: Trying to create an instance of an abstract contract. erc20ConnectorBase = new ERC20Connector();

Deploy open.aragonpm.eth APM registry as part of gen

Given that we run an open registry on Rinkeby (mainnet soon) that devs can publish any apps they wish to, aragen should deploy such registry too so devs don't have to keep changing the appId in arapp.json.

Export mnemonic

Right now it is defined in both aragen and the cli, which can be a potential problem if ever updated

ipfs-cache @aragon/aragon is empty on latest aragen version

The latest version of aragen (v5.4.3) doesn't contain the correct files for @aragon/aragon

To reproduce

  • npm i @aragon/aragen
  • ls node_modules/@aragon/aragen/ipfs-cache/@aragon/aragon/

It returns an almost empty folder instead of the aragon client files.

v5.4.2 works fine.

Customize network id of the devchain

We should allow users to customize the params of ganache, specifically network_id so it plays nice with frame:

          const server = ganache.server({
            // Start on a different networkID every time to avoid Metamask nonce caching issue:
            // https://github.com/aragon/aragon-cli/issues/156
            network_id: parseInt(1e8 * Math.random()),
            gasLimit: BLOCK_GAS_LIMIT,
            mnemonic: MNEMONIC,
            db_path: snapshotPath,
          })

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.