Skip to content

Commit

Permalink
merge master into nakamoto (#1746)
Browse files Browse the repository at this point in the history
* docs: Update how-to-install-stacks-cli.md (#1727)

Cleaned up the voice and made this page more conversational.

Of note, similar to my last PR, I'm removing some language around "Stacks 2.0" here alongside this cleanup

* docs: Update rosetta-support.md (#1728)

there is a missing period

* docs: Update overview.md (#1729)

Grammar fixes

* docs: Update how-to-run-api-node.md (#1730)

A number of grammar fixes and tweaks

* docs: Update how-to-run-mainnet-node.md (#1731)

Grammar fixes!

* docs: Update how-to-run-testnet-node.md (#1732)

Grammar fixes

* fix: move nft custody view into a table (#1741)

* fix: move to table

* fix: old nft events query

* fix: nft-custody-table migration

* fix: no longer rename old views, just remove them

---------

Co-authored-by: Matt <[email protected]>

---------

Co-authored-by: max-crawford <[email protected]>
Co-authored-by: Matt <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 74606c7 commit 872bcbd
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 94 deletions.
2 changes: 1 addition & 1 deletion content/feature-guides/rosetta-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ rosetta-cli \
`rosetta-cli` will then sync with the blockchain until it reaches the tip, and then exit, displaying the test results.
Currently, account reconciliation is disabled; proper testing of that feature requires token transfer transactions while `rosetta-cli` is running.
Documentation for the Rosetta APIs can be found [here](https://hirosystems.github.io/stacks-blockchain-api/).
You may also review Data and Construction Rosetta endpoints [here](https://docs.hiro.so/api#tag/Rosetta)
You may also review Data and Construction Rosetta endpoints [here](https://docs.hiro.so/api#tag/Rosetta).
24 changes: 12 additions & 12 deletions content/how-to-guides/how-to-install-stacks-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: How to install Stacks CLI
---

The Stacks CLI enables interactions with the Stacks 2.0 blockchain through a set of commands.
The Stacks CLI enables interactions with the Stacks blockchain through a set of commands.

## Installation

Expand All @@ -18,15 +18,15 @@ The `-g` flag makes the CLI commands available globally

## Network selection

By default, the CLI will attempt to interact with the mainnet of the Stacks 2.0 blockchain. However, it is possible to override the network and set it to the testnet:
By default, the CLI will attempt to interact with Stacks mainnet. However, it is possible to override the network and set it to testnet:

```sh
stx <command> -t
```

:::info

For account usage, that means addresses generated will _only_ be available for the specific network. An account generated for the testnet cannot be used on the mainnet.
For account usage, that means addresses generated will _only_ be available for the specific network. An account generated for testnet cannot be used on mainnet.

:::

Expand All @@ -42,7 +42,7 @@ This section describes how to use the CLI to manage an account.

:::caution

It is not recommended to use the CLI to handle accounts with real STX tokens on the mainnet. Using an appropriate wallet build to support secure token holding is recommended.
We don't recommended you use the CLI to handle accounts with real STX tokens on the mainnet. Instead, use an appropriate wallet to support secure token holding.

:::

Expand All @@ -68,14 +68,14 @@ Your response should look like this:
}
```

The mnemonic is your 24 word seed phrase which you should back up securely if you want access to this account again in the future. Once lost, it cannot be recovered.
The mnemonic is your 24 word seed phrase, which you should back up securely if you want access to this account again in the future. Once lost, it cannot be recovered.

The Stacks address associated with the newly generated account is:
`ST1BG7MHW2R524WMF7X8PGG3V45ZN040EB9EW0GQJ`

:::note

The preceding address is a testnet address that can only be used on the testnet.
The preceding address is a testnet address that can only be used on testnet.

:::

Expand Down Expand Up @@ -115,10 +115,10 @@ This section describes how to use the CLI to generate and broadcast transactions
In order to send tokens, the CLI command requires 5 parameters:

- **Recipient Address**: The Stacks address of the recipient
- **Amount**: The number of Stacks to send denoted in microstacks (1 STX = 1000000 microstacks)
- **Fee Rate**: The transaction fee rate for this transaction. You can safely set a fee rate of 200 for Testnet
- **Amount**: The number of Stacks to send denoted in microstacks (1 STX = 1,000,000 microstacks)
- **Fee Rate**: The fee rate for this transaction. You can safely set a fee rate of 200 for testnet
- **Nonce**: The nonce is a number that needs to be incremented monotonically for each transaction from the account. This ensures transactions are not duplicated
- **Private Key**: This is the private key corresponding to your account that was generated when
- **Private Key**: This is the private key corresponding to your account

The CLI command to use with these parameters is `send_tokens`:

Expand All @@ -135,7 +135,7 @@ stx send_tokens ST2KMMVJAB00W5Z6XWTFPH6B13JE9RJ2DCSHYX0S7 1000 200 0 381314da39a

With this command we’re sending 1000 microstacks to the Stacks address `ST2KMMVJAB00W5Z6XWTFPH6B13JE9RJ2DCSHYX0S7`.

We set the fee rate to `200` microstacks. If you're not sure how much your transaction will cost.
We set the fee rate to `200` microstacks.

:::tip

Expand All @@ -147,9 +147,9 @@ The nonce is set to `0` for this transaction, since it will be the first transac

Finally, the last parameter is the private key for the account. `381314da39a45f43f45ffd33b5d8767d1a38db0da71fea50ed9508e048765cf301`

Once again, we’re using the `-t` option to indicate that this is a Testnet transaction, so it should be broadcasted to Testnet.
Once again, we’re using the `-t` option to indicate that this is a testnet transaction, so it should be broadcast to testnet.

If valid, the transaction will be broadcasted to the network and the command will respond with a transaction ID.
If valid, the transaction will be broadcast to the network, and the command will respond with a transaction ID.

:::tip

Expand Down
18 changes: 9 additions & 9 deletions content/how-to-guides/how-to-run-api-node.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---
title: How to run API node
title: How to Run an API Node
---

This procedure demonstrates how to run a local API node using Docker images. There are several components that must be
This guide shows you how to run a local API node using Docker images. There are several components that must be
configured and run in a specific order for the local API node to work.

For this procedure, the order in which the services are brought up is very important. In order to start the API node
Note: the order in which the services are brought up is very important. In order to start the API node
successfully, you need to bring up the services in the following order:

1. `postgres`
2. `stacks-blockchain-api`
3. `stacks-blockchain`

When bringing down the API node, you should bring the services down in the exact reverse order in which they were
brought up, to avoid losing data.
When bringing down the API node, you should bring the services down in the reverse order in which they were
brought up in order to avoid losing data.

:::note

This procedure focuses on Unix-like operating systems (Linux and MacOS). This procedure has not been tested on
This guide focuses on Unix-like operating systems (Linux and MacOS). This has not been tested on
Windows.

:::

## Prerequisites

Running a node has no specialized hardware requirements. Users have been successful in running nodes on Raspberry Pi
boards and other system-on-chip architectures. In order to complete this procedure, you must have the following software
boards and other system-on-chip architectures. However, in order to complete this guide, you do need the following software
installed on the node host machine:

- [Docker](https://docs.docker.com/get-docker/)
Expand Down Expand Up @@ -234,13 +234,13 @@ To verify the database is ready:
2. List current databases with the command `\l`
3. Disconnect from the database with the command `\q`

To verify the `stacks-blockchain` tip height is progressing use the following command:
To verify that the `stacks-blockchain` tip height is progressing, use the following command:

```sh
curl -sL localhost:20443/v2/info | jq
```

If the instance is running you should receive terminal output similar to the following:
If the instance is running, you should receive terminal output similar to the following:

```json
{
Expand Down
12 changes: 6 additions & 6 deletions content/how-to-guides/how-to-run-mainnet-node.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: How to run mainnet node
title: How to Run a Mainnet Node
---

This procedure demonstrates how to run a local mainnet node using Docker images.
This guide shows you how to run a local mainnet node using Docker images.

:::note

This procedure focuses on Unix-like operating systems (Linux and MacOS). This procedure has not been tested on
This guide focuses on Unix-like operating systems (Linux and MacOS). This has not been tested on
Windows.

:::

## Prerequisites

Running a node has no specialized hardware requirements. Users have been successful in running nodes on Raspberry Pi
boards and other system-on-chip architectures. In order to complete this procedure, you must have the following software
boards and other system-on-chip architectures. However, in order to complete this guide, you do need the following software
installed on the node host machine:

- [Docker](https://docs.docker.com/get-docker/)
Expand Down Expand Up @@ -129,13 +129,13 @@ INFO [1626290748.103291] [src/burnchains/bitcoin/spv.rs:926] [main] Syncing Bitc
INFO [1626290776.956535] [src/burnchains/bitcoin/spv.rs:926] [main] Syncing Bitcoin headers: 1.7% (12000 out of 691034)
```

To verify the `stacks-blockchain` tip height is progressing use the following command:
To verify that the `stacks-blockchain` tip height is progressing, use the following command:

```sh
curl -sL localhost:20443/v2/info | jq
```

If the instance is running you should receive terminal output similar to the following:
If the instance is running, you should receive terminal output similar to the following:

```json
{
Expand Down
14 changes: 7 additions & 7 deletions content/how-to-guides/how-to-run-testnet-node.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: How to run testnet node
title: How to Run a Testnet Node
---

This procedure demonstrates how to run a local testnet node using Docker images.
This guide shows you how to run a local testnet node using Docker images.

:::note

This procedure focuses on Unix-like operating systems (Linux and MacOS). This procedure has not been tested on
This guide focuses on Unix-like operating systems (Linux and MacOS). This has not been tested on
Windows.

:::

## Prerequisites

Running a node has no specialized hardware requirements. Users have been successful in running nodes on Raspberry Pi
boards and other system-on-chip architectures. In order to complete this procedure, you must have the following software
boards and other system-on-chip architectures. However, in order to complete this procedure, you do need the following software
installed on the node host machine:

- [Docker](https://docs.docker.com/get-docker/)
Expand Down Expand Up @@ -45,7 +45,7 @@ These egress ports are for syncing `stacks-blockchain` and Bitcoin headers. If t

## Step 1: Initial setup

In order to run the testnet node, you must download the Docker images and create a directory structure to hold the
In order to run a testnet node, you must download the Docker images and create a directory structure to hold the
persistent data from the services. Download and configure the Docker images with the following commands:

```sh
Expand Down Expand Up @@ -100,13 +100,13 @@ INFO [1626290748.103291] [src/burnchains/bitcoin/spv.rs:926] [main] Syncing Bitc
INFO [1626290776.956535] [src/burnchains/bitcoin/spv.rs:926] [main] Syncing Bitcoin headers: 1.7% (12000 out of 2034380)
```

To verify the `stacks-blockchain` tip height is progressing use the following command:
To verify that the `stacks-blockchain` tip height is progressing, use the following command:

```sh
curl -sL localhost:20443/v2/info | jq
```

If the instance is running you should receive terminal output similar to the following:
If the instance is running, you should receive terminal output similar to the following:

```json
{
Expand Down
14 changes: 7 additions & 7 deletions content/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Title: Overview

The Stacks blockchain API allows you to query the Stacks blockchain and interact with smart contracts. It was built to maintain paginated, materialized views of the Stacks Blockchain.

The Stacks Blockchain API is hosted by Hiro. Using it requires you to trust the hosted server, but this API also provides a faster development experience. You may wish to consider running your own API instance to create a fully trustless architecture for your app.
The Stacks Blockchain API is hosted by Hiro. Using it requires you to trust us as the hosted server, but in return we provide a faster development experience. If you want a fully trustless architecture for your app, you may wish to consider running your own API instance.

> **_NOTE:_**
>
Expand All @@ -18,14 +18,14 @@ The Stacks Blockchain API is hosted by Hiro. Using it requires you to trust the

![API architecture!](images/api-architecture.png)

* The `stacks-node` has it's own minimal set of http endpoints referred to as `RPC endpoints`
* The `stacks-node` has its own minimal set of http endpoints referred to as `RPC endpoints`
* The `stacks-blockchain-api` allows clients to access these endpoints by proxying them through to a load-balanced pool of `stacks-nodes`.
* See: https://github.com/blockstack/stacks-blockchain/blob/master/docs/rpc-endpoints.md -- some common ones:
* `POST /v2/transactions` - broadcast a tx.
* `POST /v2/transactions` - broadcast a transaction.
* `GET /v2/pox` - get current PoX-relevant information.
* `POST /v2/contracts/call-read/<contract>/<function>` - evaluates and returns the result of calling a Clarity function.
* `POST /v2/fees/transaction` - evaluates a given transaction and returns tx fee estimation data.
* `GET /v2/accounts/<address>` - used to get the current `nonce` required for creating transactions.
* `POST /v2/contracts/call-read/<contract>/<function>` - evaluate and return the result of calling a Clarity function.
* `POST /v2/fees/transaction` - evaluate a given transaction and return transaction fee estimation data.
* `GET /v2/accounts/<address>` - get the current `nonce` required for creating transactions.


* The endpoints implemented by `stacks-blockchain-api` provide data that the `stacks-node` can't due to various constraints.
Expand All @@ -52,7 +52,7 @@ The Stacks Blockchain API is hosted by Hiro. Using it requires you to trust the
* ALSO the OpenAPI + JSONSchemas are used to generate a standalone `@stacks/blockchain-api-client`.


* The easiest/quickest way to develop in this repo is using the vscode debugger. It uses docker-compose to setup a `stacks-node` and postgres instance.
* The easiest/quickest way to develop in this repo is using the VS Code debugger. It uses docker-compose to setup a `stacks-node` and Postgres instance.
* Alternatively, you can run `npm run dev:integrated` which does the same thing but without a debugger.


Loading

0 comments on commit 872bcbd

Please sign in to comment.