Skip to content

Commit

Permalink
Update code/markdown referencing the prior contract/conf location
Browse files Browse the repository at this point in the history
  • Loading branch information
wileyj committed Dec 18, 2024
1 parent ccf38cf commit f8c1962
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 41 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ cargo nextest run
You can observe the state machine in action locally by running:

```bash
cd testnet/stacks-node
cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
cargo run --bin stacks-node -- start --config ./sample/conf/testnet-follower-conf.toml
```

_On Windows, many tests will fail if the line endings aren't `LF`. Please ensure that you have git's `core.autocrlf` set to `input` when you clone the repository to avoid any potential issues. This is due to the Clarity language currently being sensitive to line endings._
Expand Down
8 changes: 4 additions & 4 deletions clarity/src/vm/docs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ You _may not_ use this function to call a public function defined in the current
function returns _err_, any database changes resulting from calling `contract-call?` are aborted.
If the function returns _ok_, database changes occurred.",
example: "
;; instantiate the sample-contracts/tokens.clar contract first!
;; instantiate the sample/contracts/tokens.clar contract first!
(as-contract (contract-call? .tokens mint! u19)) ;; Returns (ok u19)"
};

Expand Down Expand Up @@ -3135,7 +3135,7 @@ mod test {
fn test_examples() {
// Execute test examples against the latest version of Clarity
let apis = make_all_api_reference();
let token_contract_content = include_str!("../../../../sample-contracts/tokens.clar");
let token_contract_content = include_str!("../../../../sample/contracts/tokens.clar");
for func_api in apis.functions.iter() {
if func_api.name == "at-block" {
eprintln!("Skipping at-block, because it cannot be evaluated without a MARF");
Expand Down Expand Up @@ -3178,7 +3178,7 @@ mod test {
&StacksEpochId::latest(),
&ClarityVersion::latest(),
)
.expect("Failed to type check sample-contracts/tokens");
.expect("Failed to type check sample/contracts/tokens");
}

{
Expand All @@ -3201,7 +3201,7 @@ mod test {
&StacksEpochId::latest(),
&ClarityVersion::latest(),
)
.expect("Failed to type check sample-contracts/tokens");
.expect("Failed to type check sample/contracts/tokens");
}

let conn = store.as_docs_clarity_db();
Expand Down
2 changes: 1 addition & 1 deletion contrib/helm/stacks-blockchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The following tables lists the configurable parameters of the stacks-blockchain
| node.volumeMounts | Additional volumeMounts for the node | [] |
| node.extraContainers | Additional containers to run alongside the node. Useful if adding a sidecar | [] |
| node.initContainers | Containers which are run before the node container is started | [] |
| config | More configs can be added than what's shown below.All children fields under the node, burnchain, and ustx_balance fields will be converted from YAML to valid TOML format in the Configmap.<br><br>For info on more available config fields, please reference to our [example config files located here](https://github.com/blockstack/stacks-blockchain/tree/master/testnet/stacks-node/conf). | |
| config | More configs can be added than what's shown below.All children fields under the node, burnchain, and ustx_balance fields will be converted from YAML to valid TOML format in the Configmap.<br><br>For info on more available config fields, please reference to our [example config files located here](https://github.com/blockstack/stacks-blockchain/tree/master/sample/conf). | |
| config.node.rpc_bind | | 0.0.0.0:20443 |
| config.node.p2p_bind | | 0.0.0.0:20444 |
| config.node.seed | Replace with your private key if deploying a miner node | nil |
Expand Down
2 changes: 1 addition & 1 deletion contrib/helm/stacks-blockchain/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ node:
##
## For more info, please reference our docs and example config files:
## https://docs.stacks.co/docs/nodes-and-miners/run-a-node
## https://github.com/blockstack/stacks-blockchain/tree/master/testnet/stacks-node/conf
## https://github.com/blockstack/stacks-blockchain/tree/master/sample/conf
##
config:
# More configs can be added than what's shown below.
Expand Down
2 changes: 1 addition & 1 deletion docs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The MacOS configuration assumes stacks-blockchain will be set up for the current

## Configuration

For an example configuration file that describes the configuration settings, see [mainnet-follower-conf.toml](../testnet/stacks-node/conf/mainnet-follower-conf.toml).
For an example configuration file that describes the configuration settings, see [mainnet-follower-conf.toml](../sample/conf/mainnet-follower-conf.toml).
Available configuration options are [documented here](https://docs.stacks.co/stacks-in-depth/nodes-and-miners/stacks-node-configuration).

## Paths
Expand Down
2 changes: 1 addition & 1 deletion docs/mining.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stacks Mining

Stacks tokens (STX) are mined by transferring BTC via PoX. To run as a miner,
you should make sure to add the following config fields to your [config file](../testnet/stacks-node/conf/mainnet-miner-conf.toml):
you should make sure to add the following config fields to your [config file](../sample/conf/mainnet-miner-conf.toml):

```toml
[node]
Expand Down
22 changes: 11 additions & 11 deletions docs/profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ Note that all bash commands in this document are run from the [stacks-core repos
Validating the config file using `stacks-node check-config`:

```
$ cargo run -r -p stacks-node --bin stacks-node check-config --config testnet/stacks-node/conf/mainnet-mockminer-conf.toml
$ cargo run -r -p stacks-node --bin stacks-node check-config --config ./sample/conf/mainnet-follower-conf.toml
INFO [1661276562.220137] [testnet/stacks-node/src/main.rs:82] [main] stacks-node 0.1.0 (:, release build, linux [x86_64])
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path testnet/stacks-node/conf/mainnet-mockminer-conf.toml
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path ./sample/conf/mainnet-follower-conf.toml
INFO [1661276562.233071] [testnet/stacks-node/src/main.rs:128] [main] Valid config!
```

Enabling debug logging using environment variable `STACKS_LOG_DEBUG=1`:

```
$ STACKS_LOG_DEBUG=1 cargo run -r -p stacks-node --bin stacks-node check-config --config testnet/stacks-node/conf/mainnet-mockminer-conf.toml
$ STACKS_LOG_DEBUG=1 cargo run -r -p stacks-node --bin stacks-node check-config --config ./sample/conf/mainnet-follower-conf.toml
INFO [1661276562.220137] [testnet/stacks-node/src/main.rs:82] [main] stacks-node 0.1.0 (tip-mine:c90476aa8a+, release build, macos [aarch64])
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path testnet/stacks-node/conf/mainnet-mockminer-conf.toml
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path ./sample/conf/mainnet-follower-conf.toml
DEBG [1661276562.222450] [testnet/stacks-node/src/main.rs:118] [main] Loaded config file: ConfigFile { burnchain: Some(BurnchainConfigFile { chain: Some("bitcoin"), burn_fee_cap: Some(1), mode: Some("mainnet"), commit_anchor_block_within: None, peer_host: Some("localhost"), peer_port: Some(8333), rpc_port: Some(8332), rpc_ssl: None, username: Some("btcuser"), password: Some("btcpass"), timeout: None, magic_bytes: None, local_mining_public_key: None, process_exit_at_block_height: None, poll_time_secs: None, satoshis_per_byte: None, leader_key_tx_estimated_size: None, block_commit_tx_estimated_size: None, rbf_fee_increment: None, max_rbf: None, epochs: None }), node: Some(NodeConfigFile { name: None, seed: None, deny_nodes: None, working_dir: Some("/Users/igor/w/stacks-work/working_dir"), rpc_bind: Some("0.0.0.0:20443"), p2p_bind: Some("0.0.0.0:20444"), p2p_address: None, data_url: None, bootstrap_node: Some("02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444"), local_peer_seed: None, miner: Some(true), mock_mining: Some(true), mine_microblocks: None, microblock_frequency: None, max_microblocks: None, wait_time_for_microblocks: None, prometheus_bind: None, marf_cache_strategy: None, marf_defer_hashing: None, pox_sync_sample_secs: None, use_test_genesis_chainstate: None }), ustx_balance: None, events_observer: Some([EventObserverConfigFile { endpoint: "localhost:3700", events_keys: ["*"] }]), connection_options: None, fee_estimation: None, miner: None }
INFO [1661276562.233071] [testnet/stacks-node/src/main.rs:128] [main] Valid config!
```

Enabling json logging using environment variable `STACKS_LOG_JSON=1` and feature flag `slog_json`:

```
$ STACKS_LOG_JSON=1 cargo run -F slog_json -r -p stacks-node --bin stacks-node check-config --config testnet/stacks-node/conf/mainnet-mockminer-conf.toml
$ STACKS_LOG_JSON=1 cargo run -F slog_json -r -p stacks-node --bin stacks-node check-config --config ./sample/conf/mainnet-follower-conf.toml
{"msg":"stacks-node 0.1.0 (tip-mine:c90476aa8a+, release build, macos [aarch64])","level":"INFO","ts":"2022-08-23T12:44:28.072462-05:00","thread":"main","line":82,"file":"testnet/stacks-node/src/main.rs"}
{"msg":"Loading config at path testnet/stacks-node/conf/mainnet-mockminer-conf.toml","level":"INFO","ts":"2022-08-23T12:44:28.074238-05:00","thread":"main","line":115,"file":"testnet/stacks-node/src/main.rs"}
{"msg":"Loading config at path ./sample/conf/mainnet-follower-conf.toml","level":"INFO","ts":"2022-08-23T12:44:28.074238-05:00","thread":"main","line":115,"file":"testnet/stacks-node/src/main.rs"}
{"msg":"Valid config!","level":"INFO","ts":"2022-08-23T12:44:28.089960-05:00","thread":"main","line":128,"file":"testnet/stacks-node/src/main.rs"}
```

Expand All @@ -56,18 +56,18 @@ $ export STACKS_SNAPSHOT_DIR=$STACKS_DIR/snapshot
Download and extract an archived snapshot of mainnet working directory, provided by Hiro.

```
$ wget -P $STACKS_DIR https://storage.googleapis.com/blockstack-publish/archiver-main/follower/mainnet-follower-latest.tar.gz
$ tar xzvf $STACKS_DIR/mainnet-follower-latest.tar.gz -C $STACKS_DIR
$ wget -P $STACKS_DIR https://archive.hiro.so/mainnet/stacks-blockchain/mainnet-stacks-blockchain-latest.tar.gz
$ tar xzvf $STACKS_DIR/mainnet-stacks-blockchain-latest.tar.gz -C $STACKS_DIR
```

We'll be using the `stacks-node` config file available at:

`testnet/stacks-node/conf/mocknet-miner-conf.toml`
`sample/conf/mainnet-mockminer-conf.toml`

Note that, for convenience, the `stacks-node` binary uses the environment variable `$STACKS_WORKING_DIR` to override the working directory location in the config file.

```
$ cargo run -r -p stacks-node --bin stacks-node start --config testnet/stacks-node/conf/mocknet-miner-conf.toml
$ cargo run -r -p stacks-node --bin stacks-node start --config ./sample/conf/mainnet-mockminer-conf.toml
```

The `stacks-node` process will receive blocks starting from the latest block available in the Hiro archive.
Expand Down Expand Up @@ -97,7 +97,7 @@ $ cargo run -r -p stacks-node --bin stacks-events | tee $STACKS_DIR/events.log
Run `stacks-node` with an event observer:

```
$ STACKS_EVENT_OBSERVER=localhost:3700 cargo run -r -p stacks-node --bin stacks-node start --config testnet/stacks-node/conf/mocknet-miner-conf.toml
$ STACKS_EVENT_OBSERVER=localhost:3700 cargo run -r -p stacks-node --bin stacks-node start --config ./sample/conf/mainnet-mockminer-conf.toml
```

You should see output from `stacks-events` in `events.logs` similar to:
Expand Down
4 changes: 2 additions & 2 deletions docs/testnet.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stacks testnet

[`testnet-follower-conf.toml`](../testnet/stacks-node/conf/testnet-follower-conf.toml) is a configuration file that you can use for setting genesis balances or configuring event observers. You can grant an address an initial account balance by adding the following entries:
[`testnet-follower-conf.toml`](../sample/conf/testnet-follower-conf.toml) is a configuration file that you can use for setting genesis balances or configuring event observers. You can grant an address an initial account balance by adding the following entries:

```
[[ustx_balance]]
Expand All @@ -27,7 +27,7 @@ cargo run --bin blockstack-cli generate-sk --testnet
# }
```

This keypair is already registered in the [`testnet-follower-conf.toml`](../testnet/stacks-node/conf/testnet-follower-conf.toml) file, so it can be used as presented here.
This keypair is already registered in the [`testnet-follower-conf.toml`](../sample/conf/testnet-follower-conf.toml) file, so it can be used as presented here.

We will interact with the following simple contract `kv-store`. In our examples, we will assume this contract is saved locally to `./kv-store.clar`:

Expand Down
4 changes: 2 additions & 2 deletions stackslib/src/blockstack_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ mod test {
"1",
"0",
"foo-contract",
"../sample-contracts/tokens.clar",
"../sample/contracts/tokens.clar",
];

assert!(main_handler(to_string_vec(&publish_args)).is_ok());
Expand All @@ -928,7 +928,7 @@ mod test {
"1",
"0",
"foo-contract",
"../sample-contracts/non-existent-tokens.clar",
"../sample/contracts/non-existent-tokens.clar",
];

assert!(format!(
Expand Down
28 changes: 14 additions & 14 deletions stackslib/src/clarity_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ mod test {
"test",
&[
"check".to_string(),
"../sample-contracts/tokens.clar".to_string(),
"../sample/contracts/tokens.clar".to_string(),
],
);

Expand All @@ -2061,7 +2061,7 @@ mod test {
"test",
&[
"check".to_string(),
"../sample-contracts/tokens.clar".to_string(),
"../sample/contracts/tokens.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2078,7 +2078,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"../sample-contracts/tokens.clar".to_string(),
"../sample/contracts/tokens.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2094,7 +2094,7 @@ mod test {
"test",
&[
"check".to_string(),
"../sample-contracts/names.clar".to_string(),
"../sample/contracts/names.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2110,7 +2110,7 @@ mod test {
"test",
&[
"check".to_string(),
"../sample-contracts/names.clar".to_string(),
"../sample/contracts/names.clar".to_string(),
db_name.clone(),
"--contract_id".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
Expand All @@ -2129,7 +2129,7 @@ mod test {
&[
"check".to_string(),
"--output_analysis".to_string(),
"../sample-contracts/names.clar".to_string(),
"../sample/contracts/names.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2147,7 +2147,7 @@ mod test {
&[
"check".to_string(),
"--costs".to_string(),
"../sample-contracts/names.clar".to_string(),
"../sample/contracts/names.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2166,7 +2166,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.names".to_string(),
"../sample-contracts/names.clar".to_string(),
"../sample/contracts/names.clar".to_string(),
"--costs".to_string(),
"--assets".to_string(),
db_name.clone(),
Expand Down Expand Up @@ -2208,7 +2208,7 @@ mod test {
&[
"eval".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
"../sample/contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
Expand Down Expand Up @@ -2236,7 +2236,7 @@ mod test {
"eval".to_string(),
"--costs".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
"../sample/contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
Expand Down Expand Up @@ -2264,7 +2264,7 @@ mod test {
&[
"eval_at_chaintip".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
"../sample/contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
Expand All @@ -2291,7 +2291,7 @@ mod test {
&[
"eval_at_chaintip".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
"../sample/contracts/tokens-mint.clar".to_string(),
db_name.clone(),
"--costs".to_string(),
],
Expand Down Expand Up @@ -2327,7 +2327,7 @@ mod test {
"test",
&[
"check".to_string(),
"../sample-contracts/tokens-ft.clar".to_string(),
"../sample/contracts/tokens-ft.clar".to_string(),
],
);

Expand All @@ -2343,7 +2343,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft".to_string(),
"../sample-contracts/tokens-ft.clar".to_string(),
"../sample/contracts/tokens-ft.clar".to_string(),
db_name.clone(),
"--assets".to_string(),
],
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ check if the associated microblocks can be downloaded
let old_sortition_db =
SortitionDB::open(old_sort_path, true, PoxConstants::mainnet_default()).unwrap();

// initial argon balances -- see testnet/stacks-node/conf/testnet-follower-conf.toml
// initial argon balances -- see sample/conf/testnet-follower-conf.toml
let initial_balances = vec![
(
StacksAddress::from_string("ST2QKZ4FKHAH1NQKYKYAYZPY440FEPK7GZ1R5HBP2")
Expand Down
2 changes: 1 addition & 1 deletion testnet/stacks-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ testnet\t\tStart a node that will join and stream blocks from the public testnet
start\t\tStart a node with a config of your own. Can be used for joining a network, starting new chain, etc.
\t\tArguments:
\t\t --config: path of the config (such as https://github.com/blockstack/stacks-blockchain/blob/master/testnet/stacks-node/conf/testnet-follower-conf.toml).
\t\t --config: path of the config (such as https://github.com/blockstack/stacks-blockchain/blob/master/sample/conf/testnet-follower-conf.toml).
\t\tExample:
\t\t stacks-node start --config /path/to/config.toml
Expand Down

0 comments on commit f8c1962

Please sign in to comment.