Skip to content

Commit 38e7eab

Browse files
authored
Merge pull request #5594 from stacks-network/chore/standardized_sample_dir
Chore/standardized sample dir
2 parents c2f5f59 + ebd892e commit 38e7eab

27 files changed

+78
-44
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ cargo nextest run
8282
You can observe the state machine in action locally by running:
8383

8484
```bash
85-
cd testnet/stacks-node
86-
cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
85+
cargo run --bin stacks-node -- start --config ./sample/conf/testnet-follower-conf.toml
8786
```
8887

8988
_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._

clarity/src/vm/docs/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ You _may not_ use this function to call a public function defined in the current
13991399
function returns _err_, any database changes resulting from calling `contract-call?` are aborted.
14001400
If the function returns _ok_, database changes occurred.",
14011401
example: "
1402-
;; instantiate the sample-contracts/tokens.clar contract first!
1402+
;; instantiate the sample/contracts/tokens.clar contract first!
14031403
(as-contract (contract-call? .tokens mint! u19)) ;; Returns (ok u19)"
14041404
};
14051405

@@ -3131,7 +3131,7 @@ mod test {
31313131
fn test_examples() {
31323132
// Execute test examples against the latest version of Clarity
31333133
let apis = make_all_api_reference();
3134-
let token_contract_content = include_str!("../../../../sample-contracts/tokens.clar");
3134+
let token_contract_content = include_str!("../../../../sample/contracts/tokens.clar");
31353135
for func_api in apis.functions.iter() {
31363136
if func_api.name == "at-block" {
31373137
eprintln!("Skipping at-block, because it cannot be evaluated without a MARF");
@@ -3174,7 +3174,7 @@ mod test {
31743174
&StacksEpochId::latest(),
31753175
&ClarityVersion::latest(),
31763176
)
3177-
.expect("Failed to type check sample-contracts/tokens");
3177+
.expect("Failed to type check sample/contracts/tokens");
31783178
}
31793179

31803180
{
@@ -3197,7 +3197,7 @@ mod test {
31973197
&StacksEpochId::latest(),
31983198
&ClarityVersion::latest(),
31993199
)
3200-
.expect("Failed to type check sample-contracts/tokens");
3200+
.expect("Failed to type check sample/contracts/tokens");
32013201
}
32023202

32033203
let conn = store.as_docs_clarity_db();

contrib/helm/stacks-blockchain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following tables lists the configurable parameters of the stacks-blockchain
8686
| node.volumeMounts | Additional volumeMounts for the node | [] |
8787
| node.extraContainers | Additional containers to run alongside the node. Useful if adding a sidecar | [] |
8888
| node.initContainers | Containers which are run before the node container is started | [] |
89-
| 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). | |
89+
| 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). | |
9090
| config.node.rpc_bind | | 0.0.0.0:20443 |
9191
| config.node.p2p_bind | | 0.0.0.0:20444 |
9292
| config.node.seed | Replace with your private key if deploying a miner node | nil |

contrib/helm/stacks-blockchain/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ node:
212212
##
213213
## For more info, please reference our docs and example config files:
214214
## https://docs.stacks.co/docs/nodes-and-miners/run-a-node
215-
## https://github.com/blockstack/stacks-blockchain/tree/master/testnet/stacks-node/conf
215+
## https://github.com/blockstack/stacks-blockchain/tree/master/sample/conf
216216
##
217217
config:
218218
# More configs can be added than what's shown below.

docs/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The MacOS configuration assumes stacks-blockchain will be set up for the current
1414

1515
## Configuration
1616

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

2020
## Paths

docs/mining.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stacks Mining
22

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

66
```toml
77
[node]

docs/profiling.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ Note that all bash commands in this document are run from the [stacks-core repos
1616
Validating the config file using `stacks-node check-config`:
1717

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

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

2727
```
28-
$ STACKS_LOG_DEBUG=1 cargo run -r -p stacks-node --bin stacks-node check-config --config testnet/stacks-node/conf/mainnet-mockminer-conf.toml
28+
$ STACKS_LOG_DEBUG=1 cargo run -r -p stacks-node --bin stacks-node check-config --config ./sample/conf/mainnet-follower-conf.toml
2929
INFO [1661276562.220137] [testnet/stacks-node/src/main.rs:82] [main] stacks-node 0.1.0 (tip-mine:c90476aa8a+, release build, macos [aarch64])
30-
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path testnet/stacks-node/conf/mainnet-mockminer-conf.toml
30+
INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path ./sample/conf/mainnet-follower-conf.toml
3131
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 }
3232
INFO [1661276562.233071] [testnet/stacks-node/src/main.rs:128] [main] Valid config!
3333
```
3434

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

3737
```
38-
$ 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
38+
$ 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
3939
{"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"}
40-
{"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"}
40+
{"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"}
4141
{"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"}
4242
```
4343

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

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

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

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

6767
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.
6868

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

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

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

103103
You should see output from `stacks-events` in `events.logs` similar to:

docs/testnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stacks testnet
22

3-
[`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:
3+
[`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:
44

55
```
66
[[ustx_balance]]
@@ -27,7 +27,7 @@ cargo run --bin blockstack-cli generate-sk --testnet
2727
# }
2828
```
2929

30-
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.
30+
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.
3131

3232
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`:
3333

0 commit comments

Comments
 (0)