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

Specify truffle config when executing CLI commands. #498

Open
willjgriff opened this issue Jun 4, 2019 · 3 comments
Open

Specify truffle config when executing CLI commands. #498

willjgriff opened this issue Jun 4, 2019 · 3 comments
Labels
💰 funded An issue that has a bounty on the Projects app 🚀 new feature A change that adds new functionality to the API

Comments

@willjgriff
Copy link

willjgriff commented Jun 4, 2019

This issue was funded with 60 DAI, see more issues on our dao projects app.

🚀 Feature

Ability to specify the truffle config used when executing CLI commands.

Have you read the Contributing Guidelines on issues?

Yes

Motivation

We cannot currently run or deploy apps with a custom truffle configuration. A custom truffle configuration could specify Solidity compilation optimisation or developer defined gas prices for deployment.

The aragon app I'm building has a fairly large contract. It's large enough to require optimisation be run on it to enable deployment without an OOG error. I currently have to specify optimisation in my project truffle config and execute truffle compile --all right before either aragon run or aragon apm publish. This seems to work as truffle does not recompile the contracts if already compiled. I have already run into one situation where this doesn't work which required commenting out Solidity to continue, I imagine I could come across more situations in the future.

Secondly, if the network's gas prices demand higher than the default in truffle config (10 Gwei I believe) then there's a chance an app won't be deployed. Also if a developer wants to pay less than 10 Gwei to deploy their app when gas prices are cheap, I'm not sure how they can.

Pitch

I imagine an extra argument that can be passed to the relevant CLI commands, likely any of those that can currently specify the --environment argument, which allows the user to specify a truffle config to use. There may be an alternative approach such as specifying the truffle config in arapp.json although I can't say what would be most appropriate.

Edit: It seems I can specify gas prices for the networks used if specified in my project truffle config. However, I'm still unsure how to enable Solidity compilation optimisation.

@kernelwhisperer
Copy link
Contributor

Edit: It seems I can specify gas prices for the networks used if specified in my project truffle config. However, I'm still unsure how to enable Solidity compilation optimisation.

Could you please post the truffle config you're using? (the one with the compilation optimisation)

@kernelwhisperer kernelwhisperer added the 🚀 new feature A change that adds new functionality to the API label Jun 5, 2019
@0xGabi 0xGabi added the 💰 funded An issue that has a bounty on the Projects app label Jun 11, 2019
@willjgriff
Copy link
Author

willjgriff commented Jun 13, 2019

I use Truffle v5+ which requires the following:

module.exports = {
    networks: {...},
    compilers: {
        solc: {
            version: "0.4.24",  
            settings: {             
                optimizer: {
                    enabled: true,
                    runs: 200
                }
            }
        }
    }
}

For Truffle version prior to v5 (v4 etc) it needs to be:

module.exports = {
    networks: {...},
    solc: {
        optimizer: {
            enabled: true,
            runs: 200
        }
    }
}

@sohkai
Copy link
Contributor

sohkai commented Jun 27, 2019

The CLI should probably change the truffle config if it detects your project directory has a truffle.js or truffle-config.js. Not sure if truffle supports node resolution for its configs, but if it does we could also do the same.

I was wondering why this wasn't a problem for aragon-apps since we use our own truffle config and have enabled optimization but, of course, we don't use aragon run in them 😅

@stale stale bot added the abandoned label Dec 24, 2019
@aragon aragon deleted a comment from stale bot Dec 27, 2019
@stale stale bot removed the abandoned label Dec 27, 2019
@0xGabi 0xGabi added this to Backlog in Aragon SDK v8 via automation Feb 14, 2020
@stale stale bot added the abandoned label Jun 24, 2020
@aragon aragon deleted a comment from stale bot Jun 25, 2020
@stale stale bot removed the abandoned label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰 funded An issue that has a bounty on the Projects app 🚀 new feature A change that adds new functionality to the API
Projects
No open projects
Aragon SDK v8
  
Backlog
Development

No branches or pull requests

4 participants