Ethereum Kit

Overview

Server-side Ethereum Kit for Node.js environments

Node.js API

The Node.js entry point provides server-side functionality for integrating Ethereum applications with the Shelby Protocol. It's designed for backend services, scripts, and CLI applications where you have direct access to Ethereum wallets via ethers.js.

Installation

npm install @shelby-protocol/ethereum-kit ethers

Usage

Import from the @shelby-protocol/ethereum-kit/node entry point:

import { Shelby, Network } from "@shelby-protocol/ethereum-kit/node";
import { Wallet } from "ethers";

// Initialize the Shelby client
const shelbyClient = new Shelby({
  network: Network.SHELBYNET,
  apiKey: "AG-***",
});

// Create a storage account from an Ethereum wallet
const ethereumWallet = new Wallet("0x...private_key...");
const storageAccount = shelbyClient.createStorageAccount(
  ethereumWallet,
  "my-app.com"
);

// Upload data
await shelbyClient.upload({
  blobData: new Uint8Array([1, 2, 3]),
  signer: storageAccount,
  blobName: "example.txt",
  expirationMicros: Date.now() * 1000 + 86400000000,
});

When to Use Node.js

Use the Node.js entry point when you:

  • Have direct access to Ethereum private keys (e.g., from environment variables or key files)
  • Building backend services or APIs
  • Running scripts or CLI tools
  • Processing data server-side before storing on Shelby

For browser applications with wallet connections, use the React entry point instead.

Exports

The @shelby-protocol/ethereum-kit/node entry point exports:

ExportDescription
ShelbyMain client class for Ethereum-Shelby integration
ShelbyStorageAccountStorage account class (also via createStorageAccount)
NetworkNetwork configuration constants
Re-exports from SDKAll exports from @shelby-protocol/sdk/node

Next Steps