@certik/skynet 0.9.3 → 0.9.6

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 CHANGED
@@ -1,8 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.6
4
+
5
+ - Updated `inline` method in `log` library to print a timestamp in front of each log line
6
+
7
+ ## 0.9.5
8
+
9
+ - Fixed deploy issue when selector value contains special characters
10
+
11
+ ## 0.9.4
12
+
13
+ - Updated Polygon Node to Certik Node
14
+
3
15
  ## 0.9.3
4
16
 
5
- - Update BSC Archive Node to NodeReal
17
+ - Updated BSC Archive Node to NodeReal
6
18
 
7
19
  ## 0.9.2
8
20
 
package/const.js CHANGED
@@ -51,7 +51,7 @@ const PROTOCOLS = {
51
51
  nativeTokenAddress: "polygon:0x0000000000000000000000000000000000000000",
52
52
  nativeTokenLogo: `https://token-logo.certik-assets.com/polygon:0x0000000000000000000000000000000000000000.png`,
53
53
  nativeTokenCoinGeckoId: "matic-network",
54
- endpoint: `https://polygon-mainnet.g.alchemy.com/v2/${getAlchemyApiKey("POLYGON")}`,
54
+ endpoint: `https://poly-full-node.certik-skynet.com`,
55
55
  backupEndpoint: `https://matic.getblock.io/mainnet/?api_key=${getGetBlockApiKey()}`,
56
56
  archiveEndpoint: `https://polygon-mainnet.g.alchemy.com/v2/${getAlchemyApiKey("POLYGON")}`,
57
57
  tokenStandard: "ERC20",
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
- jobName += `-${selectorNamePart}`;
193
+ // handle special case
194
+ jobName += `-${normalizeSelectorValue(selectorNamePart)}`;
190
195
  }
191
196
 
192
197
  return jobName;
package/examples/consumer CHANGED
File without changes
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,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -33,7 +33,16 @@ async function check({ mode, protocol, state, verbose }) {
33
33
 
34
34
  const app = modeIndexer({
35
35
  name: "LibSkynetExampleModeIndexer",
36
- selector: { protocol: { type: "string", description: "which chain to index" } },
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
package/examples/producer CHANGED
File without changes
package/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  function getLine(params) {
2
- let line = `${new Date().toISOString()}\t`;
2
+ let line = "";
3
3
 
4
4
  // Convert to string and filter out newline to tabs (AWS Athena)
5
5
  for (let i = 0, l = params.length; i < l; i++) {
@@ -11,12 +11,16 @@ function getLine(params) {
11
11
  return line.trim();
12
12
  }
13
13
 
14
+ function timestamp() {
15
+ return new Date().toISOString();
16
+ }
17
+
14
18
  const inline = {
15
19
  log: function (...args) {
16
- console.log(getLine(args));
20
+ console.log(`${timestamp()} ${getLine(args)}`);
17
21
  },
18
22
  error: function (...args) {
19
- console.error(getLine(args));
23
+ console.error(`${timestamp()} ${getLine(args)}`);
20
24
  },
21
25
  };
22
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.9.3",
3
+ "version": "0.9.6",
4
4
  "description": "Skynet Shared JS library",
5
5
  "main": "index.js",
6
6
  "author": "CertiK Engineering",
@@ -30,4 +30,4 @@
30
30
  "sinon": "^11.1.2"
31
31
  },
32
32
  "license": "MIT"
33
- }
33
+ }