Skip to content

Commit

Permalink
Merge branch 'master' into update-sbtc-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrogers authored Oct 17, 2024
2 parents 2dd4af9 + 6e5c4de commit d18b13e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Proof of Transfer (PoX) is the block production mechanism of the Stacks chain. E

#### Clarity

Clarity is the smart contract language that Stacks uses. it has been designed from the ground up to make it easier or developers to write safe, secure smart contracts. Additionally, since it has been purpose-built for Stacks and Bitcoin, there are built-in functions for reading Bitcoin state, which means you can use Bitcoin state to perform actions in Clarity. For example, you could set up a check to make sure a particular Bitcoin transaction has occurred before executing a mint function in Clarity, which just so happens to be what happens with the third component: sBTC.
Clarity is the smart contract language that Stacks uses. it has been designed from the ground up to make it easier for developers to write safe, secure smart contracts. Additionally, since it has been purpose-built for Stacks and Bitcoin, there are built-in functions for reading Bitcoin state, which means you can use Bitcoin state to perform actions in Clarity. For example, you could set up a check to make sure a particular Bitcoin transaction has occurred before executing a mint function in Clarity, which just so happens to be what happens with the third component: sBTC.

#### sBTC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ stacker = true
chain = "bitcoin"
mode = "krypton"
peer_host = "bitcoin.regtest.hiro.so"
username = "hirosystems"
password = "hirosystems"
rpc_port = 18443
peer_port = 18444
pox_prepare_length = 100
pox_reward_length = 900
Expand All @@ -54,8 +51,6 @@ auth_token = "12345"
[[events_observer]]
endpoint = "0.0.0.0.0:30000"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
[[ustx_balance]]
Expand Down Expand Up @@ -111,7 +106,7 @@ start_height = 6
[[burnchain.epochs]]
epoch_name = "3.0"
start_height = 2000701
start_height = 56_457
EOF
docker run -d \\
Expand Down Expand Up @@ -145,17 +140,12 @@ prometheus_bind = "0.0.0.0:9153"
chain = "bitcoin"
mode = "krypton"
peer_host = "bitcoin.regtest.hiro.so"
username = "hirosystems"
password = "hirosystems"
rpc_port = 18443
peer_port = 18444
pox_prepare_length = 100
pox_reward_length = 900
[[events_observer]]
endpoint = "0.0.0.0.0:30000"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
# Set your auth token, which the signer uses
Expand Down Expand Up @@ -216,7 +206,7 @@ start_height = 6
[[burnchain.epochs]]
epoch_name = "3.0"
start_height = 2000701
start_height = 56_457
```
The important aspects that you’ll need to change are:
Expand Down
2 changes: 1 addition & 1 deletion reference/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ This function returns (ok true) if the transfer is successful, or, on an error,

Introduced in: **Clarity 1**

**input:** `uint, principal, principal, buff`
**input:** `uint, principal, principal`

**output:** `(response bool uint)`

Expand Down
86 changes: 32 additions & 54 deletions reference/sample-configuration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ If you are a signer, these are the current latest versions you'll want to be run
* Signer - [2.5.0.0.5.2](https://hub.docker.com/layers/blockstack/stacks-signer/2.5.0.0.5.2/images/sha256-fc29a7c22f236f91270fb1aa58cfb4dd8dcd6b1daa0812e16df0bdc7643cb6ac?context=explore)
* Stacks Node - [2.5.0.0.7](https://hub.docker.com/layers/blockstack/stacks-core/2.5.0.0.7/images/sha256-71d3eb305b5c1b68cd44904a7bcd6e5f92542135a7218762cdf27a46acaff69b?context=explore)


### Signer Configuration File Options

The signer configuration file is a TOML file that contains the configuration options for your signer. Below are the options you can set in the signer configuration file.
Expand All @@ -25,18 +24,9 @@ The signer configuration file is a TOML file that contains the configuration opt
| stacks\_private\_key || Hex representation of the signer's Stacks private key used for communicating with the Stacks Node, including writing to the Stacker DB instance. |
| network || Network to use. One of "mainnet", "testnet" or "mocknet". |
| auth\_password || Authorization token for HTTP requests made from the signer to your Stacks node. |
| db\_path || Path to the signer's database file or :memory: for an in-memory database. |
| metrics\_endpoint | | IP:PORT for Prometheus metrics collection. |
| event\_timeout\_ms | | Time to wait (in milliseconds) for a response from the stacker-db instance. |
| block\_proposal\_timeout\_ms | | Time to wait (in milliseconds) for a block response from miners. |
| dkg\_public\_timeout\_ms | | Timeout in (milliseconds) to gather DkgPublicShares messages. |
| dkg\_private\_timeout\_ms | | Timeout in (milliseconds) to gather DkgPrivateShares messages. |
| dkg\_end\_timeout\_ms | | Timeout in (milliseconds) to gather DkgEnd messages. |
| nonce\_timeout\_ms | | Timeout in (milliseconds) to gather nonces. |
| sign\_timeout\_ms | | Timeout in (milliseconds) to gather signature shares. |
| tx\_fee\_ustx | | The STX tx fee to use in microSTX. If not set, will default to 10000. |
| max\_tx\_fee\_ustx | | The max STX tx fee to use in microSTX when estimating fees. If not set, will use tx\_fee\_ustx. |

| db\_path || Path to the signer's database file |
| metrics\_endpoint | | IP:PORT for Prometheus metrics collection. |
| chain\_id | | An optional ChainID, only used for custom networks (like Nakamoto Testnet) |

### Example Configs

Expand All @@ -45,30 +35,30 @@ Below are sample configuration files for running a Stacks node and signer provid
### Testnet Signer

```toml
# The IP address and port where your Stacks node can be accessed.
# The port 20443 is the default RPC endpoint for Stacks nodes.
# The IP address and port where your Stacks node can be accessed.
# The port 20443 is the default RPC endpoint for Stacks nodes.
# Note that you must use an IP address - DNS hosts are not supported at this time.
# This should be the IP address accessible via Docker, usually via a network.
node_host = "127.0.0.1:20443"

# This is the location where the signer will expose an RPC endpoint for
# This is the location where the signer will expose an RPC endpoint for
# receiving events from your Stacks node.
endpoint = "127.0.0.1:30000"

# Either “testnet” or “mainnet”
network = "testnet"

# this is a file path where your signer will persist data. If using Docker,
# this is a file path where your signer will persist data. If using Docker,
# this must be within a volume, so that data can be persisted across restarts
db_path = "/var/stacks/signer.sqlite"

# an authentication token that is used for some HTTP requests made from the
# signer to your Stacks node. You’ll need to use this later on when configuring
# your Stacks node. You create this field yourself, rather than it being generated
# an authentication token that is used for some HTTP requests made from the
# signer to your Stacks node. You’ll need to use this later on when configuring
# your Stacks node. You create this field yourself, rather than it being generated
# with your private key.
auth_password = "$your_http_auth_token"

# This is the privateKey field from the keys you generated in the
# This is the privateKey field from the keys you generated in the
# previous step.
stacks_private_key = "$your_stacks_private_key"
```
Expand All @@ -83,7 +73,7 @@ Additions necessary specifically to run a signer are the `[connection_options]`

```toml
[node]
# Set this based on where you downloaded
# Set this based on where you downloaded
# the chain state archive as described in the How to Run a Signer guide:
working_dir = "/stacks-blockchain/data"
rpc_bind = "0.0.0.0:20443"
Expand All @@ -98,21 +88,18 @@ stacker = true
[burnchain]
chain = "bitcoin"
mode = "krypton"
chain_id = 0x80000100
magic_bytes = "N3"
poll_time_secs = 30
pox_prepare_length = 100
pox_reward_length = 900
peer_host = "bitcoin.nakamoto.regtest.hiro.so"
username = "hirosystems"
password = "hirosystems"
burnchain_op_tx_fee = 5500
commit_anchor_block_within = 300000
rpc_port = 18543
peer_port = 18544
#satoshis_per_byte = 20
first_burn_block_height = 230
first_burn_block_timestamp = 1714513150
first_burn_block_hash = "654e1e9f66701d4f8a138b46d4cf0cc26665688175bcbb1700729efbf759e57d"

# Set your auth token, which the signer uses
# This should match the auth_password field of your signer config
Expand All @@ -123,8 +110,6 @@ auth_token = "12345"
[[events_observer]]
# This endpoint is where your signer will communicate with your Stacks node
endpoint = "127.0.0.1:30000"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]

[[burnchain.epochs]]
Expand All @@ -133,35 +118,35 @@ start_height = 0

[[burnchain.epochs]]
epoch_name = "2.0"
start_height = 230
start_height = 0

[[burnchain.epochs]]
epoch_name = "2.05"
start_height = 240
start_height = 1

[[burnchain.epochs]]
epoch_name = "2.1"
start_height = 240
start_height = 2

[[burnchain.epochs]]
epoch_name = "2.2"
start_height = 241
start_height = 3

[[burnchain.epochs]]
epoch_name = "2.3"
start_height = 242
start_height = 4

[[burnchain.epochs]]
epoch_name = "2.4"
start_height = 243
start_height = 5

[[burnchain.epochs]]
epoch_name = "2.5"
start_height = 244
start_height = 6

[[burnchain.epochs]]
epoch_name = "3.0"
start_height = 2_000_250
start_height = 1000

[[ustx_balance]]
address = "ST0DZFQ1XGHC5P1BZ6B7HSWQKQJHM74JBGCSDTNA"
Expand Down Expand Up @@ -309,9 +294,6 @@ stacker = true
chain = "bitcoin"
mode = "krypton"
peer_host = "bitcoin.regtest.hiro.so"
username = "hirosystems"
password = "hirosystems"
rpc_port = 18443
peer_port = 18444
pox_prepare_length = 100
pox_reward_length = 900
Expand All @@ -325,8 +307,6 @@ auth_token = "12345"
[[events_observer]]
# This endpoint is where your signer will communicate with your Stacks node
endpoint = "127.0.0.1:30000"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]

[[ustx_balance]]
Expand All @@ -347,7 +327,7 @@ amount = 10000000000000000

[fee_estimation]
fee_estimator = "fuzzed_weighted_median_fee_rate"

[[burnchain.epochs]]
epoch_name = "1.0"
start_height = 0
Expand Down Expand Up @@ -382,38 +362,38 @@ start_height = 6

[[burnchain.epochs]]
epoch_name = "3.0"
start_height = 2000701
start_height = 56_457
```

### Mainnet Signer

This config is very similar to the testnet config, except the `network` field is changed.

```toml
# The IP address and port where your Stacks node can be accessed.
# The port 20443 is the default RPC endpoint for Stacks nodes.
# The IP address and port where your Stacks node can be accessed.
# The port 20443 is the default RPC endpoint for Stacks nodes.
# Note that you must use an IP address - DNS hosts are not supported at this time.
# This should be the IP address accessible via Docker, usually via a network.
node_host = "127.0.0.1:20443"

# This is the location where the signer will expose an RPC endpoint for
# This is the location where the signer will expose an RPC endpoint for
# receiving events from your Stacks node.
endpoint = "127.0.0.1:30000"

# Either “testnet” or “mainnet”
network = "mainnet"

# this is a file path where your signer will persist data. If using Docker,
# this is a file path where your signer will persist data. If using Docker,
# this must be within a volume, so that data can be persisted across restarts
db_path = "/var/stacks/signer.sqlite"

# an authentication token that is used for some HTTP requests made from the
# signer to your Stacks node. You’ll need to use this later on when configuring
# your Stacks node. You create this field yourself, rather than it being generated
# an authentication token that is used for some HTTP requests made from the
# signer to your Stacks node. You’ll need to use this later on when configuring
# your Stacks node. You create this field yourself, rather than it being generated
# with your private key.
auth_password = "$your_http_auth_token"

# This is the privateKey field from the keys you generated in the
# This is the privateKey field from the keys you generated in the
# previous step.
stacks_private_key = "$your_stacks_private_key"

Expand All @@ -427,7 +407,7 @@ With a mainnet Stacks node config, you'll need to change the bootstrap node fiel

```toml
[node]
# Set this based on where you downloaded
# Set this based on where you downloaded
# the chain state archive as described in the How to Run a Signer guide:
working_dir = "/data-dir-somewhere"
rpc_bind = "0.0.0.0:20443"
Expand Down Expand Up @@ -455,7 +435,5 @@ auth_token = "12345"
[[events_observer]]
# This endpoint is where your signer will communicate with your Stacks node
endpoint = "127.0.0.1:30000"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
```
1 change: 0 additions & 1 deletion reference/stacks-node-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,5 @@ peer_port = 8333

[[events_observer]]
endpoint = "localhost:3700"
retry_count = 255
events_keys = ["*"]
```

0 comments on commit d18b13e

Please sign in to comment.