Skip to main content
Glama

Hedera MCP Server

by HGraphPunks
fileService.test.ts1.4 kB
// test/unit/fileService.test.ts import { fileService } from "../../src/services/fileService"; describe("FileService", () => { jest.setTimeout(20000); // allow enough time for network operations if any test("storeFile and fetchFile should round-trip small content", async () => { const content = "Hello Hedera!"; const ownerAccount = process.env.HEDERA_OPERATOR_ID!; // using operator as owner for test const ownerKey = process.env.HEDERA_OPERATOR_KEY!; const topicId = await fileService.storeFile(content, ownerAccount, ownerKey); expect(topicId).toMatch(/^0\.0\./); // topicId like 0.0.x // Immediately fetch the file back const fetched = await fileService.fetchFile(topicId); expect(fetched).toBe(content); }); test("storeFile should chunk large content", async () => { // Create a string larger than MAX_CHUNK_SIZE (4096 bytes) const size = 5000; const largeContent = "x".repeat(size); const ownerAccount = process.env.HEDERA_OPERATOR_ID!; const ownerKey = process.env.HEDERA_OPERATOR_KEY!; const topicId = await fileService.storeFile(largeContent, ownerAccount, ownerKey); // fetch back const fetched = await fileService.fetchFile(topicId); expect(fetched.length).toEqual(size); expect(fetched).toEqual(largeContent); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HGraphPunks/hedera-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server