@sentio/cli 4.0.0-rc.3 → 4.0.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/lib/index.js +27 -6
- package/package.json +1 -1
- package/src/commands/stop-processor.ts +1 -1
- package/src/commands/upload.ts +5 -2
- package/src/config.ts +8 -2
- package/src/network.ts +15 -2
package/lib/index.js
CHANGED
|
@@ -134712,13 +134712,19 @@ function overrideConfigWithOptions(config, options) {
|
|
|
134712
134712
|
case "devnet":
|
|
134713
134713
|
config.sentioNetwork = "7892201";
|
|
134714
134714
|
break;
|
|
134715
|
+
case "testnet-v2":
|
|
134716
|
+
config.sentioNetwork = "7892102";
|
|
134717
|
+
break;
|
|
134715
134718
|
case "7892101":
|
|
134716
134719
|
case "7892201":
|
|
134720
|
+
case "7892102":
|
|
134717
134721
|
case "789210":
|
|
134718
134722
|
config.sentioNetwork = options.sentioNetwork;
|
|
134719
134723
|
break;
|
|
134720
134724
|
default:
|
|
134721
|
-
console.error(
|
|
134725
|
+
console.error(
|
|
134726
|
+
`Invalid sentio network: ${options.sentioNetwork}, only mainnet, testnet, testnet-v2 or devnet is allowed`
|
|
134727
|
+
);
|
|
134722
134728
|
process.exit(1);
|
|
134723
134729
|
}
|
|
134724
134730
|
}
|
|
@@ -164111,6 +164117,12 @@ var TESTNET_CONFIG = {
|
|
|
164111
164117
|
explorerUrl: "https://testnet-explorer.sentio.xyz",
|
|
164112
164118
|
addressBookAddress: "0x092d795d42e23ecba5cc66927972be5c9980effb"
|
|
164113
164119
|
};
|
|
164120
|
+
var TESTNET_V2_CONFIG = {
|
|
164121
|
+
chainId: 7892102,
|
|
164122
|
+
rpcUrl: "https://sentio-testnet-v2.rpc.sentio.xyz",
|
|
164123
|
+
explorerUrl: "https://testnet-v2-explorer.sentio.xyz",
|
|
164124
|
+
addressBookAddress: "0xb7e9E56DFC27bcfA63698F2F5890e186426A0123"
|
|
164125
|
+
};
|
|
164114
164126
|
var DEVNET_CONFIG = {
|
|
164115
164127
|
chainId: 7892201,
|
|
164116
164128
|
rpcUrl: "https://sentio-devnet.test-rpc.sentio.xyz",
|
|
@@ -164123,11 +164135,17 @@ function getSentioNetworkConfig(network, addressBookOverride) {
|
|
|
164123
164135
|
config = TESTNET_CONFIG;
|
|
164124
164136
|
} else if (network === "devnet" || network === "7892201") {
|
|
164125
164137
|
config = DEVNET_CONFIG;
|
|
164138
|
+
} else if (network === "testnet-v2" || network === "7892102") {
|
|
164139
|
+
config = TESTNET_V2_CONFIG;
|
|
164126
164140
|
} else if (network === "mainnet" || network === "789210") {
|
|
164127
|
-
console.error(
|
|
164141
|
+
console.error(
|
|
164142
|
+
source_default.red("Sentio Network mainnet is not yet supported. Only testnet, testnet-v2 and devnet are available.")
|
|
164143
|
+
);
|
|
164128
164144
|
process.exit(1);
|
|
164129
164145
|
} else {
|
|
164130
|
-
console.error(
|
|
164146
|
+
console.error(
|
|
164147
|
+
source_default.red(`Invalid sentio network: ${network}. Only "testnet", "testnet-v2" or "devnet" is supported.`)
|
|
164148
|
+
);
|
|
164131
164149
|
process.exit(1);
|
|
164132
164150
|
}
|
|
164133
164151
|
if (addressBookOverride) {
|
|
@@ -164767,7 +164785,10 @@ function createUploadCommand() {
|
|
|
164767
164785
|
).option(
|
|
164768
164786
|
"--checkpoint <checkpoint...>",
|
|
164769
164787
|
'(Optional) Checkpoint(s) to rollback to, only available with --continue-from. Format: "chain_id:block_number" or "block_number" (uses default chain). Can specify multiple checkpoints.'
|
|
164770
|
-
).option("--debug", "(Optional) Run driver in debug mode").option("-y --silent-overwrite", "(Optional) Create project or upload new version without confirmation").option("--skip-build", "Skip build & pack file before uploading").option("--skip-gen", "Skip code generation.").option("--skip-deps", "Skip dependency enforce.").option("--example", "Generate example usage of the processor.").option("--walrus", "Store file in walrus").option("--path <path>", "override project path, default to current directory").option("--api-key <key>", "(Optional) Manually provide API key rather than use saved credential").option("--token <token>", "(Optional) Manually provide token rather than use saved credential").option("--host <host>", "(Optional) Override Sentio Host name").option("--num-workers <count>", "(Optional) Number of processor workers to start", myParseInt).option(
|
|
164788
|
+
).option("--debug", "(Optional) Run driver in debug mode").option("-y --silent-overwrite", "(Optional) Create project or upload new version without confirmation").option("--skip-build", "Skip build & pack file before uploading").option("--skip-gen", "Skip code generation.").option("--skip-deps", "Skip dependency enforce.").option("--example", "Generate example usage of the processor.").option("--walrus", "Store file in walrus").option("--path <path>", "override project path, default to current directory").option("--api-key <key>", "(Optional) Manually provide API key rather than use saved credential").option("--token <token>", "(Optional) Manually provide token rather than use saved credential").option("--host <host>", "(Optional) Override Sentio Host name").option("--num-workers <count>", "(Optional) Number of processor workers to start", myParseInt).option(
|
|
164789
|
+
"--sentio-network <network>",
|
|
164790
|
+
"(Optional) Sentio network to connect to, can be testnet, testnet-v2, devnet or mainnet"
|
|
164791
|
+
).option(
|
|
164771
164792
|
"--required-chain-id <chain_id...>",
|
|
164772
164793
|
"(Optional) Specify chain IDs required for the Sentio network. This option is only available when --sentio-network is used. If omitted, all chain IDs from the project configuration (contracts or network overrides) will be used."
|
|
164773
164794
|
).option(
|
|
@@ -165165,7 +165186,7 @@ async function checkOrCreateProject(options, auth) {
|
|
|
165165
165186
|
console.error(
|
|
165166
165187
|
source_default.red(
|
|
165167
165188
|
`Project ${project?.slug} is a Sentio Network project. Please add the --sentio-network flag when uploading.
|
|
165168
|
-
Example: sentio upload --sentio-network testnet|devnet`
|
|
165189
|
+
Example: sentio upload --sentio-network testnet|testnet-v2|devnet`
|
|
165169
165190
|
)
|
|
165170
165191
|
);
|
|
165171
165192
|
process.exit(1);
|
|
@@ -170418,7 +170439,7 @@ function formatTimestamp3(value) {
|
|
|
170418
170439
|
// src/commands/stop-processor.ts
|
|
170419
170440
|
init_cjs_shim();
|
|
170420
170441
|
function createStopProcessorCommand() {
|
|
170421
|
-
return new Command("stop").description("Stop a processor. Uses Sentio Network contract when --sentio-network is specified.").argument("<processorId>", "ID of the processor to stop").option("--sentio-network <network>", "Stop via Sentio Network contract (testnet or devnet)").option("--host <host>", "Override Sentio host").option("--api-key <key>", "Use an explicit API key instead of saved credentials").option("--token <token>", "Use an explicit bearer token instead of saved credentials").option("--project <owner/slug>", "Sentio project in <owner>/<slug> format").option("--owner <owner>", "Sentio project owner").option("--name <name>", "Sentio project name").option("-y, --yes", "Bypass confirmation").option("--no-delete", "Skip deleting the processor after stopping").option(
|
|
170442
|
+
return new Command("stop").description("Stop a processor. Uses Sentio Network contract when --sentio-network is specified.").argument("<processorId>", "ID of the processor to stop").option("--sentio-network <network>", "Stop via Sentio Network contract (testnet, testnet-v2 or devnet)").option("--host <host>", "Override Sentio host").option("--api-key <key>", "Use an explicit API key instead of saved credentials").option("--token <token>", "Use an explicit bearer token instead of saved credentials").option("--project <owner/slug>", "Sentio project in <owner>/<slug> format").option("--owner <owner>", "Sentio project owner").option("--name <name>", "Sentio project name").option("-y, --yes", "Bypass confirmation").option("--no-delete", "Skip deleting the processor after stopping").option(
|
|
170422
170443
|
"--address-book <address>",
|
|
170423
170444
|
"(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --sentio-network)."
|
|
170424
170445
|
).showHelpAfterError().action(async (processorId, options) => {
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export function createStopProcessorCommand() {
|
|
|
16
16
|
return new Command('stop')
|
|
17
17
|
.description('Stop a processor. Uses Sentio Network contract when --sentio-network is specified.')
|
|
18
18
|
.argument('<processorId>', 'ID of the processor to stop')
|
|
19
|
-
.option('--sentio-network <network>', 'Stop via Sentio Network contract (testnet or devnet)')
|
|
19
|
+
.option('--sentio-network <network>', 'Stop via Sentio Network contract (testnet, testnet-v2 or devnet)')
|
|
20
20
|
.option('--host <host>', 'Override Sentio host')
|
|
21
21
|
.option('--api-key <key>', 'Use an explicit API key instead of saved credentials')
|
|
22
22
|
.option('--token <token>', 'Use an explicit bearer token instead of saved credentials')
|
package/src/commands/upload.ts
CHANGED
|
@@ -85,7 +85,10 @@ export function createUploadCommand() {
|
|
|
85
85
|
.option('--token <token>', '(Optional) Manually provide token rather than use saved credential')
|
|
86
86
|
.option('--host <host>', '(Optional) Override Sentio Host name')
|
|
87
87
|
.option('--num-workers <count>', '(Optional) Number of processor workers to start', myParseInt)
|
|
88
|
-
.option(
|
|
88
|
+
.option(
|
|
89
|
+
'--sentio-network <network>',
|
|
90
|
+
'(Optional) Sentio network to connect to, can be testnet, testnet-v2, devnet or mainnet'
|
|
91
|
+
)
|
|
89
92
|
.option(
|
|
90
93
|
'--required-chain-id <chain_id...>',
|
|
91
94
|
'(Optional) Specify chain IDs required for the Sentio network. This option is only available when --sentio-network is used. If omitted, all chain IDs from the project configuration (contracts or network overrides) will be used.'
|
|
@@ -566,7 +569,7 @@ async function checkOrCreateProject(options: YamlProjectConfig, auth: Auth) {
|
|
|
566
569
|
console.error(
|
|
567
570
|
chalk.red(
|
|
568
571
|
`Project ${project?.slug} is a Sentio Network project. Please add the --sentio-network flag when uploading.\n` +
|
|
569
|
-
`Example: sentio upload --sentio-network testnet|devnet`
|
|
572
|
+
`Example: sentio upload --sentio-network testnet|testnet-v2|devnet`
|
|
570
573
|
)
|
|
571
574
|
)
|
|
572
575
|
process.exit(1)
|
package/src/config.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface YamlProjectConfig {
|
|
|
34
34
|
silentOverwrite?: boolean
|
|
35
35
|
variables?: Variable[]
|
|
36
36
|
numWorkers?: number // Number of processor worker to start, default to 1
|
|
37
|
-
sentioNetwork?: string // Sentio network to connect to, can be testnet or mainnet
|
|
37
|
+
sentioNetwork?: string // Sentio network to connect to, can be testnet, testnet-v2, devnet or mainnet
|
|
38
38
|
requiredChainIds?: string[]
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -118,13 +118,19 @@ export function overrideConfigWithOptions(config: YamlProjectConfig, options: an
|
|
|
118
118
|
case 'devnet':
|
|
119
119
|
config.sentioNetwork = '7892201'
|
|
120
120
|
break
|
|
121
|
+
case 'testnet-v2':
|
|
122
|
+
config.sentioNetwork = '7892102'
|
|
123
|
+
break
|
|
121
124
|
case '7892101':
|
|
122
125
|
case '7892201':
|
|
126
|
+
case '7892102':
|
|
123
127
|
case '789210':
|
|
124
128
|
config.sentioNetwork = options.sentioNetwork
|
|
125
129
|
break
|
|
126
130
|
default:
|
|
127
|
-
console.error(
|
|
131
|
+
console.error(
|
|
132
|
+
`Invalid sentio network: ${options.sentioNetwork}, only mainnet, testnet, testnet-v2 or devnet is allowed`
|
|
133
|
+
)
|
|
128
134
|
process.exit(1)
|
|
129
135
|
}
|
|
130
136
|
}
|
package/src/network.ts
CHANGED
|
@@ -20,6 +20,13 @@ const TESTNET_CONFIG: SentioNetworkConfig = {
|
|
|
20
20
|
addressBookAddress: '0x092d795d42e23ecba5cc66927972be5c9980effb'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const TESTNET_V2_CONFIG: SentioNetworkConfig = {
|
|
24
|
+
chainId: 7892102,
|
|
25
|
+
rpcUrl: 'https://sentio-testnet-v2.rpc.sentio.xyz',
|
|
26
|
+
explorerUrl: 'https://testnet-v2-explorer.sentio.xyz',
|
|
27
|
+
addressBookAddress: '0xb7e9E56DFC27bcfA63698F2F5890e186426A0123'
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
const DEVNET_CONFIG: SentioNetworkConfig = {
|
|
24
31
|
chainId: 7892201,
|
|
25
32
|
rpcUrl: 'https://sentio-devnet.test-rpc.sentio.xyz',
|
|
@@ -33,11 +40,17 @@ export function getSentioNetworkConfig(network: string, addressBookOverride?: st
|
|
|
33
40
|
config = TESTNET_CONFIG
|
|
34
41
|
} else if (network === 'devnet' || network === '7892201') {
|
|
35
42
|
config = DEVNET_CONFIG
|
|
43
|
+
} else if (network === 'testnet-v2' || network === '7892102') {
|
|
44
|
+
config = TESTNET_V2_CONFIG
|
|
36
45
|
} else if (network === 'mainnet' || network === '789210') {
|
|
37
|
-
console.error(
|
|
46
|
+
console.error(
|
|
47
|
+
chalk.red('Sentio Network mainnet is not yet supported. Only testnet, testnet-v2 and devnet are available.')
|
|
48
|
+
)
|
|
38
49
|
process.exit(1)
|
|
39
50
|
} else {
|
|
40
|
-
console.error(
|
|
51
|
+
console.error(
|
|
52
|
+
chalk.red(`Invalid sentio network: ${network}. Only "testnet", "testnet-v2" or "devnet" is supported.`)
|
|
53
|
+
)
|
|
41
54
|
process.exit(1)
|
|
42
55
|
}
|
|
43
56
|
|