Skip to content

Commit b2e08d4

Browse files
committed
More documentation
1 parent 6aeea51 commit b2e08d4

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

server/nodejs/README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Running the server
2-
Prior to running the server a Syscoin node must be installed and properly configured as a JSON-RPC server. After being configured the syscoin-api server
3-
needs to know the location of syscoin.conf using the `SYS_LOCATION` environmental variable, replacing DATALOCATION in the examples below
1+
# Running the Syscoin API NodeJS Server
2+
Prior to running the server a Syscoin node must be installed and properly configured as a JSON-RPC server. After the full node is configured the syscoin-api server
3+
needs to know the location of syscoin.conf using the `SYS_LOCATION` environmental variable, replacing `DATALOCATION` in the examples below
44
with the path to your Syscoin data directory, including the trailing slash.
55

66
To run the server, follow these simple steps:
@@ -11,39 +11,44 @@ SYS_LOCATION=DATALOCATION npm run start
1111
```
1212

1313
## Running the server in daemon mode
14-
Running the server in daemon mode is dependent on [pm2](https://www.npmjs.com/package/pm2). To run the server as a daemon use the below command after `npm install` completes:
14+
Running the server in daemon mode is dependent on [pm2](https://www.npmjs.com/package/pm2). To run the server as a daemon
15+
use the below command after `npm install` completes:
1516

1617
```
1718
SYS_LOCATION=DATALOCATION npm run startd
1819
```
1920

2021
## Running unit tests
2122
Syscoin API has a series of "sanity" unit tests written using the Mocha + Chai test framework and assertions library.
22-
Due to the ansyncronous nature of blockchain transactions, and for ease of use, you must first configure a few Syscoin
23-
services before running the tests. Follow the steps below before running the test suite:
23+
Due to the confirmation-based nature of blockchain transactions and for ease of use, you must first create a few Syscoin
24+
services manually and use the data from these to configure the test, before running the tests.
2425

25-
1. First ensure your wallet is running on a working testnet as the test suite will spend SYS in its execution. You can do this by
26-
editing syscoin.conf and specifying `testnet=1`.
26+
Follow the steps below before running the test suite:
27+
28+
1. First ensure your wallet is running on a working testnet as **the test suite will spend SYS in its execution.** You can do this by
29+
editing `syscoin.conf` and specifying `testnet=1`.
2730
1. Transfer at least 100 syscoin to the root wallet address (can be acquired by running `getaccountaddress ""` via syscoind
2831
or QT debug console)
29-
1. Manually create the following entities on the syscoin network:
30-
1. Create an alias with a password. Set `TEST_ALIAS` and `TEST_ALIAS_PASSWORD` in `server/nodejs/spec/config.js` to the alias and password.
32+
1. Manually create the following entities on the Syscoin network, and populate the result values mentioned below into
33+
[`server/nodejs/spec/config.js`](server/nodejs/spec/config.js):
34+
1. Create an alias with a password. Set `TEST_ALIAS` and `TEST_ALIAS_PASSWORD` to the alias and password.
3135
1. Create an offer with 100 qty and a price of 1 SYS using `TEST_ALIAS` and set `TEST_OFFER_GUID` to the guid of the new offer.
3236
1. Create a certificate using `TEST_ALIAS`, and set `TEST_CERT_GUID` to the guid of the new cert.
3337
1. Create a new message from `TEST_ALIAS` to `TEST_ALIAS`, and set `TEST_MESSAGE_GUID` to the guid of the new message.
3438
1. Create a new escrow using `TEST_ALIAS` as buyer and arbiter, purchasing `TEST_OFFER_GUID`, and set `TEST_ESCROW_GUID` to the guid of the new escrow.
3539
1. Run the test suite using the commend below, ensuring both Syscoin API Server and the Syscoin Core RPC Server are running.
3640

37-
**Note**: Depending on network variables some tests may fail due to lack of confirmation on transactions/operations earlier in
38-
the test suite. The test try to accomodate this by waiting 3mins for confirmations around these confirmation-sensitive
39-
transaction types. These are typically `offerAccept` and `offerAcceptFeedback` tests. Additionally if the `TEST_*` identifiers
40-
you're using in `Config.js` have large result lists you may need to modify the specifics tests by adding a `this.timeout(n)` where `n`
41-
represents a time in ms that allows for the full response to be returned. The default is 2000ms.
4241
```
4342
npm run test
4443
```
44+
45+
**Note**: Depending on network variables some tests may fail due to lack of confirmation on transactions/operations earlier in
46+
the test suite. The test try to accomodate this by waiting 3mins for confirmations around these confirmation-sensitive
47+
transaction types. These are typically `offerAccept` and `offerAcceptFeedback` tests. Additionally if the `TEST_*` identifiers
48+
you're using in `Config.js` have large result lists you may need to modify the specifics tests by adding a `this.timeout(n)` where `n`
49+
represents a time in ms that allows for the full response to be returned. The default is 2000ms.
4550

46-
## Configuring for Production Use
51+
# Configuring for Production Use
4752
Before deploying syscoin-api for production use you will need to modify the following files:
4853

4954
1. `host` value in [`/api/swagger.yaml`](api/swagger.yaml)

0 commit comments

Comments
 (0)