Don’t install nodejs with apt, Otherwise, you will meet a lot of permission related issues

Install nodejs

$ wget
$ sudo tar -zxvf node-v10.12.0-linux-x64.tar.gz -C /usr/local
$ sudo ln -s /usr/local/node-v10.12.0-linux-x64/bin/* /usr/bin/
$ node -v
$ sudo chmod -R 777 /usr/local/node-v10.12.0-linux-x64/bin
$ sudo chmod -R 777 /usr/local/node-v10.12.0-linux-x64/lib/node_modules/

Install alaya-truffle

$ npm install -g alaya-truffle@0.13.2
$ sudo ln -s /usr/local/node-v10.12.0-linux-x64/bin/* /usr/bin/
$ alaya-truffle version


If you meeting this problem(Example: connect ECONNREFUSED, May be a problem with github routing, You can try the following method:

  • copy related content( and paste to /etc/hosts

If the wasm compiler always fails to download due to network problems, you can go directly to github to download the compiled compressed file, and then unzip it to the ~/.config/alaya-truffle/compilers directory, and change it to platon-cdt/bin/wasm -opt soft link to /usr/bin directory

sudo tar -zxvf platon-cdt.tar.gz -C ${USER}/.config/alaya-truffle/compilers/
sudo ln -s ${USER}/.config/alaya-truffle/compilers/platon-cdt/bin/wasm-opt /usr/bin/wasm-opt


  • NodeJS v10.12.0 or later
  • Ubuntu16.04 or later

alaya-truffle also requires that you have a running PlatON client which supports the standard JSON RPC API (which is nearly all of them). There are many to choose from, and some better than others for development. We’ll discuss them in detail in the Choosing an PlatON client section.