Skip to content

Commit

Permalink
Merge branch 'main' into feat/demo-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cylewitruk committed Oct 10, 2024
2 parents 606ab2e + 2059739 commit e9a7541
Show file tree
Hide file tree
Showing 85 changed files with 3,230 additions and 1,708 deletions.
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ RUN cargo install --locked cargo-lambda

RUN wget -qO- https://get.pnpm.io/install.sh | bash -

RUN mkdir -p /tmp/smithy-install/smithy
RUN curl -L https://github.com/smithy-lang/smithy/releases/download/1.49.0/smithy-cli-linux-aarch64.zip -o /tmp/smithy-install/smithy-cli-linux-aarch64.zip
RUN unzip -qo /tmp/smithy-install/smithy-cli-linux-aarch64.zip -d /tmp/smithy-install
RUN mv /tmp/smithy-install/smithy-cli-linux-aarch64/* /tmp/smithy-install/smithy
RUN /tmp/smithy-install/smithy/install
RUN rm -rf /tmp/smithy-install

RUN mkdir -p /tmp/node-install
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o /tmp/node-install/nodesource_setup.sh
RUN bash /tmp/node-install/nodesource_setup.sh
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ devenv: $(wildcard $(subst dir, devenv, $(TWO_DIRS_DEEP)))
EMILY_CDK_SOURCE_FILES := $(wildcard $(subst dir, emily/cdk/lib, $(FIVE_DIRS_DEEP)))
EMILY_CDK_SOURCE_FILES := $(wildcard $(subst dir, emily/bin/lib, $(FIVE_DIRS_DEEP))) $(EMILY_CDK_SOURCE_FILES)

$(EMILY_CDK_TEMPLATE): $(INSTALL_TARGET) $(EMILY_OPENAPI_SPEC) $(EMILY_CDK_SOURCE_FILES)
$(EMILY_CDK_TEMPLATE): $(INSTALL_TARGET) $(EMILY_CDK_SOURCE_FILES)
AWS_STAGE=local \
TABLES_ONLY=true \
pnpm --filter $(EMILY_CDK_PROJECT_NAME) run synth
Expand Down Expand Up @@ -234,5 +234,5 @@ run-signer:
POSTGRES_PORT=$$(docker port sbtc-postgres 5432 | awk -F: '{print $$2}'); \
done; \
echo $$POSTGRES_PORT; \
RUST_LOG=info SIGNER_SIGNER__DB_ENDPOINT="postgres://postgres:postgres@localhost:$$POSTGRES_PORT/signer" cargo run --bin signer -- -c ./signer/src/config/default.toml --migrate-db
RUST_LOG=info SIGNER_SIGNER__DB_ENDPOINT="postgres://devenv:devenv@localhost:$$POSTGRES_PORT/signer" cargo run --bin signer -- -c ./signer/src/config/default.toml --migrate-db

13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ The following are the developer tools that you should install on your local mach
- **[Cargo](https://doc.rust-lang.org/cargo/)** - [Installation Guide](https://doc.rust-lang.org/cargo/getting-started/installation.html) - Builds rust packages.
- **[Cargo-lambda](https://www.cargo-lambda.info/)** - [Installation Guide](https://www.cargo-lambda.info/guide/getting-started.html) - Compile the package for AWS Lambda.
- **[pnpm](https://pnpm.io)** - [Installation guide](https://pnpm.io/installation) - Manages node packages
- **[Smithy](https://smithy.io/2.0/index.html)** - [Installation Guide](https://smithy.io/2.0/guides/smithy-cli/cli_installation.html) - Generates OpenAPI templates
- **[Make](https://www.gnu.org/software/make/)** - Development task runner; natively present on nearly every system.
- **[Docker](https://docs.docker.com/manuals/)** - [Installation Guide](https://docs.docker.com/desktop/). This is used for running integration tests.
- **[protoc](https://github.com/protocolbuffers/protobuf)** - [Installation Guide](https://grpc.io/docs/protoc-installation/). Compiles protobuf files.

#### Developer shell through `nix`

If you have `nix` and `flakes` installed (e.g. through the [DeterminateSystems
installer](https://github.com/DeterminateSystems/nix-installer)), running the
following command will enter a shell with all dependencies installed:

```bash
$ nix develop
```

#### Tool Versions

This command should check the version of the dependencies required for the sBTC
Expand All @@ -49,7 +58,6 @@ echo "\n--- sBTC tool versions ---" \
&& cargo --version \
&& cargo lambda --version \
&& echo "pnpm $(pnpm --version)" \
&& echo "smithy $(smithy --version)" \
&& make --version | head -n 1
```

Expand All @@ -60,7 +68,6 @@ Below is the output on a machine that is able to build and run all the sources a
cargo 1.77.2 (e52e36006 2024-03-26)
cargo-lambda 1.2.1 (12f9b61 2024-04-05Z)
pnpm 8.15.4
smithy 1.47.0
GNU Make 3.81
```

Expand Down
10 changes: 5 additions & 5 deletions contracts/deployments/default.devnet-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ plan:
transactions:
- contract-publish:
contract-name: sbtc-registry
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 76600
path: contracts/sbtc-registry.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-bootstrap-signers
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 52280
path: contracts/sbtc-bootstrap-signers.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-token
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 42090
path: contracts/sbtc-token.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-deposit
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 35540
path: contracts/sbtc-deposit.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-withdrawal
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 84750
path: contracts/sbtc-withdrawal.clar
anchor-block-only: true
Expand Down
10 changes: 5 additions & 5 deletions contracts/deployments/default.devnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ plan:
transactions:
- contract-publish:
contract-name: sbtc-registry
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 76600
path: contracts/sbtc-registry.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-bootstrap-signers
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 52280
path: contracts/sbtc-bootstrap-signers.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-token
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 42090
path: contracts/sbtc-token.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-deposit
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 35540
path: contracts/sbtc-deposit.clar
anchor-block-only: true
clarity-version: 2
- contract-publish:
contract-name: sbtc-withdrawal
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
expected-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
cost: 84750
path: contracts/sbtc-withdrawal.clar
anchor-block-only: true
Expand Down
33 changes: 9 additions & 24 deletions contracts/deployments/default.simnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,19 @@ network: simnet
genesis:
wallets:
- name: deployer
address: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
address: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
balance: "100000000000000"
- name: faucet
address: STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6
balance: "100000000000000"
- name: wallet_1
address: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
address: ST1YEHRRYJ4GF9CYBFFN0ZVCXX1APSBEEQ5KEDN7M
balance: "100000000000000"
- name: wallet_2
address: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
address: ST1WNJTS9JM1JYGK758B10DBAMBZ0K23ADP392SBV
balance: "100000000000000"
- name: wallet_3
address: ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
balance: "100000000000000"
- name: wallet_4
address: ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND
balance: "100000000000000"
- name: wallet_5
address: ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB
balance: "100000000000000"
- name: wallet_6
address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
balance: "100000000000000"
- name: wallet_7
address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
balance: "100000000000000"
- name: wallet_8
address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
address: ST1MDWBDVDGAANEH9001HGXQA6XRNK7PX7A7X8M6R
balance: "100000000000000"
contracts:
- costs
Expand All @@ -51,27 +36,27 @@ plan:
transactions:
- emulated-contract-publish:
contract-name: sbtc-registry
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
emulated-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
path: contracts/sbtc-registry.clar
clarity-version: 2
- emulated-contract-publish:
contract-name: sbtc-bootstrap-signers
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
emulated-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
path: contracts/sbtc-bootstrap-signers.clar
clarity-version: 2
- emulated-contract-publish:
contract-name: sbtc-token
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
emulated-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
path: contracts/sbtc-token.clar
clarity-version: 2
- emulated-contract-publish:
contract-name: sbtc-deposit
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
emulated-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
path: contracts/sbtc-deposit.clar
clarity-version: 2
- emulated-contract-publish:
contract-name: sbtc-withdrawal
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
emulated-sender: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
path: contracts/sbtc-withdrawal.clar
clarity-version: 2
epoch: "2.5"
97 changes: 49 additions & 48 deletions contracts/settings/Devnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,69 @@
name = "devnet"
deployment_fee_rate = 10



# ==============================================================================
# SBTC ACCOUNTS
# ==============================================================================

# The deployer account is used to deploy sBTC contracts
[accounts.deployer]
mnemonic = "twice kind fence tip hidden tilt action fragile skin nothing glory cousin green tomorrow spring wrist shed math olympic multiply hip blue scout claw"
mnemonic = "keep can record bracket note hip face pudding castle detail few sunset review burger enhance foil lamp estate reopen butter then wasp pen kick"
balance = 100_000_000_000_000
# secret_key: 753b7cc01a1a2e86221266a154af739463fce51219d97e4f856cd7200c3bd2a601
# stx_address: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
# btc_address: mqVnk6NPRdhntvfm4hh9vvjiRkFDUuSYsH
# ‣ Private Key: 27e27a9c242bcf79784bb8b19c8d875e23aaf65c132d54a47c84e1a5a67bc62601
# ‣ Public Key: 025fa7693cfe4b7c7beccdd9e4bfe77f77a3779d5a58faeb69ead7d1ba94d64f76
# ‣ STX Address: ST2SBXRBJJTH7GV5J93HJ62W2NRRQ46XYBK92Y039
# ‣ BTC Address: mwp5EpXXVsZxzQRC7yrDe1CJBsyub9f91n
# ‣ WIF: cNvERZ1Ci4NQydr5dTuW8K2JuoyfjLJgYVskrLzBoXREnRVbS9qx



# ==============================================================================
# TRANSACTION GENERATOR ACCOUNTS
# ------------------------------------------------------------------------------
# These accounts are used to generate random transactions to simulate regular
# usage of the network (and to push the network along). These accounts are also
# participating in solo-stacking.
# ==============================================================================

# Test account 'alice'
[accounts.wallet_1]
mnemonic = "sell invite acquire kitten bamboo drastic jelly vivid peace spawn twice guilt pave pen trash pretty park cube fragile unaware remain midnight betray rebuild"
mnemonic = "sorry door captain volume century wood soap asset scheme idea alley mammal effort shoulder gravity car pistol reform aisle gadget gown future lawsuit tone"
balance = 100_000_000_000_000
# secret_key: 7287ba251d44a4d3fd9276c88ce34c5c52a038955511cccaf77e61068649c17801
# stx_address: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
# btc_address: mr1iPkD9N3RJZZxXRk7xF9d36gffa6exNC
# ‣ Private Key: e26e611fc92fe535c5e2e58a6a446375bb5e3b471440af21bbe327384befb50a01
# ‣ Public Key: 03fb84a4a2931e7d0ec36bf6e695233bec878fd545bad580751cf4a49d78a7bb27
# ‣ STX Address: ST1YEHRRYJ4GF9CYBFFN0ZVCXX1APSBEEQ5KEDN7M
# ‣ BTC Address: mruR58H7NvUgmDydv1BM8zMT8og6QxN1Rx
# ‣ WIF: cVArVw9FJPeygtZhRtHJEhDqEQTeC3Ybw3UjXt1ir6RgMkMj1Mcz

# Test account 'bob'
[accounts.wallet_2]
mnemonic = "hold excess usual excess ring elephant install account glad dry fragile donkey gaze humble truck breeze nation gasp vacuum limb head keep delay hospital"
mnemonic = "album bid grant because narrow unusual unknown machine quick core dolphin occur repair decade toilet betray word people mule assume gesture faint trend about"
balance = 100_000_000_000_000
# secret_key: 530d9f61984c888536871c6573073bdfc0058896dc1adfe9a6a10dfacadc209101
# stx_address: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
# btc_address: muYdXKmX9bByAueDe6KFfHd5Ff1gdN9ErG
# ‣ Private Key: e3ebd73a51da9a2ab0c6679145420876bf4338554a8972e3ab200cef7adbec6001
# ‣ Public Key: 03e5049566e351debe8c4d9918faafac751fdcc0e80d3db59069b45761b39015f5
# ‣ STX Address: ST1WNJTS9JM1JYGK758B10DBAMBZ0K23ADP392SBV
# ‣ BTC Address: mrabBBLKnSZq8fziECh4TsNwVbmdGv6JDV
# ‣ WIF: cVDkVrPTBEVa9fFGwFQT4zKi9dXFUJqLym3Ct6MJTepT6Wh5413g

# Test account 'charlie'
[accounts.wallet_3]
mnemonic = "cycle puppy glare enroll cost improve round trend wrist mushroom scorpion tower claim oppose clever elephant dinosaur eight problem before frozen dune wagon high"
mnemonic = "action still web blush proud cat axis barrel tower assault cram catch more soup auction require again valley letter calm license release fruit industry"
balance = 100_000_000_000_000
# secret_key: d655b2523bcd65e34889725c73064feb17ceb796831c0e111ba1a552b0f31b3901
# stx_address: ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
# btc_address: mvZtbibDAAA3WLpY7zXXFqRa3T4XSknBX7
# ‣ Private Key: 0bfff38daea4561a4343c9b3f29bfb06e32a988868fc68beed31a6c0f6de4cf701
# ‣ Public Key: 03a89261c20768ce41930371cd4c0d756c872e96b8ff749ac044199cc7100ccd71
# ‣ STX Address: ST1MDWBDVDGAANEH9001HGXQA6XRNK7PX7A7X8M6R
# ‣ BTC Address: mq5SjFHAPh93ZnFLc6Jev8yqn2iLg28Q5B
# ‣ WIF: cMz2ZSsaVgWPFUkE44zHpJepB4NdwB9L938h53hQfFoot81AZFb3

[accounts.wallet_4]
mnemonic = "board list obtain sugar hour worth raven scout denial thunder horse logic fury scorpion fold genuine phrase wealth news aim below celery when cabin"
balance = 100_000_000_000_000
# secret_key: f9d7206a47f14d2870c163ebab4bf3e70d18f5d14ce1031f3902fbbc894fe4c701
# stx_address: ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND
# btc_address: mg1C76bNTutiCDV3t9nWhZs3Dc8LzUufj8

[accounts.wallet_5]
mnemonic = "hurry aunt blame peanut heavy update captain human rice crime juice adult scale device promote vast project quiz unit note reform update climb purchase"
balance = 100_000_000_000_000
# secret_key: 3eccc5dac8056590432db6a35d52b9896876a3d5cbdea53b72400bc9c2099fe801
# stx_address: ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB
# btc_address: mweN5WVqadScHdA81aATSdcVr4B6dNokqx

[accounts.wallet_6]
mnemonic = "area desk dutch sign gold cricket dawn toward giggle vibrant indoor bench warfare wagon number tiny universe sand talk dilemma pottery bone trap buddy"
balance = 100_000_000_000_000
# secret_key: 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01
# stx_address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
# btc_address: mzxXgV6e4BZSsz8zVHm3TmqbECt7mbuErt

[accounts.wallet_7]
mnemonic = "prevent gallery kind limb income control noise together echo rival record wedding sense uncover school version force bleak nuclear include danger skirt enact arrow"
balance = 100_000_000_000_000
# secret_key: b463f0df6c05d2f156393eee73f8016c5372caa0e9e29a901bb7171d90dc4f1401
# stx_address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
# btc_address: n37mwmru2oaVosgfuvzBwgV2ysCQRrLko7

[accounts.wallet_8]
mnemonic = "female adjust gallery certain visit token during great side clown fitness like hurt clip knife warm bench start reunion globe detail dream depend fortune"
balance = 100_000_000_000_000
# secret_key: 6a1a754ba863d7bab14adbbc3f8ebb090af9e871ace621d3e5ab634e1422885e01
# stx_address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
# btc_address: n2v875jbJ4RjBnTjgbfikDfnwsDV5iUByw
# ==============================================================================
# FAUCET ACCOUNT
# ------------------------------------------------------------------------------
# The faucet account is used to distribute STX tokens to users who request them.
# ==============================================================================

[accounts.faucet]
mnemonic = "shadow private easily thought say logic fault paddle word top book during ignore notable orange flight clock image wealth health outside kitten belt reform"
Expand Down
Loading

0 comments on commit e9a7541

Please sign in to comment.