Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ganache && fixes to devchain parametrization #79

Merged
merged 4 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aragon/aragen",
"version": "5.2.0",
"version": "5.3.0",
"description": "Generate Aragon local dev environment snapshots",
"main": "index.js",
"bin": {
Expand Down Expand Up @@ -46,7 +46,7 @@
"chalk": "^2.1.0",
"execa": "^2.0.3",
"find-process": "^1.4.2",
"ganache-core": "2.5.3",
"ganache-core": "^2.8.0",
"listr": "^0.14.3",
"ncp": "^2.0.0",
"rimraf": "^2.6.2",
Expand All @@ -59,7 +59,7 @@
"@aragon/os": "^4.2.0",
"@aragon/apps-shared-minime": "^1.0.0",
"eth-ens-namehash": "^2.0.8",
"ganache-cli": "~6.2.0",
"ganache-cli": "^6.7.0",
Copy link
Contributor

@sohkai sohkai Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xGabi I remember us rolling back to 6.2.0 due to a forwarding bug; did we test that it was resolved on newer ganache-core versions?

Ahh... I see [email protected] has this exact fix :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 🎉

"truffle": "4.1.14"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/get-repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ INSTALL_FRONTEND=true npm i;
cd ..;

echo "Fetching planning-suite and installing dependencies (this may take a while 😉)"
git clone https://github.com/AutarkLabs/planning-suite.git -b dev;
cd planning-suite;
git clone https://github.com/AutarkLabs/open-enterprise.git -b dev;
cd open-enterprise;
npm i;
cd ..;

Expand Down
2 changes: 1 addition & 1 deletion scripts/link-repos
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cd repos

echo "Linking to local repos"
ln -s ../../aragon-apps aragon-apps
ln -s ../../planning-suite planning-suite
ln -s ../../open-enterprise open-enterprise
ln -s ../../fundraising fundraising
ln -s ../../dao-templates dao-templates
ln -s ../../aragon aragon
4 changes: 2 additions & 2 deletions scripts/publish-open-enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ IPFS_CACHE=$DIR/ipfs-cache

set -e;

cd repos/planning-suite;
cd repos/open-enterprise;

LERNA_EXEC_APPS="npx lerna exec --scope=@tps/apps-address-book --scope=@tps/apps-allocations --scope=@tps/apps-dot-voting --scope=@tps/apps-projects --scope=@tps/apps-rewards --concurrency=1 --stream"

$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content"
$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content"
2 changes: 1 addition & 1 deletion scripts/start-ganache
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mnemonic=$(node -p "require(require('path').join(\"${BASEPATH}\", 'src/helpers/g
rm -rf aragon-ganache
mkdir aragon-ganache
set -e;
npx ganache-cli -m "${mnemonic}" -i 15 -l 100000000 --db aragon-ganache
npx ganache-cli -m "${mnemonic}" -i 15 -l 100000000 --db aragon-ganache --e 10000
28 changes: 5 additions & 23 deletions src/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,9 @@ exports.builder = yargs => {
description: 'Specify blockTime in seconds for automatic mining',
alias: 'b',
})
.option('default-balance-ether', {
description: 'The default account balance, specified in ether',
default: 100,
alias: 'e',
})
.option('mnemonic', {
type: 'string',
default: MNEMONIC,
description: 'Mnemonic phrase',
alias: 'm',
})
.option('gas-limit', {
default: BLOCK_GAS_LIMIT,
description: 'Block gas limit',
description: 'Block gas limit. Must be specified as a hex string',
alias: 'l',
})
.option('reset', {
Expand All @@ -66,16 +55,14 @@ exports.builder = yargs => {
default: false,
type: 'boolean',
description: 'Enable verbose devchain output',
alias: 'v',
alias: 'd',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually verbose is shortened to v; as well, this would constitute a major version change since it's part of the external API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I decide to include alias to have a similar syntax as ganache. Then I realize that there were a clash between the aragon --version alias and this alias on the devchain. What would be your suggestion in this case? Better not having the v alias on aragonCLI instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good question, the two might be mutually compatible, but confusing.

aragon -v
aragon devchain -v`

Of those two, I think aragon devchain -v is more important, and mirrors ganache-cli's flag.

})
}

exports.task = async function({
port = 8545,
networkId,
defaultBalanceEther = 100,
blockTime,
mnemonic = MNEMONIC,
gasLimit = BLOCK_GAS_LIMIT,
verbose = false,
reset = false,
Expand Down Expand Up @@ -129,14 +116,13 @@ exports.task = async function({
{
title: 'Starting a local chain from snapshot',
task: async (ctx, task) => {
ctx.id = networkId || parseInt(1e8 * Math.random())
ctx.id = parseInt(networkId) || parseInt(1e8 * Math.random())

const options = {
network_id: ctx.id,
default_balance_ether: defaultBalanceEther,
blockTime,
gasLimit,
mnemonic,
mnemonic: MNEMONIC,
db_path: snapshotPath,
logger: verbose ? { log: reporter.info.bind(reporter) } : undefined,
debug,
Expand Down Expand Up @@ -221,9 +207,7 @@ exports.handler = async ({
reporter,
port,
networkId,
defaultBalanceEther,
blockTime,
mnemonic,
gasLimit,
reset,
verbose,
Expand All @@ -234,9 +218,7 @@ exports.handler = async ({
const task = await exports.task({
port,
networkId,
defaultBalanceEther,
blockTime,
mnemonic,
gasLimit,
reset,
verbose,
Expand All @@ -245,7 +227,7 @@ exports.handler = async ({
silent,
debug,
})
const { privateKeys, id } = await task.run()
const { privateKeys, id, mnemonic } = await task.run()
exports.printAccounts(reporter, privateKeys)
exports.printMnemonic(reporter, mnemonic)
exports.printResetNotice(reporter, reset)
Expand Down