From fbdda22c14ead196ecf1b0e8b44ab0b76bc8d037 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 25 Mar 2018 00:24:24 -0600 Subject: [PATCH] Create README.md --- server/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 server/README.md diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..a2157c2 --- /dev/null +++ b/server/README.md @@ -0,0 +1,30 @@ +# XSN Block Explorer - Server + +## Run +1. We need the xsn rpc server running, download the latest one from [xsn releases](https://github.com/X9Developers/XSN/releases), then, start the rpc server with: `bin/xsnd -txindex -addressindex -spentindex -rpcport=51473 -rpcuser=dummy -rpcpassword=replaceme` + +2. In case you modified the parameters to start the xsn rpc server, edit the [application.conf](server/conf/application.conf). + +3. Add this `play.filters.enabled += "play.filters.cors.CORSFilter"` to the [application.conf](server/conf/application.conf). + +4. Run the application with: `sbt run` + +## Test +Run the `sbt test` command to execute the tests. + +## Deploy + +This assumes that you have the following: +- A linux-based virtual machine prepared with Java 8 and a systemd service called `xsn-backend`. +- A system level user called `play` which belogs to the group `nogroup`. + +### Client side +- Package the application: `sbt dist` +- Upload the application: `scp target/universal/xsn-block-explorer-0.1.0-SNAPSHOT.zip $SERVER_IP:~/` +- Login into the server: `ssh $SERVER_IP`. + +### Server side +- Unpack the application: `sudo unzip ~/xsn-block-explorer-0.1.0-SNAPSHOT.zip -d /home/play/server` +- Update configuration: `sudo vim /home/play/server/xsn-block-explorer-0.1.0-SNAPSHOT/conf/application.conf` +- Give permissions: `sudo chown -R play:nogroup /home/play/server` +- Restart the service: `sudo service xsn-backend restart`