Deploying Aragon Client in new Chains
Introduction
This guide will run you through how to deploy Aragon to other EVM compatible chains.
This deployment is self-sufficient and does not pose a requirement on other contracts already deployed to the target chain.
Before you begin, make sure that there are no official deployments to the network you will be targeting.
Official Aragon Client deployments
Good Manners
Please verify all contracts that you have deployed with the target network scanner unless they are automatically verified.
Notify the Aragon team about your plans to deploy to the target network.
Keep the team in close loops about the issues you encounter as well as any ambiguity during the process.
Do not change the smart contract code.
Any automation and new scripts are welcome. Create a PR for the respective Github repository.
Deploying
Before you start
We will use notation
<target network>
to represent the network we are deploying to. It should be consistent throughout this tutorial.Make sure that you use one account thought the tutorial. You will need Private key and some network tokens to pay for gas.
Step 1
Description: Provide an account that will be used to deploy contracts as well as rpc connection to the target network.
This account will be the owner of the deployed Aragon infrastructure. To be considered an official deployment we will need to transfer all permissions from this account to an official Aragon account.
To provide access to an account using a Private Key:
Create a file
nano ~/.aragon/<target network>_key.json
Add the following inside the file
To provide access to an account using a Seed Phrase:
Create a file
nano ~/.aragon/mnemonic.json
Add the following inside the file
Step 2
Description: Deploy AragonOS, which contains all main contracts, to the target network. This will allow creating new DAOs as well as publish apps to APM.
Clone AragonOS repository
Checkout to
master
branch instead of defaultnext
branch.The
master
branch contains AragonOS v4.4.0 latest stable version. Whereas thenext
has more features, but we don’t want a disputable feature for now.Run
yarn
Run
yarn add @aragon/truffle-config-v4
Update
node_modules/@aragon/truffle-config-v4/truffle-config.js
with the new network informationExample:
Run
yarn compile
Deploy
ENS
to the target networkIn case the network does not have an official ENS registry, one should deploy it themselves using provided
ENSFactory
.If there is an official ENS deployment, you can use it or deploy a new ENS. If you decide on using an official ENS, make sure to purchase the
aragonpm.eth
domain with the key provided in step 1.Run the command below in AragonOS repo, substituting placeholder values:
Deploy
DaoFactory
DAO factory will already include other contracts that are necessary for the contract deployment. It is a very large contract, and we are aware that some networks do not offer enough gas per block to deploying it.
You might encounter RPC failing due to making too many calls in a short period of time. As a solution split the deployment script into several subparts or use a more reliable RPC in step 1.
Run the command below in AragonOS repo, substituting placeholder values:
Deploy
APM
(Aragon Package Manager) to the target networkYou should be able to deploy APM in its own repository. However, currently, it does not work due to an unknown issue. If you could fix it, it would be greatly appreciated and you will get rewarded!
As a workaround, you should deploy the APM in the AragonOS repository.
Run the command below in AragonOS repo, substituting placeholder values:
Step 3
Description: Deploy AragonID.
Clone the repo master branch.
Run
yarn
to install packagesSetup truffle-config on
node_modules/@aragon/truffle-config-v4/truffle-config.js
as previous stepUpdate the
truffle.js
to point to the right truffle-config. Basically replace its contents withrun
yarn compile
to build the contractsRun the following script:
Step 4
Description: Deploy standard Aragon Apps to the AragonPM.
Clone Aragon Apps repository
Provide your Private Key
Create
.env
file in the root directory of the Aragon Apps repository with the following content:Update
node_modules/@aragon/hardhat-config/hardhat.config.js
with the new network information. Ex:Deploy an app
Repeat this for each app inside the
\\apps
directory. We will use the Finance app here as an example.IMPORTANT: Do not try to deploy
voting-disputable
andagreement
apps they require Aragon Court instance present on the target network.Navigate to the apps directory (
\\apps\\finance
)Change
arapp.json
In the
environment
part add information about your target network.For the
registry
variable specify ENS address that we have obtained in step 2.Run
yarn
Run
yarn compile
to generate contractsRun
yarn build
to build the UI App partStart a local version of IPFS with
ipfs daemon
If you don't have IPFS installed, check here https://docs.ipfs.io/install/command-line/ how to install it
Publish the App to APM
Download the files that were uploaded to IPFS with
ipfs get <CID>
. The CID is available from previous stepCompress the folders that were downloaded and send to product@aragon.org so they can be pinned.
Step 5
Description: Deploy standard DAO Templates to the AragonPM.
Clone DAO Templates repository
Provide your Private Key
Create
.env
file in the root directory of the Aragon Apps repository with the following content:Go to
/shared
directory and runyarn
and thenyarn link
If you have problems with node version on installing dependencies, add
--ignore-engines
to the commandDeploy a template
Repeat this for each template inside the
/templates
directory. We will use the Company template here as an example.IMPORTANT: Please only try to deploy
company
,reputation
andmembership
templates, as other templates do not contain all required components.Navigate to the templates directory (
/templates/company
)Run
yarn link @aragon/templates-shared
Run
yarn
to install dependenciessetup truffle-config on
node_modules/@aragon/truffle-config-v4/truffle-config.js
as previous stepChange
arapp.json
In the
environment
part add information about your target network.For the
registry
variable specify ENS address that we have obtained in step 2.switch to node 10
Run
yarn compile
switch to node 12
Change
package.json
Add a new script below to the
scripts
section.Please note that if you are using the official ENS, then you should also acquire the
aragonid.eth
domain for the step below to work.Run
yarn deploy:<target network>
to deploy the TemplateThis should deploy additionally AragonId and MiniMe Token Factory. Copy the MiniMe Token Factory address and when deploying the next template add it to the script in step 7:
Start a local version of IPFS with
ipfs daemon
If you don't have IPFS installed, check here https://docs.ipfs.io/install/command-line/ how to install it
Publish the Template to APM
Last updated