Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

chore!: rename QGB to BlobStream #520

Merged
merged 24 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
uses: goreleaser/goreleaser-action@v5.0.0
with:
args: release --rm-dist
workdir: ./cmd/qgb
workdir: ./cmd/blobstream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Run tests in race mode
run: make test-race

test-qgb-e2e:
test-blobstream-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -61,4 +61,4 @@ jobs:
- name: Test
run: go test -test.timeout 60m -failfast -v github.com/celestiaorg/orchestrator-relayer/e2e # yamllint disable-line rule:line-length
env:
QGB_INTEGRATION_TEST: true
BLOBSTREAM_INTEGRATION_TEST: true
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1 Build qgb binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder
# stage 1 Build blobstream binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.2-alpine3.18 as builder
RUN apk update && apk --no-cache add make gcc musl-dev git bash
rach-id marked this conversation as resolved.
Show resolved Hide resolved

COPY . /orchestrator-relayer
Expand Down Expand Up @@ -27,7 +27,7 @@ RUN apk update && apk add --no-cache \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /orchestrator-relayer/build/qgb /bin/qgb
COPY --from=builder /orchestrator-relayer/build/blobstream /bin/blobstream
COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh

USER ${USER_NAME}
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ DOCKER := $(shell which docker)
all: install

install: go.sum
@echo "--> Installing qgb"
@go install -mod=readonly ./cmd/qgb
@echo "--> Installing blobstream"
@go install -mod=readonly ./cmd/blobstream

go.sum: mod
@echo "--> Verifying dependencies have expected content"
Expand All @@ -24,7 +24,7 @@ pre-build:

build: mod
@mkdir -p build/
@go build -o build ./cmd/qgb
@go build -o build ./cmd/blobstream

build-docker:
@echo "--> Building Docker image"
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# orchestrator-relayer

Contains the implementation of the QGB orchestrator and relayer.
Contains the implementation of the Blobstream orchestrator and relayer.

The orchestrator is the software that signs the QGB attestations, and the relayer is the one that relays them to the target EVM chain.
The orchestrator is the software that signs the Blobstream attestations, and the relayer is the one that relays them to the target EVM chain.
rach-id marked this conversation as resolved.
Show resolved Hide resolved

For a high-level overview of how the QGB works, check [here](https://github.com/celestiaorg/quantum-gravity-bridge/tree/76efeca0be1a17d32ef633c0fdbd3c8f5e4cc53f#how-it-works) and [here](https://blog.celestia.org/celestiums/).
For a high-level overview of how the Blobstream works, check [here](https://github.com/celestiaorg/quantum-gravity-bridge/tree/76efeca0be1a17d32ef633c0fdbd3c8f5e4cc53f#how-it-works) and [here](https://blog.celestia.org/celestiums/).
rach-id marked this conversation as resolved.
Show resolved Hide resolved

## Install

1. [Install Go](https://go.dev/doc/install) 1.21.1
2. Clone this repo
3. Install the QGB CLI
3. Install the Blobstream CLI

```shell
make install
Expand All @@ -20,16 +20,16 @@ make install

```sh
# Print help
qgb --help
blobstream --help
```

## How to run

If you are a Celestia-app validator, all you need to do is run the orchestrator. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/orchestrator.md) for more details.

If you want to post commitments on an EVM chain, you will need to deploy a new QGB contract and run a relayer. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/relayer.md) for relayer docs and [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/deploy.md) for how to deploy a new QGB contract.
If you want to post commitments on an EVM chain, you will need to deploy a new Blobstream contract and run a relayer. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/relayer.md) for relayer docs and [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/deploy.md) for how to deploy a new Blobstream contract.

Note: the QGB P2P network is a separate network than the consensus or the data availability one. Thus, you will need its specific bootstrappers to be able to connect to it.
Note: the Blobstream P2P network is a separate network than the consensus or the data availability one. Thus, you will need its specific bootstrappers to be able to connect to it.

## Contributing

Expand All @@ -41,7 +41,7 @@ Note: the QGB P2P network is a separate network than the consensus or the data a
### Helpful Commands

```sh
# Build a new orchestrator-relayer binary and output to build/qgb
# Build a new orchestrator-relayer binary and output to build/blobstream
make build

# Run tests
Expand All @@ -53,10 +53,10 @@ make fmt

## Useful links

The smart contract implementation is in [quantum-gravity-bridge](https://github.com/celestiaorg/quantum-gravity-bridge/).
The smart contract implementation is in [blobstream-contracts](https://github.com/celestiaorg/blobstream-contracts).

The state machine implementation is in [x/qgb](https://github.com/celestiaorg/celestia-app/tree/main/x/qgb).
The state machine implementation is in [x/blobstream](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream).

QGB ADRs are in the [docs](https://github.com/celestiaorg/celestia-app/tree/main/docs/architecture).
Blobstream ADRs are in the [docs](https://github.com/celestiaorg/celestia-app/tree/main/docs/architecture).

QGB design explained in this [blog](https://blog.celestia.org/celestiums/).
Blobstream design explained in this [blog](https://blog.celestia.org/celestiums).
2 changes: 1 addition & 1 deletion cmd/qgb/base/config.go → cmd/blobstream/base/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Config struct {
EVMPassphrase string
}

// DefaultServicePath constructs the default qgb store path for
// DefaultServicePath constructs the default Blobstream store path for
// the provided service.
// It tries to get the home directory from an environment variable
// called `<service_name_in_upper_case>_HOME`. If not set, then reverts to using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

p2pcmd "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p"
p2pcmd "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p"
"github.com/celestiaorg/orchestrator-relayer/helpers"
"github.com/celestiaorg/orchestrator-relayer/p2p"
"github.com/celestiaorg/orchestrator-relayer/store"
Expand All @@ -21,7 +21,7 @@ func Command() *cobra.Command {
bsCmd := &cobra.Command{
Use: "bootstrapper",
Aliases: []string{"bs"},
Short: "QGB P2P network bootstrapper command",
Short: "Blobstream P2P network bootstrapper command",
SilenceUsage: true,
}

Expand Down Expand Up @@ -110,7 +110,7 @@ func Start() *cobra.Command {
}

// creating the dht
dht, err := p2p.NewQgbDHT(ctx, h, dataStore, aIBootstrappers, logger)
dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, aIBootstrappers, logger)
if err != nil {
return err
}
Expand All @@ -137,7 +137,7 @@ func Start() *cobra.Command {
func Init() *cobra.Command {
cmd := cobra.Command{
Use: "init",
Short: "Initialize the QGB bootstrapper store. Passed flags have persisted effect.",
Short: "Initialize the Blobstream bootstrapper store. Passed flags have persisted effect.",
RunE: func(cmd *cobra.Command, args []string) error {
config, err := parseInitFlags(cmd)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bootstrapper

import (
"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base"
"github.com/spf13/cobra"
)

Expand All @@ -14,7 +14,7 @@ func addStartFlags(cmd *cobra.Command) *cobra.Command {
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb bootstrappers home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream bootstrappers home directory")
base.AddP2PNicknameFlag(cmd)
base.AddP2PListenAddressFlag(cmd)
base.AddBootstrappersFlag(cmd)
Expand Down Expand Up @@ -65,7 +65,7 @@ func addInitFlags(cmd *cobra.Command) *cobra.Command {
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb bootstrappers home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream bootstrappers home directory")
return cmd
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/celestiaorg/celestia-app/app"
"github.com/celestiaorg/celestia-app/app/encoding"
common2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p"
common2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p"
"github.com/celestiaorg/orchestrator-relayer/helpers"
"github.com/celestiaorg/orchestrator-relayer/p2p"
"github.com/celestiaorg/orchestrator-relayer/rpc"
Expand Down Expand Up @@ -60,7 +60,7 @@ func NewTmAndAppQuerier(logger tmlog.Logger, tendermintRPC string, celesGRPC str
return tmQuerier, appQuerier, stopFuncs, nil
}

// CreateDHTAndWaitForPeers helper function that creates a new QGB DHT and waits for some peers to connect to it.
// CreateDHTAndWaitForPeers helper function that creates a new Blobstream DHT and waits for some peers to connect to it.
func CreateDHTAndWaitForPeers(
ctx context.Context,
logger tmlog.Logger,
Expand All @@ -69,7 +69,7 @@ func CreateDHTAndWaitForPeers(
p2pListenAddr string,
bootstrappers string,
dataStore ds.Batching,
) (*p2p.QgbDHT, error) {
) (*p2p.BlobstreamDHT, error) {
// get the p2p private key or generate a new one
privKey, err := common2.GetP2PKeyOrGenerateNewOne(p2pKeyStore, p2pNickname)
if err != nil {
Expand Down Expand Up @@ -98,7 +98,7 @@ func CreateDHTAndWaitForPeers(
}

// creating the dht
dht, err := p2p.NewQgbDHT(ctx, h, dataStore, aIBootstrappers, logger)
dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, aIBootstrappers, logger)
if err != nil {
return nil, err
}
Expand Down
16 changes: 8 additions & 8 deletions cmd/qgb/deploy/cmd.go → cmd/blobstream/deploy/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"strconv"

evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm"
evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm"

"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"

Expand All @@ -25,7 +25,7 @@ import (
func Command() *cobra.Command {
command := &cobra.Command{
Use: "deploy <flags>",
Short: "Deploys the QGB contract and initializes it using the provided Celestia chain",
Short: "Deploys the Blobstream contract and initializes it using the provided Celestia chain",
RunE: func(cmd *cobra.Command, args []string) error {
config, err := parseDeployFlags(cmd)
if err != nil {
Expand All @@ -37,7 +37,7 @@ func Command() *cobra.Command {
// checking if the provided home is already initiated
isInit := store.IsInit(logger, config.Home, store.InitOptions{NeedEVMKeyStore: true})
if !isInit {
logger.Info("please initialize the EVM keystore using the `qgb deploy keys add/import` command")
logger.Info("please initialize the EVM keystore using the `blobstream deploy keys add/import` command")
return store.ErrNotInited
}

Expand All @@ -59,7 +59,7 @@ func Command() *cobra.Command {
if err != nil {
return errors.Wrap(
err,
"cannot initialize the QGB contract without having a valset request: %s",
"cannot initialize the Blobstream contract without having a valset request: %s",
)
}

Expand Down Expand Up @@ -110,15 +110,15 @@ func Command() *cobra.Command {
}
defer backend.Close()

address, tx, _, err := evmClient.DeployQGBContract(txOpts, backend, *vs, vs.Nonce, false)
address, tx, _, err := evmClient.DeployBlobstreamContract(txOpts, backend, *vs, vs.Nonce, false)
if err != nil {
logger.Error("failed to deploy QGB contract")
logger.Error("failed to deploy Blobstream contract")
return err
}

receipt, err := evmClient.WaitForTransaction(cmd.Context(), backend, tx)
if err == nil && receipt != nil && receipt.Status == 1 {
logger.Info("deployed QGB contract", "proxy_address", address.Hex(), "tx_hash", tx.Hash().String())
logger.Info("deployed Blobstream contract", "proxy_address", address.Hex(), "tx_hash", tx.Hash().String())
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base"

"github.com/celestiaorg/orchestrator-relayer/evm"
"github.com/spf13/cobra"
Expand All @@ -30,7 +30,7 @@ func addDeployFlags(cmd *cobra.Command) *cobra.Command {
cmd.Flags().String(
FlagStartingNonce,
"latest",
"Specify the nonce to start the QGB contract from. "+
"Specify the nonce to start the Blobstream contract from. "+
"\"earliest\": for genesis, "+
"\"latest\": for latest valset nonce, "+
"\"nonce\": for the latest valset before the provided nonce, provided nonce included.",
Expand All @@ -40,7 +40,7 @@ func addDeployFlags(cmd *cobra.Command) *cobra.Command {
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb deployer home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream deployer home directory")
cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)")

return cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package evm

import (
"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
)
Expand All @@ -15,7 +15,7 @@ func keysConfigFlags(cmd *cobra.Command, service string) *cobra.Command {
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb evm keys home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream evm keys home directory")
cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)")
return cmd
}
Expand Down Expand Up @@ -54,7 +54,7 @@ func keysNewPassphraseConfigFlags(cmd *cobra.Command, service string) *cobra.Com
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb evm keys home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream evm keys home directory")
cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)")
cmd.Flags().String(FlagNewEVMPassphrase, "", "the evm account new passphrase (if not specified as a flag, it will be asked interactively)")
return cmd
Expand Down
4 changes: 2 additions & 2 deletions cmd/qgb/keys/evm/evm.go → cmd/blobstream/keys/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/ethereum/go-ethereum/accounts/keystore"

common2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/common"
common2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/common"
"github.com/celestiaorg/orchestrator-relayer/store"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -21,7 +21,7 @@ import (
func Root(serviceName string) *cobra.Command {
evmCmd := &cobra.Command{
Use: "evm",
Short: "QGB EVM keys manager",
Short: "Blobstream EVM keys manager",
SilenceUsage: true,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/qgb/keys/keys.go → cmd/blobstream/keys/keys.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package keys

import (
"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm"
"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p"
"github.com/spf13/cobra"
)

func Command(serviceName string) *cobra.Command {
keysCmd := &cobra.Command{
Use: "keys",
Short: "QGB keys manager",
Short: "Blobstream keys manager",
SilenceUsage: true,
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package p2p

import (
"github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base"
"github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
)
Expand All @@ -11,7 +11,7 @@ func keysConfigFlags(cmd *cobra.Command, service string) *cobra.Command {
if err != nil {
panic(err)
}
cmd.Flags().String(base.FlagHome, homeDir, "The qgb p2p keys home directory")
cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream p2p keys home directory")
return cmd
}

Expand Down
Loading
Loading