mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
block template
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
export interface IBlockTempalte {
|
||||
// (json object)
|
||||
version: number; // (numeric) The preferred block version
|
||||
rules: string[]; // (json array) specific block rules that are to be enforced // (string) name of a rule the client must understand to some extent; see BIP 9 for format
|
||||
|
||||
vbavailable: { // (json object) set of pending, supported versionbit (BIP 9) softfork deployments
|
||||
rulename: number, // (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
|
||||
},
|
||||
vbrequired: number, // (numeric) bit mask of versionbits the server requires set in submissions
|
||||
previousblockhash: string, // (string) The hash of current highest block
|
||||
transactions: [ // (json array) contents of non-coinbase transactions that should be included in the next block
|
||||
{ // (json object)
|
||||
data: string; //'hex', // (string) transaction data encoded in hexadecimal (byte-for-byte)
|
||||
txid: string; //'hex', // (string) transaction id encoded in little-endian hexadecimal
|
||||
hash: string; //'hex', // (string) hash encoded in little-endian hexadecimal (including witness data)
|
||||
depends: number[]; // (json array) array of numbers // (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
|
||||
fee: number, // (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
|
||||
sigops: number, // (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
|
||||
weight: number // (numeric) total transaction weight, as counted for purposes of block limits
|
||||
}
|
||||
],
|
||||
coinbaseaux: { // (json object) data that should be included in the coinbase's scriptSig content
|
||||
key: string; //'hex', // (string) values must be in the coinbase (keys may be ignored)
|
||||
},
|
||||
coinbasevalue: number, // (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
|
||||
longpollid: string, // (string) an id to include with a request to longpoll on an update to this template
|
||||
target: string, // (string) The hash target
|
||||
mintime: number, // (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time
|
||||
mutable: string[]; // (json array) list of ways the block template may be changed // (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
|
||||
|
||||
noncerange: string; // 'hex', // (string) A range of valid nonces
|
||||
sigoplimit: number, // (numeric) limit of sigops in blocks
|
||||
sizelimit: number, // (numeric) limit of block size
|
||||
weightlimit: number, // (numeric) limit of block weight
|
||||
curtime: number, // (numeric) current timestamp in UNIX epoch time
|
||||
bits: string, // (string) compressed target of next block
|
||||
height: number, // (numeric) The height of the next block
|
||||
default_witness_commitment: string // (string, optional) a valid witness commitment for the unmodified block template
|
||||
|
||||
|
||||
}
|
||||
@@ -9,12 +9,12 @@ export class MiningJob {
|
||||
|
||||
|
||||
public job_id: string; // ID of the job. Use this ID while submitting share generated from this job.
|
||||
public prevhash: string; // Hash of previous block.
|
||||
public coinb1: string; // Initial part of coinbase transaction.
|
||||
public coinb2: string; // Final part of coinbase transaction.
|
||||
public prevhash: string; // The hex-encoded previous block hash.
|
||||
public coinb1: string; // The hex-encoded prefix of the coinbase transaction (to precede extra nonce 2).
|
||||
public coinb2: string; //The hex-encoded suffix of the coinbase transaction (to follow extra nonce 2).
|
||||
public merkle_branch: string[]; // List of hashes, will be used for calculation of merkle root. This is not a list of all transactions, it only contains prepared hashes of steps of merkle tree algorithm.
|
||||
public version: string; // Bitcoin block version.
|
||||
public nbits: string; // Encoded current network difficulty
|
||||
public version: string; // The hex-encoded block version.
|
||||
public nbits: string; // The hex-encoded network difficulty required for the block.
|
||||
public ntime: string; // Current ntime/
|
||||
public clean_jobs: boolean; // When true, server indicates that submitting shares from previous jobs don't have a sense and such shares will be rejected. When this flag is set, miner should also drop all previous jobs too.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user