Set Up Secure Signing: edits per reviews

- Moved the LAN config tutorial to its own (draft) file to be finished later
- Mentioned dedicated signing devices such as the Ledger Nano S
- Improved the JS example's handling of secrets
This commit is contained in:
mDuo13
2019-02-14 17:10:34 -08:00
parent f94191a9db
commit 984533a702
4 changed files with 89 additions and 59 deletions

View File

@@ -1,20 +1,23 @@
'use strict'
const RippleAPI = require('ripple-lib').RippleAPI
// Load address & secret from environment variables:
const from_address = process.env['MY_ADDRESS']
const secret = process.env['MY_SECRET']
// Can sign offline if the txJSON has all required fields
const api = new RippleAPI()
const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za", \
"TransactionType":"Payment", \
"Destination":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", \
"Amount":"13000000", \
"Flags":2147483648, \
"LastLedgerSequence":7835923, \
"Fee":"13", \
"Sequence":2}'
// Be careful where you store your real secret.
const secret = 's████████████████████████████'
const txJSON = JSON.stringify({
"Account": from_address,
"TransactionType":"Payment",
"Destination":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"13000000",
"Flags":2147483648,
"LastLedgerSequence":7835923,
"Fee":"13",
"Sequence":2
})
const signed = api.sign(txJSON, secret)