Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution - Enhance API schema with expanded type definitions and resolvers - Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth - Implement new services: AI optimization, billing, blockchain, compliance, marketplace - Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage) - Update Crossplane provider with enhanced VM management capabilities - Add comprehensive test suite for API endpoints and services - Update frontend components with improved GraphQL subscriptions and real-time updates - Enhance security configurations and headers (CSP, CORS, etc.) - Update documentation and configuration files - Add new CI/CD workflows and validation scripts - Implement design system improvements and UI enhancements
This commit is contained in:
49
blockchain/scripts/deploy.ts
Normal file
49
blockchain/scripts/deploy.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { ethers } from 'hardhat'
|
||||
|
||||
async function main() {
|
||||
console.log('Deploying Sankofa Phoenix smart contracts...')
|
||||
|
||||
// Get deployer account
|
||||
const [deployer] = await ethers.getSigners()
|
||||
console.log('Deploying contracts with account:', deployer.address)
|
||||
console.log('Account balance:', (await ethers.provider.getBalance(deployer.address)).toString())
|
||||
|
||||
// Deploy ResourceProvisioning
|
||||
const ResourceProvisioningFactory = await ethers.getContractFactory('ResourceProvisioning')
|
||||
const resourceProvisioning = await ResourceProvisioningFactory.deploy()
|
||||
await resourceProvisioning.waitForDeployment()
|
||||
console.log('ResourceProvisioning deployed to:', await resourceProvisioning.getAddress())
|
||||
|
||||
// Deploy IdentityManagement
|
||||
const IdentityManagementFactory = await ethers.getContractFactory('IdentityManagement')
|
||||
const identityManagement = await IdentityManagementFactory.deploy()
|
||||
await identityManagement.waitForDeployment()
|
||||
console.log('IdentityManagement deployed to:', await identityManagement.getAddress())
|
||||
|
||||
// Deploy Billing
|
||||
const BillingFactory = await ethers.getContractFactory('Billing')
|
||||
const billing = await BillingFactory.deploy()
|
||||
await billing.waitForDeployment()
|
||||
console.log('Billing deployed to:', await billing.getAddress())
|
||||
|
||||
// Deploy Compliance
|
||||
const ComplianceFactory = await ethers.getContractFactory('Compliance')
|
||||
const compliance = await ComplianceFactory.deploy()
|
||||
await compliance.waitForDeployment()
|
||||
console.log('Compliance deployed to:', await compliance.getAddress())
|
||||
|
||||
console.log('\n✅ All contracts deployed successfully!')
|
||||
console.log('\nContract Addresses:')
|
||||
console.log(' ResourceProvisioning:', await resourceProvisioning.getAddress())
|
||||
console.log(' IdentityManagement:', await identityManagement.getAddress())
|
||||
console.log(' Billing:', await billing.getAddress())
|
||||
console.log(' Compliance:', await compliance.getAddress())
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
44
blockchain/scripts/generate-types.ts
Normal file
44
blockchain/scripts/generate-types.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Generate TypeScript types from compiled smart contracts
|
||||
* Run: pnpm exec ts-node scripts/generate-types.ts
|
||||
*/
|
||||
|
||||
import { execSync } from 'child_process'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
|
||||
async function generateTypes() {
|
||||
console.log('Generating TypeScript types from smart contracts...')
|
||||
|
||||
try {
|
||||
// Run typechain to generate types
|
||||
execSync('npx typechain --target ethers-v6 --out-dir ../api/src/types/contracts artifacts/contracts/**/*.json', {
|
||||
cwd: path.join(__dirname, '..'),
|
||||
stdio: 'inherit',
|
||||
})
|
||||
|
||||
console.log('✓ TypeScript types generated successfully')
|
||||
console.log('Types are available in: api/src/types/contracts/')
|
||||
|
||||
// Create index file for easy imports
|
||||
const typesDir = path.join(__dirname, '../../api/src/types/contracts')
|
||||
if (fs.existsSync(typesDir)) {
|
||||
const indexContent = `// Auto-generated contract type exports
|
||||
// This file is generated by scripts/generate-types.ts
|
||||
|
||||
export * from './ResourceProvisioning'
|
||||
export * from './IdentityManagement'
|
||||
export * from './Billing'
|
||||
export * from './Compliance'
|
||||
`
|
||||
fs.writeFileSync(path.join(typesDir, 'index.ts'), indexContent)
|
||||
console.log('✓ Created index.ts for contract types')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to generate types:', error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
generateTypes()
|
||||
|
||||
Reference in New Issue
Block a user