Browse Source

fix: update link for stacks.js reference docs

feat/add-spellcheck-action
Ken 4 years ago
committed by Ken Liao
parent
commit
145ab8f4c2
  1. 4
      src/common/navigation.yaml
  2. 2
      src/pages/authentication/building-todo-app.md
  3. 2
      src/pages/authentication/overview.md
  4. 4
      src/pages/data-storage/overview.md
  5. 16
      src/pages/data-storage/storage-guide.md
  6. 5
      src/pages/data-storage/storage-write-read.md
  7. 13
      src/pages/naming-services/architecture.md
  8. 3
      src/pages/naming-services/subdomains-tutorial.md

4
src/common/navigation.yaml

@ -113,8 +113,8 @@ sections:
- path: /stacking-contract - path: /stacking-contract
- path: /stacks-blockchain-api - path: /stacks-blockchain-api
- external: - external:
href: 'https://blockstack.github.io/blockstack.js/' href: 'https://blockstack.github.io/stacks.js/'
title: blockstack.js title: Stacks.js
- path: /faqs - path: /faqs
- path: /glossary - path: /glossary
- path: /deploy-tips - path: /deploy-tips

2
src/pages/authentication/building-todo-app.md

@ -218,7 +218,7 @@ field and hitting "Enter".
![The authenticated view of the todos app](/images/todos-home-authenticated.svg) ![The authenticated view of the todos app](/images/todos-home-authenticated.svg)
The data for all todos are saved as JSON to the Gaia hub linked to your Secret Key using the The data for all todos are saved as JSON to the Gaia hub linked to your Secret Key using the
[`putFile`](http://blockstack.github.io/blockstack.js/globals.html#putfile) method of the `userSession` object in the [`putFile`](http://blockstack.github.io/stacks.js/classes/storage.html#putfile) method of the `userSession` object in the
[`src/assets/data-store.js`](https://github.com/blockstack/blockstack-todos/blob/master/src/assets/data-store.js#L26) module: [`src/assets/data-store.js`](https://github.com/blockstack/blockstack-todos/blob/master/src/assets/data-store.js#L26) module:
```jsx ```jsx

2
src/pages/authentication/overview.md

@ -39,7 +39,7 @@ Apps may request any of the following scopes:
| `store_write` | Read and write data to the user's Gaia hub in an app-specific storage bucket. | | `store_write` | Read and write data to the user's Gaia hub in an app-specific storage bucket. |
| `publish_data` | Publish data so that other users of the app can discover and interact with the user. | | | `publish_data` | Publish data so that other users of the app can discover and interact with the user. | |
The permissions scope should be specified through the [`AppConfig`](https://blockstack.github.io/blockstack.js/classes/appconfig.html) The permissions scope should be specified through the [`AppConfig`](https://blockstack.github.io/stacks.js/classes/appconfig.html)
object. If no `scopes` array is provided to the `redirectToSignIn` or `makeAuthRequest` functions, the default is to request `['store_write']`. object. If no `scopes` array is provided to the `redirectToSignIn` or `makeAuthRequest` functions, the default is to request `['store_write']`.
## Manifest file ## Manifest file

4
src/pages/data-storage/overview.md

@ -57,13 +57,13 @@ Because `alice.id` has access to her zonefile, she can change where her profile
~> Users with existing identities cannot yet migrate their data from one hub to another. ~> Users with existing identities cannot yet migrate their data from one hub to another.
Applications writing directly on behalf of `alice.id` do not need to perform a lookup. Instead, the [Blockstack authentication flow](http://blockstack.github.io/blockstack.js/index.html) provides Alice's chosen application root URL to the application. This authentication flow _is also_ within Alice's control because Alice's browser _must_ generate the authentication response. Applications writing directly on behalf of `alice.id` do not need to perform a lookup. Instead, the [Stacks authentication flow](http://blockstack.github.io/stacks.js/index.html) provides Alice's chosen application root URL to the application. This authentication flow _is also_ within Alice's control because Alice's browser _must_ generate the authentication response.
## Understand data storage ## Understand data storage
A Gaia hub stores the written data _exactly_ as given. It offers minimal guarantees about the data. It does not ensure that data is validly formatted, contains valid signatures, or is encrypted. Rather, the design philosophy is that these concerns are client-side concerns. A Gaia hub stores the written data _exactly_ as given. It offers minimal guarantees about the data. It does not ensure that data is validly formatted, contains valid signatures, or is encrypted. Rather, the design philosophy is that these concerns are client-side concerns.
Client libraries (such as `blockstack.js`) are capable of providing these guarantees. Blockstack used a liberal definition of the [end-to-end principle](https://en.wikipedia.org/wiki/End-to-end_principle) to guide this design decision. Client libraries (such as `Stacks.js`) are capable of providing these guarantees. Blockstack used a liberal definition of the [end-to-end principle](https://en.wikipedia.org/wiki/End-to-end_principle) to guide this design decision.
## Gaia versus other storage systems ## Gaia versus other storage systems

16
src/pages/data-storage/storage-guide.md

@ -17,7 +17,7 @@ Gaia storage is a key-value store.
## Creating a file ## Creating a file
Use the [UserSession.putFile](https://blockstack.github.io/blockstack.js/classes/usersession.html#putfile) method: Use the [UserSession.putFile](https://blockstack.github.io/stacks.js/classes/usersession.html#putfile) method:
```tsx ```tsx
const userSession = new UserSession(); const userSession = new UserSession();
@ -31,8 +31,8 @@ userSession.putFile('hello.txt', 'hello world!', options).then(() => {
## Creating an encrypted file ## Creating an encrypted file
Use the [UserSession.putFile](https://blockstack.github.io/blockstack.js/classes/usersession.html#putfile) method and Use the [UserSession.putFile](https://blockstack.github.io/stacks.js/classes/usersession.html#putfile) method and
pass `encrypt: true` within the options object. See the [`PutFileOptions` type definition here](https://blockstack.github.io/blockstack.js/interfaces/putfileoptions.html#encrypt) pass `encrypt: true` within the options object. See the [`PutFileOptions` type definition here](https://blockstack.github.io/stacks.js/interfaces/putfileoptions.html#encrypt)
```tsx ```tsx
const userSession = new UserSession(); const userSession = new UserSession();
@ -48,7 +48,7 @@ userSession.putFile('message.txt', 'Secret hello!', options).then(() => {
## Reading a file ## Reading a file
Use the [UserSession.getFile](https://blockstack.github.io/blockstack.js/classes/usersession.html#getfile) method: Use the [UserSession.getFile](https://blockstack.github.io/stacks.js/classes/usersession.html#getfile) method:
```tsx ```tsx
const userSession = new UserSession(); const userSession = new UserSession();
@ -65,8 +65,8 @@ userSession.getFile('hello.txt', options).then(fileContents => {
## Reading an encrypted file ## Reading an encrypted file
Use the [UserSession.getFile](https://blockstack.github.io/blockstack.js/classes/usersession.html#getfile) method and pass Use the [UserSession.getFile](https://blockstack.github.io/stacks.js/classes/usersession.html#getfile) method and pass
`decrypt: true` within the options object. See the [`GetFileOptions` type definition here](https://blockstack.github.io/blockstack.js/interfaces/getfileoptions.html#decrypt) `decrypt: true` within the options object. See the [`GetFileOptions` type definition here](https://blockstack.github.io/stacks.js/interfaces/getfileoptions.html#decrypt)
```tsx ```tsx
const userSession = new UserSession(); const userSession = new UserSession();
@ -84,7 +84,7 @@ userSession.getFile('message.txt', options).then(fileContents => {
## Reading another user's unencrypted file ## Reading another user's unencrypted file
In order for files to be publicly readable, the app must request In order for files to be publicly readable, the app must request
the [`publish_data` scope](https://blockstack.github.io/blockstack.js/enums/authscope.html#publish_data) during authentication. the [`publish_data` scope](https://blockstack.github.io/stacks.js/enums/authscope.html#publish_data) during authentication.
```jsx ```jsx
const options = { const options = {
@ -101,7 +101,7 @@ userSession.putFile('hello.txt', 'hello world!', options).then(fileContents => {
## Delete a file ## Delete a file
Use the [`UserSession.deleteFile`](https://blockstack.github.io/blockstack.js/classes/usersession.html#deletefile) from the application's data store. Use the [`UserSession.deleteFile`](https://blockstack.github.io/stacks.js/classes/usersession.html#deletefile) from the application's data store.
```jsx ```jsx
const userSession = new UserSession(); const userSession = new UserSession();

5
src/pages/data-storage/storage-write-read.md

@ -5,8 +5,9 @@ description: 'Storing user data with Blockstack'
## Introduction ## Introduction
Once a user authenticates and a DApp obtains authentication, the application interacts with Gaia through the Once a user authenticates and a DApp obtains authentication, the application interacts with Gaia through the
blockstack.js library. There are two simple methods for working with data in Gaia hub: the `putFile()` and `getFile()` `@stacks/auth` library. There are two simple methods in `@stacks/storage` for working with data in Gaia hub:
methods. This section goes into greater detail about the methods, how they interact with a hub, and how to use them. the `putFile()` and `getFile()` methods. This section goes into greater detail about the methods, how they
interact with a hub, and how to use them.
## Write-to and Read-from URL Guarantees ## Write-to and Read-from URL Guarantees

13
src/pages/naming-services/architecture.md

@ -61,19 +61,10 @@ They should not attempt to talk to a BNS indexer directly, because its API is no
for consumption by any other process except for the API module. for consumption by any other process except for the API module.
Registering and managing names require generating and sending blockchain Registering and managing names require generating and sending blockchain
transactions, which requires running a BNS client. We provide two reference transactions, which requires running a BNS client.
BNS clients:
- The [Blockstack Browser](https://github.com/blockstack/blockstack-browser) gives users - The [Stacks CLI](https://www.npmjs.com/package/@stacks/cli) gives developers low-level
and developers a graphical UI to resolve, register and manage names. This is the recommended
way to interact with BNS.
- The Blockstack CLI gives developers low-level
control over resolving, registering, and managing names. control over resolving, registering, and managing names.
A new CLI that uses [blockstack.js](https://github.com/blockstack/blockstack.js)
is under development, and will replace the existing CLI program.
We recommend that new developers use the [Blockstack
Browser](https://github.com/blockstack/blockstack-browser).
Developers who want to make their own client programs that do not use Developers who want to make their own client programs that do not use
the reference client library code should read the the reference client library code should read the

3
src/pages/naming-services/subdomains-tutorial.md

@ -220,8 +220,7 @@ $ curl -H "Authorization: bearer blockstack_integration_test_api_password" -H "O
} }
``` ```
Name info lookups are also supported (this should enable authenticating logins Name info lookups are also supported
with `blockstack.js`, but I will need to double check).
```bash ```bash
$ curl -H "Authorization: bearer XXXX" -H "Origin: http://localhost:3000" http://localhost:6270/v1/names/created_equal.self_evident_truth.id -s | python -m json.tool $ curl -H "Authorization: bearer XXXX" -H "Origin: http://localhost:3000" http://localhost:6270/v1/names/created_equal.self_evident_truth.id -s | python -m json.tool

Loading…
Cancel
Save