Skip to content

Commit

Permalink
Migrate to labs
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Jul 30, 2024
1 parent 6ba8d4f commit ae35775
Show file tree
Hide file tree
Showing 42 changed files with 253 additions and 252 deletions.
196 changes: 98 additions & 98 deletions CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ FROM golang:1.22.3 as builder
RUN apt-get update && apt-get install -y make git bash gcc curl jq

# Build
WORKDIR /go/src/github.com/babylonchain/btc-staker
WORKDIR /go/src/github.com/babylonlabs-io/btc-staker
# Cache dependencies
COPY go.mod go.sum /go/src/github.com/babylonchain/btc-staker/
COPY go.mod go.sum /go/src/github.com/babylonlabs-io/btc-staker/
RUN go mod download

# Copy the rest of the files
COPY ./ /go/src/github.com/babylonchain/btc-staker/
COPY ./ /go/src/github.com/babylonlabs-io/btc-staker/

RUN BUILD_TAGS=netgo \
LDFLAGS="-w -s" \
Expand All @@ -22,7 +22,7 @@ FROM debian:bookworm-slim AS run
RUN addgroup --gid 1138 --system btcstaker && adduser --uid 1138 --system --home /home/btcstaker btcstaker
RUN apt-get update && apt-get install -y bash curl jq wget

COPY --from=builder /go/src/github.com/babylonchain/btc-staker/go.mod /tmp
COPY --from=builder /go/src/github.com/babylonlabs-io/btc-staker/go.mod /tmp
RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.$(uname -m).so \
-O /lib/libwasmvm.$(uname -m).so && \
Expand All @@ -31,8 +31,8 @@ RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2
sha256sum /lib/libwasmvm.$(uname -m).so | grep $(cat /tmp/checksums.txt | grep libwasmvm.$(uname -m) | cut -d ' ' -f 1)
RUN rm -f /tmp/go.mod

COPY --from=builder /go/src/github.com/babylonchain/btc-staker/build/stakerd /bin/stakerd
COPY --from=builder /go/src/github.com/babylonchain/btc-staker/build/stakercli /bin/stakercli
COPY --from=builder /go/src/github.com/babylonlabs-io/btc-staker/build/stakerd /bin/stakerd
COPY --from=builder /go/src/github.com/babylonlabs-io/btc-staker/build/stakercli /bin/stakercli

WORKDIR /home/btcstaker
RUN chown -R btcstaker /home/btcstaker
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.

Parameters

Licensor: Babylonchain, Inc.
Licensor: Babylon Labs, Ltd.

Licensed Work: btc-staker
The Licensed Work is (c) 2023 Babylonchain, Inc.
The Licensed Work is (c) 2023 Babylon Labs, Ltd.

Additional Use Grant: None.

Change Date: 2027-01-20 (January 20th, 2027]
Change Date: 2027-01-20 (January 20th, 2027)

Change License: Apache 2.0

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DOCKER = $(shell which docker)
BUILDDIR ?= $(CURDIR)/build
TOOLS_DIR := tools

BABYLON_PKG := github.com/babylonchain/babylon/cmd/babylond
BABYLON_PKG := github.com/babylonlabs-io/babylon/cmd/babylond

GO_BIN := ${GOPATH}/bin

Expand Down Expand Up @@ -42,7 +42,7 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
$(DOCKER) build --tag babylonchain/btc-staker -f Dockerfile \
$(DOCKER) build --tag babylonlabs-io/btc-staker -f Dockerfile \
$(shell git rev-parse --show-toplevel)

.PHONY: build build-docker
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ 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
5. Start the `bitcoind` with `-txindex` option to make sure btc-staker can get
all needed bitcoin transaction data.

```bash
```bash
# Create the service file
sudo tee /etc/systemd/system/bitcoind.service >/dev/null <<EOF
[Unit]
Expand Down Expand Up @@ -228,7 +228,7 @@ command
getwalletinfo
```
The output should be similar to this and the `format` should be `bdb`:
```bash
```bash
{
"walletname": "btcstaker",
"walletversion": 169900,
Expand Down Expand Up @@ -276,11 +276,11 @@ sudo apt install build-essential
To get started, clone the repository to your local machine from Github:
```bash
git clone https://github.com/babylonchain/btc-staker.git
git clone https://github.com/babylonlabs-io/btc-staker.git
```
You can choose a specific version from
the [official releases page](https://github.com/babylonchain/btc-staker/releases)
the [official releases page](https://github.com/babylonlabs-io/btc-staker/releases)
```bash
cd btc-staker # cd into the project directory
Expand Down
18 changes: 9 additions & 9 deletions babylonclient/babyloncontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import (
"strings"
"time"

btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"

sdkErr "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
"github.com/avast/retry-go/v4"
bbnclient "github.com/babylonchain/babylon/client/client"
bbntypes "github.com/babylonchain/babylon/types"
bcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types"
btclctypes "github.com/babylonchain/babylon/x/btclightclient/types"
btcstypes "github.com/babylonchain/babylon/x/btcstaking/types"
"github.com/babylonchain/btc-staker/stakercfg"
"github.com/babylonchain/btc-staker/stakerdb"
"github.com/babylonchain/btc-staker/utils"
bbnclient "github.com/babylonlabs-io/babylon/client/client"
bbntypes "github.com/babylonlabs-io/babylon/types"
bcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
btcstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/btc-staker/stakercfg"
"github.com/babylonlabs-io/btc-staker/stakerdb"
"github.com/babylonlabs-io/btc-staker/utils"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
"github.com/btcsuite/btcd/btcutil"
Expand Down
4 changes: 2 additions & 2 deletions babylonclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"

sdkmath "cosmossdk.io/math"
"github.com/babylonchain/babylon/testutil/datagen"
"github.com/babylonchain/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/babylon/testutil/datagen"
"github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
Expand Down
2 changes: 1 addition & 1 deletion babylonclient/msgsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
pv "github.com/cosmos/relayer/v2/relayer/provider"
"golang.org/x/sync/semaphore"

"github.com/babylonchain/btc-staker/utils"
"github.com/babylonlabs-io/btc-staker/utils"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/sirupsen/logrus"
)
Expand Down
6 changes: 3 additions & 3 deletions babylonclient/pop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package babylonclient
import (
"fmt"

"github.com/babylonchain/babylon/crypto/bip322"
bbn "github.com/babylonchain/babylon/types"
btcstypes "github.com/babylonchain/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/babylon/crypto/bip322"
bbn "github.com/babylonlabs-io/babylon/types"
btcstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
Expand Down
6 changes: 3 additions & 3 deletions babylonclient/utils.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package babylonclient

import (
babylontypes "github.com/babylonchain/babylon/types"
btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types"
"github.com/babylonchain/btc-staker/utils"
babylontypes "github.com/babylonlabs-io/babylon/types"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
"github.com/babylonlabs-io/btc-staker/utils"
"github.com/btcsuite/btcd/wire"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/stakercli/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"path"

babylonApp "github.com/babylonchain/babylon/app"
"github.com/babylonchain/btc-staker/stakercfg"
babylonApp "github.com/babylonlabs-io/babylon/app"
"github.com/babylonlabs-io/btc-staker/stakercfg"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/go-bip39"
Expand Down
6 changes: 3 additions & 3 deletions cmd/stakercli/daemon/daemoncommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"strconv"

"github.com/babylonchain/btc-staker/cmd/stakercli/helpers"
scfg "github.com/babylonchain/btc-staker/stakercfg"
dc "github.com/babylonchain/btc-staker/stakerservice/client"
"github.com/babylonlabs-io/btc-staker/cmd/stakercli/helpers"
scfg "github.com/babylonlabs-io/btc-staker/stakercfg"
dc "github.com/babylonlabs-io/btc-staker/stakerservice/client"
"github.com/urfave/cli"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/stakercli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

cmdadmin "github.com/babylonchain/btc-staker/cmd/stakercli/admin"
cmddaemon "github.com/babylonchain/btc-staker/cmd/stakercli/daemon"
cmdtx "github.com/babylonchain/btc-staker/cmd/stakercli/transaction"
cmdadmin "github.com/babylonlabs-io/btc-staker/cmd/stakercli/admin"
cmddaemon "github.com/babylonlabs-io/btc-staker/cmd/stakercli/daemon"
cmdtx "github.com/babylonlabs-io/btc-staker/cmd/stakercli/transaction"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/stakercli/transaction/parsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"math"

"github.com/babylonchain/babylon/btcstaking"
"github.com/babylonlabs-io/babylon/btcstaking"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
"github.com/btcsuite/btcd/btcutil"
Expand Down
10 changes: 5 additions & 5 deletions cmd/stakercli/transaction/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"fmt"
"strings"

"github.com/babylonchain/babylon/btcstaking"
bbn "github.com/babylonchain/babylon/types"
"github.com/babylonchain/networks/parameters/parser"
"github.com/babylonlabs-io/babylon/btcstaking"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/networks/parameters/parser"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
"github.com/btcsuite/btcd/btcutil"
Expand All @@ -19,8 +19,8 @@ import (
"github.com/cometbft/cometbft/libs/os"
"github.com/urfave/cli"

"github.com/babylonchain/btc-staker/cmd/stakercli/helpers"
"github.com/babylonchain/btc-staker/utils"
"github.com/babylonlabs-io/btc-staker/cmd/stakercli/helpers"
"github.com/babylonlabs-io/btc-staker/utils"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions cmd/stakercli/transaction/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"path/filepath"
"testing"

bbn "github.com/babylonchain/babylon/types"
"github.com/babylonchain/networks/parameters/parser"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/networks/parameters/parser"

"github.com/babylonchain/babylon/btcstaking"
"github.com/babylonchain/babylon/testutil/datagen"
"github.com/babylonlabs-io/babylon/btcstaking"
"github.com/babylonlabs-io/babylon/testutil/datagen"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
"github.com/btcsuite/btcd/btcutil"
Expand All @@ -27,10 +27,10 @@ import (
"github.com/stretchr/testify/require"
"github.com/urfave/cli"

cmdadmin "github.com/babylonchain/btc-staker/cmd/stakercli/admin"
cmddaemon "github.com/babylonchain/btc-staker/cmd/stakercli/daemon"
"github.com/babylonchain/btc-staker/cmd/stakercli/transaction"
"github.com/babylonchain/btc-staker/utils"
cmdadmin "github.com/babylonlabs-io/btc-staker/cmd/stakercli/admin"
cmddaemon "github.com/babylonlabs-io/btc-staker/cmd/stakercli/daemon"
"github.com/babylonlabs-io/btc-staker/cmd/stakercli/transaction"
"github.com/babylonlabs-io/btc-staker/utils"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions cmd/stakerd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"runtime/pprof"

"github.com/babylonchain/btc-staker/metrics"
staker "github.com/babylonchain/btc-staker/staker"
scfg "github.com/babylonchain/btc-staker/stakercfg"
service "github.com/babylonchain/btc-staker/stakerservice"
"github.com/babylonlabs-io/btc-staker/metrics"
staker "github.com/babylonlabs-io/btc-staker/staker"
scfg "github.com/babylonlabs-io/btc-staker/stakercfg"
service "github.com/babylonlabs-io/btc-staker/stakerservice"

"github.com/jessevdk/go-flags"
"github.com/lightningnetwork/lnd/signal"
Expand Down
8 changes: 4 additions & 4 deletions docs/create-phase1-staking.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Creating and Submitting phase-1 Staking Transactions

The phase-1 staking transaction is a
[Bitcoin Staking transaction](https://github.com/babylonchain/babylon/blob/v0.9.0-rc.3/docs/staking-script.md)
[Bitcoin Staking transaction](https://github.com/babylonlabs-io/babylon/blob/v0.9.0-rc.3/docs/staking-script.md)
that includes an additional `OP_RETURN` field containing the staking parameters
to enable for easy identification and taproot decoding through observing the
Bitcoin ledger.
Expand Down Expand Up @@ -99,7 +99,7 @@ is the BTC staker public key in hex format.

The binary `stakercli` will be used to generate the transaction using
the `transaction create-phase1-staking-transaction-with-params` command.
The only argument for this command is the path to the `global-params.json`
The only argument for this command is the path to the `global-params.json`
downloaded from https://github.com/babylonchain/networks/blob/main/bbn-test-4/parameters/global-params.json (for testnet-4).
Note that one should always use the latest global parameter file.

Expand Down Expand Up @@ -132,7 +132,7 @@ stakercli transaction create-phase1-staking-transaction-with-params [fullpath/to
```

For advanced usage, one can use `stakercli transaction create-phase1-staking-transaction`
to specify customized global parameters but should only be used for testing purpose.
to specify customized global parameters but should only be used for testing purpose.

## Fund Raw Transaction

Expand Down Expand Up @@ -191,7 +191,7 @@ It outputs whether the staking transaction is valid and the parsed staking data
stakercli transaction check-phase1-staking-transaction-params [fullpath/to/parameters.json] \
--staking-transaction 02000000000101a252eb96c7945fc03e17aa2c135c130cf3a497bff1c5f99845bf69194788e4c80200000000fdffffff03404b4c00000000002251205e405197f52aa158a8bc3372d6569ec95abc069e93565c1588d4552173cbedb50000000000000000496a476262743400363c51c11532a48aa765f5e7d4225db68dcc530f374007354de6c0e13eb86399d23c2c25e1fcf8fd1c21b9a402c19e2e309e531e45e92fb1e9805b6056b0cc76fa00476d3800000000002251209e8ceac88cae40c4749f6d67e76509414bd4e55924b38e9e34205e41fbf93a7b0140d6d2bbb60484154f687a4f3b592b6e3f3a0abd788c3bd813d09a8d47712822854e933be6bb5b384db1b0918781582dd6d35ebd9b4d45d0f55ff9c1ab128ffd0ad80f0300 \
--network signet

{
"is_valid": true,
"staking_data": {
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/babylonchain/btc-staker
module github.com/babylonlabs-io/btc-staker

go 1.22.3

require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonchain/babylon v0.9.0-rc.3
github.com/babylonchain/networks/parameters v0.2.1
github.com/babylonlabs-io/babylon v0.9.0
github.com/babylonlabs-io/networks/parameters v0.2.2
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.5
Expand All @@ -18,7 +18,7 @@ require (
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3
github.com/btcsuite/btcwallet/walletdb v1.4.0
github.com/cometbft/cometbft v0.38.6
github.com/cometbft/cometbft v0.38.7
github.com/cosmos/cosmos-sdk v0.50.6
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/relayer/v2 v2.5.2
Expand Down Expand Up @@ -60,7 +60,7 @@ require (
github.com/99designs/keyring v1.2.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/CosmWasm/wasmd v0.51.0 // indirect
github.com/CosmWasm/wasmvm/v2 v2.0.0 // indirect
github.com/CosmWasm/wasmvm/v2 v2.0.1 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand Down Expand Up @@ -103,7 +103,8 @@ require (
github.com/cosmos/gogoproto v1.4.12 // indirect
github.com/cosmos/iavl v1.1.2 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect
github.com/cosmos/ibc-go/v8 v8.0.0 // indirect
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead // indirect
github.com/cosmos/ibc-go/v8 v8.3.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
Expand Down
Loading

0 comments on commit ae35775

Please sign in to comment.