You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-4Lines changed: 37 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ This [demo](https://overhide.github.io/ledgers.js-demo/demo/login.html) ([source
46
46
The respective API instances used by the [demo](https://overhide.github.io/ledgers.js-demo/demo/login.html) are the following test network nodes:
47
47
48
48
* ether: [*overhide* Remuneration API for Ethereum](https://rinkeby.ethereum.overhide.io/swagger.html)
49
-
* dollars: [*overhide-ledger*--the renmuneration provider for US dollars](https://test.ohledger.com/swagger.html)
49
+
* dollars: [*overhide-ledger*--the renmuneration provider for US dollars](https://test.ledger.overhide.io/swagger.html)
50
50
51
51
Use a [Rinkeby](https://faucet.rinkeby.io/) faucet to get "test" Ether for playing around with Ethereum in the [demo](https://overhide.github.io/ledgers.js-demo/demo/login.html) ([source](https://github.com/overhide/ledgers.js/blob/master/demo/login.html)).
52
52
@@ -147,11 +147,27 @@ We need it in the front-end to tell the user what our prices for each tier are.
147
147
148
148
We need it in the service to know what payment amounts constitute authorizations to which tier.
149
149
150
+
**( o_o) Take note of the `"[...] (login.html) :: successfuly retrieved token : {"` trace.**
151
+
152
+
The [ledgers.js library requires an authorization token](https://overhide.io//2021/03/21/tokens.html).
153
+
154
+
The asynchronous token retrieval starts earlier with the trace:
155
+
156
+
```
157
+
[...] (login.html) :: retrieving token on load : {
158
+
```
159
+
160
+
Once it's available, it's provided to the library:
161
+
162
+
```
163
+
oh$.enable(token);
164
+
```
165
+
150
166
**( o_o) Take note of the `"appAddress": "0x046c88317b23dc57F6945Bf4140140f73c8FC80F"`.**
151
167
152
168
All the ledgers enumerated in our *payment schedule* list the application as having the address *0x046c88317b23dc57F6945Bf4140140f73c8FC80F*.
153
169
154
-
This is the application's Ethereum address on the [rinkeby testnet](https://rinkeby.etherscan.io/address/0x046c88317b23dc57f6945bf4140140f73c8fc80f) and on the [test *overhide-ledger*](https://test.ohledger.com/).
170
+
This is the application's Ethereum address on the [rinkeby testnet](https://rinkeby.etherscan.io/address/0x046c88317b23dc57f6945bf4140140f73c8fc80f) and on the [test *overhide-ledger*](https://test.ledger.overhide.io/).
155
171
156
172
This is the address receiving (make-pretend) payments from the game's players.
157
173
@@ -223,7 +239,7 @@ Our clicking of the "Generate" button caused the `ui.onGenerate` callback to run
223
239
224
240
The logging pane shows the UI's *onGenerate* function where our first interaction with the [*ledgers.js*](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html) occurs.
225
241
226
-
We see `ui.onGenerate` call [oh$.generateCredentials](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html#generatecredentials), passing in the "ohledger" imparter tag, indicating the [ledger](https://test.ohledger.com/swagger.html) we're working with.
242
+
We see `ui.onGenerate` call [oh$.generateCredentials](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html#generatecredentials), passing in the "ohledger" imparter tag, indicating the [ledger](https://test.ledger.overhide.io/swagger.html) we're working with.
@@ -245,7 +261,7 @@ Following along--in the code pane--we see that the [oh$.onCredentialsUpdate call
245
261
246
262
The `gatherData()` function call (at the end of the [callback](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html#oncredentialsupdate)) triggers [*ledgers.js*](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html) getters to update payment amounts via the "ohledger" imparter--the currently selected ledger--and compare it to the pre-configured payment schedule ([config.js](https://github.com/overhide/ledgers.js/blob/master/demo/config.js)).
247
263
248
-
This stack of functions make several calls to the [ledger](https://test.ohledger.com/swagger.html) abstracted via [*ledgers.js*](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html):
264
+
This stack of functions make several calls to the [ledger](https://test.ledger.overhide.io/swagger.html) abstracted via [*ledgers.js*](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html):
@@ -303,6 +319,23 @@ The *service* is configured with the same schedule so as to be on the same page
303
319
304
320
Whereby *login.html* ([source](https://github.com/overhide/ledgers.js/blob/master/demo/login.html)) needs the *payment schedule* to aid the user in paying, *service.html* ([source](https://github.com/overhide/ledgers.js/blob/master/demo/service.html)) needs it to validate payment before allowing asked-for authorizations.
305
321
322
+
**( o_o) Take note of the `"[...] (service.html) :: successfuly retrieved token for APIs : {"` trace.**
323
+
324
+
On the back-end, our remuneration API calls also require a token.
325
+
326
+
The token is retrieved using the `getToken()` function and passed into the various `fetch` commands:
327
+
328
+
```
329
+
fetch(..., {
330
+
...
331
+
headers: {
332
+
"Authorization": `Bearer ${token}`
333
+
}
334
+
})
335
+
```
336
+
337
+
338
+
306
339
**(¬-_-)¬ Click the `[...] (service.html) :: remunaration API >> isValidOnLedger call` log.**
307
340
308
341
Take note that the *service* no longer uses [*ledgers.js*](https://overhide.github.io/ledgers.js/ledgers.js-rendered-docs/index.html) API.
Copy file name to clipboardExpand all lines: demo/ignore/login.ui.html
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ <h4>Login With</h4>
111
111
<divclass="header">
112
112
Background Info
113
113
</div>
114
-
<p>For <b>dollars</b> our make-believe "cake game" developer previously <ahref="https://test.ledger.overhide.io" target="_blank">registered</a> with the <ahref="https://test.ledger.overhide.io" target="_blank">overhide-ledger test network</a> using their <code>0x046c88317b23dc57F6945Bf4140140f73c8FC80F</code> ledger address.</p>
114
+
<p>For <b>dollars</b> our make-believe "cake game" developer previously <ahref="https://test.ledger.overhide.io/onboard" target="_blank">registered</a> with the <ahref="https://test.ledger.overhide.io" target="_blank">overhide-ledger test network</a> using their <code>0x046c88317b23dc57F6945Bf4140140f73c8FC80F</code> ledger address.</p>
115
115
<hr/>
116
116
<p>For <b>ethers</b> our make-believe "cake game" developer uses the same <code>0x046c88317b23dc57F6945Bf4140140f73c8FC80F</code><em>ledger address</em> with the <ahref="https://rinkeby.etherscan.io/address/0x046c88317b23dc57f6945bf4140140f73c8fc80f" target="_blank">Rinkeby testnet</a>.</p>
117
117
</div>
@@ -175,14 +175,14 @@ <h4>
175
175
<divclass="content">
176
176
<divclass="ui basic segment">
177
177
<p>There is no concept of resetting passwords with blockchain ledgers. We cannot generate new secret keys for existing addresses. Should users forgot their secret keys, they cannot proove they own their addresses.</p>
178
-
<p>But when using <ahref="https://test.ohledger.com/pay" target="_blank">overhide-ledger</a> payments are made with <ahref="https://stripe.com" target="_blank">Stripe.com</a>. Every <ahref="https://stripe.com" target="_blank">Stripe.com</a> payment involves email or SMS verification. If email verification occured, that email address can be provided to <b>re-target</b><ahref="https://test.ohledger.com/pay" target="_blank">overhide-ledger</a> transactions as if they come from a new address.</p>
179
-
<p>Since <ahref="https://test.ohledger.com/pay" target="_blank">overhide-ledger</a> is not a blockchain, we can rewrite ledger entries in the database.</p>
180
-
<p>Check out this feature by clicking the blue button and visiting the <ahref="https://test.ohledger.com/pay" target="_blank">overhide-ledger</a> site.</p>
178
+
<p>But when using <ahref="https://test.ledger.overhide.io/pay" target="_blank">overhide-ledger</a> payments are made with <ahref="https://stripe.com" target="_blank">Stripe.com</a>. Every <ahref="https://stripe.com" target="_blank">Stripe.com</a> payment involves email or SMS verification. If email verification occured, that email address can be provided to <b>re-target</b><ahref="https://test.ledger.overhide.io/pay" target="_blank">overhide-ledger</a> transactions as if they come from a new address.</p>
179
+
<p>Since <ahref="https://test.ledger.overhide.io/pay" target="_blank">overhide-ledger</a> is not a blockchain, we can rewrite ledger entries in the database.</p>
180
+
<p>Check out this feature by clicking the blue button and visiting the <ahref="https://test.ledger.overhide.io/pay" target="_blank">overhide-ledger</a> site.</p>
181
181
<p>You can think of <b>re-targeting</b> as a blockchain on-boarding feature. It isn't a password reset. But it's not as painful as loosing your secret key to an address on a blockchain.</p>
182
-
<p>Of course this isn't available for any blockchain ledgers supported by <em>overhide</em>, it's only available for the centralized <ahref="https://test.ohledger.com/pay" target="_blank">overhide-ledger</a>.</p>
182
+
<p>Of course this isn't available for any blockchain ledgers supported by <em>overhide</em>, it's only available for the centralized <ahref="https://test.ledger.overhide.io/pay" target="_blank">overhide-ledger</a>.</p>
0 commit comments