@moltium/world-cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -90,16 +90,17 @@ ${options.tokenType === "custom" ? "WORLD_TOKEN_ADDRESS=\n" : ""}
|
|
|
90
90
|
// src/templates/world-template.ts
|
|
91
91
|
function generateWorldTemplate(config3) {
|
|
92
92
|
const files = {};
|
|
93
|
-
files["src/index.ts"] = `import { World } from '@moltium/world-core';
|
|
94
|
-
import {
|
|
95
|
-
import { startWorldServer } from '@moltium/world-core/server';
|
|
93
|
+
files["src/index.ts"] = `import { World, startWorldServer, validateWorldConfig } from '@moltium/world-core';
|
|
94
|
+
import type { WorldConfig } from '@moltium/world-core';
|
|
96
95
|
import dotenv from 'dotenv';
|
|
96
|
+
import fs from 'fs';
|
|
97
97
|
|
|
98
98
|
dotenv.config();
|
|
99
99
|
|
|
100
100
|
async function main() {
|
|
101
101
|
// Load configuration
|
|
102
|
-
const
|
|
102
|
+
const raw = JSON.parse(fs.readFileSync('./world.config.json', 'utf-8'));
|
|
103
|
+
const config = raw as WorldConfig;
|
|
103
104
|
|
|
104
105
|
// Create world instance
|
|
105
106
|
const world = new World(config);
|
|
@@ -110,13 +111,13 @@ async function main() {
|
|
|
110
111
|
// Start HTTP server
|
|
111
112
|
await startWorldServer(world);
|
|
112
113
|
|
|
113
|
-
console.log(
|
|
114
|
-
console.log(
|
|
115
|
-
console.log(
|
|
114
|
+
console.log(\\\`\u{1F30D} \${config.name} is running!\\\`);
|
|
115
|
+
console.log(\\\` Server: http://\${config.server?.host ?? 'localhost'}:\${config.server?.port ?? 3000}\\\`);
|
|
116
|
+
console.log(\\\` Agents: \${world.getAgents().length}/\${config.admission?.maxAgents ?? 10}\\\`);
|
|
116
117
|
|
|
117
118
|
// Graceful shutdown
|
|
118
119
|
process.on('SIGINT', async () => {
|
|
119
|
-
console.log('
|
|
120
|
+
console.log('\\\\n\\\\n\u{1F6D1} Shutting down...');
|
|
120
121
|
await world.stop();
|
|
121
122
|
process.exit(0);
|
|
122
123
|
});
|
|
@@ -395,7 +396,7 @@ var initCommand = new Command("init").description("Initialize a new world projec
|
|
|
395
396
|
"deploy:contracts": "moltium-world deploy"
|
|
396
397
|
},
|
|
397
398
|
dependencies: {
|
|
398
|
-
"@moltium/world-core": "^0.1.
|
|
399
|
+
"@moltium/world-core": "^0.1.7",
|
|
399
400
|
dotenv: "^16.4.0"
|
|
400
401
|
},
|
|
401
402
|
devDependencies: {
|
|
@@ -808,7 +809,7 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
|
|
|
808
809
|
|
|
809
810
|
// src/index.ts
|
|
810
811
|
var program = new Command5();
|
|
811
|
-
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.
|
|
812
|
+
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.7");
|
|
812
813
|
program.addCommand(initCommand);
|
|
813
814
|
program.addCommand(tokenCommand);
|
|
814
815
|
program.addCommand(startCommand);
|