aragon / aragen

(Aragon 1) Generate an Aragon environment
GNU General Public License v3.0
20 stars 27 forks source link

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

Closed izqui closed 5 years ago

izqui commented 6 years ago

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.

kernelwhisperer commented 5 years ago

Given that we use environments now, you no longer have to keep changing the appId. That being said, a common issue devs run into when trying to deploy is not having permissions to aragonpm.eth. I think we can make things a bit simpler by making the default open.aragonpm.eth.

sohkai commented 5 years ago

Agreed, and especially with the changes in the boilerplates to default the environments to open.aragonpm.eth we should do this in the next release.

bumi commented 5 years ago

Is there any update on this? This is currently exactly the problem that I am having.

what needs to be done to include open.aragonpm.eth in the snapshot? Do I understand the code correctly that the deploy-base script needs to be updated and thus the deploy-apm.js in aragonOS? (specifically making the apmNode configurable?)

bumi commented 5 years ago

I've tried to adjust the deploy-apm.js script to use open.aragonpm.eth but I couldn't figure it out. I first need to better understand how ENS and the apm registry works. - maybe somebody has some pointers?

right now I get an "Repository kredits-contribution.open.aragonpm.eth does not exist and it's registry does..." error when trying to publish an app version with appName "kredits-contribution.open.aragonpm.eth" (running aragon apm publish major)

0xGabi commented 5 years ago

what needs to be done to include open.aragonpm.eth in the snapshot? Do I understand the code correctly that the deploy-base script needs to be updated and thus the deploy-apm.js in aragonOS? (specifically making the apmNode configurable?)

Hey @bumi for what I can see in a quick look you are in the right direction. To better understand aragonPM I recommend you the dev portal. And for ENS they have a really good documentation.

I'll take a look as well and let you know 👍

sohkai commented 5 years ago

@0xGabi @bumi This should be quite easy to do, since our scripts deploy an APMRegistryFactory that spins up an entire aragonPM instance.

The script that does this both logs the factory's address and returns it to callers (so we could write another truffle exec script that wraps it and does another deploy, for open.aragonpm.eth).

Once we've deployed the second instance, we just need to add a new ENS mapping with the initial aragonPM's ENSSubdomainRegistrar.createAndPoint() (you can get this app's address via the returned apm instance by its registrar() getter). The root account may as well need to grant itself the CREATE_NAME_ROLE.

bumi commented 5 years ago

ahhh, nice! thanks a lot! I think I was missing the last part... will try it over the weekend.

0xGabi commented 5 years ago

Hey @bumi let me know how it went. Thanks

0xGabi commented 5 years ago

@bumi I'll start working on this

bumi commented 5 years ago

oh, sorry for the missing update... I still had an issue with the subdomain entry. if you have a solution, that's cool... otherwise I am slow but still on it :)

0xGabi commented 5 years ago

Ok, no worries. If you can further explain the issue you are having I'll look into it tomorrow and give you some feedback 👍

bumi commented 5 years ago

arg, I still fail to wrap my head around it.

We got a ENS instance on which we have set the subnode owner to an APM factory. (aragonpm.eth => APM factory address)

Then a new APM DAO is created by calling newAPM() which creates a an APMRegistry and an ENSSubdomainRegistrar. This also sets the owner of the node to the ENSSubdomainRegistrar. (aragonpm.eth => ENSSubdomainRegistrar)

The APMRegistry has the role to create names on the ENSSubdomainRegistrar, which it does when a new repo is created, then that subdomain points to the repo.

Now as aragonpm.eth is already deployed like that. I need to do the same thing BUT use the ENSSubdomainRegistrar to point the subdomain (open) to a APM factory address?

(I used this deply-apm.js script, that first should do the aragonpm.eth deployment and then open.aragonpm.eth - loads of hackish copy pasta where I try to understand what's going on :) - and right now I get a revert error when calling createNameAndPoint.

anyway, if I am blocking and especially if it's easier to solve directly than to wait and help me, don't bother with this - I don't want to waste your time.

0xGabi commented 5 years ago

Hey @bumi no worries is really complex subject in my opinion. So, take my next words with cautions cause I'm not an expert. I believe you misunderstand the responsibility of the APMRegistryFactory. This smart contract will create new instances of an aragonPM DAO. In the deploy-apm script this is aragonpm.eth (exact place where this happens).

Then following @sohkai suggestions what I understand we need to accomplish is create a new instance of aragonPM DAO for open.aragonpm.eth with the APMRegistryFactory. As the deploy-apm script already made much of the work of deploying the APMRegistryFactory we can wrap on a new truffle script (e.g.deploy-apm-open) and use the return values from deploy-apm.

I'll try to solve this now and let you know. Please ask again if you still are confuse or correct me if I'm wrong (Brett you as well 😅)!

0xGabi commented 5 years ago

Hey @bumi I pushed a draft with what I have so far, I have commented what is blocking me