@net-protocol/cli 0.1.18 → 0.1.20
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 +14 -3
- package/dist/cli/index.mjs +6 -0
- package/dist/cli/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,8 @@ netp storage upload \
|
|
|
43
43
|
--text <description> \
|
|
44
44
|
[--private-key <0x...>] \
|
|
45
45
|
--chain-id <8453|1|...> \
|
|
46
|
-
[--rpc-url <custom-rpc>]
|
|
46
|
+
[--rpc-url <custom-rpc>] \
|
|
47
|
+
[--chunk-size <bytes>]
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
**Storage Upload Arguments:**
|
|
@@ -54,6 +55,7 @@ netp storage upload \
|
|
|
54
55
|
- `--private-key` (optional): Private key (0x-prefixed hex, 66 characters). Can also be set via `NET_PRIVATE_KEY` or `PRIVATE_KEY` environment variable
|
|
55
56
|
- `--chain-id` (optional): Chain ID (8453 for Base, 1 for Ethereum, etc.). Can also be set via `NET_CHAIN_ID` environment variable
|
|
56
57
|
- `--rpc-url` (optional): Custom RPC URL. Can also be set via `NET_RPC_URL` environment variable
|
|
58
|
+
- `--chunk-size` (optional): Size of each XML chunk in bytes (default: 80000). Controls how large files are split for XML storage
|
|
57
59
|
|
|
58
60
|
**Examples:**
|
|
59
61
|
|
|
@@ -80,6 +82,14 @@ netp storage upload \
|
|
|
80
82
|
# NET_CHAIN_ID=8453
|
|
81
83
|
# NET_RPC_URL=https://base-mainnet.public.blastapi.io # optional
|
|
82
84
|
netp storage upload --file ./example.txt --key "my-file" --text "Example file"
|
|
85
|
+
|
|
86
|
+
# Custom chunk size (40KB instead of default 80KB)
|
|
87
|
+
netp storage upload \
|
|
88
|
+
--file ./large-file.bin \
|
|
89
|
+
--key "my-file" \
|
|
90
|
+
--text "Large file" \
|
|
91
|
+
--chunk-size 40000 \
|
|
92
|
+
--chain-id 8453
|
|
83
93
|
```
|
|
84
94
|
|
|
85
95
|
##### Storage Preview
|
|
@@ -93,7 +103,8 @@ netp storage preview \
|
|
|
93
103
|
--text <description> \
|
|
94
104
|
[--private-key <0x...>] \
|
|
95
105
|
--chain-id <8453|1|...> \
|
|
96
|
-
[--rpc-url <custom-rpc>]
|
|
106
|
+
[--rpc-url <custom-rpc>] \
|
|
107
|
+
[--chunk-size <bytes>]
|
|
97
108
|
```
|
|
98
109
|
|
|
99
110
|
**Storage Preview Arguments:**
|
|
@@ -675,7 +686,7 @@ For files up to 20KB, the tool uses normal storage:
|
|
|
675
686
|
|
|
676
687
|
For files larger than 20KB or containing XML references, the tool uses XML storage:
|
|
677
688
|
|
|
678
|
-
- Breaks file into 80KB XML chunks
|
|
689
|
+
- Breaks file into 80KB XML chunks (configurable via `--chunk-size`)
|
|
679
690
|
- Each XML chunk is stored in ChunkedStorage (compressed and chunked into 20KB pieces)
|
|
680
691
|
- XML metadata references all chunks
|
|
681
692
|
- Multiple sequential transactions (metadata first, then chunks)
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1250,6 +1250,8 @@ async function encodeStorageUpload(options) {
|
|
|
1250
1250
|
if (options.privateKey) {
|
|
1251
1251
|
const account = privateKeyToAccount(options.privateKey);
|
|
1252
1252
|
operatorAddress = account.address;
|
|
1253
|
+
} else if (options.address) {
|
|
1254
|
+
operatorAddress = options.address;
|
|
1253
1255
|
} else {
|
|
1254
1256
|
operatorAddress = "0x0000000000000000000000000000000000000000";
|
|
1255
1257
|
}
|
|
@@ -1310,6 +1312,9 @@ function registerStorageCommand(program2) {
|
|
|
1310
1312
|
).option(
|
|
1311
1313
|
"--encode-only",
|
|
1312
1314
|
"Output transaction data as JSON instead of executing"
|
|
1315
|
+
).option(
|
|
1316
|
+
"--address <address>",
|
|
1317
|
+
"Operator address (0x-prefixed). Used with --encode-only when no private key is provided"
|
|
1313
1318
|
).option(
|
|
1314
1319
|
"--chunk-size <bytes>",
|
|
1315
1320
|
`Max chunk size in bytes for splitting large files (default: ${OPTIMAL_CHUNK_SIZE})`,
|
|
@@ -1322,6 +1327,7 @@ function registerStorageCommand(program2) {
|
|
|
1322
1327
|
storageKey: options.key,
|
|
1323
1328
|
text: options.text,
|
|
1324
1329
|
privateKey: options.privateKey,
|
|
1330
|
+
address: options.address,
|
|
1325
1331
|
chainId: options.chainId,
|
|
1326
1332
|
rpcUrl: options.rpcUrl,
|
|
1327
1333
|
chunkSize: options.chunkSize
|