@sentio/cli 3.8.0-rc.2 → 3.8.0-rc.4
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 +29 -13
- package/package.json +1 -1
- package/src/commands/stop-processor.ts +6 -2
- package/src/commands/upload.ts +5 -1
- package/src/network.ts +21 -10
package/lib/index.js
CHANGED
|
@@ -139195,7 +139195,7 @@ var TESTNET_CONFIG = {
|
|
|
139195
139195
|
chainId: 7892101,
|
|
139196
139196
|
rpcUrl: "https://sentio-testnet.rpc.sentio.xyz",
|
|
139197
139197
|
explorerUrl: "https://testnet-explorer.sentio.xyz",
|
|
139198
|
-
addressBookAddress: "
|
|
139198
|
+
addressBookAddress: "0x092d795d42e23ecba5cc66927972be5c9980effb"
|
|
139199
139199
|
};
|
|
139200
139200
|
var DEVNET_CONFIG = {
|
|
139201
139201
|
chainId: 7892201,
|
|
@@ -139203,19 +139203,29 @@ var DEVNET_CONFIG = {
|
|
|
139203
139203
|
explorerUrl: "https://devnet-explorer.sentio.xyz",
|
|
139204
139204
|
addressBookAddress: "0xCfCE965429602b02b453477Cd8Bc7FEd5E8ffc14"
|
|
139205
139205
|
};
|
|
139206
|
-
function getSentioNetworkConfig(network) {
|
|
139206
|
+
function getSentioNetworkConfig(network, addressBookOverride) {
|
|
139207
|
+
let config;
|
|
139207
139208
|
if (network === "testnet" || network === "7892101") {
|
|
139208
|
-
|
|
139209
|
-
}
|
|
139210
|
-
|
|
139211
|
-
|
|
139212
|
-
}
|
|
139213
|
-
if (network === "mainnet" || network === "789210") {
|
|
139209
|
+
config = TESTNET_CONFIG;
|
|
139210
|
+
} else if (network === "devnet" || network === "7892201") {
|
|
139211
|
+
config = DEVNET_CONFIG;
|
|
139212
|
+
} else if (network === "mainnet" || network === "789210") {
|
|
139214
139213
|
console.error(source_default.red("Sentio Network mainnet is not yet supported. Only testnet is available."));
|
|
139215
139214
|
process.exit(1);
|
|
139215
|
+
} else {
|
|
139216
|
+
console.error(source_default.red(`Invalid sentio network: ${network}. Only "testnet" or "devnet" is supported.`));
|
|
139217
|
+
process.exit(1);
|
|
139218
|
+
}
|
|
139219
|
+
if (addressBookOverride) {
|
|
139220
|
+
if (!ethers_exports.isAddress(addressBookOverride)) {
|
|
139221
|
+
console.error(
|
|
139222
|
+
source_default.red(`Invalid --address-book: "${addressBookOverride}" is not a valid 0x-prefixed Ethereum address.`)
|
|
139223
|
+
);
|
|
139224
|
+
process.exit(1);
|
|
139225
|
+
}
|
|
139226
|
+
return { ...config, addressBookAddress: ethers_exports.getAddress(addressBookOverride) };
|
|
139216
139227
|
}
|
|
139217
|
-
|
|
139218
|
-
process.exit(1);
|
|
139228
|
+
return config;
|
|
139219
139229
|
}
|
|
139220
139230
|
var ADDRESS_BOOK_ABI = [
|
|
139221
139231
|
"function getAddress(string name) view returns (address)",
|
|
@@ -139851,6 +139861,9 @@ function createUploadCommand() {
|
|
|
139851
139861
|
"--ipfs-put-url <url>",
|
|
139852
139862
|
"IPFS upload endpoint (used with --no-platform)",
|
|
139853
139863
|
"https://api.sentio.xyz/v1/ipfs/add"
|
|
139864
|
+
).option(
|
|
139865
|
+
"--address-book <address>",
|
|
139866
|
+
"(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --no-platform)."
|
|
139854
139867
|
).action(async (options, command) => {
|
|
139855
139868
|
const processorConfig = loadProcessorConfig(options.path);
|
|
139856
139869
|
overrideConfigWithOptions(processorConfig, options);
|
|
@@ -139866,7 +139879,7 @@ function createUploadCommand() {
|
|
|
139866
139879
|
}
|
|
139867
139880
|
async function runNoPlatformUpload(processorConfig, options) {
|
|
139868
139881
|
const network = options.sentioNetwork || "testnet";
|
|
139869
|
-
const networkConfig = getSentioNetworkConfig(network);
|
|
139882
|
+
const networkConfig = getSentioNetworkConfig(network, options.addressBook);
|
|
139870
139883
|
const privateKey = requirePrivateKey();
|
|
139871
139884
|
const wallet = getWalletFromPrivateKey(privateKey);
|
|
139872
139885
|
const walletAddress = wallet.address;
|
|
@@ -145488,7 +145501,10 @@ function formatTimestamp3(value) {
|
|
|
145488
145501
|
// src/commands/stop-processor.ts
|
|
145489
145502
|
init_cjs_shim();
|
|
145490
145503
|
function createStopProcessorCommand() {
|
|
145491
|
-
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").
|
|
145504
|
+
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(
|
|
145505
|
+
"--address-book <address>",
|
|
145506
|
+
"(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --sentio-network)."
|
|
145507
|
+
).showHelpAfterError().action(async (processorId, options) => {
|
|
145492
145508
|
try {
|
|
145493
145509
|
if (options.sentioNetwork) {
|
|
145494
145510
|
await runStopProcessorOnChain(processorId, options);
|
|
@@ -145502,7 +145518,7 @@ function createStopProcessorCommand() {
|
|
|
145502
145518
|
}
|
|
145503
145519
|
async function runStopProcessorOnChain(processorId, options) {
|
|
145504
145520
|
const network = options.sentioNetwork;
|
|
145505
|
-
const networkConfig = getSentioNetworkConfig(network);
|
|
145521
|
+
const networkConfig = getSentioNetworkConfig(network, options.addressBook);
|
|
145506
145522
|
const privateKey = requirePrivateKey();
|
|
145507
145523
|
const wallet = getWalletFromPrivateKey(privateKey);
|
|
145508
145524
|
console.log(source_default.blue(`Wallet address: ${wallet.address}`));
|
package/package.json
CHANGED
|
@@ -25,6 +25,10 @@ export function createStopProcessorCommand() {
|
|
|
25
25
|
.option('--name <name>', 'Sentio project name')
|
|
26
26
|
.option('-y, --yes', 'Bypass confirmation')
|
|
27
27
|
.option('--no-delete', 'Skip deleting the processor after stopping')
|
|
28
|
+
.option(
|
|
29
|
+
'--address-book <address>',
|
|
30
|
+
'(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --sentio-network).'
|
|
31
|
+
)
|
|
28
32
|
.showHelpAfterError()
|
|
29
33
|
.action(async (processorId, options) => {
|
|
30
34
|
try {
|
|
@@ -41,10 +45,10 @@ export function createStopProcessorCommand() {
|
|
|
41
45
|
|
|
42
46
|
async function runStopProcessorOnChain(
|
|
43
47
|
processorId: string,
|
|
44
|
-
options: { sentioNetwork?: string; yes?: boolean; delete?: boolean }
|
|
48
|
+
options: { sentioNetwork?: string; yes?: boolean; delete?: boolean; addressBook?: string }
|
|
45
49
|
) {
|
|
46
50
|
const network = options.sentioNetwork!
|
|
47
|
-
const networkConfig = getSentioNetworkConfig(network)
|
|
51
|
+
const networkConfig = getSentioNetworkConfig(network, options.addressBook)
|
|
48
52
|
|
|
49
53
|
const privateKey = requirePrivateKey()
|
|
50
54
|
const wallet = getWalletFromPrivateKey(privateKey)
|
package/src/commands/upload.ts
CHANGED
|
@@ -99,6 +99,10 @@ export function createUploadCommand() {
|
|
|
99
99
|
'IPFS upload endpoint (used with --no-platform)',
|
|
100
100
|
'https://api.sentio.xyz/v1/ipfs/add'
|
|
101
101
|
)
|
|
102
|
+
.option(
|
|
103
|
+
'--address-book <address>',
|
|
104
|
+
'(Optional) Override the default AddressBook contract address used to resolve on-chain contracts (used with --no-platform).'
|
|
105
|
+
)
|
|
102
106
|
.action(async (options, command) => {
|
|
103
107
|
const processorConfig = loadProcessorConfig(options.path)
|
|
104
108
|
overrideConfigWithOptions(processorConfig, options)
|
|
@@ -119,7 +123,7 @@ async function runNoPlatformUpload(
|
|
|
119
123
|
) {
|
|
120
124
|
// Determine network - default to testnet for --no-platform
|
|
121
125
|
const network = options.sentioNetwork || 'testnet'
|
|
122
|
-
const networkConfig = getSentioNetworkConfig(network)
|
|
126
|
+
const networkConfig = getSentioNetworkConfig(network, options.addressBook)
|
|
123
127
|
|
|
124
128
|
// Step 1: Require PRIVATE_KEY (operator key when --owner is set, otherwise the owner's own key)
|
|
125
129
|
const privateKey = requirePrivateKey()
|
package/src/network.ts
CHANGED
|
@@ -17,7 +17,7 @@ const TESTNET_CONFIG: SentioNetworkConfig = {
|
|
|
17
17
|
chainId: 7892101,
|
|
18
18
|
rpcUrl: 'https://sentio-testnet.rpc.sentio.xyz',
|
|
19
19
|
explorerUrl: 'https://testnet-explorer.sentio.xyz',
|
|
20
|
-
addressBookAddress: '
|
|
20
|
+
addressBookAddress: '0x092d795d42e23ecba5cc66927972be5c9980effb'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const DEVNET_CONFIG: SentioNetworkConfig = {
|
|
@@ -27,19 +27,30 @@ const DEVNET_CONFIG: SentioNetworkConfig = {
|
|
|
27
27
|
addressBookAddress: '0xCfCE965429602b02b453477Cd8Bc7FEd5E8ffc14'
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function getSentioNetworkConfig(network: string): SentioNetworkConfig {
|
|
30
|
+
export function getSentioNetworkConfig(network: string, addressBookOverride?: string): SentioNetworkConfig {
|
|
31
|
+
let config: SentioNetworkConfig
|
|
31
32
|
if (network === 'testnet' || network === '7892101') {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
if (network === 'mainnet' || network === '789210') {
|
|
33
|
+
config = TESTNET_CONFIG
|
|
34
|
+
} else if (network === 'devnet' || network === '7892201') {
|
|
35
|
+
config = DEVNET_CONFIG
|
|
36
|
+
} else if (network === 'mainnet' || network === '789210') {
|
|
38
37
|
console.error(chalk.red('Sentio Network mainnet is not yet supported. Only testnet is available.'))
|
|
39
38
|
process.exit(1)
|
|
39
|
+
} else {
|
|
40
|
+
console.error(chalk.red(`Invalid sentio network: ${network}. Only "testnet" or "devnet" is supported.`))
|
|
41
|
+
process.exit(1)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (addressBookOverride) {
|
|
45
|
+
if (!ethers.isAddress(addressBookOverride)) {
|
|
46
|
+
console.error(
|
|
47
|
+
chalk.red(`Invalid --address-book: "${addressBookOverride}" is not a valid 0x-prefixed Ethereum address.`)
|
|
48
|
+
)
|
|
49
|
+
process.exit(1)
|
|
50
|
+
}
|
|
51
|
+
return { ...config, addressBookAddress: ethers.getAddress(addressBookOverride) }
|
|
40
52
|
}
|
|
41
|
-
|
|
42
|
-
process.exit(1)
|
|
53
|
+
return config
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
// --- Contract ABIs ---
|