Skip to content

Commit

Permalink
Merge pull request #154 from babylonchain/release/v0.2.0
Browse files Browse the repository at this point in the history
Release/v0.2.0
  • Loading branch information
KonradStaniec authored May 15, 2024
2 parents f22ee2f + 5b60b53 commit 515865b
Show file tree
Hide file tree
Showing 38 changed files with 3,107 additions and 1,079 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
name: Run integration tests
command: |
make test-e2e
no_output_timeout: 20m

build_docker:
machine:
Expand Down
127 changes: 127 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Changelog

## [Unreleased](https://github.com/babylonchain/btc-staker/tree/HEAD)

[Full Changelog](https://github.com/babylonchain/btc-staker/compare/v0.1.0...HEAD)

**Closed issues:**

- Stakerd init fails if directory doesn't exist [\#108](https://github.com/babylonchain/btc-staker/issues/108)

**Merged pull requests:**

- Bitcoind tests [\#110](https://github.com/babylonchain/btc-staker/pull/110) ([KonradStaniec](https://github.com/KonradStaniec))
- docs: Incorporate validator feedback [\#109](https://github.com/babylonchain/btc-staker/pull/109) ([gusin13](https://github.com/gusin13))
- Bump staker to stable babylon version [\#106](https://github.com/babylonchain/btc-staker/pull/106) ([KonradStaniec](https://github.com/KonradStaniec))
- Bumps babylon to latest version [\#105](https://github.com/babylonchain/btc-staker/pull/105) ([KonradStaniec](https://github.com/KonradStaniec))
- bump babylon version [\#104](https://github.com/babylonchain/btc-staker/pull/104) ([KonradStaniec](https://github.com/KonradStaniec))
- docs: Add instructions to setup bitcoind signet node [\#103](https://github.com/babylonchain/btc-staker/pull/103) ([gusin13](https://github.com/gusin13))
- CI: Remove redundant SSH key logic [\#102](https://github.com/babylonchain/btc-staker/pull/102) ([filippos47](https://github.com/filippos47))
- docs: Remove btcd refs [\#101](https://github.com/babylonchain/btc-staker/pull/101) ([gusin13](https://github.com/gusin13))
- docs: Mention legacy wallet requirement [\#96](https://github.com/babylonchain/btc-staker/pull/96) ([filippos47](https://github.com/filippos47))
- docs: Include ZMQ endpoint config [\#94](https://github.com/babylonchain/btc-staker/pull/94) ([filippos47](https://github.com/filippos47))

## [v0.1.0](https://github.com/babylonchain/btc-staker/tree/v0.1.0) (2024-02-08)

[Full Changelog](https://github.com/babylonchain/btc-staker/compare/v0.1.0-rc.0...v0.1.0)

**Closed issues:**

- Improper handling of pending delegations upon restart [\#58](https://github.com/babylonchain/btc-staker/issues/58)

## [v0.1.0-rc.0](https://github.com/babylonchain/btc-staker/tree/v0.1.0-rc.0) (2024-01-22)

[Full Changelog](https://github.com/babylonchain/btc-staker/compare/263d857429d555e0772d104dbeee70ab4e4d8c89...v0.1.0-rc.0)

**Breaking changes:**

- Adjust data model to store confirmed block info [\#53](https://github.com/babylonchain/btc-staker/pull/53) ([KonradStaniec](https://github.com/KonradStaniec))
- Adapt spend stake endpoint to unbonding tx [\#48](https://github.com/babylonchain/btc-staker/pull/48) ([KonradStaniec](https://github.com/KonradStaniec))
- Introduce watched transactions to enable staker to act as queuing service. [\#45](https://github.com/babylonchain/btc-staker/pull/45) ([KonradStaniec](https://github.com/KonradStaniec))
- use prod hint cache [\#40](https://github.com/babylonchain/btc-staker/pull/40) ([KonradStaniec](https://github.com/KonradStaniec))
- List all tracked transaction query [\#33](https://github.com/babylonchain/btc-staker/pull/33) ([KonradStaniec](https://github.com/KonradStaniec))
- Improve data model [\#32](https://github.com/babylonchain/btc-staker/pull/32) ([KonradStaniec](https://github.com/KonradStaniec))

**Closed issues:**

- Unable to dump configuration if parent directory doesn't exist [\#88](https://github.com/babylonchain/btc-staker/issues/88)
- Cannot withdraw expired delegation [\#81](https://github.com/babylonchain/btc-staker/issues/81)
- Unbonding request tx can't be sent to BTC [\#76](https://github.com/babylonchain/btc-staker/issues/76)
- Support for multiple validators when re-staking [\#68](https://github.com/babylonchain/btc-staker/issues/68)
- Add additional field `unbodningTime` to `BTCUndelegationInfo` in query `BTCDelegation` and use it in staker app [\#67](https://github.com/babylonchain/btc-staker/issues/67)
- Proper handling of restarts [\#27](https://github.com/babylonchain/btc-staker/issues/27)
- `StakeFunds` should check whether the btc validator exists [\#20](https://github.com/babylonchain/btc-staker/issues/20)

**Merged pull requests:**

- chore: Upgrade bbn to 0.8.0-rc.0 [\#93](https://github.com/babylonchain/btc-staker/pull/93) ([vitsalis](https://github.com/vitsalis))
- license and public deps [\#92](https://github.com/babylonchain/btc-staker/pull/92) ([KonradStaniec](https://github.com/KonradStaniec))
- fix: Add BLS flags in make [\#91](https://github.com/babylonchain/btc-staker/pull/91) ([gusin13](https://github.com/gusin13))
- chore: restructure and improve docs [\#90](https://github.com/babylonchain/btc-staker/pull/90) ([gusin13](https://github.com/gusin13))
- create dir if not exists [\#89](https://github.com/babylonchain/btc-staker/pull/89) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix signet support [\#87](https://github.com/babylonchain/btc-staker/pull/87) ([KonradStaniec](https://github.com/KonradStaniec))
- Handle lock time change output [\#86](https://github.com/babylonchain/btc-staker/pull/86) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix dynamic fee estimation [\#85](https://github.com/babylonchain/btc-staker/pull/85) ([KonradStaniec](https://github.com/KonradStaniec))
- Bump babylon [\#84](https://github.com/babylonchain/btc-staker/pull/84) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix withdrawing [\#83](https://github.com/babylonchain/btc-staker/pull/83) ([KonradStaniec](https://github.com/KonradStaniec))
- Bump babylon. Use min unbonding time [\#82](https://github.com/babylonchain/btc-staker/pull/82) ([KonradStaniec](https://github.com/KonradStaniec))
- Rename validator to finality provider [\#79](https://github.com/babylonchain/btc-staker/pull/79) ([KonradStaniec](https://github.com/KonradStaniec))
- Pre signed unbonding [\#78](https://github.com/babylonchain/btc-staker/pull/78) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix unbonding witness building [\#77](https://github.com/babylonchain/btc-staker/pull/77) ([KonradStaniec](https://github.com/KonradStaniec))
- docs: Setup docs [\#75](https://github.com/babylonchain/btc-staker/pull/75) ([gusin13](https://github.com/gusin13))
- fix: Use the slashing change address flag [\#72](https://github.com/babylonchain/btc-staker/pull/72) ([vitsalis](https://github.com/vitsalis))
- Handle multiple validators [\#71](https://github.com/babylonchain/btc-staker/pull/71) ([KonradStaniec](https://github.com/KonradStaniec))
- Use unbonding time from bayblon [\#70](https://github.com/babylonchain/btc-staker/pull/70) ([KonradStaniec](https://github.com/KonradStaniec))
- Bump babylon and use new staking tx and unbonding tx [\#66](https://github.com/babylonchain/btc-staker/pull/66) ([KonradStaniec](https://github.com/KonradStaniec))
- feat: Utilize new slashing tx format [\#64](https://github.com/babylonchain/btc-staker/pull/64) ([gusin13](https://github.com/gusin13))
- Add support for ecdsa sig type [\#63](https://github.com/babylonchain/btc-staker/pull/63) ([KonradStaniec](https://github.com/KonradStaniec))
- Add criticial error channel and simplify unbodning send [\#62](https://github.com/babylonchain/btc-staker/pull/62) ([KonradStaniec](https://github.com/KonradStaniec))
- Bump babylon version [\#61](https://github.com/babylonchain/btc-staker/pull/61) ([KonradStaniec](https://github.com/KonradStaniec))
- Extract modules [\#60](https://github.com/babylonchain/btc-staker/pull/60) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix restart bug [\#59](https://github.com/babylonchain/btc-staker/pull/59) ([KonradStaniec](https://github.com/KonradStaniec))
- Code cleanup [\#56](https://github.com/babylonchain/btc-staker/pull/56) ([KonradStaniec](https://github.com/KonradStaniec))
- Get withdrawable transactions endpoint [\#55](https://github.com/babylonchain/btc-staker/pull/55) ([KonradStaniec](https://github.com/KonradStaniec))
- Extend restart to unbonding tx [\#52](https://github.com/babylonchain/btc-staker/pull/52) ([KonradStaniec](https://github.com/KonradStaniec))
- fix restart [\#51](https://github.com/babylonchain/btc-staker/pull/51) ([KonradStaniec](https://github.com/KonradStaniec))
- Add handling of new pop type [\#47](https://github.com/babylonchain/btc-staker/pull/47) ([KonradStaniec](https://github.com/KonradStaniec))
- Unbonding flow [\#46](https://github.com/babylonchain/btc-staker/pull/46) ([KonradStaniec](https://github.com/KonradStaniec))
- chore: Update bbn version [\#44](https://github.com/babylonchain/btc-staker/pull/44) ([vitsalis](https://github.com/vitsalis))
- Force larger staking time [\#43](https://github.com/babylonchain/btc-staker/pull/43) ([KonradStaniec](https://github.com/KonradStaniec))
- chore: Update dn unstake operation help msg [\#42](https://github.com/babylonchain/btc-staker/pull/42) ([filippos47](https://github.com/filippos47))
- Imporve checking for best block [\#41](https://github.com/babylonchain/btc-staker/pull/41) ([KonradStaniec](https://github.com/KonradStaniec))
- Recovery after restart [\#39](https://github.com/babylonchain/btc-staker/pull/39) ([KonradStaniec](https://github.com/KonradStaniec))
- Fix bug in list\_transactions [\#36](https://github.com/babylonchain/btc-staker/pull/36) ([KonradStaniec](https://github.com/KonradStaniec))
- Add some missing daemon commands [\#35](https://github.com/babylonchain/btc-staker/pull/35) ([KonradStaniec](https://github.com/KonradStaniec))
- Improve e2e test [\#34](https://github.com/babylonchain/btc-staker/pull/34) ([KonradStaniec](https://github.com/KonradStaniec))
- Add check that validator exists before allowing for staking [\#31](https://github.com/babylonchain/btc-staker/pull/31) ([KonradStaniec](https://github.com/KonradStaniec))
- Improve slashing fee handling [\#30](https://github.com/babylonchain/btc-staker/pull/30) ([KonradStaniec](https://github.com/KonradStaniec))
- Only show active validators [\#29](https://github.com/babylonchain/btc-staker/pull/29) ([vitsalis](https://github.com/vitsalis))
- Stall when babylon node is not ready [\#26](https://github.com/babylonchain/btc-staker/pull/26) ([KonradStaniec](https://github.com/KonradStaniec))
- Add babylon to e2e test [\#25](https://github.com/babylonchain/btc-staker/pull/25) ([KonradStaniec](https://github.com/KonradStaniec))
- nit: Update Block Cache Size default and fix usage [\#24](https://github.com/babylonchain/btc-staker/pull/24) ([vitsalis](https://github.com/vitsalis))
- Fix delegation bug [\#23](https://github.com/babylonchain/btc-staker/pull/23) ([KonradStaniec](https://github.com/KonradStaniec))
- nit: Add default values for ZMQ messages [\#22](https://github.com/babylonchain/btc-staker/pull/22) ([vitsalis](https://github.com/vitsalis))
- nit: default to btcwallet for wallet backend type [\#21](https://github.com/babylonchain/btc-staker/pull/21) ([vitsalis](https://github.com/vitsalis))
- fix: Replace deprecated SignRawTransaction [\#19](https://github.com/babylonchain/btc-staker/pull/19) ([vitsalis](https://github.com/vitsalis))
- cli for staking BTC to Babylon [\#18](https://github.com/babylonchain/btc-staker/pull/18) ([SebastianElvis](https://github.com/SebastianElvis))
- fix: offset and limit params out of order [\#17](https://github.com/babylonchain/btc-staker/pull/17) ([vitsalis](https://github.com/vitsalis))
- Fix signers field in message [\#16](https://github.com/babylonchain/btc-staker/pull/16) ([KonradStaniec](https://github.com/KonradStaniec))
- makefile: Add build-docker command [\#15](https://github.com/babylonchain/btc-staker/pull/15) ([vitsalis](https://github.com/vitsalis))
- chore: Minor cleanup and nitpicks [\#14](https://github.com/babylonchain/btc-staker/pull/14) ([vitsalis](https://github.com/vitsalis))
- Add query for current babylon validators [\#13](https://github.com/babylonchain/btc-staker/pull/13) ([KonradStaniec](https://github.com/KonradStaniec))
- Add api to spend staking transaction after time lock [\#12](https://github.com/babylonchain/btc-staker/pull/12) ([KonradStaniec](https://github.com/KonradStaniec))
- Command to check wallets outputs [\#11](https://github.com/babylonchain/btc-staker/pull/11) ([KonradStaniec](https://github.com/KonradStaniec))
- Add fee estimation [\#10](https://github.com/babylonchain/btc-staker/pull/10) ([KonradStaniec](https://github.com/KonradStaniec))
- Improve handling of sending delegation to babylon [\#9](https://github.com/babylonchain/btc-staker/pull/9) ([KonradStaniec](https://github.com/KonradStaniec))
- Add dockerfile and push images to ECR [\#8](https://github.com/babylonchain/btc-staker/pull/8) ([KonradStaniec](https://github.com/KonradStaniec))
- Bump babylon to latest version [\#7](https://github.com/babylonchain/btc-staker/pull/7) ([KonradStaniec](https://github.com/KonradStaniec))
- Add admin commands [\#6](https://github.com/babylonchain/btc-staker/pull/6) ([KonradStaniec](https://github.com/KonradStaniec))
- Babylon communication and persistence [\#5](https://github.com/babylonchain/btc-staker/pull/5) ([KonradStaniec](https://github.com/KonradStaniec))
- Add initial stake command [\#4](https://github.com/babylonchain/btc-staker/pull/4) ([KonradStaniec](https://github.com/KonradStaniec))
- Add server and daemon mode [\#3](https://github.com/babylonchain/btc-staker/pull/3) ([KonradStaniec](https://github.com/KonradStaniec))
- Add core logic for funding, building, signing, sending staking transaciton [\#2](https://github.com/babylonchain/btc-staker/pull/2) ([KonradStaniec](https://github.com/KonradStaniec))
- Project skeleton with initial cli command [\#1](https://github.com/babylonchain/btc-staker/pull/1) ([KonradStaniec](https://github.com/KonradStaniec))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ DOCKER = $(shell which docker)
BUILDDIR ?= $(CURDIR)/build
TOOLS_DIR := tools

BTCD_PKG := github.com/btcsuite/btcd
BTCDW_PKG := github.com/btcsuite/btcwallet
BABYLON_PKG := github.com/babylonchain/babylon/cmd/babylond

GO_BIN := ${GOPATH}/bin
BTCD_BIN := $(GO_BIN)/btcd

ldflags := $(LDFLAGS)
build_tags := $(BUILD_TAGS)
Expand All @@ -26,6 +23,14 @@ endif
BUILD_TARGETS := build install
BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)'

# Update changelog vars
ifneq (,$(SINCE_TAG))
sinceTag := --since-tag $(SINCE_TAG)
endif
ifneq (,$(UPCOMING_TAG))
upcomingTag := --future-release $(UPCOMING_TAG)
endif

all: build install

build: BUILD_ARGS := $(build_args) -o $(BUILDDIR)
Expand All @@ -46,11 +51,17 @@ test:
go test ./...

test-e2e:
cd $(TOOLS_DIR); go install -trimpath $(BTCD_PKG); go install -trimpath $(BTCDW_PKG); go install -trimpath $(BABYLON_PKG);
cd $(TOOLS_DIR); go install -trimpath $(BABYLON_PKG);
go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 --tags=e2e

proto-gen:
@$(call print, "Compiling protos.")
cd ./proto; ./gen_protos_docker.sh

.PHONY: proto-gen

update-changelog:
@echo ./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)
./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)

.PHONY: update-changelog
38 changes: 10 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Please update the following configurations in the provided file:
and this [link](https://github.com/bitcoin/bitcoin/pull/28597).
4. If you want to enable remote connections to the node, you can add
`rpcallowip=0.0.0.0/0` and `rpcbind=0.0.0.0` to the bitcoind command.
5. Start the `bitcoind` with `-txindex` option to make sure btc-staker can get
all needed bitcoin transaction data.

```bash
# Create the service file
Expand All @@ -72,6 +74,7 @@ ExecStart=/home/ubuntu/bitcoin-26.0/bin/bitcoind \
-deprecatedrpc=create_bdb \
-signet \
-server \
-txindex \
-rpcport=38332 \
-rpcuser=<your_rpc_username> \
-rpcpassword=<your_rpc_password>
Expand Down Expand Up @@ -306,28 +309,13 @@ export PATH=$HOME/go/bin:$PATH
echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.profile
```
To build without installing,
```bash
make build
```
### Create a Babylon keyring (keyring backend: test) with funds
The `stakerd` daemon requires a keyring with loaded Babylon tokens to pay for the
transactions. Follow this
[guide](https://docs.babylonchain.io/docs/user-guides/btc-staking-testnet/getting-funds)
to create a keyring and request funds.
The above command will put the built binaries in a build directory with the following
structure:
```bash
ls build
├── stakerd
└── stakercli
```
## 4. BTC Staker Setup
### Staker daemon (`stakerd`) configuration
Expand Down Expand Up @@ -391,25 +379,16 @@ In the following, we go through important parameters of the `stakerd.conf` file.
Key = btc-staker
# Chain id of the chain (Babylon)
ChainID = chain-test
ChainID = bbn-test-3
# Address of the chain's RPC server (Babylon)
RPCAddr = http://localhost:26657
# Address of the chain's GRPC server (Babylon)
GRPCAddr = https://localhost:9090
# Type of keyring backend to use
KeyringBackend = test
# Adjustment factor when using gas estimation
GasAdjustment = 1.2
# Comma separated minimum gas prices to accept for transactions
GasPrices = 0.01ubbn
# Directory to store staker keys in
KeyDirectory = /Users/<user>/Library/Application Support/Stakerd
KeyDirectory = /path/to/stakerd-home/
```

#### BTC Node configuration
Expand Down Expand Up @@ -507,7 +486,7 @@ You can start the staker daemon using the following command:
stakerd
```
This will start the RPC server at the address specified in the configuration under
This will start the Staker daemon RPC server at the address specified in the configuration under
the `RawRPCListeners` field. A custom address can also be specified using
the `--rpclisten` flag.
Expand Down Expand Up @@ -587,7 +566,7 @@ stakercli daemon stake \
--staker-address bcrt1q56ehztys752uzg7fzpear08l5mw8w2kxgz7644 \
--staking-amount 1000000 \
--finality-providers-pks 3328782c63404386d9cd905dba5a35975cba629e48192cea4a348937e865d312 \
--staking-time 100
--staking-time 10000 # ~70 days
# Transaction details
{
Expand Down Expand Up @@ -648,3 +627,6 @@ db.
```bash
stakercli daemon withdrawable-transactions
```
In order to `unstake` you'll need to wait for your staking/unbonding tx to be deep
enough in btc so that the timelock expires.
Loading

0 comments on commit 515865b

Please sign in to comment.