Install Node.js by your favorite method, or use Node Version Manager by following directions at https://github.com/creationix/nvm
nvm install v4To develop auroracoin-node:
cd ~
git clone git@github.com:<yourusername>/auroracoin-node.git
git clone git@github.com:<yourusername>/auroracoin.gitTo develop auroracoin or to compile from source:
git clone git@github.com:<yourusername>/auroracoin.git
git fetch origin <branchname>:<branchname>
git checkout <branchname>Note: See auroracoin documentation for building auroracoin on your platform.
For Ubuntu:
sudo apt-get install libzmq3-dev
sudo apt-get install build-essentialNote: Make sure that libzmq-dev is not installed, it should be removed when installing libzmq3-dev.
For Mac OS X:
brew install zeromqcd auroracoin
npm install
cd ../auroracoin-node
npm installNote: If you get a message about not being able to download auroracoin distribution, you'll need to compile auroracoind from source, and setup your configuration to use that version.
We now will setup symlinks in auroracoin-node (repeat this for any other modules you're planning on developing):
cd node_modules
rm -rf auroracoin
ln -s ~/auroracoin
rm -rf auroracoind-rpc
ln -s ~/auroracoind-rpcAnd if you're compiling or developing auroracoin:
cd ../bin
ln -sf ~/auroracoin/src/auroracoindIf you do not already have mocha installed:
npm install mocha -gTo run all test suites:
cd auroracoin-node
npm run regtest
npm run testTo run a specific unit test in watch mode:
mocha -w -R spec test/services/auroracoind.unit.jsTo run a specific regtest:
mocha -R spec regtest/auroracoind.jsTo test running the node, you can setup a configuration that will specify development versions of all of the services:
cd ~
mkdir devnode
cd devnode
mkdir node_modules
touch auroracoin-node.json
touch package.jsonEdit auroracoin-node.json with something similar to:
{
"network": "livenet",
"port": 3001,
"services": [
"auroracoind",
"web",
"insight-api",
"insight-ui",
"<additional_service>"
],
"servicesConfig": {
"auroracoind": {
"spawn": {
"datadir": "/home/<youruser>/.auroracoin",
"exec": "/home/<youruser>/auroracoin/src/auroracoind"
}
}
}
}Note: To install services insight-api and insight-ui you'll need to clone the repositories locally.
Setup symlinks for all of the services and dependencies:
cd node_modules
ln -s ~/auroracoin
ln -s ~/auroracoin-node
ln -s ~/insight-api
ln -s ~/insight-uiMake sure that the <datadir>/auroracoin.conf has the necessary settings, for example:
server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:214022
zmqpubhashblock=tcp://127.0.0.1:214022
rpcallowip=127.0.0.1
rpcuser=auroracoin
rpcpassword=local321
From within the devnode directory with the configuration file, start the node:
../auroracoin-node/bin/auroracoin-node start