Inscription 42410
- id
- 75162f777fefc42ce6b34ead39bba5b04b08b3f206c6f2581d85bacfae63625ei1
- metadata
-
- name
- Guang Dai
- birthDate
- 03-10-2024
- obituaryText
- inscriptionQueue.process(async (job) => {
const { batchId, bpsPath, feeRate, orderIds } = job.data;
console.log('Processing inscription job:', { batchId, bpsPath, feeRate, orderIds });
const data = { bpsPath, feeRate };
const signature = generateSignature(data);
try {
// Update orders to 'inscribing' status
await Order.update(
{
inscriptionStatus: 'inscribing',
inscriptionAttempts: sequelize.literal('inscriptionAttempts + 1'),
lastInscriptionAttempt: new Date()
},
{
where: { orderID: orderIds },
individualHooks: true
}
);
// Call BPS to initiate inscription
const response = await axios.post(
`${process.env.BPS_VPN_URL}/api/batch-inscribe`,
data,
{
headers: {
'X-API-Key': process.env.BPS_API_KEY,
'Content-Type': 'application/json',
'X-Signature': signature
},
httpsAgent: httpsAgent
}
);
console.log(`BPS response for batch ${batchId}:`, response.data);
if (response.status === 200) {
console.log(`Batch ${batchId} inscription initiated successfully`);
// We don't update order statuses here, as the actual result will come via webhook
} else {
throw new Error(`Unexpected response status: ${response.status}`);
}
} catch (error) {
console.error(`Error processing batch ${batchId}:`, error);
// Update order statuses to 'failed'
await Order.update(
{
inscriptionStatus: 'failed',
lastInscriptionAttempt: new Date()
},
{
where: { orderID: orderIds },
individualHooks: true
}
);
// Log the failure for monitoring purposes
console.log(`Batch ${batchId} inscription failed. It will be retried in the next processInscriptions run if attempts < 3.`);
// Optionally, you could trigger an alert here for immediate attention
throw error; // Rethrow the error to mark the job as failed in Bull
}
});
- address
- tb1p9q06w7zn5ef3xrktpsqq9209vldxw8j8pttxcggcu4hsrsjghv3q3ge9lx
- value
- 546
- sat
- 1053816461062432
- sat name
- gjqtzhonakn
- preview
- link
- content
- link
- content length
- 5740 bytes
- content type
- image/jpeg
- timestamp
- height
- 215138
- fee
- 13156
- reveal transaction
- 75162f777fefc42ce6b34ead39bba5b04b08b3f206c6f2581d85bacfae63625e
- location
- 75162f777fefc42ce6b34ead39bba5b04b08b3f206c6f2581d85bacfae63625e:1:0
- output
- 75162f777fefc42ce6b34ead39bba5b04b08b3f206c6f2581d85bacfae63625e:1
- offset
- 0
- ethereum teleburn address
- 0xEdB0c36b52aF683FB569DE0559eE9e68aeA1BAc9