
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
chronosnet-js
Advanced tools
JavaScript SDK for ChronosNet - A distributed temporal consensus network
A comprehensive JavaScript/TypeScript client for integrating with ChronosNet temporal anchoring and decentralized networking platform.
npm install chronosnet-js
or
yarn add chronosnet-js
import { ChronosNet } from 'chronosnet-js';
// Create and start a node
const node = new ChronosNet({
nodeId: 'my-js-node',
apiPort: 8081
});
await node.start();
// Create an event with error handling for SDK parsing issue
try {
const event = await node.createEvent({
data: { message: 'Hello from JavaScript!' },
eventType: 'greeting'
});
console.log('Event created:', event.eventId);
} catch (error) {
// Handle SDK parsing issue - successful HTTP 200 responses reported as errors
if (error.message && error.message.includes('HTTP 200') && error.message.includes('event_id')) {
// Extract event data from error message
const eventMatch = error.message.match(/{"event_id":.*}/);
if (eventMatch) {
const eventData = JSON.parse(eventMatch[0]);
console.log('Event created (from HTTP 200):', eventData.event_id);
} else {
console.error('Failed to extract event data from error message');
}
} else {
// Re-throw other errors
throw error;
}
}
// Get all events
const events = await node.getEvents();
console.log(`Total events: ${events.length}`);
import { ChronosNetClient } from 'chronosnet-js';
// Connect to existing node
const client = new ChronosNetClient({
baseUrl: 'http://localhost:8081'
});
// Create an event with error handling for SDK parsing issue
try {
const event = await client.createEvent({
data: { user: 'alice', action: 'login' },
eventType: 'user_action'
});
console.log('Event created:', event.eventId);
} catch (error) {
// Handle SDK parsing issue - successful HTTP 200 responses reported as errors
if (error.message && error.message.includes('HTTP 200') && error.message.includes('event_id')) {
// Extract event data from error message
const eventMatch = error.message.match(/{"event_id":.*}/);
if (eventMatch) {
const eventData = JSON.parse(eventMatch[0]);
console.log('Event created (from HTTP 200):', eventData.event_id);
} else {
console.error('Failed to extract event data from error message');
}
} else {
// Re-throw other errors
throw error;
}
}
// Query events
const events = await client.queryEvents({
eventType: 'user_action',
limit: 10
});
console.log('Recent events:', events);
Known Issue: The ChronosNet SDK may incorrectly report successful HTTP 200 responses as errors when creating events. Despite the error, events are actually created successfully with valid event IDs, temporal proofs, and causal parent references. Use the utility functions below to handle this issue.
import { createEventWithErrorHandling, extractEventFromError } from 'chronosnet-js';
// Using the utility function
const client = new ChronosNetClient({
baseUrl: 'http://localhost:8081'
});
// Using the wrapper function
const event = await createEventWithErrorHandling(client, {
data: { message: 'Testing error handling' },
eventType: 'test_event'
});
console.log('Event created with ID:', event.event_id);
import { ChronosNetClient, ChronosNetError, ValidationError, NetworkError } from 'chronosnet-js';
try {
const event = await client.createEvent({
data: { invalid: 'data' },
eventType: 'test'
});
} catch (error) {
if (error instanceof ValidationError) {
console.error('Validation failed:', error.details);
} else if (error instanceof NetworkError) {
console.error('Network error:', error.message);
// Retry logic here
} else if (error instanceof ChronosNetError) {
console.error('ChronosNet error:', error.code, error.message);
} else {
console.error('Unexpected error:', error);
}
}
Full Node Implementation for server-side applications and full ChronosNet nodes.
new ChronosNet(options: {
nodeId: string;
apiPort?: number;
p2pPort?: number;
vdfDifficulty?: number;
})
Creates a new ChronosNet node instance with the specified configuration.
async start(): Promise<void> - Start the ChronosNet node and all servicesasync createEvent(options): Promise<Event> - Create a new temporal eventasync getEvents(options?): Promise<Event[]> - Get events with optional filteringasync getStatus(): Promise<NodeStatus> - Get node health and statisticsHTTP Client Implementation for browser applications and lightweight integrations.
new ChronosNetClient(options: {
baseUrl: string;
timeout?: number;
headers?: Record<string, string>;
})
Creates a client to connect to an existing ChronosNet node via HTTP.
async createEvent(options): Promise<Event> - Create event via REST APIasync queryEvents(filters): Promise<Event[]> - Advanced event queryingasync getNodeStatus(): Promise<NodeStatus> - Get node health and statisticsMIT
FAQs
JavaScript SDK for ChronosNet - A distributed temporal consensus network
We found that chronosnet-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.