Ardor Develop Tips for Dummies
If you are not a professional developer like me, or not familiar with the Ardor platform, here are some quick tips you may find useful at the beginning :).
Difference between Ardor and Ignis
In short, Ardor is the parent chain, using the token ARDOR, which security the networks and package all child-chain transactions.You can’t do much thing only with Ardor chain.
Ignis is the first child-chain which has the most features , using the token IGNIS.
If you want build some dApps , you should focus on Ignis chain and may need some IGNIS coins.
The official Ardor client has a API Console packaged in, which I found quite useful. You can test all API calls there and check the response:
Located at http://localhost:27876/test
It also lead you to the Wiki page of those API calls.
There is also a new Ardor API Reference in construction.
The Chain-id of Ignis is 2
Most API calls need a param called ‘chain’ to specify the chain-id.
The Ignis chain-id is 2 (I thought was 1, and wasted a lot of time ^^;) .
Get the Minimal-fee
The minimal fee needed for each transaction depends on transaction type, bundle rate, and size of attached data.
There is a simple way to get the minimal fee:
- Submit your transaction with ‘broadcast’ => false.
- Get the ‘feeNQT’ filed of response(that’s the minimal fee).
- Submit your transaction again with ‘broadcast’ => true and the feeNQT you got.
For fees of different transaction types, there is a official note: https://www.jelurida.com/sites/default/files/ArdorFees.pdfs
Calculate the Current Timestamp
The timestamp API returning is the seconds after Ardor Main Net Launch, which is 2018–01–01 0:00 (UTC).
So if you want get the real date, JS code for example:
real_date = new Date(response[‘timestamp’]*1000 + Date.UTC(2018));