This is a demonstration of a NANO MCP (Merchant Crypto Payment) server implementation that provides cryptocurrency payment processing capabilities.
- Initialize server with custom configuration
- Handle various cryptocurrency operations
- Support for multiple payment methods
- Real-time transaction processing
- Secure RPC communication
- Node.js v16.0.0 or higher
- npm (Node Package Manager)
- Clone this repository or create a new directory:
mkdir nano-mcp-demo
cd nano-mcp-demo- Initialize a new Node.js project:
npm init -y- Install the required dependencies:
npm install nano-mcpThe server uses the following configuration parameters:
{
publicKey: 'PUBLIC-KEY-FA9CE81226BF478291D34836A09D8B06',
rpcKey: 'RPC-KEY-BAB822FCCDAE42ECB7A331CCAAAA23',
port: 8000,
host: '127.0.0.1'
}publicKey: Your NANO MCP public key for authenticationrpcKey: Your NANO MCP RPC key for secure communicationport: The port number the server will listen on (default: 8000)host: The host address to bind to (default: 127.0.0.1)
nano-mcp-demo/
├── package.json
├── server.js
└── README.md
The server supports the following methods:
initialize: Initialize the server and get version informationgetBalance: Get account balancegetAccountInfo: Retrieve account informationgetBlockCount: Get the current block countgetVersion: Get server versionconvertToNano: Convert from raw to NANOconvertFromNano: Convert from NANO to raw
- Start the server:
node server.js- The server will output initialization information and start listening for requests:
Starting NANO MCP Server...
MCPServer initialized with config: { name: 'NANO', version: '1.0.0' }
Registering handler for method: initialize
Registering handler for method: generateWallet
Registering handler for method: getBalance
Registering handler for method: initializeAccount
Registering handler for method: sendTransaction
Registering handler for method: receivePending
Server started successfully!
The server implements robust error handling:
- Connection errors are logged with detailed information
- Invalid requests return appropriate error messages
- Transaction failures are properly handled and reported
- All RPC communications are authenticated using the provided keys
- Requests are validated before processing
- Sensitive operations require proper authorization
The server can be gracefully shut down using Ctrl+C (SIGINT signal). This ensures:
- All pending operations are completed
- Connections are properly closed
- Resources are released
This demo is built using ES modules. Make sure your package.json includes:
{
"type": "module"
}ISC
For issues and feature requests, please open an issue in the repository.
This is a demonstration server and should be properly secured before use in a production environment. Always follow security best practices when handling cryptocurrency transactions.