@avm-sdk/avmnet-cli 1.0.0 → 1.0.5
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/cli/avm-node.js +1 -1
- package/index.js +26 -6
- package/package.json +11 -4
- package/hello/index.js +0 -2
- package/hello/package.json +0 -9
- /package/{rpc.js → cli/rpc.js} +0 -0
package/cli/avm-node.js
CHANGED
package/index.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const args = process.argv.slice(2);
|
|
4
|
+
const path = require("path");
|
|
4
5
|
|
|
5
|
-
if (args[0]
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
console.log("
|
|
9
|
-
console.log("
|
|
10
|
-
console.log("
|
|
6
|
+
if (!args[0]) {
|
|
7
|
+
console.log("AVMNet CLI");
|
|
8
|
+
console.log("Commands:");
|
|
9
|
+
console.log(" avmnet node - start blockchain");
|
|
10
|
+
console.log(" avmnet run - run script");
|
|
11
|
+
console.log(" avmnet init - create project");
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const command = args[0];
|
|
16
|
+
const cliPath = path.join(__dirname, "cli");
|
|
17
|
+
|
|
18
|
+
switch (command) {
|
|
19
|
+
case "node":
|
|
20
|
+
require(path.join(cliPath, "avm-node.js"));
|
|
21
|
+
break;
|
|
22
|
+
case "run":
|
|
23
|
+
require(path.join(cliPath, "avm-run.js"));
|
|
24
|
+
break;
|
|
25
|
+
case "init":
|
|
26
|
+
require(path.join(cliPath, "avm-sdk.js"));
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
console.log(`Unknown command: ${command}`);
|
|
30
|
+
process.exit(1);
|
|
11
31
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avm-sdk/avmnet-cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "AVM Blockchain CLI",
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"avmnet": "./
|
|
7
|
+
"avmnet": "./cli/avm-node.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"cli",
|
|
12
|
+
"vm.js",
|
|
13
|
+
"state.js",
|
|
14
|
+
"programs"
|
|
15
|
+
],
|
|
9
16
|
"type": "commonjs",
|
|
10
17
|
"license": "MIT"
|
|
11
18
|
}
|
package/hello/index.js
DELETED
package/hello/package.json
DELETED
/package/{rpc.js → cli/rpc.js}
RENAMED
|
File without changes
|