An Azure Functions service for registering Secret Network nodes using remote attestation certificates.
This service provides a secure HTTP endpoint for registering Secret Network nodes by validating and processing remote attestation certificates. The service interacts with the Secret Network blockchain using the SecretJS library to authenticate nodes via the RA (Remote Attestation) authentication mechanism.
The service uses a built-in wallet to pay for transactions.
- Platform: Azure Functions (TypeScript)
- Framework: Azure Functions v4
- Blockchain: Secret Network
- Language: TypeScript
- Dependencies: SecretJS for blockchain interaction
Registers a Secret Network node using a remote attestation certificate.
{
"certificate": "base64-encoded-certificate"
}{
"status": "success",
"details": {
"key": "encrypted_seed",
"value": "encrypted-seed-value"
},
"registration_key": "registration-key-value"
}{
"status": "failed",
"details": "error-description"
}200- Successful registration400- Malformed certificate500- Internal server error or blockchain transaction failure
| Variable | Description | Required |
|---|---|---|
REGISTRATION_KEY |
Node registration key certificate | No (has default) |
MNEMONICS |
Wallet mnemonic for transaction signing | Yes |
SENDER_ADDRESS |
Address of the transaction sender | Yes |
SECRET_NODE_LCD |
Secret Network LCD endpoint URL | Yes |
CHAIN_ID |
Secret Network chain ID | No (default: "pulsar-3") |
GAS_FEE_IN_DENOM |
Gas fee amount | No (default: 0.25) |
GAS_FOR_REGISTER |
Gas limit for registration | No (default: 150,000) |
- Node.js 18+
- Azure Functions Core Tools
- Azure account and subscription
npm install# Build and watch for changes
npm run watch
# Start local development server
npm start# Development build
npm run build
# Production build
npm run build:productionnpm run deploy:testnetnpm run deploy:mainnetregistration-service/
├── src/
│ └── functions/
│ └── RegisterNode.ts # Main registration function
├── host.json # Azure Functions configuration
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
- Certificates are validated and decoded from base64
- All transactions are signed using the configured wallet
- Environment variables contain sensitive information (mnemonics, keys)
- The service uses HTTPS endpoints for blockchain communication
The service includes comprehensive error handling for:
- Malformed certificate data
- Base64 decoding failures
- Blockchain transaction failures
- Network connectivity issues
@azure/functions- Azure Functions runtimesecretjs- Secret Network JavaScript SDK@types/node- TypeScript definitions for Node.js
[Add your license information here]