@sentio/cli 4.2.4-rc.2 → 4.3.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/dist/index.js +16 -5
- package/package.json +1 -1
- package/src/commands/stop-processor.ts +1 -1
- package/src/commands/upload.ts +2 -5
- package/src/config.ts +6 -4
- package/src/network.ts +21 -6
package/dist/index.js
CHANGED
|
@@ -11557,12 +11557,16 @@ function overrideConfigWithOptions(config, options) {
|
|
|
11557
11557
|
case "testnet-v2":
|
|
11558
11558
|
config.sentioNetwork = "7892102";
|
|
11559
11559
|
break;
|
|
11560
|
+
case "devnet":
|
|
11561
|
+
config.sentioNetwork = "7892301";
|
|
11562
|
+
break;
|
|
11560
11563
|
case "7892102":
|
|
11564
|
+
case "7892301":
|
|
11561
11565
|
case "789210":
|
|
11562
11566
|
config.sentioNetwork = options.sentioNetwork;
|
|
11563
11567
|
break;
|
|
11564
11568
|
default:
|
|
11565
|
-
console.error(`Invalid sentio network: ${options.sentioNetwork}, only mainnet or
|
|
11569
|
+
console.error(`Invalid sentio network: ${options.sentioNetwork}, only mainnet, testnet or devnet is allowed`);
|
|
11566
11570
|
process.exit(1);
|
|
11567
11571
|
}
|
|
11568
11572
|
}
|
|
@@ -169626,14 +169630,21 @@ const TESTNET_CONFIG = {
|
|
|
169626
169630
|
explorerUrl: "https://testnet-explorer.sentio.xyz",
|
|
169627
169631
|
addressBookAddress: "0xb7e9E56DFC27bcfA63698F2F5890e186426A0123"
|
|
169628
169632
|
};
|
|
169633
|
+
const DEVNET_CONFIG = {
|
|
169634
|
+
chainId: 7892301,
|
|
169635
|
+
rpcUrl: "https://sentio-devnet.test-rpc.sentio.xyz",
|
|
169636
|
+
explorerUrl: "https://devnet-explorer.sentio.xyz",
|
|
169637
|
+
addressBookAddress: "0xb7e9E56DFC27bcfA63698F2F5890e186426A0123"
|
|
169638
|
+
};
|
|
169629
169639
|
function getSentioNetworkConfig(network, addressBookOverride) {
|
|
169630
169640
|
let config;
|
|
169631
169641
|
if (network === "testnet" || network === "testnet-v2" || network === "7892102") config = TESTNET_CONFIG;
|
|
169642
|
+
else if (network === "devnet" || network === "7892301") config = DEVNET_CONFIG;
|
|
169632
169643
|
else if (network === "mainnet" || network === "789210") {
|
|
169633
|
-
console.error(chalk.red("Sentio Network mainnet is not yet supported. Only testnet
|
|
169644
|
+
console.error(chalk.red("Sentio Network mainnet is not yet supported. Only testnet and devnet are available."));
|
|
169634
169645
|
process.exit(1);
|
|
169635
169646
|
} else {
|
|
169636
|
-
console.error(chalk.red(`Invalid sentio network: ${network}. Only "testnet"
|
|
169647
|
+
console.error(chalk.red(`Invalid sentio network: ${network}. Only "testnet" and "devnet" are supported.`));
|
|
169637
169648
|
process.exit(1);
|
|
169638
169649
|
}
|
|
169639
169650
|
if (addressBookOverride) {
|
|
@@ -170147,7 +170158,7 @@ function myParseInt(value, dummyPrevious) {
|
|
|
170147
170158
|
return parsedValue;
|
|
170148
170159
|
}
|
|
170149
170160
|
function createUploadCommand() {
|
|
170150
|
-
return new Command$5("upload").description("Upload processor to Sentio").option("--owner <owner>", "(Optional) Project owner. Platform mode: project owner username. --no-platform mode: on-chain owner address (0x...) — $PRIVATE_KEY then signs as an operator on the owner's behalf, requires Permissions.addOperator beforehand.").option("--name <name>", "(Optional) Override Project name").option("--continue-from <version>", "(Optional) Continue processing data from the specific processor version which will keeping the old data from previous version and will STOP that version IMMEDIATELY.", myParseInt).option("--checkpoint <checkpoint...>", "(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.").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("--sentio-network <network>", "(Optional) Sentio network to connect to, can be testnet or mainnet").option("--required-chain-id <chain_id...>", "(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.").option("--no-platform", "Upload processor directly to Sentio Network without platform support. Requires $PRIVATE_KEY env var.
|
|
170161
|
+
return new Command$5("upload").description("Upload processor to Sentio").option("--owner <owner>", "(Optional) Project owner. Platform mode: project owner username. --no-platform mode: on-chain owner address (0x...) — $PRIVATE_KEY then signs as an operator on the owner's behalf, requires Permissions.addOperator beforehand.").option("--name <name>", "(Optional) Override Project name").option("--continue-from <version>", "(Optional) Continue processing data from the specific processor version which will keeping the old data from previous version and will STOP that version IMMEDIATELY.", myParseInt).option("--checkpoint <checkpoint...>", "(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.").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("--sentio-network <network>", "(Optional) Sentio network to connect to, can be testnet, devnet or mainnet").option("--required-chain-id <chain_id...>", "(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.").option("--no-platform", "Upload processor directly to Sentio Network without platform support. Requires $PRIVATE_KEY env var. Supported networks: testnet, devnet.").option("--ipfs-put-url <url>", "IPFS upload endpoint (used with --no-platform)", "https://api.sentio.xyz/v1/ipfs/add").option("--address-book <address>", "(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --no-platform).").action(async (options, command) => {
|
|
170151
170162
|
const processorConfig = loadProcessorConfig(options.path);
|
|
170152
170163
|
overrideConfigWithOptions(processorConfig, options);
|
|
170153
170164
|
if (options.path) process.chdir(options.path);
|
|
@@ -184454,7 +184465,7 @@ function formatTimestamp(value) {
|
|
|
184454
184465
|
//#endregion
|
|
184455
184466
|
//#region src/commands/stop-processor.ts
|
|
184456
184467
|
function createStopProcessorCommand() {
|
|
184457
|
-
return new Command$5("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)").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("--address-book <address>", "(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --sentio-network).").showHelpAfterError().action(async (processorId, options) => {
|
|
184468
|
+
return new Command$5("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("--address-book <address>", "(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --sentio-network).").showHelpAfterError().action(async (processorId, options) => {
|
|
184458
184469
|
try {
|
|
184459
184470
|
if (options.sentioNetwork) await runStopProcessorOnChain(processorId, options);
|
|
184460
184471
|
else await runProcessorStop(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)')
|
|
19
|
+
.option('--sentio-network <network>', 'Stop via Sentio Network contract (testnet 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,17 +85,14 @@ 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(
|
|
89
|
-
'--sentio-network <network>',
|
|
90
|
-
'(Optional) Sentio network to connect to, can be testnet or mainnet'
|
|
91
|
-
)
|
|
88
|
+
.option('--sentio-network <network>', '(Optional) Sentio network to connect to, can be testnet, devnet or mainnet')
|
|
92
89
|
.option(
|
|
93
90
|
'--required-chain-id <chain_id...>',
|
|
94
91
|
'(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.'
|
|
95
92
|
)
|
|
96
93
|
.option(
|
|
97
94
|
'--no-platform',
|
|
98
|
-
'Upload processor directly to Sentio Network without platform support. Requires $PRIVATE_KEY env var.
|
|
95
|
+
'Upload processor directly to Sentio Network without platform support. Requires $PRIVATE_KEY env var. Supported networks: testnet, devnet.'
|
|
99
96
|
)
|
|
100
97
|
.option(
|
|
101
98
|
'--ipfs-put-url <url>',
|
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, devnet or mainnet
|
|
38
38
|
requiredChainIds?: string[]
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -116,14 +116,16 @@ export function overrideConfigWithOptions(config: YamlProjectConfig, options: an
|
|
|
116
116
|
case 'testnet-v2':
|
|
117
117
|
config.sentioNetwork = '7892102'
|
|
118
118
|
break
|
|
119
|
+
case 'devnet':
|
|
120
|
+
config.sentioNetwork = '7892301'
|
|
121
|
+
break
|
|
119
122
|
case '7892102':
|
|
123
|
+
case '7892301':
|
|
120
124
|
case '789210':
|
|
121
125
|
config.sentioNetwork = options.sentioNetwork
|
|
122
126
|
break
|
|
123
127
|
default:
|
|
124
|
-
console.error(
|
|
125
|
-
`Invalid sentio network: ${options.sentioNetwork}, only mainnet or testnet is allowed`
|
|
126
|
-
)
|
|
128
|
+
console.error(`Invalid sentio network: ${options.sentioNetwork}, only mainnet, testnet or devnet is allowed`)
|
|
127
129
|
process.exit(1)
|
|
128
130
|
}
|
|
129
131
|
}
|
package/src/network.ts
CHANGED
|
@@ -26,19 +26,34 @@ const TESTNET_CONFIG: SentioNetworkConfig = {
|
|
|
26
26
|
addressBookAddress: '0xb7e9E56DFC27bcfA63698F2F5890e186426A0123'
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// Sentio Network devnet — chain id 7892301. This replaced the original devnet
|
|
30
|
+
// (7892201), which has been decommissioned, and inherited its hosts: the RPC is
|
|
31
|
+
// sentio-devnet.test-rpc.sentio.xyz and the explorer devnet-explorer.sentio.xyz.
|
|
32
|
+
// `sentio-devnet2` is NOT a thing — that hostname is unrouted and answers
|
|
33
|
+
// "unknown network slug". Same as testnet-v2 taking over the plain testnet hosts.
|
|
34
|
+
//
|
|
35
|
+
// Contracts are deployed deterministically, so every module proxy — and the
|
|
36
|
+
// AddressBook itself — sits at the same address as on testnet. The one exception
|
|
37
|
+
// is `sentio_token`, which here is the WETH9 predeploy; it resolves through the
|
|
38
|
+
// AddressBook like everything else, so nothing in this file needs to know.
|
|
39
|
+
const DEVNET_CONFIG: SentioNetworkConfig = {
|
|
40
|
+
chainId: 7892301,
|
|
41
|
+
rpcUrl: 'https://sentio-devnet.test-rpc.sentio.xyz',
|
|
42
|
+
explorerUrl: 'https://devnet-explorer.sentio.xyz',
|
|
43
|
+
addressBookAddress: '0xb7e9E56DFC27bcfA63698F2F5890e186426A0123'
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
export function getSentioNetworkConfig(network: string, addressBookOverride?: string): SentioNetworkConfig {
|
|
30
47
|
let config: SentioNetworkConfig
|
|
31
48
|
if (network === 'testnet' || network === 'testnet-v2' || network === '7892102') {
|
|
32
49
|
config = TESTNET_CONFIG
|
|
50
|
+
} else if (network === 'devnet' || network === '7892301') {
|
|
51
|
+
config = DEVNET_CONFIG
|
|
33
52
|
} else if (network === 'mainnet' || network === '789210') {
|
|
34
|
-
console.error(
|
|
35
|
-
chalk.red('Sentio Network mainnet is not yet supported. Only testnet is available.')
|
|
36
|
-
)
|
|
53
|
+
console.error(chalk.red('Sentio Network mainnet is not yet supported. Only testnet and devnet are available.'))
|
|
37
54
|
process.exit(1)
|
|
38
55
|
} else {
|
|
39
|
-
console.error(
|
|
40
|
-
chalk.red(`Invalid sentio network: ${network}. Only "testnet" is supported.`)
|
|
41
|
-
)
|
|
56
|
+
console.error(chalk.red(`Invalid sentio network: ${network}. Only "testnet" and "devnet" are supported.`))
|
|
42
57
|
process.exit(1)
|
|
43
58
|
}
|
|
44
59
|
|