-
Notifications
You must be signed in to change notification settings - Fork 494
Setting Up Local Environment
-
Install node.js. Node.js should come with Node Package Manager (npm).
-
Install Grunt. If you installed npm properly, you can run the following command in your Terminal. You may need to prefix this command with 'sudo'.
$ npm install -g grunt-cli
-
Install bower
$ npm install -g bower
-
Install Git and then clone the Ripple Trade client repo and run npm install.
$ git clone https://github.com/ripple/ripple-client ./ripple-client $ cd ripple-client $ npm install $ bower install
-
Create a new config.js file and copy/paste from config-example.js into the same directory, located under 'src/js'.
-
Likewise, create a new config.json file by copying config-example.json in the same directory, located under the repo root directory.
Run the following command to build the client.
$ grunt
Your web client is in the 'build/bundle/web/' directory. Use 'index_debug.html' for development.
If you want to watch for changes and have the client rebuild for index_debug.html, run the following command while you make changes:
$ grunt watch
- Find your root 'hosts' file.
For Mac, this is usually located at /private/etc/hosts. For Windows, this is usually located at ~%SystemRoot%\system32\drivers\etc\hosts
If you can't find your hosts file, please refer to this wiki.
-
Add
127.0.0.1 local.ripple.com
to your 'hosts' file. -
Set up a web server - use either apache or the node.js development server as described in the sections below.
There is a node.js server available, for development only, which you may use instead of apache. It simply serves the static files from build/bundle/web. Run it with the 'devserver' grunt task, i.e. grunt devserver
.
- Find your 'httpd.conf' file from the directory where your Apache is installed.
For Mac, this is usually located at '~/private/etc/apache2/httpd.conf'. For Windows, this may be located at 'C:\Program Files\Apache Software Foundation\Apache2.4\httpd.conf'.
- Change "DocumentRoot" in your httpd.conf file to where your Ripple Trade client repository is located. Make sure you add "/build/bundle/web" to the end of the path.
DocumentRoot "/location/of/ripple-client/build/bundle/web"
If there is a line below with a Directory tag containing a path, replace that path with either "/" (without quotation marks) or by repeating the same path (with quotation marks).
For example, on Mac it should look like this:
<Directory "/location/of/ripple-client/build/bundle/web"> or <Directory />
-
In
ripple-client/src/js/config.js
, make sure you change the 'domain' under Options tostaging.ripple.com
. -
Start Apache
Run the following command from your Terminal:
$ sudo apachectl start
Remember that if you make any changes to your httpd.conf file or hosts file, you have to restart your apache server:
$ sudo apachectl restart
-
If you're running win32, visit Apache Software Foundation's website to download Apache.
-
If you're running win64, you can find the latest win64 binary here.
-
Start your Apache server. Remember that if you make any changes to your httpd.conf file or hosts file, you have to restart your Apache server.
-
Open up your browser and point to 'local.ripple.com/index_debug.html#'.
-
Always run
index_debug.html
during development. -
WebPack module bundler
- Has an entry file
entry/web.js
- bundles the entire app to one file for the Jade and JS files respectively
- Has an entry file
Local URL: local.ripple.com
Staging URL: staging.ripple.com