Skip to main content

Installation

Get L{CORE} SDK installed and configured in your project.


SDK Installation

TypeScript / JavaScript

npm install @localecore/lcore-sdk

Or with yarn:

yarn add @localecore/lcore-sdk

Or with pnpm:

pnpm add @localecore/lcore-sdk

Python

pip install lcore-sdk

Or with poetry:

poetry add lcore-sdk

C (Embedded)

Clone the repository and include the header:

git clone https://github.com/Modern-Society-Labs/lcore-sdk.git
#include "lcore-sdk/packages/c/include/lcore.h"

Link against the library during compilation:

gcc -o myapp myapp.c -L./lcore-sdk/packages/c/lib -llcore

Basic Configuration

TypeScript

import { LCore } from '@localecore/lcore-sdk'

const lcore = new LCore({
attestorUrl: 'http://localhost:8001', // Or your Attestor endpoint
cartesiUrl: 'http://localhost:10000', // Or your Cartesi node endpoint
dappAddress: '0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d',
})

Python

from lcore_sdk import LCore

lcore = LCore(
attestor_url='http://localhost:8001',
cartesi_url='http://localhost:10000',
dapp_address='0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d',
)

C

#include "lcore.h"

lcore_config_t config = {
.attestor_url = "http://localhost:8001",
.cartesi_url = "http://localhost:10000",
.dapp_address = "0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d",
};

lcore_client_t* client = lcore_init(&config);

Endpoints

Use the shared testnet infrastructure:

ServiceEndpoint
AttestorContact team for access
Cartesi NodeContact team for access
DApp Address0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d
NetworkArbitrum Sepolia

Self-Hosted

Run your own infrastructure:

git clone https://github.com/Modern-Society-Labs/lcore-sdk.git
cd lcore-sdk
cp .env.example .env
# Edit .env with your configuration
docker-compose up -d

See Self-Hosting Guide for details.


Verify Installation

TypeScript

import { LCore } from '@localecore/lcore-sdk'

const lcore = new LCore({
attestorUrl: 'http://localhost:8001',
cartesiUrl: 'http://localhost:10000',
dappAddress: '0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d',
})

// Check health
const health = await lcore.health()
console.log('Attestor status:', health.attestor)
console.log('Cartesi status:', health.cartesi)

Python

from lcore_sdk import LCore

lcore = LCore(
attestor_url='http://localhost:8001',
cartesi_url='http://localhost:10000',
dapp_address='0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d',
)

# Check health
health = lcore.health()
print(f"Attestor status: {health['attestor']}")
print(f"Cartesi status: {health['cartesi']}")

TypeScript Configuration Options

interface LCoreConfig {
// Required
attestorUrl: string // Attestor service URL
cartesiUrl: string // Cartesi node URL
dappAddress: string // DApp contract address

// Optional
timeout?: number // Request timeout in ms (default: 30000)
retries?: number // Number of retries (default: 3)
debug?: boolean // Enable debug logging (default: false)
}

Environment Variables

The SDK can read configuration from environment variables:

LCORE_ATTESTOR_URL=http://localhost:8001
LCORE_CARTESI_URL=http://localhost:10000
LCORE_DAPP_ADDRESS=0xAE0863401D5B953b89cad8a5E7c98f5136E9C26d
import { LCore } from '@localecore/lcore-sdk'

// Reads from environment variables
const lcore = LCore.fromEnv()

Next Steps