A robust API service built on top of the Fileverse SDK, providing decentralized file management capabilities.
For more information visit Fileverse
Agnet: https://gnosisscan.io/address/0xc4fdb8516e5a7dfa501ee432df40b8f34ea88b9a
Example output: https://ipfs.io/ipfs/bafkreigr3v3yophf5hwtwujqoxnhre4n2rft4ay6rq7enfffkpuks5dwuu

- File CRUD operations (Create, Read, Update, Delete)
- Decentralized storage using Fileverse SDK
- Blockchain interaction (block number queries, etc.)
- Docker containerization support
- Secure environment configuration
- Advanced logging system with rotation
- Node.js
- Express.js
- Fileverse SDK
- Docker
- Winston (for logging)
- Node.js 18+
- Docker (optional)
- Docker Compose (optional)
- Clone the repository:
git clone <your-repo-url>
cd fileverse-api- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit the .env file with your configuration.
Pimlico is used for ERC-4337 (Account Abstraction) transactions. You need to:
- Register at Pimlico Dashboard
- Obtain your API key
- Fund your account:
- Log into Pimlico Dashboard
- Click "Add Funds" or "Deposit"
- Choose payment method (credit card or crypto)
- Enter amount (recommended minimum: 0.01 USD)
- Complete payment process
- Wait for balance update (usually within minutes)
- Add your API key to
.env:
PIMLICO_API_KEY=your_api_key_hereNote:
- Each transaction requires a balance (approximately 0.006 USD/transaction)
- Maintain a balance above 0.01 USD
- Balance alerts can be set up in the Dashboard
- Auto-funding is available (configurable in Dashboard)
-
Credential Management:
/credsdirectory stores Fileverse SDK credentials- Directory is included in
.gitignorefor security - If you encounter "Role missing" error:
- Delete JSON files in
/credsdirectory - Ensure
PRIVATE_KEYis correctly set in environment - Restart the service
- Delete JSON files in
-
File Encryption:
- File encryption not directly supported by Fileverse SDK
- Implement encryption at application level if needed
- Future versions will support more storage networks and encryption
npm run devnpm startUsing Docker:
docker build -t fileverse-api .
docker run -p 3000:3000 --env-file .env fileverse-apiUsing Docker Compose (recommended):
# Start service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop service
docker-compose downHealth check endpoint
// Response example
{
"status": "ok",
"agent": "initialized",
"blockNumber": "12345678",
"chain": "gnosis"
}Get latest block number
// Response example
{
"blockNumber": "12345678"
}Create new file
// Request example
{
"content": "Hello World"
}
// Response example
{
"fileId": "xxx",
"content": "Hello World"
}Get file content
// Response example
{
"fileId": "xxx",
"content": "Hello World"
}Update file content
// Request example
{
"content": "Hello World 2"
}
// Response example
{
"fileId": "xxx",
"content": "Hello World 2"
}Delete file
// Response example
{
"success": true
}CHAIN: Blockchain network (gnosis or sepolia)PRIVATE_KEY: Private key (optional)PINATA_JWT: Pinata JWT tokenPINATA_GATEWAY: Pinata gatewayPIMLICO_API_KEY: Pimlico API key (required with sufficient balance)PORT: API service port (default: 3000)NODE_ENV: Runtime environment (development/production)LOG_LEVEL: Logging level (error/warn/info/debug)
If you encounter "Insufficient Pimlico balance" error:
- Visit Pimlico Dashboard
- Log into your account
- Add funds (recommended minimum 0.01 USD)
- Retry operation
If you encounter "Role missing" error:
- Delete all JSON files in
/credsdirectory - Verify
.envconfiguration - Restart service
Currently, SDK doesn't directly support file encryption. If your application requires encryption:
- Encrypt data on client-side before sending to API
- Use standard encryption libraries and algorithms
- Implement secure key management
- Keep
.envfile out of version control - Protect private keys and API keys
- Use secure key management in production
- Backup
/credsdirectory contents regularly - Monitor Pimlico account balance
MIT