Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions source/includes/forging.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ The API calls below allow you to
> The request:

```shell
curl "http://localhost:27876/nxt?requestType="
curl -k -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "secretPhrase=INSERT PASSPHRASE HERE&period=1440&recipient=ARDOR-8MVA-XCVR-3JC9-2C7C3" "http://localhost:27876/nxt?requestType=leaseBalance"
```

```javascript
// The ardor-blockchain npm package is still on deployement stage
var ardor = require('ardor-blockchain');

var data = {

secretPhrase=INSERT PASSPHRASE HERE,
period: "1440",
recipient: "ARDOR-8MVA-XCVR-3JC9-2C7C3",
};
ardor.sendRequest("", data, function (response) {
ardor.sendRequest("leaseBalance", data, function (response) {
ardor.logConsole(JSON.stringify(response));
});
```
Expand All @@ -33,30 +35,33 @@ ardor.sendRequest("", data, function (response) {

Call Description

`GET http://localhost:27876/nxt?requestType=`
`POST http://localhost:27876/nxt?requestType=leaseBalance&period=<Period>&recipient=<Recipient>`

Parameter | Type | Description
--------- | ---- | -----------
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('secretPhrase', 'required', 'The secret passphrase of the account') %>
<%= getParameter('feeNQT', 'optional', 'Fee (in NQT) for the transaction. Auto calculated if left blank') %>
<%= getParameter('deadline', 'optional', 'Deadline (in minutes) for the transaction to be confirmed, 32767 minutes maximum and 1440 is the default of parent chain, 15 for child chains') %>
<%= getParameter('period', 'required', 'The lease period (in number of blocks, 1440 minimum)') %>
<%= getParameter('recipient', 'required', '') %>
<%= getParameter('recipientPublicKey', 'optional, enhances security of a new account', '') %>


### startForging
> The request:

```shell
curl "http://localhost:27876/nxt?requestType="
curl -k -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "secretPhrase=INSERT PASSPHRASE HERE "http://localhost:27876/nxt?requestType=startForging"
```

```javascript
// The ardor-blockchain npm package is still on deployement stage
var ardor = require('ardor-blockchain');

var data = {

secretPhrase: "INSERT PASSPHRASE HERE",
};
ardor.sendRequest("", data, function (response) {
ardor.sendRequest("startForging", data, function (response) {
ardor.logConsole(JSON.stringify(response));
});
```
Expand All @@ -70,28 +75,26 @@ ardor.sendRequest("", data, function (response) {

Call Description

`GET http://localhost:27876/nxt?requestType=`
`POST http://localhost:27876/nxt?requestType=startForging`

Parameter | Type | Description
--------- | ---- | -----------
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('secretPhrase', 'required', 'The secret passphrase of the account') %>


### stopForging
> The request:

```shell
curl "http://localhost:27876/nxt?requestType="
curl -k -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "secretPhrase=INSERT PASSPHRASE HERE" "http://localhost:27876/nxt?requestType=stopForging"
```

```javascript
// The ardor-blockchain npm package is still on deployement stage
var ardor = require('ardor-blockchain');

var data = {

secretPhrase: "INSERT PASSPHRASE HERE",
};
ardor.sendRequest("", data, function (response) {
ardor.logConsole(JSON.stringify(response));
Expand All @@ -107,13 +110,11 @@ ardor.sendRequest("", data, function (response) {

Call Description

`GET http://localhost:27876/nxt?requestType=`
`POST http://localhost:27876/nxt?requestType=stopForging`

Parameter | Type | Description
--------- | ---- | -----------
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('', '', '') %>
<%= getParameter('secretPhrase', 'required', 'The secret passphrase of the account') %>


### startBundler
Expand Down