@settlemint/sdk-cli 2.1.3 → 2.1.4-main0ca0d06f
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 +1 -1
- package/dist/cli.js +651 -131
- package/dist/cli.js.map +53 -46
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -4157,7 +4157,7 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4157
4157
|
exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
|
4158
4158
|
});
|
4159
4159
|
|
4160
|
-
// ../../node_modules/@noble/hashes/_assert.js
|
4160
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_assert.js
|
4161
4161
|
var require__assert2 = __commonJS((exports) => {
|
4162
4162
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4163
4163
|
exports.anumber = anumber;
|
@@ -4199,7 +4199,7 @@ var require__assert2 = __commonJS((exports) => {
|
|
4199
4199
|
}
|
4200
4200
|
});
|
4201
4201
|
|
4202
|
-
// ../../node_modules/@noble/hashes/cryptoNode.js
|
4202
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
|
4203
4203
|
var require_cryptoNode2 = __commonJS((exports) => {
|
4204
4204
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4205
4205
|
exports.crypto = undefined;
|
@@ -4207,7 +4207,7 @@ var require_cryptoNode2 = __commonJS((exports) => {
|
|
4207
4207
|
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
4208
4208
|
});
|
4209
4209
|
|
4210
|
-
// ../../node_modules/@noble/hashes/utils.js
|
4210
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
|
4211
4211
|
var require_utils4 = __commonJS((exports) => {
|
4212
4212
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
4213
4213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -4386,7 +4386,7 @@ var require_utils4 = __commonJS((exports) => {
|
|
4386
4386
|
}
|
4387
4387
|
});
|
4388
4388
|
|
4389
|
-
// ../../node_modules/@noble/hashes/_md.js
|
4389
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
|
4390
4390
|
var require__md = __commonJS((exports) => {
|
4391
4391
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4392
4392
|
exports.HashMD = undefined;
|
@@ -4503,7 +4503,7 @@ var require__md = __commonJS((exports) => {
|
|
4503
4503
|
exports.HashMD = HashMD;
|
4504
4504
|
});
|
4505
4505
|
|
4506
|
-
// ../../node_modules/@noble/hashes/_u64.js
|
4506
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
|
4507
4507
|
var require__u64 = __commonJS((exports) => {
|
4508
4508
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4509
4509
|
exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = undefined;
|
@@ -4595,7 +4595,7 @@ var require__u64 = __commonJS((exports) => {
|
|
4595
4595
|
exports.default = u64;
|
4596
4596
|
});
|
4597
4597
|
|
4598
|
-
// ../../node_modules/@noble/hashes/sha512.js
|
4598
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha512.js
|
4599
4599
|
var require_sha512 = __commonJS((exports) => {
|
4600
4600
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4601
4601
|
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
|
@@ -4876,7 +4876,7 @@ var require_sha512 = __commonJS((exports) => {
|
|
4876
4876
|
exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA384);
|
4877
4877
|
});
|
4878
4878
|
|
4879
|
-
// ../../node_modules/@noble/curves/abstract/utils.js
|
4879
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
|
4880
4880
|
var require_utils5 = __commonJS((exports) => {
|
4881
4881
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
4882
4882
|
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -5146,7 +5146,7 @@ var require_utils5 = __commonJS((exports) => {
|
|
5146
5146
|
}
|
5147
5147
|
});
|
5148
5148
|
|
5149
|
-
// ../../node_modules/@noble/curves/abstract/modular.js
|
5149
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/modular.js
|
5150
5150
|
var require_modular = __commonJS((exports) => {
|
5151
5151
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5152
5152
|
exports.isNegativeLE = undefined;
|
@@ -5481,7 +5481,7 @@ var require_modular = __commonJS((exports) => {
|
|
5481
5481
|
}
|
5482
5482
|
});
|
5483
5483
|
|
5484
|
-
// ../../node_modules/@noble/curves/abstract/curve.js
|
5484
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/curve.js
|
5485
5485
|
var require_curve = __commonJS((exports) => {
|
5486
5486
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5487
5487
|
exports.wNAF = wNAF;
|
@@ -5723,7 +5723,7 @@ var require_curve = __commonJS((exports) => {
|
|
5723
5723
|
}
|
5724
5724
|
});
|
5725
5725
|
|
5726
|
-
// ../../node_modules/@noble/curves/abstract/edwards.js
|
5726
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/edwards.js
|
5727
5727
|
var require_edwards = __commonJS((exports) => {
|
5728
5728
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5729
5729
|
exports.twistedEdwards = twistedEdwards;
|
@@ -6085,7 +6085,7 @@ var require_edwards = __commonJS((exports) => {
|
|
6085
6085
|
}
|
6086
6086
|
});
|
6087
6087
|
|
6088
|
-
// ../../node_modules/@noble/curves/abstract/hash-to-curve.js
|
6088
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/hash-to-curve.js
|
6089
6089
|
var require_hash_to_curve = __commonJS((exports) => {
|
6090
6090
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6091
6091
|
exports.expand_message_xmd = expand_message_xmd;
|
@@ -6232,7 +6232,7 @@ var require_hash_to_curve = __commonJS((exports) => {
|
|
6232
6232
|
}
|
6233
6233
|
});
|
6234
6234
|
|
6235
|
-
// ../../node_modules/@noble/curves/abstract/montgomery.js
|
6235
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/montgomery.js
|
6236
6236
|
var require_montgomery = __commonJS((exports) => {
|
6237
6237
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6238
6238
|
exports.montgomery = montgomery;
|
@@ -6357,7 +6357,7 @@ var require_montgomery = __commonJS((exports) => {
|
|
6357
6357
|
}
|
6358
6358
|
});
|
6359
6359
|
|
6360
|
-
// ../../node_modules/@noble/curves/ed25519.js
|
6360
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
|
6361
6361
|
var require_ed25519 = __commonJS((exports) => {
|
6362
6362
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6363
6363
|
exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
|
@@ -6724,7 +6724,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
6724
6724
|
exports.hash_to_ristretto255 = exports.hashToRistretto255;
|
6725
6725
|
});
|
6726
6726
|
|
6727
|
-
// ../../node_modules/@noble/hashes/sha256.js
|
6727
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
|
6728
6728
|
var require_sha256 = __commonJS((exports) => {
|
6729
6729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6730
6730
|
exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
|
@@ -6897,7 +6897,7 @@ var require_sha256 = __commonJS((exports) => {
|
|
6897
6897
|
exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA224);
|
6898
6898
|
});
|
6899
6899
|
|
6900
|
-
// ../../node_modules/@noble/hashes/hmac.js
|
6900
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/hmac.js
|
6901
6901
|
var require_hmac = __commonJS((exports) => {
|
6902
6902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6903
6903
|
exports.hmac = exports.HMAC = undefined;
|
@@ -6971,7 +6971,7 @@ var require_hmac = __commonJS((exports) => {
|
|
6971
6971
|
exports.hmac.create = (hash, key) => new HMAC(hash, key);
|
6972
6972
|
});
|
6973
6973
|
|
6974
|
-
// ../../node_modules/@noble/curves/abstract/weierstrass.js
|
6974
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/weierstrass.js
|
6975
6975
|
var require_weierstrass = __commonJS((exports) => {
|
6976
6976
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6977
6977
|
exports.DER = exports.DERErr = undefined;
|
@@ -7878,7 +7878,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
7878
7878
|
}
|
7879
7879
|
});
|
7880
7880
|
|
7881
|
-
// ../../node_modules/@noble/curves/_shortw_utils.js
|
7881
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/_shortw_utils.js
|
7882
7882
|
var require__shortw_utils = __commonJS((exports) => {
|
7883
7883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7884
7884
|
exports.getHash = getHash;
|
@@ -7900,7 +7900,7 @@ var require__shortw_utils = __commonJS((exports) => {
|
|
7900
7900
|
}
|
7901
7901
|
});
|
7902
7902
|
|
7903
|
-
// ../../node_modules/@noble/curves/secp256k1.js
|
7903
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
|
7904
7904
|
var require_secp256k1 = __commonJS((exports) => {
|
7905
7905
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7906
7906
|
exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
|
@@ -8226,7 +8226,7 @@ var require_elliptic = __commonJS((exports) => {
|
|
8226
8226
|
};
|
8227
8227
|
});
|
8228
8228
|
|
8229
|
-
// ../../node_modules/@noble/hashes/hkdf.js
|
8229
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/hkdf.js
|
8230
8230
|
var require_hkdf = __commonJS((exports) => {
|
8231
8231
|
Object.defineProperty(exports, "__esModule", { value: true });
|
8232
8232
|
exports.hkdf = undefined;
|
@@ -245084,8 +245084,11 @@ var DotEnvSchema = z.object({
|
|
245084
245084
|
SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
|
245085
245085
|
SETTLEMINT_APPLICATION: UniqueNameSchema.optional(),
|
245086
245086
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema.optional(),
|
245087
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
245087
245088
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema.optional(),
|
245088
|
-
|
245089
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: UrlSchema.optional(),
|
245090
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema.optional(),
|
245091
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema.optional(),
|
245089
245092
|
SETTLEMINT_HASURA: UniqueNameSchema.optional(),
|
245090
245093
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
|
245091
245094
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
@@ -245278,7 +245281,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
245278
245281
|
var package_default = {
|
245279
245282
|
name: "@settlemint/sdk-cli",
|
245280
245283
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
245281
|
-
version: "2.1.
|
245284
|
+
version: "2.1.4-main0ca0d06f",
|
245282
245285
|
type: "module",
|
245283
245286
|
private: false,
|
245284
245287
|
license: "FSL-1.1-MIT",
|
@@ -245327,8 +245330,8 @@ var package_default = {
|
|
245327
245330
|
"@inquirer/input": "4.1.9",
|
245328
245331
|
"@inquirer/password": "4.0.12",
|
245329
245332
|
"@inquirer/select": "4.1.1",
|
245330
|
-
"@settlemint/sdk-js": "2.1.
|
245331
|
-
"@settlemint/sdk-utils": "2.1.
|
245333
|
+
"@settlemint/sdk-js": "2.1.4-main0ca0d06f",
|
245334
|
+
"@settlemint/sdk-utils": "2.1.4-main0ca0d06f",
|
245332
245335
|
"@types/node": "22.14.1",
|
245333
245336
|
"@types/semver": "7.7.0",
|
245334
245337
|
"@types/which": "3.0.4",
|
@@ -246741,8 +246744,11 @@ var DotEnvSchema2 = z.object({
|
|
246741
246744
|
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
246742
246745
|
SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
|
246743
246746
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
|
246747
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
246744
246748
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
|
246745
|
-
|
246749
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: UrlSchema2.optional(),
|
246750
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
246751
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema2.optional(),
|
246746
246752
|
SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
|
246747
246753
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
246748
246754
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
@@ -247641,11 +247647,61 @@ var BlockchainNetworkFragment = graphql(`
|
|
247641
247647
|
healthStatus
|
247642
247648
|
provider
|
247643
247649
|
region
|
247650
|
+
... on BesuQBFTBlockchainNetwork {
|
247651
|
+
chainId
|
247652
|
+
}
|
247653
|
+
... on BesuIbftv2BlockchainNetwork {
|
247654
|
+
chainId
|
247655
|
+
}
|
247656
|
+
... on GethPoWBlockchainNetwork {
|
247657
|
+
chainId
|
247658
|
+
}
|
247659
|
+
... on GethPoSRinkebyBlockchainNetwork {
|
247660
|
+
chainId
|
247661
|
+
}
|
247662
|
+
... on GethVenidiumBlockchainNetwork {
|
247663
|
+
chainId
|
247664
|
+
}
|
247665
|
+
... on GethGoerliBlockchainNetwork {
|
247666
|
+
chainId
|
247667
|
+
}
|
247668
|
+
... on AvalancheBlockchainNetwork {
|
247669
|
+
chainId
|
247670
|
+
}
|
247671
|
+
... on AvalancheFujiBlockchainNetwork {
|
247672
|
+
chainId
|
247673
|
+
}
|
247674
|
+
... on BscPoWBlockchainNetwork {
|
247675
|
+
chainId
|
247676
|
+
}
|
247677
|
+
... on BscPoWTestnetBlockchainNetwork {
|
247678
|
+
chainId
|
247679
|
+
}
|
247680
|
+
... on PolygonBlockchainNetwork {
|
247681
|
+
chainId
|
247682
|
+
}
|
247683
|
+
... on PolygonMumbaiBlockchainNetwork {
|
247684
|
+
chainId
|
247685
|
+
}
|
247686
|
+
... on PolygonEdgePoABlockchainNetwork {
|
247687
|
+
chainId
|
247688
|
+
}
|
247689
|
+
... on QuorumQBFTBlockchainNetwork {
|
247690
|
+
chainId
|
247691
|
+
}
|
247692
|
+
... on GethCliqueBlockchainNetwork {
|
247693
|
+
chainId
|
247694
|
+
}
|
247644
247695
|
blockchainNodes {
|
247645
247696
|
... on BlockchainNode {
|
247646
247697
|
id
|
247647
247698
|
name
|
247648
247699
|
uniqueName
|
247700
|
+
endpoints {
|
247701
|
+
id
|
247702
|
+
label
|
247703
|
+
displayValue
|
247704
|
+
}
|
247649
247705
|
}
|
247650
247706
|
}
|
247651
247707
|
}
|
@@ -247807,6 +247863,51 @@ var BlockchainNodeFragment = graphql(`
|
|
247807
247863
|
id
|
247808
247864
|
name
|
247809
247865
|
uniqueName
|
247866
|
+
... on BesuQBFTBlockchainNetwork {
|
247867
|
+
chainId
|
247868
|
+
}
|
247869
|
+
... on BesuIbftv2BlockchainNetwork {
|
247870
|
+
chainId
|
247871
|
+
}
|
247872
|
+
... on GethPoWBlockchainNetwork {
|
247873
|
+
chainId
|
247874
|
+
}
|
247875
|
+
... on GethPoSRinkebyBlockchainNetwork {
|
247876
|
+
chainId
|
247877
|
+
}
|
247878
|
+
... on GethVenidiumBlockchainNetwork {
|
247879
|
+
chainId
|
247880
|
+
}
|
247881
|
+
... on GethGoerliBlockchainNetwork {
|
247882
|
+
chainId
|
247883
|
+
}
|
247884
|
+
... on AvalancheBlockchainNetwork {
|
247885
|
+
chainId
|
247886
|
+
}
|
247887
|
+
... on AvalancheFujiBlockchainNetwork {
|
247888
|
+
chainId
|
247889
|
+
}
|
247890
|
+
... on BscPoWBlockchainNetwork {
|
247891
|
+
chainId
|
247892
|
+
}
|
247893
|
+
... on BscPoWTestnetBlockchainNetwork {
|
247894
|
+
chainId
|
247895
|
+
}
|
247896
|
+
... on PolygonBlockchainNetwork {
|
247897
|
+
chainId
|
247898
|
+
}
|
247899
|
+
... on PolygonMumbaiBlockchainNetwork {
|
247900
|
+
chainId
|
247901
|
+
}
|
247902
|
+
... on PolygonEdgePoABlockchainNetwork {
|
247903
|
+
chainId
|
247904
|
+
}
|
247905
|
+
... on QuorumQBFTBlockchainNetwork {
|
247906
|
+
chainId
|
247907
|
+
}
|
247908
|
+
... on GethCliqueBlockchainNetwork {
|
247909
|
+
chainId
|
247910
|
+
}
|
247810
247911
|
}
|
247811
247912
|
}
|
247812
247913
|
privateKeys {
|
@@ -248050,6 +248151,11 @@ var LoadBalancerFragment = graphql(`
|
|
248050
248151
|
healthStatus
|
248051
248152
|
provider
|
248052
248153
|
region
|
248154
|
+
endpoints {
|
248155
|
+
id
|
248156
|
+
label
|
248157
|
+
displayValue
|
248158
|
+
}
|
248053
248159
|
}
|
248054
248160
|
`);
|
248055
248161
|
var getLoadBalancer = graphql(`
|
@@ -248059,6 +248165,47 @@ var getLoadBalancer = graphql(`
|
|
248059
248165
|
}
|
248060
248166
|
}
|
248061
248167
|
`, [LoadBalancerFragment]);
|
248168
|
+
var getLoadBalancers = graphql(`
|
248169
|
+
query getLoadBalancers($applicationUniqueName: String!) {
|
248170
|
+
loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
248171
|
+
items {
|
248172
|
+
...LoadBalancer
|
248173
|
+
}
|
248174
|
+
}
|
248175
|
+
}
|
248176
|
+
`, [LoadBalancerFragment]);
|
248177
|
+
var createLoadBalancer = graphql(`
|
248178
|
+
mutation createLoadBalancer(
|
248179
|
+
$applicationId: ID!
|
248180
|
+
$blockchainNetworkId: ID!
|
248181
|
+
$name: String!
|
248182
|
+
$provider: String!
|
248183
|
+
$region: String!
|
248184
|
+
$size: ClusterServiceSize
|
248185
|
+
$type: ClusterServiceType
|
248186
|
+
$connectedNodes: [ID!]!
|
248187
|
+
) {
|
248188
|
+
createLoadBalancer(
|
248189
|
+
applicationId: $applicationId
|
248190
|
+
blockchainNetworkId: $blockchainNetworkId
|
248191
|
+
name: $name
|
248192
|
+
provider: $provider
|
248193
|
+
region: $region
|
248194
|
+
size: $size
|
248195
|
+
type: $type
|
248196
|
+
connectedNodes: $connectedNodes
|
248197
|
+
) {
|
248198
|
+
...LoadBalancer
|
248199
|
+
}
|
248200
|
+
}
|
248201
|
+
`, [LoadBalancerFragment]);
|
248202
|
+
var restartLoadBalancer = graphql(`
|
248203
|
+
mutation RestartLoadBalancer($uniqueName: String!) {
|
248204
|
+
restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
248205
|
+
...LoadBalancer
|
248206
|
+
}
|
248207
|
+
}
|
248208
|
+
`, [LoadBalancerFragment]);
|
248062
248209
|
var loadBalancerRead = (gqlClient) => {
|
248063
248210
|
return async (loadBalancerUniqueName) => {
|
248064
248211
|
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
@@ -248067,6 +248214,37 @@ var loadBalancerRead = (gqlClient) => {
|
|
248067
248214
|
return loadBalancer;
|
248068
248215
|
};
|
248069
248216
|
};
|
248217
|
+
var loadBalancerList = (gqlClient) => {
|
248218
|
+
return async (applicationUniqueName) => {
|
248219
|
+
const {
|
248220
|
+
loadBalancersByUniqueName: { items }
|
248221
|
+
} = await gqlClient.request(getLoadBalancers, { applicationUniqueName });
|
248222
|
+
return items;
|
248223
|
+
};
|
248224
|
+
};
|
248225
|
+
var loadBalancerCreate = (gqlClient) => {
|
248226
|
+
return async (args) => {
|
248227
|
+
const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;
|
248228
|
+
const [application, blockchainNetwork, connectedNodes] = await Promise.all([
|
248229
|
+
applicationRead(gqlClient)(applicationUniqueName),
|
248230
|
+
blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),
|
248231
|
+
Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))
|
248232
|
+
]);
|
248233
|
+
const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {
|
248234
|
+
...otherArgs,
|
248235
|
+
applicationId: application.id,
|
248236
|
+
blockchainNetworkId: blockchainNetwork.id,
|
248237
|
+
connectedNodes: connectedNodes.map((node) => node.id)
|
248238
|
+
});
|
248239
|
+
return loadBalancer;
|
248240
|
+
};
|
248241
|
+
};
|
248242
|
+
var loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
248243
|
+
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {
|
248244
|
+
uniqueName: loadBalancerUniqueName
|
248245
|
+
});
|
248246
|
+
return loadBalancer;
|
248247
|
+
};
|
248070
248248
|
var InsightsFragment = graphql(`
|
248071
248249
|
fragment Insights on Insights {
|
248072
248250
|
__typename
|
@@ -248767,6 +248945,12 @@ function createSettleMintClient(options) {
|
|
248767
248945
|
create: blockchainNodeCreate(gqlClient),
|
248768
248946
|
restart: blockchainNodeRestart(gqlClient)
|
248769
248947
|
},
|
248948
|
+
loadBalancer: {
|
248949
|
+
list: loadBalancerList(gqlClient),
|
248950
|
+
read: loadBalancerRead(gqlClient),
|
248951
|
+
create: loadBalancerCreate(gqlClient),
|
248952
|
+
restart: loadBalancerRestart(gqlClient)
|
248953
|
+
},
|
248770
248954
|
middleware: {
|
248771
248955
|
list: middlewareList(gqlClient),
|
248772
248956
|
read: middlewareRead(gqlClient),
|
@@ -250141,7 +250325,7 @@ export const postgresPool = createPostgresPool(process.env.SETTLEMINT_HASURA_DAT
|
|
250141
250325
|
await installDependencies(PACKAGE_NAME, projectDir);
|
250142
250326
|
}
|
250143
250327
|
if (!databaseUrl) {
|
250144
|
-
|
250328
|
+
note("[Codegen] Missing database environment variables", "warn");
|
250145
250329
|
}
|
250146
250330
|
}
|
250147
250331
|
|
@@ -251698,6 +251882,7 @@ async function codegenBlockscout(env2) {
|
|
251698
251882
|
__schema {
|
251699
251883
|
queryType { name }
|
251700
251884
|
mutationType { name }
|
251885
|
+
subscriptionType { name }
|
251701
251886
|
types {
|
251702
251887
|
...FullType
|
251703
251888
|
}
|
@@ -251779,10 +251964,6 @@ async function codegenBlockscout(env2) {
|
|
251779
251964
|
ofType {
|
251780
251965
|
kind
|
251781
251966
|
name
|
251782
|
-
ofType {
|
251783
|
-
kind
|
251784
|
-
name
|
251785
|
-
}
|
251786
251967
|
}
|
251787
251968
|
}
|
251788
251969
|
}
|
@@ -251900,9 +252081,72 @@ export const { client } = createServerMinioClient({
|
|
251900
252081
|
}
|
251901
252082
|
}
|
251902
252083
|
|
252084
|
+
// src/commands/codegen/codegen-viem.ts
|
252085
|
+
var PACKAGE_NAME7 = "@settlemint/sdk-viem";
|
252086
|
+
async function codegenViem(env2) {
|
252087
|
+
const chainId = env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID;
|
252088
|
+
if (!chainId) {
|
252089
|
+
note("[Codegen] No chain ID found, skipping Viem resources generation", "warn");
|
252090
|
+
return;
|
252091
|
+
}
|
252092
|
+
const loadBalancerRpcEndpoint = env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT;
|
252093
|
+
const blockchainNodeRpcEndpoint = env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
|
252094
|
+
if (!loadBalancerRpcEndpoint && !blockchainNodeRpcEndpoint) {
|
252095
|
+
note("[Codegen] No RPC endpoints found, skipping Viem resources generation", "warn");
|
252096
|
+
return;
|
252097
|
+
}
|
252098
|
+
const projectDir = await projectRoot3();
|
252099
|
+
if (!await isPackageInstalled(PACKAGE_NAME7, projectDir)) {
|
252100
|
+
await installDependencies(PACKAGE_NAME7, projectDir);
|
252101
|
+
}
|
252102
|
+
const imports = [];
|
252103
|
+
if (loadBalancerRpcEndpoint) {
|
252104
|
+
imports.push("getPublicClient");
|
252105
|
+
}
|
252106
|
+
if (blockchainNodeRpcEndpoint) {
|
252107
|
+
imports.push("getWalletClient");
|
252108
|
+
}
|
252109
|
+
const viemTemplate = [`import { ${imports.join(", ")} } from "${PACKAGE_NAME7}";`];
|
252110
|
+
if (loadBalancerRpcEndpoint) {
|
252111
|
+
viemTemplate.push(`
|
252112
|
+
/**
|
252113
|
+
* The public client. Use this if you need to read from the blockchain.
|
252114
|
+
*/
|
252115
|
+
export const publicClient = getPublicClient({
|
252116
|
+
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252117
|
+
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252118
|
+
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,
|
252119
|
+
});`);
|
252120
|
+
}
|
252121
|
+
if (blockchainNodeRpcEndpoint) {
|
252122
|
+
viemTemplate.push(`
|
252123
|
+
/**
|
252124
|
+
* The wallet client. Use this if you need to write to the blockchain.
|
252125
|
+
*/
|
252126
|
+
export const walletClient = getWalletClient({
|
252127
|
+
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252128
|
+
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252129
|
+
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
252130
|
+
})();
|
252131
|
+
|
252132
|
+
/**
|
252133
|
+
* The wallet client for HD wallets. Use this if you need to write to the blockchain.
|
252134
|
+
* HD wallets require a challenge response to be sent with the request.
|
252135
|
+
*/
|
252136
|
+
export const hdWalletClient = getWalletClient({
|
252137
|
+
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252138
|
+
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252139
|
+
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
252140
|
+
});`);
|
252141
|
+
}
|
252142
|
+
await writeTemplate(viemTemplate.join(`
|
252143
|
+
`), "/lib/settlemint", "viem.ts");
|
252144
|
+
note("Viem resources generated successfully");
|
252145
|
+
}
|
252146
|
+
|
251903
252147
|
// src/commands/codegen.ts
|
251904
252148
|
function codegenCommand() {
|
251905
|
-
return new Command("codegen").option("--prod", "Connect to your production environment").option("--thegraph-subgraph-names <subgraph-names...>", "The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)").description("Generate GraphQL and REST types and queries").usage(createExamples([
|
252149
|
+
return new Command("codegen").option("--prod", "Connect to your production environment").option("--thegraph-subgraph-names <subgraph-names...>", "The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)").option("--generate-viem", "Generate Viem resources").description("Generate GraphQL and REST types and queries").usage(createExamples([
|
251906
252150
|
{
|
251907
252151
|
description: "Generate GraphQL types and queries for your dApp",
|
251908
252152
|
command: "codegen"
|
@@ -251910,8 +252154,12 @@ function codegenCommand() {
|
|
251910
252154
|
{
|
251911
252155
|
description: "Generate GraphQL types and queries for specific TheGraph subgraphs",
|
251912
252156
|
command: "codegen --thegraph-subgraph-names subgraph1 subgraph2"
|
252157
|
+
},
|
252158
|
+
{
|
252159
|
+
description: "Generate Viem resources",
|
252160
|
+
command: "codegen --generate-viem"
|
251913
252161
|
}
|
251914
|
-
])).action(async ({ prod, thegraphSubgraphNames }) => {
|
252162
|
+
])).action(async ({ prod, thegraphSubgraphNames, generateViem }) => {
|
251915
252163
|
intro("Generating GraphQL types and queries for your dApp");
|
251916
252164
|
const env2 = await loadEnv(true, !!prod);
|
251917
252165
|
if (!Array.isArray(thegraphSubgraphNames)) {
|
@@ -251929,6 +252177,10 @@ function codegenCommand() {
|
|
251929
252177
|
},
|
251930
252178
|
stopMessage: "Tested GraphQL schemas"
|
251931
252179
|
});
|
252180
|
+
if (generateViem) {
|
252181
|
+
note("Generating Viem resources");
|
252182
|
+
await codegenViem(env2);
|
252183
|
+
}
|
251932
252184
|
if (hasura) {
|
251933
252185
|
note("Generating Hasura resources");
|
251934
252186
|
await codegenHasura(env2);
|
@@ -252190,6 +252442,7 @@ async function applicationPrompt(env2, applications, accept) {
|
|
252190
252442
|
}
|
252191
252443
|
|
252192
252444
|
// src/prompts/cluster-service/service.prompt.ts
|
252445
|
+
var ALL2 = "All";
|
252193
252446
|
async function servicePrompt({
|
252194
252447
|
env: env2,
|
252195
252448
|
services,
|
@@ -252198,13 +252451,17 @@ async function servicePrompt({
|
|
252198
252451
|
defaultHandler,
|
252199
252452
|
isRequired = false,
|
252200
252453
|
isCi = is_in_ci_default,
|
252201
|
-
singleOptionMessage
|
252454
|
+
singleOptionMessage,
|
252455
|
+
allowAll = false
|
252202
252456
|
}) {
|
252203
252457
|
if (services.length === 0) {
|
252204
252458
|
return;
|
252205
252459
|
}
|
252206
|
-
const selectedService = services.find((service) => service.uniqueName === env2[envKey]);
|
252460
|
+
const selectedService = services.find((service) => Array.isArray(service) ? false : service.uniqueName === env2[envKey]);
|
252207
252461
|
const autoAccept = isCi || accept;
|
252462
|
+
if (autoAccept && allowAll) {
|
252463
|
+
return services;
|
252464
|
+
}
|
252208
252465
|
if (autoAccept && selectedService) {
|
252209
252466
|
return selectedService;
|
252210
252467
|
}
|
@@ -252212,7 +252469,7 @@ async function servicePrompt({
|
|
252212
252469
|
return;
|
252213
252470
|
}
|
252214
252471
|
if (isRequired && services.length === 1) {
|
252215
|
-
if (singleOptionMessage) {
|
252472
|
+
if (singleOptionMessage && !Array.isArray(services[0])) {
|
252216
252473
|
note(singleOptionMessage(services[0].uniqueName));
|
252217
252474
|
}
|
252218
252475
|
return services[0];
|
@@ -252221,13 +252478,37 @@ async function servicePrompt({
|
|
252221
252478
|
name: `${service.name} (${service.uniqueName})`,
|
252222
252479
|
value: service
|
252223
252480
|
}));
|
252481
|
+
if (allowAll) {
|
252482
|
+
choices.unshift({
|
252483
|
+
name: ALL2,
|
252484
|
+
value: services
|
252485
|
+
});
|
252486
|
+
}
|
252224
252487
|
if (!isRequired) {
|
252225
252488
|
choices.push({
|
252226
252489
|
name: "None",
|
252227
252490
|
value: undefined
|
252228
252491
|
});
|
252229
252492
|
}
|
252230
|
-
return defaultHandler({
|
252493
|
+
return defaultHandler({
|
252494
|
+
defaultService: selectedService,
|
252495
|
+
choices
|
252496
|
+
});
|
252497
|
+
}
|
252498
|
+
|
252499
|
+
// src/utils/cluster-service.ts
|
252500
|
+
function isValidPrivateKey(privateKey) {
|
252501
|
+
return privateKey.privateKeyType !== "HD_ECDSA_P256";
|
252502
|
+
}
|
252503
|
+
function hasValidPrivateKey(service) {
|
252504
|
+
return (service.privateKeys ?? []).some(isValidPrivateKey);
|
252505
|
+
}
|
252506
|
+
function hasPrivateKey(service) {
|
252507
|
+
const keys = service.privateKeys ?? [];
|
252508
|
+
return keys.length > 0;
|
252509
|
+
}
|
252510
|
+
function isRunning(service) {
|
252511
|
+
return service === undefined || service?.status === "COMPLETED";
|
252231
252512
|
}
|
252232
252513
|
|
252233
252514
|
// src/prompts/cluster-service/blockchain-node.prompt.ts
|
@@ -252238,7 +252519,8 @@ async function blockchainNodePrompt({
|
|
252238
252519
|
singleOptionMessage,
|
252239
252520
|
promptMessage,
|
252240
252521
|
filterRunningOnly = false,
|
252241
|
-
isRequired = false
|
252522
|
+
isRequired = false,
|
252523
|
+
allowAll = false
|
252242
252524
|
}) {
|
252243
252525
|
return servicePrompt({
|
252244
252526
|
env: env2,
|
@@ -252247,14 +252529,25 @@ async function blockchainNodePrompt({
|
|
252247
252529
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
252248
252530
|
isRequired,
|
252249
252531
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
252250
|
-
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) =>
|
252532
|
+
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => {
|
252533
|
+
return Array.isArray(node) ? true : isRunning(node);
|
252534
|
+
}).map((item) => {
|
252535
|
+
if (Array.isArray(item.value)) {
|
252536
|
+
return {
|
252537
|
+
...item,
|
252538
|
+
value: item.value.filter(isRunning)
|
252539
|
+
};
|
252540
|
+
}
|
252541
|
+
return item;
|
252542
|
+
}) : choices;
|
252251
252543
|
return esm_default3({
|
252252
252544
|
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
252253
252545
|
choices: filteredChoices,
|
252254
252546
|
default: defaultNode
|
252255
252547
|
});
|
252256
252548
|
},
|
252257
|
-
singleOptionMessage
|
252549
|
+
singleOptionMessage,
|
252550
|
+
allowAll
|
252258
252551
|
});
|
252259
252552
|
}
|
252260
252553
|
|
@@ -252559,7 +252852,8 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252559
252852
|
storages,
|
252560
252853
|
privateKeys,
|
252561
252854
|
insights,
|
252562
|
-
customDeployments
|
252855
|
+
customDeployments,
|
252856
|
+
loadBalancers
|
252563
252857
|
] = await Promise.all([
|
252564
252858
|
shouldFetch("blockchain-network") ? settlemint.blockchainNetwork.list(applicationUniqueName) : Promise.resolve([]),
|
252565
252859
|
shouldFetch("blockchain-node") ? settlemint.blockchainNode.list(applicationUniqueName) : Promise.resolve([]),
|
@@ -252568,7 +252862,8 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252568
252862
|
shouldFetch("storage") ? settlemint.storage.list(applicationUniqueName) : Promise.resolve([]),
|
252569
252863
|
shouldFetch("private-key") ? settlemint.privateKey.list(applicationUniqueName) : Promise.resolve([]),
|
252570
252864
|
shouldFetch("insights") ? settlemint.insights.list(applicationUniqueName) : Promise.resolve([]),
|
252571
|
-
shouldFetch("custom-deployment") ? settlemint.customDeployment.list(applicationUniqueName) : Promise.resolve([])
|
252865
|
+
shouldFetch("custom-deployment") ? settlemint.customDeployment.list(applicationUniqueName) : Promise.resolve([]),
|
252866
|
+
shouldFetch("load-balancer") ? settlemint.loadBalancer.list(applicationUniqueName) : Promise.resolve([])
|
252572
252867
|
]);
|
252573
252868
|
return {
|
252574
252869
|
blockchainNetworks,
|
@@ -252578,7 +252873,8 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252578
252873
|
storages,
|
252579
252874
|
privateKeys,
|
252580
252875
|
insights,
|
252581
|
-
customDeployments
|
252876
|
+
customDeployments,
|
252877
|
+
loadBalancers
|
252582
252878
|
};
|
252583
252879
|
}
|
252584
252880
|
});
|
@@ -252617,8 +252913,11 @@ async function writeEnvSpinner(prod, env2) {
|
|
252617
252913
|
SETTLEMINT_WORKSPACE: env2.SETTLEMINT_WORKSPACE,
|
252618
252914
|
SETTLEMINT_APPLICATION: env2.SETTLEMINT_APPLICATION,
|
252619
252915
|
SETTLEMINT_BLOCKCHAIN_NETWORK: env2.SETTLEMINT_BLOCKCHAIN_NETWORK,
|
252916
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID,
|
252620
252917
|
SETTLEMINT_BLOCKCHAIN_NODE: env2.SETTLEMINT_BLOCKCHAIN_NODE,
|
252621
|
-
|
252918
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT,
|
252919
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER,
|
252920
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT,
|
252622
252921
|
SETTLEMINT_HASURA: env2.SETTLEMINT_HASURA,
|
252623
252922
|
SETTLEMINT_HASURA_ENDPOINT: env2.SETTLEMINT_HASURA_ENDPOINT,
|
252624
252923
|
SETTLEMINT_THEGRAPH: env2.SETTLEMINT_THEGRAPH,
|
@@ -252653,6 +252952,14 @@ async function writeEnvSpinner(prod, env2) {
|
|
252653
252952
|
});
|
252654
252953
|
}
|
252655
252954
|
|
252955
|
+
// src/utils/blockchain-network.ts
|
252956
|
+
function getBlockchainNetworkChainId(blockchainNetwork) {
|
252957
|
+
if (!blockchainNetwork) {
|
252958
|
+
return;
|
252959
|
+
}
|
252960
|
+
return "chainId" in blockchainNetwork && typeof blockchainNetwork.chainId === "number" ? blockchainNetwork.chainId.toString() : undefined;
|
252961
|
+
}
|
252962
|
+
|
252656
252963
|
// src/utils/get-cluster-service-endpoint.ts
|
252657
252964
|
async function getGraphEndpoint(settlemint, service, graphName) {
|
252658
252965
|
if (!service || service.__typename !== "HAGraphMiddleware") {
|
@@ -252726,6 +253033,51 @@ function getMinioEndpoints(service) {
|
|
252726
253033
|
SETTLEMINT_MINIO_SECRET_KEY: service?.credentials.find((credential) => credential.id.includes("secret-key"))?.displayValue
|
252727
253034
|
};
|
252728
253035
|
}
|
253036
|
+
function getBlockchainNodeEndpoints(service) {
|
253037
|
+
if (!service) {
|
253038
|
+
return {};
|
253039
|
+
}
|
253040
|
+
return {
|
253041
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
|
253042
|
+
};
|
253043
|
+
}
|
253044
|
+
function getBlockchainNodeOrLoadBalancerEndpoints(service) {
|
253045
|
+
if (!service) {
|
253046
|
+
return {};
|
253047
|
+
}
|
253048
|
+
return {
|
253049
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
|
253050
|
+
};
|
253051
|
+
}
|
253052
|
+
|
253053
|
+
// src/prompts/cluster-service/blockchain-node-or-load-balancer.prompt.ts
|
253054
|
+
async function blockchainNodeOrLoadBalancerPrompt({
|
253055
|
+
env: env2,
|
253056
|
+
nodes,
|
253057
|
+
loadBalancers,
|
253058
|
+
accept,
|
253059
|
+
singleOptionMessage,
|
253060
|
+
promptMessage,
|
253061
|
+
filterRunningOnly = false,
|
253062
|
+
isRequired = false
|
253063
|
+
}) {
|
253064
|
+
return servicePrompt({
|
253065
|
+
env: env2,
|
253066
|
+
services: [...loadBalancers, ...nodes],
|
253067
|
+
accept,
|
253068
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
253069
|
+
isRequired,
|
253070
|
+
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
253071
|
+
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
253072
|
+
return esm_default3({
|
253073
|
+
message: promptMessage ?? "Which blockchain node or load balancer do you want to connect to?",
|
253074
|
+
choices: filteredChoices,
|
253075
|
+
default: defaultNode
|
253076
|
+
});
|
253077
|
+
},
|
253078
|
+
singleOptionMessage
|
253079
|
+
});
|
253080
|
+
}
|
252729
253081
|
|
252730
253082
|
// src/commands/connect.ts
|
252731
253083
|
function connectCommand() {
|
@@ -252746,11 +253098,30 @@ function connectCommand() {
|
|
252746
253098
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
252747
253099
|
const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
|
252748
253100
|
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
|
252749
|
-
const {
|
253101
|
+
const {
|
253102
|
+
middlewares,
|
253103
|
+
integrationTools,
|
253104
|
+
storages,
|
253105
|
+
privateKeys,
|
253106
|
+
insights,
|
253107
|
+
customDeployments,
|
253108
|
+
blockchainNodes,
|
253109
|
+
loadBalancers
|
253110
|
+
} = await servicesSpinner(settlemint, application.uniqueName);
|
253111
|
+
const nodesWithPrivateKey = blockchainNodes.filter(hasPrivateKey);
|
252750
253112
|
const blockchainNode = await blockchainNodePrompt({
|
252751
253113
|
env: env2,
|
252752
|
-
nodes:
|
252753
|
-
accept: acceptDefaults
|
253114
|
+
nodes: nodesWithPrivateKey,
|
253115
|
+
accept: acceptDefaults,
|
253116
|
+
promptMessage: "Which blockchain node do you want to use for sending transactions?"
|
253117
|
+
});
|
253118
|
+
const nodesWithoutPrivateKey = blockchainNodes.filter((node) => !hasPrivateKey(node));
|
253119
|
+
const loadBalancerOrBlockchainNode = await blockchainNodeOrLoadBalancerPrompt({
|
253120
|
+
env: env2,
|
253121
|
+
nodes: nodesWithoutPrivateKey,
|
253122
|
+
loadBalancers,
|
253123
|
+
accept: acceptDefaults,
|
253124
|
+
promptMessage: "Which load balancer or blockchain node do you want to use for read operations?"
|
252754
253125
|
});
|
252755
253126
|
const hasura = await hasuraPrompt({
|
252756
253127
|
env: env2,
|
@@ -252816,10 +253187,15 @@ function connectCommand() {
|
|
252816
253187
|
uniqueName: blockchainNode.blockchainNetwork?.uniqueName
|
252817
253188
|
},
|
252818
253189
|
blockchainNode && {
|
252819
|
-
type: "Blockchain Node",
|
253190
|
+
type: "Blockchain Node (use for sending transactions)",
|
252820
253191
|
name: blockchainNode.name,
|
252821
253192
|
uniqueName: blockchainNode.uniqueName
|
252822
253193
|
},
|
253194
|
+
loadBalancerOrBlockchainNode && {
|
253195
|
+
type: "Load Balancer or Blockchain Node (use for read operations)",
|
253196
|
+
name: loadBalancerOrBlockchainNode.name,
|
253197
|
+
uniqueName: loadBalancerOrBlockchainNode.uniqueName
|
253198
|
+
},
|
252823
253199
|
hasura && {
|
252824
253200
|
type: "Hasura",
|
252825
253201
|
name: hasura.name,
|
@@ -252869,7 +253245,11 @@ function connectCommand() {
|
|
252869
253245
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
252870
253246
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
252871
253247
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
253248
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: getBlockchainNetworkChainId(blockchainNode?.blockchainNetwork),
|
252872
253249
|
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
253250
|
+
...getBlockchainNodeEndpoints(blockchainNode),
|
253251
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: loadBalancerOrBlockchainNode?.uniqueName,
|
253252
|
+
...getBlockchainNodeOrLoadBalancerEndpoints(loadBalancerOrBlockchainNode),
|
252873
253253
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
252874
253254
|
...getHasuraEndpoints(hasura),
|
252875
253255
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
@@ -256211,7 +256591,8 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
256211
256591
|
"integration tool": "integrationTool",
|
256212
256592
|
storage: "storage",
|
256213
256593
|
insights: "insights",
|
256214
|
-
"application access token": "applicationAccessToken"
|
256594
|
+
"application access token": "applicationAccessToken",
|
256595
|
+
"load balancer": "loadBalancer"
|
256215
256596
|
};
|
256216
256597
|
var LABELS_MAP = {
|
256217
256598
|
application: { singular: "application", plural: "applications", command: "app" },
|
@@ -256232,7 +256613,8 @@ var LABELS_MAP = {
|
|
256232
256613
|
singular: "application access token",
|
256233
256614
|
plural: "application access tokens",
|
256234
256615
|
command: "application-access-token"
|
256235
|
-
}
|
256616
|
+
},
|
256617
|
+
"load balancer": { singular: "load balancer", plural: "load balancers", command: "load-balancer" }
|
256236
256618
|
};
|
256237
256619
|
|
256238
256620
|
// src/spinners/service.spinner.ts
|
@@ -256734,7 +257116,10 @@ function getCreateCommand({
|
|
256734
257116
|
usePersonalAccessToken = true,
|
256735
257117
|
requiresDeployment = true
|
256736
257118
|
}) {
|
256737
|
-
const cmd2 = new Command(sanitizeCommandName(name3)).
|
257119
|
+
const cmd2 = new Command(sanitizeCommandName(name3)).description(`Create a new ${subType ? `${subType} ${type4}` : type4} in the SettleMint platform.`).usage(createExamples(examples)).argument("<name>", `The ${subType ? `${subType} ${type4}` : type4} name`).option("-a, --accept-defaults", "Accept the default values").option("-d, --default", `Save as default ${type4}`).option("--prod", "Connect to production environment");
|
257120
|
+
if (alias) {
|
257121
|
+
cmd2.alias(alias);
|
257122
|
+
}
|
256738
257123
|
if (requiresDeployment) {
|
256739
257124
|
cmd2.option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded");
|
256740
257125
|
}
|
@@ -256752,12 +257137,14 @@ function getCreateCommand({
|
|
256752
257137
|
instance
|
256753
257138
|
});
|
256754
257139
|
const platformConfig = await settlemint.platform.config();
|
257140
|
+
let selectedProvider = undefined;
|
257141
|
+
let selectedRegion = undefined;
|
256755
257142
|
if (cmd2.options.some((option) => option.long === "--provider")) {
|
256756
|
-
|
257143
|
+
selectedProvider = await providerPrompt(platformConfig, provider);
|
256757
257144
|
if (!selectedProvider) {
|
256758
257145
|
return nothingSelectedError("provider");
|
256759
257146
|
}
|
256760
|
-
|
257147
|
+
selectedRegion = await regionPrompt(selectedProvider, region);
|
256761
257148
|
if (!selectedRegion) {
|
256762
257149
|
return nothingSelectedError("region");
|
256763
257150
|
}
|
@@ -256767,7 +257154,13 @@ function getCreateCommand({
|
|
256767
257154
|
task,
|
256768
257155
|
stopMessage: `${capitalizeFirstLetter2(type4)} created`
|
256769
257156
|
});
|
256770
|
-
const { result, waitFor, mapDefaultEnv } = await createFunction(
|
257157
|
+
const { result, waitFor, mapDefaultEnv } = await createFunction({
|
257158
|
+
settlemint,
|
257159
|
+
env: env2,
|
257160
|
+
showSpinner,
|
257161
|
+
provider: selectedProvider?.id ?? "",
|
257162
|
+
region: selectedRegion?.id ?? ""
|
257163
|
+
});
|
256771
257164
|
if (wait) {
|
256772
257165
|
await waitForCompletion({
|
256773
257166
|
settlemint,
|
@@ -256796,7 +257189,10 @@ function getCreateCommand({
|
|
256796
257189
|
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
|
256797
257190
|
}
|
256798
257191
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
256799
|
-
|
257192
|
+
const newNode = await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE);
|
257193
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = newNode.blockchainNetwork.uniqueName;
|
257194
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID = getBlockchainNetworkChainId(newNode.blockchainNetwork);
|
257195
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT = getBlockchainNodeEndpoints(newNode).SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
|
256800
257196
|
}
|
256801
257197
|
await writeEnvSpinner(!!prod, newEnv);
|
256802
257198
|
note(`${capitalizeFirstLetter2(type4)} ${result.name} set as default`);
|
@@ -256836,7 +257232,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
256836
257232
|
...defaultArgs,
|
256837
257233
|
provider,
|
256838
257234
|
region
|
256839
|
-
}, async (settlemint, env2, showSpinner) => {
|
257235
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
256840
257236
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
256841
257237
|
if (!applicationUniqueName) {
|
256842
257238
|
return missingApplication();
|
@@ -256851,8 +257247,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
256851
257247
|
evmStackSize,
|
256852
257248
|
gasLimit,
|
256853
257249
|
gasPrice,
|
256854
|
-
provider,
|
256855
|
-
region,
|
257250
|
+
provider: provider2,
|
257251
|
+
region: region2,
|
256856
257252
|
secondsPerBlock,
|
256857
257253
|
size,
|
256858
257254
|
type: type4
|
@@ -256868,7 +257264,11 @@ function blockchainNetworkBesuCreateCommand() {
|
|
256868
257264
|
return {
|
256869
257265
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
256870
257266
|
SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
|
256871
|
-
|
257267
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: getBlockchainNetworkChainId(result),
|
257268
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
257269
|
+
...getBlockchainNodeEndpoints(blockchainNode),
|
257270
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: undefined,
|
257271
|
+
...getBlockchainNodeOrLoadBalancerEndpoints(undefined)
|
256872
257272
|
};
|
256873
257273
|
}
|
256874
257274
|
};
|
@@ -256995,7 +257395,7 @@ function workspaceCreateCommand() {
|
|
256995
257395
|
addressLine1,
|
256996
257396
|
...defaultArgs
|
256997
257397
|
}) => {
|
256998
|
-
return baseAction(defaultArgs, async (settlemint,
|
257398
|
+
return baseAction(defaultArgs, async ({ settlemint, showSpinner }) => {
|
256999
257399
|
const result = await showSpinner(() => settlemint.workspace.create({
|
257000
257400
|
name: name3,
|
257001
257401
|
taxIdValue,
|
@@ -257046,7 +257446,7 @@ function applicationAccessTokenCreateCommand() {
|
|
257046
257446
|
alias: "aat",
|
257047
257447
|
execute: (cmd2, baseAction) => {
|
257048
257448
|
cmd2.option("--app, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name3, { application, validityPeriod, ...defaultArgs }) => {
|
257049
|
-
return baseAction(defaultArgs, async (settlemint, env2, showSpinner) => {
|
257449
|
+
return baseAction(defaultArgs, async ({ settlemint, env: env2, showSpinner }) => {
|
257050
257450
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257051
257451
|
if (!applicationUniqueName) {
|
257052
257452
|
return missingApplication();
|
@@ -257139,7 +257539,7 @@ function applicationCreateCommand() {
|
|
257139
257539
|
return baseAction({
|
257140
257540
|
...defaultArgs,
|
257141
257541
|
acceptDefaults
|
257142
|
-
}, async (settlemint, env2, showSpinner) => {
|
257542
|
+
}, async ({ settlemint, env: env2, showSpinner }) => {
|
257143
257543
|
let workspaceUniqueName = workspace;
|
257144
257544
|
if (!workspaceUniqueName) {
|
257145
257545
|
const workspaces = await workspaceSpinner(settlemint);
|
@@ -257230,7 +257630,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
257230
257630
|
acceptDefaults,
|
257231
257631
|
provider,
|
257232
257632
|
region
|
257233
|
-
}, async (settlemint, env2, showSpinner) => {
|
257633
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257234
257634
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257235
257635
|
if (!applicationUniqueName) {
|
257236
257636
|
return missingApplication();
|
@@ -257255,8 +257655,8 @@ function blockchainNodeBesuCreateCommand() {
|
|
257255
257655
|
blockchainNetworkUniqueName: networkUniqueName,
|
257256
257656
|
nodeType,
|
257257
257657
|
keyMaterial: nodeIdentity,
|
257258
|
-
provider,
|
257259
|
-
region,
|
257658
|
+
provider: provider2,
|
257659
|
+
region: region2,
|
257260
257660
|
size,
|
257261
257661
|
type: type4
|
257262
257662
|
}));
|
@@ -257308,18 +257708,20 @@ function blockscoutInsightsCreateCommand() {
|
|
257308
257708
|
acceptDefaults,
|
257309
257709
|
provider,
|
257310
257710
|
region
|
257311
|
-
}, async (settlemint, env2, showSpinner) => {
|
257711
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257312
257712
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257313
257713
|
if (!applicationUniqueName) {
|
257314
257714
|
return missingApplication();
|
257315
257715
|
}
|
257316
257716
|
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
257317
|
-
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.
|
257717
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER;
|
257318
257718
|
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257319
257719
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257320
|
-
const
|
257720
|
+
const loadBalancers = await serviceSpinner("load balancer", () => settlemint.loadBalancer.list(applicationUniqueName));
|
257721
|
+
const node = await blockchainNodeOrLoadBalancerPrompt({
|
257321
257722
|
env: env2,
|
257322
257723
|
nodes: blockchainNodes,
|
257724
|
+
loadBalancers,
|
257323
257725
|
accept: acceptDefaults,
|
257324
257726
|
isRequired: true
|
257325
257727
|
});
|
@@ -257332,8 +257734,8 @@ function blockscoutInsightsCreateCommand() {
|
|
257332
257734
|
name: name3,
|
257333
257735
|
applicationUniqueName,
|
257334
257736
|
insightsCategory: "BLOCKCHAIN_EXPLORER",
|
257335
|
-
provider,
|
257336
|
-
region,
|
257737
|
+
provider: provider2,
|
257738
|
+
region: region2,
|
257337
257739
|
size,
|
257338
257740
|
type: type4,
|
257339
257741
|
blockchainNodeUniqueName,
|
@@ -257385,7 +257787,7 @@ function hasuraIntegrationCreateCommand() {
|
|
257385
257787
|
...defaultArgs,
|
257386
257788
|
provider,
|
257387
257789
|
region
|
257388
|
-
}, async (settlemint, env2, showSpinner) => {
|
257790
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257389
257791
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257390
257792
|
if (!applicationUniqueName) {
|
257391
257793
|
return missingApplication();
|
@@ -257394,8 +257796,8 @@ function hasuraIntegrationCreateCommand() {
|
|
257394
257796
|
name: name3,
|
257395
257797
|
applicationUniqueName,
|
257396
257798
|
integrationType: "HASURA",
|
257397
|
-
provider,
|
257398
|
-
region,
|
257799
|
+
provider: provider2,
|
257800
|
+
region: region2,
|
257399
257801
|
size,
|
257400
257802
|
type: type4
|
257401
257803
|
}));
|
@@ -257432,6 +257834,107 @@ function integrationToolCreateCommand() {
|
|
257432
257834
|
return cmd2;
|
257433
257835
|
}
|
257434
257836
|
|
257837
|
+
// src/commands/platform/load-balancer/evm/create.ts
|
257838
|
+
function loadBalancerEvmCreateCommand() {
|
257839
|
+
return getCreateCommand({
|
257840
|
+
name: "evm",
|
257841
|
+
type: "load balancer",
|
257842
|
+
subType: "EVM",
|
257843
|
+
execute: (cmd2, baseAction) => {
|
257844
|
+
addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").action(async (name3, { application, provider, region, size, type: type4, blockchainNodes, acceptDefaults, ...defaultArgs }) => {
|
257845
|
+
return baseAction({
|
257846
|
+
...defaultArgs,
|
257847
|
+
acceptDefaults,
|
257848
|
+
provider,
|
257849
|
+
region
|
257850
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257851
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257852
|
+
if (!applicationUniqueName) {
|
257853
|
+
return missingApplication();
|
257854
|
+
}
|
257855
|
+
let networkUniqueName;
|
257856
|
+
let connectedNodesUniqueNames = blockchainNodes;
|
257857
|
+
if (!connectedNodesUniqueNames) {
|
257858
|
+
const networks = await serviceSpinner("blockchain network", () => settlemint.blockchainNetwork.list(applicationUniqueName));
|
257859
|
+
const network = await blockchainNetworkPrompt({
|
257860
|
+
env: env2,
|
257861
|
+
networks,
|
257862
|
+
accept: acceptDefaults,
|
257863
|
+
isRequired: true
|
257864
|
+
});
|
257865
|
+
if (!network) {
|
257866
|
+
return nothingSelectedError("blockchain network");
|
257867
|
+
}
|
257868
|
+
networkUniqueName = network.uniqueName;
|
257869
|
+
const blockchainNodes2 = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257870
|
+
const connectedNodes = await blockchainNodePrompt({
|
257871
|
+
env: env2,
|
257872
|
+
nodes: blockchainNodes2.filter((node) => node.blockchainNetwork?.uniqueName === network.uniqueName),
|
257873
|
+
accept: acceptDefaults,
|
257874
|
+
promptMessage: "Which blockchain node do you want to connect the load balancer to?",
|
257875
|
+
allowAll: true
|
257876
|
+
});
|
257877
|
+
connectedNodesUniqueNames = Array.isArray(connectedNodes) ? blockchainNodes2.map((node) => node.uniqueName) : connectedNodes ? [connectedNodes.uniqueName] : [];
|
257878
|
+
}
|
257879
|
+
if (connectedNodesUniqueNames.length === 0) {
|
257880
|
+
return cancel2("A load balancer must connect to at least one blockchain node");
|
257881
|
+
}
|
257882
|
+
if (!networkUniqueName) {
|
257883
|
+
const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257884
|
+
const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
|
257885
|
+
if (selectedBlockchainNodes.length === 0) {
|
257886
|
+
return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
|
257887
|
+
}
|
257888
|
+
const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === selectedBlockchainNodes[0].blockchainNetwork?.uniqueName);
|
257889
|
+
if (!onTheSameNetwork) {
|
257890
|
+
return cancel2("Blockchain nodes must be on the same network");
|
257891
|
+
}
|
257892
|
+
networkUniqueName = selectedBlockchainNodes[0].blockchainNetwork?.uniqueName;
|
257893
|
+
}
|
257894
|
+
const result = await showSpinner(() => settlemint.loadBalancer.create({
|
257895
|
+
applicationUniqueName,
|
257896
|
+
name: name3,
|
257897
|
+
blockchainNetworkUniqueName: networkUniqueName,
|
257898
|
+
provider: provider2,
|
257899
|
+
region: region2,
|
257900
|
+
size,
|
257901
|
+
type: type4,
|
257902
|
+
connectedNodesUniqueNames
|
257903
|
+
}));
|
257904
|
+
return {
|
257905
|
+
result,
|
257906
|
+
mapDefaultEnv: () => {
|
257907
|
+
return {
|
257908
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
257909
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName
|
257910
|
+
};
|
257911
|
+
}
|
257912
|
+
};
|
257913
|
+
});
|
257914
|
+
});
|
257915
|
+
},
|
257916
|
+
examples: [
|
257917
|
+
{
|
257918
|
+
description: "Create an EVM load balancer and save as default",
|
257919
|
+
command: "platform create load-balancer evm my-lb --accept-defaults -d"
|
257920
|
+
},
|
257921
|
+
{
|
257922
|
+
description: "Create an EVM load balancer and connect to specific blockchain nodes",
|
257923
|
+
command: "platform create load-balancer evm my-lb --blockchain-network my-network --accept-defaults"
|
257924
|
+
},
|
257925
|
+
{
|
257926
|
+
description: "Create an EVM load balancer in a different application",
|
257927
|
+
command: "platform create load-balancer evm my-lb --application my-app --accept-defaults"
|
257928
|
+
}
|
257929
|
+
]
|
257930
|
+
});
|
257931
|
+
}
|
257932
|
+
|
257933
|
+
// src/commands/platform/load-balancer/create.ts
|
257934
|
+
function loadBalancerCreateCommand() {
|
257935
|
+
return new Command("load-balancer").alias("lb").description("Create a load balancer in the SettleMint platform").addCommand(loadBalancerEvmCreateCommand());
|
257936
|
+
}
|
257937
|
+
|
257435
257938
|
// src/commands/platform/middleware/graph/create.ts
|
257436
257939
|
function graphMiddlewareCreateCommand() {
|
257437
257940
|
return getCreateCommand({
|
@@ -257440,38 +257943,46 @@ function graphMiddlewareCreateCommand() {
|
|
257440
257943
|
subType: "The Graph",
|
257441
257944
|
alias: "gr",
|
257442
257945
|
execute: (cmd2, baseAction) => {
|
257443
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name3, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
257946
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").action(async (name3, { application, blockchainNode, loadBalancer, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
257444
257947
|
return baseAction({
|
257445
257948
|
...defaultArgs,
|
257446
257949
|
acceptDefaults,
|
257447
257950
|
provider,
|
257448
257951
|
region
|
257449
|
-
}, async (settlemint, env2, showSpinner) => {
|
257952
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257450
257953
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257451
257954
|
if (!applicationUniqueName) {
|
257452
257955
|
return missingApplication();
|
257453
257956
|
}
|
257454
257957
|
let blockchainNodeUniqueName = blockchainNode;
|
257455
|
-
|
257958
|
+
let loadBalancerUniqueName = loadBalancer;
|
257959
|
+
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257456
257960
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257457
|
-
const
|
257961
|
+
const loadBalancers = await serviceSpinner("load balancer", () => settlemint.loadBalancer.list(applicationUniqueName));
|
257962
|
+
const nodeOrLoadbalancer = await blockchainNodeOrLoadBalancerPrompt({
|
257458
257963
|
env: env2,
|
257459
257964
|
nodes: blockchainNodes,
|
257965
|
+
loadBalancers,
|
257460
257966
|
accept: acceptDefaults,
|
257461
257967
|
isRequired: true
|
257462
257968
|
});
|
257463
|
-
if (!
|
257464
|
-
return nothingSelectedError("blockchain node");
|
257969
|
+
if (!nodeOrLoadbalancer) {
|
257970
|
+
return nothingSelectedError("blockchain node or load balancer");
|
257971
|
+
}
|
257972
|
+
if (nodeOrLoadbalancer.__typename?.endsWith("LoadBalancer")) {
|
257973
|
+
loadBalancerUniqueName = nodeOrLoadbalancer.uniqueName;
|
257974
|
+
} else {
|
257975
|
+
blockchainNodeUniqueName = nodeOrLoadbalancer.uniqueName;
|
257465
257976
|
}
|
257466
|
-
blockchainNodeUniqueName = node.uniqueName;
|
257467
257977
|
}
|
257468
257978
|
const result = await showSpinner(() => settlemint.middleware.create({
|
257469
257979
|
name: name3,
|
257470
257980
|
applicationUniqueName,
|
257471
257981
|
interface: "HA_GRAPH",
|
257472
257982
|
blockchainNodeUniqueName,
|
257473
|
-
|
257474
|
-
|
257983
|
+
loadBalancerUniqueName,
|
257984
|
+
provider: provider2,
|
257985
|
+
region: region2,
|
257475
257986
|
size,
|
257476
257987
|
type: type4
|
257477
257988
|
}));
|
@@ -257529,18 +258040,18 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
257529
258040
|
acceptDefaults,
|
257530
258041
|
provider,
|
257531
258042
|
region
|
257532
|
-
}, async (settlemint, env2, showSpinner) => {
|
258043
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257533
258044
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257534
258045
|
if (!applicationUniqueName) {
|
257535
258046
|
return missingApplication();
|
257536
258047
|
}
|
257537
258048
|
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
257538
|
-
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.
|
258049
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER;
|
257539
258050
|
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257540
258051
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257541
258052
|
const node = await blockchainNodePrompt({
|
257542
258053
|
env: env2,
|
257543
|
-
nodes: blockchainNodes,
|
258054
|
+
nodes: blockchainNodes.filter(hasValidPrivateKey),
|
257544
258055
|
accept: acceptDefaults,
|
257545
258056
|
isRequired: true
|
257546
258057
|
});
|
@@ -257578,8 +258089,8 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
257578
258089
|
loadBalancerUniqueName,
|
257579
258090
|
abis: parsedAbis,
|
257580
258091
|
includePredeployedAbis,
|
257581
|
-
provider,
|
257582
|
-
region,
|
258092
|
+
provider: provider2,
|
258093
|
+
region: region2,
|
257583
258094
|
size,
|
257584
258095
|
type: type4
|
257585
258096
|
}));
|
@@ -257626,7 +258137,7 @@ function privateKeyAccessibleCreateCommand() {
|
|
257626
258137
|
return baseAction({
|
257627
258138
|
...defaultArgs,
|
257628
258139
|
acceptDefaults
|
257629
|
-
}, async (settlemint, env2, showSpinner) => {
|
258140
|
+
}, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
|
257630
258141
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257631
258142
|
if (!applicationUniqueName) {
|
257632
258143
|
return missingApplication();
|
@@ -257686,7 +258197,7 @@ function privateKeyHdCreateCommand() {
|
|
257686
258197
|
return baseAction({
|
257687
258198
|
...defaultArgs,
|
257688
258199
|
acceptDefaults
|
257689
|
-
}, async (settlemint, env2, showSpinner) => {
|
258200
|
+
}, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
|
257690
258201
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257691
258202
|
if (!applicationUniqueName) {
|
257692
258203
|
return missingApplication();
|
@@ -257752,7 +258263,7 @@ function privateKeyHsmCreateCommand() {
|
|
257752
258263
|
return baseAction({
|
257753
258264
|
...defaultArgs,
|
257754
258265
|
acceptDefaults
|
257755
|
-
}, async (settlemint, env2, showSpinner) => {
|
258266
|
+
}, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
|
257756
258267
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257757
258268
|
if (!applicationUniqueName) {
|
257758
258269
|
return missingApplication();
|
@@ -257818,7 +258329,7 @@ function ipfsStorageCreateCommand() {
|
|
257818
258329
|
...defaultArgs,
|
257819
258330
|
provider,
|
257820
258331
|
region
|
257821
|
-
}, async (settlemint, env2, showSpinner) => {
|
258332
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257822
258333
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257823
258334
|
if (!applicationUniqueName) {
|
257824
258335
|
return missingApplication();
|
@@ -257827,8 +258338,8 @@ function ipfsStorageCreateCommand() {
|
|
257827
258338
|
name: name3,
|
257828
258339
|
applicationUniqueName,
|
257829
258340
|
storageProtocol: "IPFS",
|
257830
|
-
provider,
|
257831
|
-
region,
|
258341
|
+
provider: provider2,
|
258342
|
+
region: region2,
|
257832
258343
|
size,
|
257833
258344
|
type: type4
|
257834
258345
|
}));
|
@@ -257871,7 +258382,7 @@ function minioStorageCreateCommand() {
|
|
257871
258382
|
...defaultArgs,
|
257872
258383
|
provider,
|
257873
258384
|
region
|
257874
|
-
}, async (settlemint, env2, showSpinner) => {
|
258385
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257875
258386
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257876
258387
|
if (!applicationUniqueName) {
|
257877
258388
|
return missingApplication();
|
@@ -257880,8 +258391,8 @@ function minioStorageCreateCommand() {
|
|
257880
258391
|
name: name3,
|
257881
258392
|
applicationUniqueName,
|
257882
258393
|
storageProtocol: "MINIO",
|
257883
|
-
provider,
|
257884
|
-
region,
|
258394
|
+
provider: provider2,
|
258395
|
+
region: region2,
|
257885
258396
|
size,
|
257886
258397
|
type: type4
|
257887
258398
|
}));
|
@@ -257918,7 +258429,7 @@ function storageCreateCommand() {
|
|
257918
258429
|
|
257919
258430
|
// src/commands/platform/create.ts
|
257920
258431
|
function createCommand3() {
|
257921
|
-
return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
258432
|
+
return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand()).addCommand(loadBalancerCreateCommand());
|
257922
258433
|
}
|
257923
258434
|
|
257924
258435
|
// src/prompts/delete-confirmation.prompt.ts
|
@@ -258158,6 +258669,19 @@ function integrationToolRestartCommand() {
|
|
258158
258669
|
return new Command("integration-tool").alias("it").description("Restart an integration tool service in the SettleMint platform").addCommand(hasuraRestartCommand());
|
258159
258670
|
}
|
258160
258671
|
|
258672
|
+
// src/commands/platform/load-balancer/restart.ts
|
258673
|
+
function loadBalancerRestartCommand() {
|
258674
|
+
return getRestartCommand({
|
258675
|
+
name: "load-balancer",
|
258676
|
+
type: "load balancer",
|
258677
|
+
alias: "lb",
|
258678
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
258679
|
+
restartFunction: async (settlemint, id) => {
|
258680
|
+
return settlemint.loadBalancer.restart(id);
|
258681
|
+
}
|
258682
|
+
});
|
258683
|
+
}
|
258684
|
+
|
258161
258685
|
// src/commands/platform/middleware/graph/restart.ts
|
258162
258686
|
function graphRestartCommand() {
|
258163
258687
|
return getRestartCommand({
|
@@ -258224,7 +258748,7 @@ function storageRestartCommand() {
|
|
258224
258748
|
|
258225
258749
|
// src/commands/platform/restart.ts
|
258226
258750
|
function restartCommand() {
|
258227
|
-
const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand());
|
258751
|
+
const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand()).addCommand(loadBalancerRestartCommand());
|
258228
258752
|
return cmd2;
|
258229
258753
|
}
|
258230
258754
|
|
@@ -259067,38 +259591,6 @@ function getStatusAction(status) {
|
|
259067
259591
|
return "Please try again later.";
|
259068
259592
|
}
|
259069
259593
|
|
259070
|
-
// src/prompts/smart-contract-set/address.prompt.ts
|
259071
|
-
async function addressPrompt({
|
259072
|
-
env: env2,
|
259073
|
-
accept,
|
259074
|
-
prod,
|
259075
|
-
node,
|
259076
|
-
hardhatConfig
|
259077
|
-
}) {
|
259078
|
-
const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)) ?? [];
|
259079
|
-
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
259080
|
-
const defaultPossible = accept && defaultAddress;
|
259081
|
-
if (defaultPossible) {
|
259082
|
-
if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
|
259083
|
-
return defaultAddress;
|
259084
|
-
}
|
259085
|
-
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
259086
|
-
Please select another key or activate this key on the node and try again.`, "warn");
|
259087
|
-
}
|
259088
|
-
const address = await esm_default3({
|
259089
|
-
message: "Which private key do you want to deploy from?",
|
259090
|
-
choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
|
259091
|
-
name: name3,
|
259092
|
-
value: address2
|
259093
|
-
})),
|
259094
|
-
default: defaultAddress ?? possiblePrivateKeys[0]?.address
|
259095
|
-
});
|
259096
|
-
return address;
|
259097
|
-
}
|
259098
|
-
function validPrivateKey(privateKey) {
|
259099
|
-
return privateKey.privateKeyType !== "HD_ECDSA_P256";
|
259100
|
-
}
|
259101
|
-
|
259102
259594
|
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
259103
259595
|
async function selectTargetNode({
|
259104
259596
|
env: env2,
|
@@ -259122,6 +259614,7 @@ async function selectTargetNode({
|
|
259122
259614
|
nodes: validNodes,
|
259123
259615
|
accept: autoAccept,
|
259124
259616
|
isRequired: true,
|
259617
|
+
filterRunningOnly: true,
|
259125
259618
|
promptMessage: "Which blockchain node do you want to connect to? (Only nodes with private keys activated are shown)",
|
259126
259619
|
singleOptionMessage: (node2) => `Using '${node2}' - the only node with active private keys. To use a different node, ensure it has a private key activated.`
|
259127
259620
|
});
|
@@ -259143,7 +259636,7 @@ function validateNode(node, cancelOnError = true) {
|
|
259143
259636
|
}
|
259144
259637
|
return false;
|
259145
259638
|
}
|
259146
|
-
if (node
|
259639
|
+
if (!hasValidPrivateKey(node)) {
|
259147
259640
|
if (cancelOnError) {
|
259148
259641
|
cancel2(`The specified blockchain node '${node.uniqueName}' does not have an ECDSA P256 or HSM ECDSA P256 private key activated. Please activate an ECDSA P256 or HSM ECDSA P256 private key on your node and try again.`);
|
259149
259642
|
}
|
@@ -259158,6 +259651,33 @@ function validateNode(node, cancelOnError = true) {
|
|
259158
259651
|
return true;
|
259159
259652
|
}
|
259160
259653
|
|
259654
|
+
// src/prompts/smart-contract-set/address.prompt.ts
|
259655
|
+
async function addressPrompt({
|
259656
|
+
accept,
|
259657
|
+
node,
|
259658
|
+
hardhatConfig
|
259659
|
+
}) {
|
259660
|
+
const possiblePrivateKeys = node.privateKeys?.filter(isValidPrivateKey) ?? [];
|
259661
|
+
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
259662
|
+
const defaultPossible = accept && defaultAddress;
|
259663
|
+
if (defaultPossible) {
|
259664
|
+
if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
|
259665
|
+
return defaultAddress;
|
259666
|
+
}
|
259667
|
+
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
259668
|
+
Please select another key or activate this key on the node and try again.`, "warn");
|
259669
|
+
}
|
259670
|
+
const address = await esm_default3({
|
259671
|
+
message: "Which private key do you want to deploy from?",
|
259672
|
+
choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
|
259673
|
+
name: name3,
|
259674
|
+
value: address2
|
259675
|
+
})),
|
259676
|
+
default: defaultAddress
|
259677
|
+
});
|
259678
|
+
return address;
|
259679
|
+
}
|
259680
|
+
|
259161
259681
|
// src/utils/smart-contract-set/hardhat-config.ts
|
259162
259682
|
async function getHardhatConfigData(envConfig) {
|
259163
259683
|
try {
|
@@ -259247,7 +259767,7 @@ function hardhatDeployRemoteCommand() {
|
|
259247
259767
|
}
|
259248
259768
|
let address = defaultSender ?? null;
|
259249
259769
|
if (!defaultSender) {
|
259250
|
-
address = await addressPrompt({
|
259770
|
+
address = await addressPrompt({ accept: autoAccept, node, hardhatConfig });
|
259251
259771
|
}
|
259252
259772
|
if (!address) {
|
259253
259773
|
return nothingSelectedError("private key");
|
@@ -259893,4 +260413,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
259893
260413
|
// src/cli.ts
|
259894
260414
|
sdkCliCommand();
|
259895
260415
|
|
259896
|
-
//# debugId=
|
260416
|
+
//# debugId=37A4FC7CE35F25C164756E2164756E21
|