You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/nodejs/README.md
+21-16Lines changed: 21 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
4
4
with the path to your Syscoin data directory, including the trailing slash.
5
5
6
6
To run the server, follow these simple steps:
@@ -11,39 +11,44 @@ SYS_LOCATION=DATALOCATION npm run start
11
11
```
12
12
13
13
## 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:
15
16
16
17
```
17
18
SYS_LOCATION=DATALOCATION npm run startd
18
19
```
19
20
20
21
## Running unit tests
21
22
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.
24
25
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`.
27
30
1. Transfer at least 100 syscoin to the root wallet address (can be acquired by running `getaccountaddress ""` via syscoind
28
31
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
1. Create an alias with a password. Set `TEST_ALIAS` and `TEST_ALIAS_PASSWORD` to the alias and password.
31
35
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.
32
36
1. Create a certificate using `TEST_ALIAS`, and set `TEST_CERT_GUID` to the guid of the new cert.
33
37
1. Create a new message from `TEST_ALIAS` to `TEST_ALIAS`, and set `TEST_MESSAGE_GUID` to the guid of the new message.
34
38
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.
35
39
1. Run the test suite using the commend below, ensuring both Syscoin API Server and the Syscoin Core RPC Server are running.
36
40
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.
42
41
```
43
42
npm run test
44
43
```
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.
45
50
46
-
##Configuring for Production Use
51
+
# Configuring for Production Use
47
52
Before deploying syscoin-api for production use you will need to modify the following files:
48
53
49
54
1.`host` value in [`/api/swagger.yaml`](api/swagger.yaml)
0 commit comments