@xaidenlabs/uso 1.0.2 β 1.1.0
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/README.md +89 -53
- package/bin/index.js +7 -1
- package/my-test-project/Anchor.toml +18 -0
- package/my-test-project/README.md +36 -0
- package/my-test-project/package-lock.json +2102 -0
- package/my-test-project/package.json +17 -0
- package/my-test-project/programs/my_test_project/Cargo.toml +19 -0
- package/my-test-project/programs/my_test_project/src/lib.rs +16 -0
- package/my-test-project/tests/my-test-project.ts +16 -0
- package/my-test-project/tsconfig.json +17 -0
- package/package.json +1 -1
- package/src/commands/create.js +115 -0
- package/templates/default/Anchor.toml +18 -0
- package/templates/default/README.md +36 -0
- package/templates/default/package.json +19 -0
- package/templates/default/programs/my-project/Cargo.lock +1471 -0
- package/templates/default/programs/my-project/Cargo.toml +19 -0
- package/templates/default/programs/my-project/src/lib.rs +16 -0
- package/templates/default/tests/my-project.ts +17 -0
- package/templates/default/tsconfig.json +18 -0
package/README.md
CHANGED
|
@@ -1,97 +1,133 @@
|
|
|
1
|
-
#
|
|
2
|
-
### The **Magic Button** for Solana! β¨
|
|
1
|
+
# Universal Solana Orchestrator (USO)
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
The Universal Solana Orchestrator (USO) is a command-line interface designed to streamline the initialization and management of Solana development environments. By automating the installation of the Rust toolchain, Solana CLI, and Anchor framework, USO eliminates the complexity often associated with setting up a Web3 development workspace on Windows, macOS, and Linux.
|
|
4
|
+
|
|
5
|
+
This tool is engineered to support developers at all levelsβfrom beginners setting up their first environment to senior engineers managing multiple workstations.
|
|
7
6
|
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
##
|
|
11
|
-
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install USO globally using NPM. This ensures the CLI is accessible from any terminal directory.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install -g @xaidenlabs/uso
|
|
15
15
|
```
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
**Prerequisites:**
|
|
18
|
+
- **Node.js**: Ensure Node.js is installed on your system.
|
|
19
|
+
- **Administrator Privileges**: Some installation steps (successfully creating symlinks, updating system PATH) may require elevated permissions.
|
|
17
20
|
|
|
18
21
|
---
|
|
19
22
|
|
|
20
|
-
##
|
|
21
|
-
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### System Diagnostics
|
|
26
|
+
|
|
27
|
+
Before attempting installation, you can run a diagnostic check to evaluate the current state of your environment.
|
|
28
|
+
|
|
22
29
|
```bash
|
|
23
30
|
uso doctor
|
|
24
31
|
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- β means MISSING (Don't worry, USO will fix it!)
|
|
32
|
+
|
|
33
|
+
This command will inspect your system for existing installations of Git, Rust, Solana CLI, and Anchor.
|
|
28
34
|
|
|
29
35
|
---
|
|
30
36
|
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
### Full Environment Setup
|
|
38
|
+
|
|
39
|
+
To perform a complete installation of the entire stack (Rust, Solana, Anchor), use the initialization command:
|
|
40
|
+
|
|
33
41
|
```bash
|
|
34
42
|
uso init
|
|
35
43
|
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
|
|
45
|
+
The installer will:
|
|
46
|
+
1. Detect your operating system.
|
|
47
|
+
2. Check for necessary build tools (C++ Build Tools on Windows).
|
|
48
|
+
3. Download and install the Rust toolchain (via `rustup`).
|
|
49
|
+
4. Install the Solana CLI (Agave release).
|
|
50
|
+
5. Build and install the Anchor Version Manager (AVM) and Anchor Framework.
|
|
51
|
+
6. Generate a new Solana wallet if one is not detected.
|
|
52
|
+
|
|
53
|
+
**Note:** You may be prompted to approve administrative access during the installation of specific components.
|
|
39
54
|
|
|
40
55
|
---
|
|
41
56
|
|
|
42
|
-
|
|
43
|
-
Maybe you only want one toy? You can do that too!
|
|
57
|
+
### Granular Installation
|
|
44
58
|
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
uso install rust
|
|
48
|
-
```
|
|
59
|
+
Use the `install` command to set up individual components if you do not require the full stack.
|
|
49
60
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
**Install Rust:**
|
|
62
|
+
```bash
|
|
63
|
+
uso install rust
|
|
64
|
+
```
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
**Install Solana CLI:**
|
|
67
|
+
```bash
|
|
68
|
+
uso install solana
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Install Anchor Framework:**
|
|
72
|
+
```bash
|
|
73
|
+
uso install anchor
|
|
74
|
+
```
|
|
59
75
|
|
|
60
76
|
---
|
|
61
77
|
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### Project Scaffolding
|
|
81
|
+
|
|
82
|
+
Start a new project with a robust, pre-configured Anchor template.
|
|
83
|
+
|
|
64
84
|
```bash
|
|
65
|
-
uso
|
|
85
|
+
uso create <project-name>
|
|
66
86
|
```
|
|
67
|
-
|
|
87
|
+
|
|
88
|
+
This generates a "batteries-included" workspace with:
|
|
89
|
+
- **Localnet Configuration**: `Anchor.toml` pre-wired for local development.
|
|
90
|
+
- **Test Suite**: A running example test file using the latest Anchor syntax.
|
|
91
|
+
- **Scripts**: NPM scripts for linting and testing.
|
|
68
92
|
|
|
69
93
|
---
|
|
70
94
|
|
|
71
|
-
|
|
72
|
-
If you don't want these tools anymore, USO can clean up for you.
|
|
95
|
+
### Verification
|
|
73
96
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
97
|
+
After installation, verify that all components are correctly configured and accessible in your system PATH.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
uso verify
|
|
101
|
+
```
|
|
79
102
|
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
uso uninstall solana
|
|
83
|
-
```
|
|
103
|
+
This process will validate the version of each tool and ensure the environment is ready for development.
|
|
84
104
|
|
|
85
105
|
---
|
|
86
106
|
|
|
87
|
-
##
|
|
107
|
+
## Uninstallation
|
|
108
|
+
|
|
109
|
+
USO provides a clean uninstallation process to remove the installed toolchains.
|
|
110
|
+
|
|
111
|
+
**Remove All Components:**
|
|
112
|
+
```bash
|
|
113
|
+
uso uninstall
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Remove Individual Components:**
|
|
117
|
+
```bash
|
|
118
|
+
uso uninstall solana
|
|
119
|
+
uso uninstall rust
|
|
120
|
+
uso uninstall anchor
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
88
124
|
|
|
89
|
-
|
|
90
|
-
- Try running your terminal as **Administrator** (Right-click -> Run as Administrator).
|
|
125
|
+
## Troubleshooting
|
|
91
126
|
|
|
92
|
-
**"
|
|
93
|
-
-
|
|
127
|
+
- **"Permission Denied" Errors**: If you encounter errors related to permissions or symlinks, try running your terminal as an Administrator.
|
|
128
|
+
- **"Command Not Found"**: After installation, your system PATH is updated. You must restart your terminal (close and reopen) for these changes to take effect.
|
|
129
|
+
- **Windows Build Tools**: If Rust fails to install on Windows, ensure you have the "Desktop development with C++" workload installed via Visual Studio Build Tools.
|
|
94
130
|
|
|
95
131
|
---
|
|
96
132
|
|
|
97
|
-
**
|
|
133
|
+
**Developed by Xaiden Labs**
|
package/bin/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
const { program } = require('commander');
|
|
3
3
|
const { init } = require('../src/commands/init');
|
|
4
4
|
const { doctor } = require('../src/commands/doctor');
|
|
5
5
|
const { verify } = require('../src/commands/verify');
|
|
6
|
+
const { create } = require('../src/commands/create');
|
|
6
7
|
const { build, test, deploy, clean } = require('../src/commands/workflow');
|
|
7
8
|
const { uninstall } = require('../src/commands/uninstall');
|
|
8
9
|
|
|
@@ -27,6 +28,11 @@ program
|
|
|
27
28
|
.description('Verify installation by building a test Anchor project')
|
|
28
29
|
.action(verify);
|
|
29
30
|
|
|
31
|
+
program
|
|
32
|
+
.command('create <project_name>')
|
|
33
|
+
.description('Scaffold a new Anchor project')
|
|
34
|
+
.action(create);
|
|
35
|
+
|
|
30
36
|
program
|
|
31
37
|
.command('build')
|
|
32
38
|
.description('Build the Anchor project (wraps "anchor build")')
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[toolchain]
|
|
2
|
+
|
|
3
|
+
[features]
|
|
4
|
+
seeds = false
|
|
5
|
+
skip-lint = false
|
|
6
|
+
|
|
7
|
+
[programs.localnet]
|
|
8
|
+
my_test_project = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
|
|
9
|
+
|
|
10
|
+
[registry]
|
|
11
|
+
url = "https://api.apr.dev"
|
|
12
|
+
|
|
13
|
+
[provider]
|
|
14
|
+
cluster = "Localnet"
|
|
15
|
+
wallet = "~/.config/solana/id.json"
|
|
16
|
+
|
|
17
|
+
[scripts]
|
|
18
|
+
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Welcome to Your USO Project π
|
|
2
|
+
|
|
3
|
+
Congratulations! You've just scaffolded a professional Solana workspace using the **Universal Solana Orchestrator (USO)**.
|
|
4
|
+
|
|
5
|
+
This isn't just a folder with files. It's a battle-tested setup ready for serious development.
|
|
6
|
+
|
|
7
|
+
## π Structure
|
|
8
|
+
- `programs/`: Your Rust smart contracts live here.
|
|
9
|
+
- `tests/`: Robust TypeScript tests using Anchor.
|
|
10
|
+
- `Anchor.toml`: Your project configuration.
|
|
11
|
+
|
|
12
|
+
## β‘ Quick Start
|
|
13
|
+
|
|
14
|
+
### 1. Build
|
|
15
|
+
Compile your smart contract:
|
|
16
|
+
```bash
|
|
17
|
+
anchor build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Test
|
|
21
|
+
Run your test suite against a local validator:
|
|
22
|
+
```bash
|
|
23
|
+
anchor test
|
|
24
|
+
```
|
|
25
|
+
*Note: This automatically spins up a local validator, deploys your program, runs tests, and shuts down.*
|
|
26
|
+
|
|
27
|
+
### 3. Deploy (Devnet)
|
|
28
|
+
When you're ready to go public:
|
|
29
|
+
1. Switch to devnet: `solana config set --url devnet`
|
|
30
|
+
2. Airdrop SOL: `solana airdrop 2`
|
|
31
|
+
3. Deploy: `anchor deploy`
|
|
32
|
+
|
|
33
|
+
## π§ Need Help?
|
|
34
|
+
Run `uso doctor` if your environment feels weird. Usage instructions are also available via `uso help`.
|
|
35
|
+
|
|
36
|
+
Happy coding!
|