gitmark 0.0.58 → 0.0.61

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/bin/git-mark CHANGED
@@ -21,7 +21,8 @@ globalThis.data = {
21
21
  branch: 'gh-pages',
22
22
  notify: 'http://gitmark.me:4444',
23
23
  sign: false,
24
- tag: false
24
+ tag: false,
25
+ exodus: false
25
26
  }
26
27
 
27
28
  // FUNCTIONS
@@ -112,6 +113,8 @@ data.hash = argv._[1] || head || data.hash
112
113
  data.genesis = argv.genesis || data.genesis
113
114
  data.sign = argv.S || data.sign
114
115
  data.tag = argv.tag || data.tag
116
+ data.exodus = argv.exodus || data.exodus
117
+
115
118
 
116
119
  console.log('data', data)
117
120
 
@@ -185,6 +188,15 @@ console.log(b3.toString(16))
185
188
  console.log(b4.toString(16))
186
189
  console.log(b5.toString(16))
187
190
 
191
+ // address from priv key addition
192
+ var { address } = bitcoin.payments.p2pkh({
193
+ pubkey: keyPair1.publicKey,
194
+ network: NETWORK
195
+ })
196
+ console.log('initial address computed from private', address)
197
+ var genesisAddress = address
198
+
199
+
188
200
  // address from priv key addition
189
201
  var { address } = bitcoin.payments.p2pkh({
190
202
  pubkey: keyPair3.publicKey,
@@ -272,6 +284,9 @@ console.log(`signrawtransaction ${hex} null '["${keyPair1.toWIF()}"]'`)
272
284
  console.log('sendrawtransaction')
273
285
 
274
286
  var txexe = getConfig('gitmark.txexe')
287
+ if (data.exodus) {
288
+ address = genesisAddress
289
+ }
275
290
  var txcommand = `bin/tx.sh ${lastCommit[0]} ${lastCommit[1]
276
291
  } ${address} ${nextfee} ${keyPair1.toWIF()}`
277
292
  console.log(txcommand)
package/bin/git-mark-list CHANGED
@@ -37,11 +37,13 @@ const options = {
37
37
  repo: './',
38
38
  fields: ['subject', 'authorName', 'authorDate'],
39
39
  execOptions: { maxBuffer: 1000 * 1024 },
40
- number: 1000,
40
+ number: 1000000,
41
41
  fields: ['hash', 'subject', 'authorDate']
42
42
  }
43
43
 
44
44
  function addCryptoToCommit(commit) {
45
+ // console.log('commit', commit)
46
+ if (!commit.hash) return
45
47
  b2 = BigInt('0x' + commit.hash)
46
48
  b3 = BigInt.asUintN(256, b1 + b2)
47
49
  commit.privkey = b1.toString(16)
@@ -89,7 +91,7 @@ function renderCommit(commit, type) {
89
91
  // console.log(canon)
90
92
 
91
93
  // sign
92
-
94
+ const KIND_CODE = 17
93
95
 
94
96
  const privateKeyHex = commit.privkey
95
97
  const message = Buffer.from(id, 'hex')
@@ -99,7 +101,7 @@ function renderCommit(commit, type) {
99
101
  // console.log(sig)
100
102
  // var sig = 1
101
103
 
102
- var event = `["EVENT",{"id":"${id}","pubkey":"${commit.pubkey}","created_at":${commit.authorDate},"kind":1,"tags":[],"content":"${commit.hash}","sig":"${sig}"}]`
104
+ var event = `["EVENT",{"id":"${id}","pubkey":"${commit.pubkey}","created_at":${commit.authorDate},"kind":${KIND_CODE},"tags":[],"content":"${commit.hash}","sig":"${sig}"}]`
103
105
 
104
106
  console.log(event)
105
107
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitmark",
3
- "version": "0.0.58",
3
+ "version": "0.0.61",
4
4
  "description": "gitmark",
5
5
  "main": "index.js",
6
6
  "scripts": {