Skip to content

Instantly share code, notes, and snippets.

View jonyx225's full-sized avatar
🏠
Working from home

jonyx225

🏠
Working from home
View GitHub Profile
@jonyx225
jonyx225 / a2a-client-hello-world.ts
Created October 9, 2025 00:49
Hello World A2A Client
// client.ts
import { A2AClient, SendMessageSuccessResponse } from "@a2a-js/sdk/client";
import { Message, MessageSendParams } from "@a2a-js/sdk";
import { v4 as uuidv4 } from "uuid";
async function run() {
// Create a client pointing to the agent's Agent Card URL.
const client = await A2AClient.fromCardUrl("http://localhost:4000/.well-known/agent-card.json");
const sendParams: MessageSendParams = {
@jonyx225
jonyx225 / a2a-server-hello-world.ts
Created October 9, 2025 00:49
Hello World A2A Server
// server.ts
import express from "express";
import { v4 as uuidv4 } from "uuid";
import type { AgentCard, Message } from "@a2a-js/sdk";
import {
AgentExecutor,
RequestContext,
ExecutionEventBus,
DefaultRequestHandler,
InMemoryTaskStore,
@jonyx225
jonyx225 / eigen-mcp.ts
Created October 9, 2025 00:32 — forked from dabit3/eigen-mcp.ts
EigenLayer MCP Server Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import 'dotenv/config'
const server = new McpServer({
name: "EigenLayer AVS service",
version: "1.0.0",
});
from modelcontextprotocol.sdk.client.mcp import McpClient
from modelcontextprotocol.sdk.client.stdio import StdioClientTransport
import asyncio
import json
async def run_mcp_client():
# Initialize MCP client
client = McpClient(
name="AVS Data Fetcher Client",
version="1.0.0"
from modelcontextprotocol.sdk.server.mcp import McpServer
from modelcontextprotocol.sdk.server.stdio import StdioServerTransport
from pydantic import BaseModel, Field
from typing import Optional
import requests
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
@jonyx225
jonyx225 / jdbc_sink_connector.json
Created February 6, 2024 00:31
JDBC Postgres Sink Connector Config
{
"name": "newuser",
"connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"connection.url": "jdbc:postgresql://${MASTER_DB_HOST}:${MASTER_DB_PORT}/${MASTER_DB_NAME}",
"connection.username": "${MASTER_DB_USER}",
"connection.password": "${MASTER_DB_PASSWORD}",
"insert.mode": "upsert",
"delete.enabled": "true",
"primary.key.mode": "record_key",
@jonyx225
jonyx225 / debezium_postgres_connector.json
Created February 6, 2024 00:30
Debezium postgres connector config
{
"name": "user",
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"database.hostname": "${MASTER_DB_HOST}",
"database.port": "${MASTER_DB_PORT}",
"database.user": "${MASTER_DB_USER}",
"database.password": "${MASTER_DB_PASSWORD}",
"database.server.name": "user",
"database.dbname": "${MASTER_DB_NAME}",
"tasks.max": "1",
@jonyx225
jonyx225 / docker-compose.yml
Created February 6, 2024 00:14
Debezium Postgres Kafka CDC
version: "3"
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
@jonyx225
jonyx225 / FA2_REVEAL.py
Created April 7, 2023 01:24
SmartPy NFT FA2 Contract with reveal feature
import smartpy as sp
FA2 = sp.io.import_script_from_url("https://smartpy.io/templates/fa2_lib.py")
class MyProject(
FA2.Admin,
FA2.BurnNft,
FA2.ChangeMetadata,
FA2.WithdrawMutez,
FA2.MintNft,
FA2.OnchainviewBalanceOf,
@jonyx225
jonyx225 / LazyMint.ts
Created September 14, 2022 03:49
LazyMint using EIP712
// sign a message for LazyMintVoucher
const data = {
receiver: alice.address,
displayTypes: [
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("paint"), 0, 16),
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("wheel"), 0, 16),
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("engine"), 0, 16),
],
traitTypes: [
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("paint"), 0, 16),