Introduction
The aragonCLI (Command Line Interface) is used to create, develop, configure and manage Aragon DAOs and Applications.
Installation
Installation pre-requisites
The following must be installed prior to installation:
Node + npm + yarn
We recommend to install Node using Node Version Manager or NVM. You can find instructions on how to install NVM and Node here.
After downloading and unpacking, you must add the /bin folder to your $PATH.
For Linux:
git
Install this using the command
sudo apt install git
python
Install this using the command
sudo apt install python
make
Install this using the command
sudo apt install make
g++
Install this using the command
sudo apt install g++
For Mac:
git
Install this using the official installer. We recommend using the package manager Homebrew, in this case use the command
brew install git
.
Note: Python comes pre-installed on Mac.
For Windows:
windows-build-tools
Install with
npm i windows-build-tools
Install aragonCLI
The aragonCLI can be installed from NPM:
In case the above does not work, aragonCLI can also be built and installed from the source with the following commands:
If you're seeing errors similar to:
EACCES: permission denied
It's probably because you originally installed Node with root permissions. Because of this, writing to your npm directory (npm -i -g
) requires root permissions too.
While it's not a good idea to have Node installed this way, one way to quickly give yourself root permissions is to run the slightly modified command:
sudo npm i -g --unsafe-perm @aragon/cli
An arguably better way to fix the problem is to follow the steps outlined in this stackoverflow answer.
After installing aragonCLI, the main aragon
executable will be available for use. Also, the dao
alias will be available which is a shortcut for aragon dao
commands.
The ~/.aragon directory
The aragonCLI creates the .aragon
directory under the user's home directory, where it saves the state of the devchain and the Aragon client. At the moment, this folder is only automatically created after running aragon devchain
once, but can also be created by via mkdir ~/.aragon
.
Set a private key
Warning
The default mnemonic for the Aragon CLI is the same for all users. If you are going to deploy contracts to public networks it is highly recommended that you use your own web3 provider and set your own private key.
You can configure a private key for the Aragon CLI in ~/.aragon
. To do so you will need to create a file <network>_key.json
(eg. rinkeby_key.json
) with this structure:
You can easily create a new file from the terminal. Find how to do it for Linux and Mac and for Windows.
Then if you use --env aragon:<network>
when using the aragonCLI it will use that account.
You can also define an ~/.aragon/mnemonic.json
file like:
Install IPFS
Since v6.0.0
we separate the installation of go-ipfs
from the aragonCLI. If you do not have it installed globally on your system we have a couple of commands to help with that:aragon ipfs install
and aragon ipfs uninstall
.
Global options
Options that change the behaviour of the aragon
command:
--environment
: The environment in yourarapp.json
that you want to use. Defaults toaragon:local
. Check the other default environments. You can also use it with the--env
alias.--gas-price
: Gas price in Gwei. Defaults to2
.--use-frame
: Use Frame as a signing provider and web3 provider.--ens-registry
: Address of the ENS registry. This will be overwritten if the selected environment from your arapp.json includes aregistry
property.--ipfs-gateway
: An URI to the IPFS Gateway to read files from. Defaults tohttp://localhost:8080/ipfs
.--ipfs-rpc
: An URI to the IPFS node used to publish files. Defaults tohttp://localhost:5001#default
.--cwd
: Project working directory.--debug
: Show more output to terminal.--silent
: Silence output to terminal.
Example
create-aragon-app
This command will set up an Aragon app project so you can start building your app from a functional boilerplate.
app-name
: The name or ENS domain name for your app in an aragonPM Registry (e.g.myapp
ormyapp.aragonpm.eth
). If only the name is provided it will create your app on the defaultaragonpm.eth
registry.boilerplate
: (optional) the Github repo name or alias for a boilerplate to set up your app. The currently available boilerplates are:react
: this boilerplate contains a very basic Counter app and a webapp for interacting with it. It showcases the end-to-end interaction with an Aragon app, from the contracts to the webapp. Also it comes with a DAO Template which will allow for using your app to interact with other Aragon apps like the Voting app. You can read more about DAO Template here.bare
: this boilerplate will just set up your app directory structure but contains no functional code.tutorial
: this boilerplate is the one used in the "Your first Aragon app" guide.other available boilerplates you can find here.
Note
Npx is an independent package, it's not necessary to have @aragon/cli
installed to use it. npx comes with npm 5.2+. If you use npm 5.1 or earlier, you can't use npx
. Instead, install create-aragon-app
globally
Last updated