@certik/skynet 0.9.2 → 0.9.5
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/CHANGELOG.md +13 -1
- package/const.js +4 -3
- package/deploy.js +6 -1
- package/env.js +6 -0
- package/examples/indexer +4 -0
- package/examples/mode-indexer +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.5
|
|
4
|
+
|
|
5
|
+
- Fixed deploy issue when selector value contains special characters
|
|
6
|
+
|
|
7
|
+
## 0.9.4
|
|
8
|
+
|
|
9
|
+
- Updated Polygon Node to Certik Node
|
|
10
|
+
|
|
11
|
+
## 0.9.3
|
|
12
|
+
|
|
13
|
+
- Updated BSC Archive Node to NodeReal
|
|
14
|
+
|
|
3
15
|
## 0.9.2
|
|
4
16
|
|
|
5
17
|
- Enhanced security by moving secret files into nomad secrets folder
|
|
@@ -19,7 +31,7 @@
|
|
|
19
31
|
|
|
20
32
|
## 0.8.15
|
|
21
33
|
|
|
22
|
-
- Fixed OpsGenie message bug
|
|
34
|
+
- Fixed OpsGenie message bug
|
|
23
35
|
|
|
24
36
|
## 0.8.14
|
|
25
37
|
|
package/const.js
CHANGED
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
getPolygonScanApiKey,
|
|
5
5
|
getGetBlockApiKey,
|
|
6
6
|
getAlchemyApiKey,
|
|
7
|
+
getNodeRealApiKey,
|
|
7
8
|
} = require("./env");
|
|
8
9
|
|
|
9
10
|
const SKYNET_API_PREFIX = "https://api.certik-skynet.com";
|
|
@@ -34,7 +35,7 @@ const PROTOCOLS = {
|
|
|
34
35
|
nativeTokenLogo: `https://token-logo.certik-assets.com/bsc:0x0000000000000000000000000000000000000000.png`,
|
|
35
36
|
nativeTokenCoinGeckoId: "binance-coin",
|
|
36
37
|
endpoint: "https://bsc-full-node.certik-skynet.com",
|
|
37
|
-
archiveEndpoint:
|
|
38
|
+
archiveEndpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
|
|
38
39
|
tokenStandard: "BEP20",
|
|
39
40
|
scanApi: {
|
|
40
41
|
endpoint: "https://api.bscscan.com/api",
|
|
@@ -50,7 +51,7 @@ const PROTOCOLS = {
|
|
|
50
51
|
nativeTokenAddress: "polygon:0x0000000000000000000000000000000000000000",
|
|
51
52
|
nativeTokenLogo: `https://token-logo.certik-assets.com/polygon:0x0000000000000000000000000000000000000000.png`,
|
|
52
53
|
nativeTokenCoinGeckoId: "matic-network",
|
|
53
|
-
endpoint: `https://
|
|
54
|
+
endpoint: `https://poly-full-node.certik-skynet.com`,
|
|
54
55
|
backupEndpoint: `https://matic.getblock.io/mainnet/?api_key=${getGetBlockApiKey()}`,
|
|
55
56
|
archiveEndpoint: `https://polygon-mainnet.g.alchemy.com/v2/${getAlchemyApiKey("POLYGON")}`,
|
|
56
57
|
tokenStandard: "ERC20",
|
|
@@ -60,7 +61,7 @@ const PROTOCOLS = {
|
|
|
60
61
|
},
|
|
61
62
|
multiCallProvider: "", // TODO
|
|
62
63
|
scanUrl: "https://polygonscan.com/",
|
|
63
|
-
}
|
|
64
|
+
},
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
const TIME = {
|
package/deploy.js
CHANGED
|
@@ -173,6 +173,10 @@ EOH
|
|
|
173
173
|
}
|
|
174
174
|
}`;
|
|
175
175
|
|
|
176
|
+
function normalizeSelectorValue(v) {
|
|
177
|
+
return v.replace(/[^A-Za-z0-9]+/g, "-");
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
function getJobName(name, selectorFlags, mode = null) {
|
|
177
181
|
const selectorNamePart = Object.keys(selectorFlags)
|
|
178
182
|
.sort()
|
|
@@ -186,7 +190,8 @@ function getJobName(name, selectorFlags, mode = null) {
|
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
if (selectorNamePart.length > 0) {
|
|
189
|
-
|
|
193
|
+
// handle special case
|
|
194
|
+
jobName += `-${normalizeSelectorValue(selectorNamePart)}`;
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
return jobName;
|
package/env.js
CHANGED
|
@@ -35,6 +35,11 @@ function getAlchemyApiKey(identifier) {
|
|
|
35
35
|
return ensureAndGet(`SKYNET_ALCHEMY_API_${identifier.toUpperCase()}_KEY`);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function getNodeRealApiKey(identifier) {
|
|
39
|
+
// NodeReal API keys are different for each NodeReal app
|
|
40
|
+
return ensureAndGet(`SKYNET_NODEREAL_API_${identifier.toUpperCase()}_KEY`);
|
|
41
|
+
}
|
|
42
|
+
|
|
38
43
|
function ensureAndGet(envName, defaultValue) {
|
|
39
44
|
if (Array.isArray(envName)) {
|
|
40
45
|
for (let name of envName) {
|
|
@@ -81,4 +86,5 @@ module.exports = {
|
|
|
81
86
|
getPolygonScanApiKey,
|
|
82
87
|
getGetBlockApiKey,
|
|
83
88
|
getAlchemyApiKey,
|
|
89
|
+
getNodeRealApiKey,
|
|
84
90
|
};
|
package/examples/indexer
CHANGED
|
@@ -36,13 +36,17 @@ async function check({ protocol, state, verbose }) {
|
|
|
36
36
|
|
|
37
37
|
const app = indexer({
|
|
38
38
|
name: "LibSkynetExampleIndexer",
|
|
39
|
+
|
|
39
40
|
selector: {
|
|
41
|
+
// for more flags check meow documentation at https://github.com/sindresorhus/meow
|
|
40
42
|
protocol: {
|
|
41
43
|
type: "string",
|
|
42
44
|
description: "which chain to index"
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
|
|
48
|
+
env: {},
|
|
49
|
+
|
|
46
50
|
build: {
|
|
47
51
|
func: build,
|
|
48
52
|
schedule: every(1).minute,
|
package/examples/mode-indexer
CHANGED
|
@@ -33,7 +33,16 @@ async function check({ mode, protocol, state, verbose }) {
|
|
|
33
33
|
|
|
34
34
|
const app = modeIndexer({
|
|
35
35
|
name: "LibSkynetExampleModeIndexer",
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
selector: {
|
|
38
|
+
// for more flags check meow documentation at https://github.com/sindresorhus/meow
|
|
39
|
+
protocol: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "which chain to index",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
env: {},
|
|
37
46
|
|
|
38
47
|
state: {
|
|
39
48
|
type: "block", // can be omitted, default is block
|