Deploying Aragon Client in new Chains
Introduction
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.jsonAdd the following inside the file
{ "rpc": "<RPC url for your target network, for example "<https://rpc-mainnet.matic.network>" for Polygon>", "keys": ["Your Private Key"] }To provide access to an account using a Seed Phrase:
Create a file
nano ~/.aragon/mnemonic.jsonAdd the following inside the file
{ "rpc": "<RPC url for your target network, for example "<https://rpc-mainnet.matic.network>" for Polygon>", "mnemonic": "your mnemonic phrase..." }
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
masterbranch instead of defaultnextbranch.The
masterbranch contains AragonOS v4.4.0 latest stable version. Whereas thenexthas more features, but we don’t want a disputable feature for now.Run
yarnRun
yarn add @aragon/truffle-config-v4Update
node_modules/@aragon/truffle-config-v4/truffle-config.jswith the new network informationExample:
mumbai: {network_id: 80001,provider: providerForNetwork('mumbai'),gas: 6.9e6}Run
yarn compileDeploy
ENSto 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.ethdomain with the key provided in step 1.Run the command below in AragonOS repo, substituting placeholder values:
OWNER=<Your Public Key> npx truffle exec --network <target network> scripts/deploy-test-ens.jsDeploy
DaoFactoryDAO 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:
OWNER=<Your Public Key> npx truffle exec --network <target network> scripts/deploy-daofactory.jsDeploy
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:
OWNER=<Your Public Key> ENS=<ENS Registry address from step> DAO_FACTORY=<DAO Factory address from step 2> npx truffle exec --network <target network> scripts/deploy-apm.js
Step 3
Description: Deploy AragonID.
Clone the repo master branch.
Run
yarnto install packagesSetup truffle-config on
node_modules/@aragon/truffle-config-v4/truffle-config.jsas previous stepUpdate the
truffle.jsto point to the right truffle-config. Basically replace its contents withmodule.exports = require("@aragon/truffle-config-v4")run
yarn compileto build the contractsRun the following script:
OWNER=<Your public key> ENS=<ENS Registry address from step> npx truffle exec --network <target network> scripts/deploy-beta-aragonid.js
Step 4
Description: Deploy standard Aragon Apps to the AragonPM.
Clone Aragon Apps repository
Provide your Private Key
Create
.envfile in the root directory of the Aragon Apps repository with the following content:ETH_KEYS=0x<Your Private Key>Update
node_modules/@aragon/hardhat-config/hardhat.config.jswith the new network information. Ex:mumbai: providerForNetwork('mumbai')Deploy an app
Repeat this for each app inside the
\\appsdirectory. We will use the Finance app here as an example.IMPORTANT: Do not try to deploy
voting-disputableandagreementapps they require Aragon Court instance present on the target network.Navigate to the apps directory (
\\apps\\finance)Change
arapp.jsonIn the
environmentpart add information about your target network.For the
registryvariable specify ENS address that we have obtained in step 2."<target netwrok>": { "registry": "<ENS Registry address>", "appName": "finance.aragonpm.eth", // app name "network": "<target network>" }Run
yarnRun
yarn compileto generate contractsRun
yarn buildto build the UI App partStart a local version of IPFS with
ipfs daemonIf you don't have IPFS installed, check here https://docs.ipfs.io/install/command-line/ how to install it
Publish the App to APM
npx hardhat publish major --network mumbai --ipfs-api-url <http://localhost:5001>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 [email protected] so they can be pinned.
Step 5
Description: Deploy standard DAO Templates to the AragonPM.
Clone DAO Templates repository
Provide your Private Key
Create
.envfile in the root directory of the Aragon Apps repository with the following content:ETH_KEYS=0x<Your Private Key>Go to
/shareddirectory and runyarnand thenyarn linkIf you have problems with node version on installing dependencies, add
--ignore-enginesto the commandDeploy a template
Repeat this for each template inside the
/templatesdirectory. We will use the Company template here as an example.IMPORTANT: Please only try to deploy
company,reputationandmembershiptemplates, as other templates do not contain all required components.Navigate to the templates directory (
/templates/company)Run
yarn link @aragon/templates-sharedRun
yarnto install dependenciessetup truffle-config on
node_modules/@aragon/truffle-config-v4/truffle-config.jsas previous stepChange
arapp.jsonIn the
environmentpart add information about your target network.For the
registryvariable specify ENS address that we have obtained in step 2."<target network>": { "registry": "<ENS Registry address>", "appName": "finance.aragonpm.eth", // app name "network": "<target network>", "wsRPC": "<RPC url for your target network, for example wss://matic-testnet-archive-ws.bwarelabs.com for Polygon>" }switch to node 10
Run
yarn compileswitch to node 12
Change
package.jsonAdd a new script below to the
scriptssection.Please note that if you are using the official ENS, then you should also acquire the
aragonid.ethdomain for the step below to work."deploy:<target network>": "truffle exec ./scripts/deploy.js --network <target network> --ens <ENS Registry address from step 2> --dao-factory <DAO Factory address from step 2>"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:
"deploy:<target network>": "truffle exec ./scripts/deploy.js --network <target network> --ens <ENS Registry address from step 2> --dao-factory <DAO Factory address from step 2> --mini-me-factory <MiniMe Factory address that we have just deployed>"Start a local version of IPFS with
ipfs daemonIf you don't have IPFS installed, check here https://docs.ipfs.io/install/command-line/ how to install it
Publish the Template to APM
npx hardhat compile && npx hardhat publish major --contract <Template contract that we got in previous step> --network <target network> --ipfs-api-url <http://localhost:5001/>
Last updated
Was this helpful?
