Setting up an instance for LND
- EC2: T3 small or better
I hereby claim:
To claim this, I am signing this object:
const OpenTimestamps = require('javascript-opentimestamps'); | |
/** Timestamp text | |
{ | |
text: <Text String> | |
} | |
@returns via cbk | |
{ |
/** Transaction input | |
*/ | |
struct TransactionInput { | |
/** Final sequence number marking the input as final | |
*/ | |
static let finalSequence = UInt32.max | |
/** Spending output | |
*/ | |
let outpoint: Outpoint |
import Foundation | |
/** Outpoint | |
*/ | |
struct Outpoint { | |
/** Index | |
*/ | |
let index: UInt32 | |
/** Number of bytes for the outpoint index |
import Foundation | |
/** Can be included after this time marker | |
*/ | |
enum Locktime { | |
case date(Date) | |
case height(Int) | |
/** Number of bytes | |
*/ |
/** Compact Size UInt | |
*/ | |
enum CompactSizeUInt { | |
case uint8(UInt8), uint16(UInt16), uint32(UInt32), uint64(UInt64) | |
// MARK: - Init | |
/** Create from hex string | |
*/ | |
init(from hex: String) throws { |
/** Compact size uint marker byte | |
*/ | |
enum CompactSizeMarker: Byte { | |
case uint8, uint16 = 253, uint32, uint64 | |
/** Byte length of discriminant | |
*/ | |
static let discriminantByteLength = 1 | |
/** Hex byte length |
/** Extensions to Data | |
*/ | |
extension Data { | |
/** Create data from hex string | |
*/ | |
init(hex: String) throws { | |
var bytes = Array<Byte>(repeating: Byte(), count: (hex.unicodeScalars.count + 1) >> 1) | |
try hex.unicodeScalars.enumerated().forEach { index, scalar in | |
var nibble = try scalar.hexNibble() |
/** Extensions to UnicodeScalar | |
*/ | |
extension UnicodeScalar { | |
/** Unicode scalar errors | |
*/ | |
enum UnicodeScalarError: String, Error { | |
case illegalHexValue | |
} | |
/** Get the byte value of a hex nibble |