{"id":19291791,"url":"https://github.com/hirosystems/gh-action-testing","last_synced_at":"2026-05-16T06:13:07.080Z","repository":{"id":48611358,"uuid":"317986862","full_name":"hirosystems/gh-action-testing","owner":"hirosystems","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-09T13:34:14.000Z","size":73537,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-22T19:50:01.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirosystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-02T20:45:11.000Z","updated_at":"2021-10-29T18:28:15.000Z","dependencies_parsed_at":"2022-09-16T00:20:41.869Z","dependency_job_id":null,"html_url":"https://github.com/hirosystems/gh-action-testing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fgh-action-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fgh-action-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fgh-action-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fgh-action-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirosystems","download_url":"https://codeload.github.com/hirosystems/gh-action-testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240395747,"owners_count":19794572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:27:55.014Z","updated_at":"2026-05-16T06:13:07.049Z","avatar_url":"https://github.com/hirosystems.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stacks 2.0\n\nReference implementation of the [Stacks blockchain](https://github.com/blockstack/stacks) in Rust.\n\nStacks 2.0 is a layer-1 blockchain that connects to Bitcoin for security and enables decentralized apps and predictable smart contracts. Stacks 2.0 implements [Proof of Transfer (PoX)](https://blockstack.org/pox.pdf) mining that anchors to Bitcoin security. Leader election happens at the Bitcoin blockchain and Stacks (STX) miners write new blocks on the separate Stacks blockchain. With PoX there is no need to modify Bitcoin to enable smart contracts and apps around it. See [this page](https://github.com/blockstack/stacks) for more details and resources.\n\n[![CircleCI](https://circleci.com/gh/blockstack/stacks-blockchain/tree/master.svg?style=svg)](https://circleci.com/gh/blockstack/stacks-blockchain/tree/master)\n\n## Repository\n\n| Blockstack Topic/Tech    | Where to learn more more                                                          |\n| ------------------------ | --------------------------------------------------------------------------------- |\n| Stacks 2.0               | [master branch](https://github.com/blockstack/stacks-blockchain/tree/master)      |\n| Stacks 1.0               | [legacy branch](https://github.com/blockstack/stacks-blockchain/tree/stacks-1.0)  |\n| Use the package          | [our core docs](https://docs.blockstack.org/core/naming/introduction.html)        |\n| Develop a Blockstack App | [our developer docs](https://docs.blockstack.org/browser/hello-blockstack.html)   |\n| Use a Blockstack App     | [our browser docs](https://docs.blockstack.org/browser/browser-introduction.html) |\n| Blockstack PBC the company   | [our website](https://blockstack.org)                                             |\n\n\n## Roadmap\n\n- [x] [SIP 001: Burn Election](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-001-burn-election.md)\n- [x] [SIP 002: Clarity, a language for predictable smart contracts](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-002-smart-contract-language.md)\n- [X] [SIP 003: Peer Network](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-003-peer-network.md)\n- [x] [SIP 004: Cryptographic Committment to Materialized Views](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-004-materialized-view.md)\n- [x] [SIP 005: Blocks, Transactions, and Accounts](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md)\n- [ ] SIP 006: Clarity Execution Cost Assessment\n- [x] [SIP 007: Stacking Consensus](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-007-stacking-consensus.md)\n- [ ] SIP 008: Clarity Parsing and Analysis Cost Assessment\n\nStacks improvement proposals (SIPs) are aimed at describing the implementation of the Stacks blockchain, as well as proposing improvements. They should contain concise technical specifications of features or standards and the rationale behind it. SIPs are intended to be the primary medium for proposing new features, for collecting community input on a system-wide issue, and for documenting design decisions.\n\nSee [SIP 000](https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-000-stacks-improvement-proposal-process.md) for more details.\n\n### Testnet versions\n\n- [x] **Helium** is a developer local setup, mono-node, assembling SIP 001, SIP 002, SIP 004 and SIP 005. With this version, developers can not only run Stacks 2.0 on their development machines, but also write, execute, and test smart contracts. See the instructions below for more details.\n\n- [X] **Neon** is the first version of our public testnet, which shipped in Q2 2020. This testnet added SIP 003, and will be an open-membership public network, where participants will be able to validate and participate in mining testnet blocks.\n\n- [X] **Argon** is the second version of our public testnet, which shipped in Q2 2020. This testnet improved on the stability of the Neon testnet.\n\n- [X] **Krypton** is the third version of our public testnet, which incorporates a partial implementation of SIP 007.  It allows developers to test a simple version of Stacking and PoX consensus.\n\n- [ ] **Xenon** is the upcoming version of our public testnet, which will run on the Bitcoin testnet.  It will include SIP 006 and SIP 008, and will contain bugfixes and improvements to the implementation of SIP 007.\n\n- [ ] **Mainnet** is the fully functional version, that is estimated for Q4 2020.\n\nSee the [testnet website](https://testnet.blockstack.org) and [\"when mainnet?\" FAQ](https://github.com/blockstack/stacks/blob/master/whenmainnet.md) for details.\n\n## Getting started\n\n### Download and build stacks-blockchain\n\nThe first step is to ensure that you have Rust and the support software installed.\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n_For building on Windows, follow the rustup installer instructions at https://rustup.rs/_\n\nFrom there, you can clone this repository:\n\n```bash\ngit clone --depth=1 https://github.com/blockstack/stacks-blockchain.git\n\ncd stacks-blockchain\n```\n\nThen build the project:\n\n```bash\ncargo build\n```\n\nRun the tests:\n\n```bash\ncargo test testnet  -- --test-threads=1\n```\n\n### Encode and sign transactions\n\nLet's start by generating a keypair, that will be used for signing the upcoming transactions:\n\n```bash\ncargo run --bin blockstack-cli generate-sk --testnet\n\n# Output\n# {\n#  secretKey: \"b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001\",\n#  publicKey: \"02781d2d3a545afdb7f6013a8241b9e400475397516a0d0f76863c6742210539b5\",\n#  stacksAddress: \"ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH\"\n# }\n```\n\nWe will interact with the following simple contract `kv-store`. In our examples, we will assume this contract is saved to `./kv-store.clar`:\n\n```scheme\n(define-map store { key: (string-ascii 32) } { value: (string-ascii 32) })\n\n(define-public (get-value (key (string-ascii 32)))\n    (match (map-get? store { key: key })\n        entry (ok (get value entry))\n        (err 0)))\n\n(define-public (set-value (key (string-ascii 32)) (value (string-ascii 32)))\n    (begin\n        (map-set store { key: key } { value: value })\n        (ok true)))\n```\n\nWe want to publish this contract on chain, then issue some transactions that interact with it by setting some keys and getting some values, so we can observe read and writes.\n\nOur first step is to generate and sign, using your private key, the transaction that will publish the contract `kv-store`.\nTo do that, we will use the subcommand:\n\n```bash\ncargo run --bin blockstack-cli publish --help\n```\n\nWith the following arguments:\n\n```bash\ncargo run --bin blockstack-cli publish b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001 500 0 kv-store ./kv-store.clar --testnet\n```\n\nThe `500` is the transaction fee, denominated in microSTX.  Right now, the\ntestnet requires one microSTX per byte minimum, and this transaction should be\nless than 500 bytes.\n\nThis command will output the **binary format** of the transaction. In our case, we want to pipe this output and dump it to a file that will be used later in this tutorial.\n\n```bash\ncargo run --bin blockstack-cli publish b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001 500 0 kv-store ./kv-store.clar --testnet | xxd -r -p \u003e tx1.bin\n```\n\n### Run the testnet\n\nYou can observe the state machine in action locally by running:\n\n```bash\ncargo testnet start --config=./testnet/stacks-node/Stacks.toml\n```\n\n`Stacks.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:\n\n```\n[[ustx_balance]]\naddress = \"ST2VHM28V9E5QCRD6C73215KAPSBKQGPWTEE5CMQT\"\namount = 100000000\n```\n\nThe `address` field is the Stacks testnet address, and the `amount` field is the\nnumber of microSTX to grant to it in the genesis block.  The addresses of the\nprivate keys used in the tutorial below are already added.\n\n### Publish your contract\n\nAssuming that the testnet is running, we can publish our `kv-store` contract.\n\nIn another terminal (or file explorer), you can move the `tx1.bin` generated earlier, to the mempool:\n\n```bash\ncurl -X POST -H \"Content-Type: application/octet-stream\" --data-binary @./tx1.bin http://localhost:20443/v2/transactions\n```\n\nIn the terminal window running the testnet, you can observe the state machine's reactions.\n\n### Reading from / Writing to the contract\n\nNow that our contract has been published on chain, let's try to submit some read / write transactions.\nWe will start by trying to read the value associated with the key `foo`.\n\nTo do that, we will use the subcommand:\n\n```bash\ncargo run --bin blockstack-cli contract-call --help\n```\n\nWith the following arguments:\n\n```bash\ncargo run --bin blockstack-cli contract-call b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001 500 1 ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH kv-store get-value -e \\\"foo\\\" --testnet | xxd -r -p \u003e tx2.bin\n```\n\n`contract-call` generates and signs a contract-call transaction.\nNote: the third argument `1` is a nonce, that must be increased monotonically with each new transaction.\n\nWe can submit the transaction by moving it to the mempool path:\n\n```bash\ncurl -X POST -H \"Content-Type: application/octet-stream\" --data-binary @./tx2.bin http://localhost:20443/v2/transactions\n```\n\nSimilarly, we can generate a transaction that would be setting the key `foo` to the value `bar`:\n\n```bash\ncargo run --bin blockstack-cli contract-call b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001 500 2 ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH kv-store set-value -e \\\"foo\\\" -e \\\"bar\\\" --testnet | xxd -r -p \u003e tx3.bin\n```\n\nAnd submit it by moving it to the mempool path:\n\n```bash\ncurl -X POST -H \"Content-Type: application/octet-stream\" --data-binary @./tx3.bin http://localhost:20443/v2/transactions\n```\n\nFinally, we can issue a third transaction, reading the key `foo` again, for ensuring that the previous transaction has successfully updated the state machine:\n\n```bash\ncargo run --bin blockstack-cli contract-call b8d99fd45da58038d630d9855d3ca2466e8e0f89d3894c4724f0efc9ff4b51f001 500 3 ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH kv-store get-value -e \\\"foo\\\" --testnet | xxd -r -p \u003e tx4.bin\n```\n\nAnd submit this last transaction by moving it to the mempool path:\n\n```bash\ncurl -X POST -H \"Content-Type: application/octet-stream\" --data-binary @./tx4.bin http://localhost:20443/v2/transactions\n```\n\nCongratulations, you can now [write your own smart contracts with Clarity](https://docs.blockstack.org/core/smart/overview.html).\n\n## Platform support\n\nOfficially supported platforms: `Linux 64-bit`, `MacOS 64-bit`, `Windows 64-bit`.\n\nPlatforms with second-tier status _(builds are provided but not tested)_: `Linux ARMv7`, `Linux ARM64`.\n\n## Community\n\nBeyond this Github project,\nBlockstack maintains a public [forum](https://forum.blockstack.org) and an\nopened [Discord](https://discord.com/invite/XYdRyhf) channel. In addition, the project\nmaintains a [mailing list](https://blockstack.org/signup) which sends out\ncommunity announcements.\n\nThe greater Blockstack community regularly hosts in-person\n[meetups](https://www.meetup.com/topics/blockstack/). The project's\n[YouTube channel](https://www.youtube.com/channel/UC3J2iHnyt2JtOvtGVf_jpHQ) includes\nvideos from some of these meetups, as well as video tutorials to help new\nusers get started and help developers wrap their heads around the system's\ndesign.\n\nFor help cross-compiling on memory-constrained devices, please see the community supported documentation here: [Cross Compiling](https://github.com/dantrevino/cross-compiling-stacks-blockchain/blob/master/README.md).\n\n## Further Reading\n\nYou can learn more by visiting [the Blockstack Website](https://blockstack.org) and checking out the documentation:\n\n- [Blockstack docs](https://docs.blockstack.org/)\n\nYou can also read the technical papers:\n\n- [\"PoX: Proof of Transfer Mining with Bitcoin\"](https://blockstack.org/pox.pdf), May 2020\n- [\"The Blockstack Decentralized Computing Network\"](https://blockstack.org/whitepaper.pdf), May 2019\n\nIf you have high-level questions about Blockstack, try [searching our forum](https://forum.blockstack.org) and start a new question if your question is not answered there.\n\n## Contributing\n\n### Tests and Coverage\n\nPRs must include test coverage. However, if your PR includes large tests or tests which cannot run in parallel\n(which is the default operation of the `cargo test` command), these tests should be decorated with `#[ignore]`.\nIf you add `#[ignore]` tests, you should add your branch to the filters for the `all_tests` job in our circle.yml\n(or if you are working on net code or marf code, your branch should be named such that it matches the existing\nfilters there).\n\nA test should be marked `#[ignore]` if:\n\n1. It does not _always_ pass `cargo test` in a vanilla environment (i.e., it does not need to run with `--test-threads 1`).\n2. Or, it runs for over a minute via a normal `cargo test` execution (the `cargo test` command will warn if this is not the case).\n\n### Formatting\n\nThis repository uses the default rustfmt formatting style. PRs will be checked against `rustfmt` and will _fail_ if not\nproperly formatted.\n\nYou can check the formatting locally via:\n\n```bash\ncargo fmt --all -- --check\n```\n\nYou can automatically reformat your commit via:\n\n```bash\ncargo fmt --all\n```\n\n## Copyright and License\n\nThe code and documentation copyright are attributed to blockstack.org for the year of 2020.\n\nThis code is released under [the GPL v3 license](https://www.gnu.org/licenses/quick-guide-gplv3.en.html), and the docs are released under [the Creative Commons license](https://creativecommons.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fgh-action-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirosystems%2Fgh-action-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fgh-action-testing/lists"}