Skip to main content

Configuration

MnemosClient takes a single config object in its constructor.

MnemosClientConfig

interface MnemosClientConfig {
privateKey: `0x${string}`;
chainId: number;
rpcUrl: string;
storageNodeUrl: string;
registryAddress: `0x${string}`;
marketplaceAddress: `0x${string}`;
storageMock?: boolean;
}
FieldTypeDescription
privateKey`0x${string}`Your wallet's private key in hex with 0x prefix. Used to sign all transactions.
chainIdnumberEVM chain ID. Must be 16661 for 0G Mainnet.
rpcUrlstringJSON-RPC endpoint for 0G Chain. Use https://evmrpc.0g.ai.
storageNodeUrlstring0G Storage indexer URL. Use https://indexer-storage-turbo.0g.ai.
registryAddress`0x${string}`MemoryRegistry contract address.
marketplaceAddress`0x${string}`MemoryMarketplace contract address.
storageMockboolean (optional)Skip real 0G Storage uploads and use a stub URI. Useful for demos and testing. Default: false.
import 'dotenv/config';
import { MnemosClient } from '@mnemos-sdk/sdk';

const mnemos = new MnemosClient({
privateKey: process.env.AGENT_PRIVATE_KEY as `0x${string}`,
chainId: parseInt(process.env.OG_CHAIN_ID!),
rpcUrl: process.env.OG_RPC_URL!,
storageNodeUrl: process.env.OG_STORAGE_NODE!,
registryAddress: process.env.REGISTRY_ADDRESS as `0x${string}`,
marketplaceAddress: process.env.MARKETPLACE_ADDRESS as `0x${string}`,
});

See Environment Setup → for the .env file template with all fixed 0G Mainnet values.

storageMock

When storageMock: true, the SDK skips the actual 0G Storage upload and uses a placeholder URI. The on-chain mint still happens, so token IDs are real — but the storage URI will point to non-existent content.

Use this when:

  • Running demos without A0GI for storage fees
  • Writing unit tests against a local chain
const mnemos = new MnemosClient({
// ... other config ...
storageMock: true,
});

Do not use storageMock in production — memory bundles will not be stored and cannot be loaded.