Documentation

Documentation

Getting Started with Pillars

Welcome to Pillars, the distributed infrastructure for verifiable computing. This guide will help you get started with integrating Pillars into your applications, understanding the architecture, and leveraging the platform's capabilities.

Installation

To get started with Pillars, install our client SDK using a local path:

npm install --save ./path/to/pillars-sdk

Basic Usage

Here's a simple example of initializing the Pillars client and submitting a transaction for a PyTorch model:

import { PillarsClient } from '../path/to/pillars-sdk';

// Initialize the client
const client = new PillarsClient({
  apiKey: 'YOUR_API_KEY',
  environment: 'production' // or 'sandbox' for testing
});

// Create a transaction for a PyTorch model
async function createModelVerificationTransaction() {
  try {
    // Create transaction for PyTorch model verification
    const transaction = await client.transactions.create({
      metadata: {
        description: 'PyTorch NLP Model Verification',
        tags: ['ai', 'pytorch', 'nlp', 'model', 'verification'],
        modelName: 'SentimentAnalyzer-v2',
        modelVersion: '1.3.0',
        modelType: 'pytorch',
        framework: 'PyTorch 2.0',
        author: 'AI Research Team'
      },
      payload: {
        data: {
          modelArchitecture: 'BERT-Base',
          trainingDataset: 'Customer Reviews Dataset v3',
          epochs: 5,
          batchSize: 32,
          learningRate: 2e-5,
          accuracy: 0.94,
          f1Score: 0.92,
          trainDate: '2025-05-01',
          purpose: 'Sentiment analysis of customer feedback'
        },
        contentReferences: [
          {
            contentId: 'content-12345-model',
            contentType: 'application/octet-stream',
            description: 'PyTorch model weights'
          },
          {
            contentId: 'content-12345-config',
            contentType: 'application/json',
            description: 'Model configuration'
          },
          {
            contentId: 'content-12345-vocab',
            contentType: 'application/json',
            description: 'Model vocabulary'
          },
          {
            contentId: 'content-12345-metrics',
            contentType: 'text/csv',
            description: 'Training metrics'
          }
        ]
      }
    });
    
    console.log('Transaction created:', transaction.transactionId);
    console.log('Model verified with Pillars');
    return transaction;
  } catch (error) {
    console.error('Error creating transaction:', error);
    throw error;
  }
}

Understanding the Architecture

Pillars is built on a three-tiered architecture:

  • Level Zero (Data Storage): The blockchain-based foundation providing security, immutability, and high throughput.
  • Level One (File Storage): Distributed storage for large files with cryptographic verification.
  • Level Two (Application Layer): Developer tools, APIs, and execution environments for building applications.