Skip to content

Commit

Permalink
bisonw: brand wallet (decred#2778)
Browse files Browse the repository at this point in the history
* rebrand everything
  • Loading branch information
buck54321 authored May 22, 2024
1 parent 59e663b commit bf69c28
Show file tree
Hide file tree
Showing 163 changed files with 486 additions and 437 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ server/cmd/usermatches/usermatches
markets.json
dist/
node_modules/
client/cmd/dexc/dexc
client/cmd/dexc-desktop/dexc-desktop
client/cmd/dexcctl/dexcctl
client/cmd/bisonw/bisonw
client/cmd/bisonw-desktop/bisonw-desktop
client/cmd/bwctl/bwctl
client/cmd/assetseed/assetseed
client/cmd/simnet-trade-tests/simnet-trade-tests
client/cmd/mmbot/mmbot
Expand All @@ -39,7 +39,7 @@ client/asset/btc/electrum/example/wallet/wallet
**/testdata/fuzz
client/asset/eth/cmd/getgas/getgas
client/asset/eth/cmd/deploy/deploy
client/cmd/dexc-desktop/pkg/installers
client/cmd/bisonw-desktop/pkg/installers
client/cmd/testbinance/testbinance
client/cmd/mmbaltracker/mmbaltracker
server/noderelay/cmd/sourcenode/sourcenode
Expand Down
71 changes: 58 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# <img src="docs/images/logo_wide_v1.svg" alt="DCRDEX" width="250">
# <img src="docs/images/logo_wide_v2.svg" alt="DCRDEX" width="456">

[![Build Status](https://github.com/decred/dcrdex/workflows/Build%20and%20Test/badge.svg)](https://github.com/decred/dcrdex/actions)
[![ISC License](https://img.shields.io/badge/license-Blue_Oak-007788.svg)](https://blueoakcouncil.org/license/1.0.0)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-blue.svg?logo=go&logoColor=lightblue)](https://pkg.go.dev/decred.org/dcrdex)

## What is DEX?
### Bison Wallet and DCRDEX development

This is the repository for development of Bison Wallet, DCRDEX, and Tatanka
Mesh.

## What is DCRDEX?

The [Decred Decentralized Exchange (DEX)](https://dex.decred.org/) is a system
that enables trustless exchange of different types of blockchain assets via a
Expand All @@ -29,6 +34,46 @@ but client software must still adhere to a set of policies to ensure orderly
settlement of matches. The maximum penalty imposable by DEX is loss of trading
privileges and forfeiture of registration fee.

## What is Bison Wallet

Bison Wallet is a multi-wallet developed in concert with DCRDEX and Tatanka
Mesh. Bison Wallet leverages state-of-the-art blockchain technology to bring
more features and more privacy for your favorite assets. DCRDEX is built-in, as
well as advanced trading features like market-making and arbitrage, directly
from your wallet.

Our goal is to find a balance of convenience and privacy that works for you,
while giving you access to advanced features most wallets ignore. For many
assets, we can cut out the middleman altogether and allow you to interact
directly with the blockchain network. This type of wallet is highly-resilient to
data collection and censorship.

We also focus on bringing advanced, asset-specific features for out wallets.
With Decred, you can use CoinShuffle++ to further anonymize your funds, or stake
your DCR and earn some block rewards. The Zcash wallet exposes unified addresses
and shielded pools, and operates on a shielded-first principle that makes
privacy effortless. Keep an eye on development here. We are dedicated to
exposing these technologies to the communities that want them.

## What is Tatanka Mesh

Tatanka Mesh (Tatanka, the mesh) is the evolution of DCRDEX. Where DCRDEX relies
on a central server for maintaining order books and policing trades, Tatanka is
a decentralized P2P protocol that enables a network of subscribers to
collectively perform these tasks. Here are the three critical services that
Tatanka Mesh provides.

- Enhance the ability for users to connect and to share data both publicly and privately
- Aggregate reputation data and monitor fidelity bonds. Tatanka can limit
access to users who earn a bad reputation
- Oracle services for fiat exchange rates and blockchain transaction fee rates

The mesh collects no fees for its services. Trades are performed using trustless
atomic swaps that exchange funds directly between wallets.

Going P2P empowers our users to trade directly, enhancing security,
censorship-resistance, privacy. and self-sovereignty.

## Contents

- [Getting Started](#getting-started)
Expand All @@ -40,19 +85,19 @@ privileges and forfeiture of registration fee.

## Getting Started

To begin using the DEX to trade, you need the client application. There are a
few simple *options* for obtaining the software. The standalone DEX client is
strongly recommended as it is the easiest to setup and generally has the most
up-to-date downloads. Pick **just one** method:
To trade on DCRDEX, you can use Bison Wallet. There are a few simple options
for obtaining Bison Wallet. The standalone wallet is strongly recommended as
it is the easiest to setup and generally has the most up-to-date downloads. Pick
**just one** method:

1. Download the standalone DEX client for your operating system for the
1. From version 1.0, installers are available for all major operating systems
2. Download standalone Bison Wallet for your operating system for the
[latest release on GitHub](https://github.com/decred/dcrdex/releases).
2. Use your operating system's package manager. See [OS Packages](#os-packages)
3. Use your operating system's package manager. See [OS Packages](#os-packages)
for more info.
3. [Use Decrediton](https://docs.decred.org/wallets/decrediton/decrediton-setup/),
the official graphical Decred wallet, which integrates the DEX client, and go
4. [Use Decrediton](https://docs.decred.org/wallets/decrediton/decrediton-setup/),
the official graphical Decred wallet, which integrates Bison Wallet, and go
to the DEX tab.
4. Use the Decred command line application installer, [**dcrinstall**](https://docs.decred.org/wallets/cli/cli-installation/). Not recommended unless you already have this in your workflow.
5. Build the standalone client [from source](https://github.com/decred/dcrdex/wiki/Client-Installation-and-Configuration#advanced-client-installation).

See the [Client Installation and Configuration](https://github.com/decred/dcrdex/wiki/Client-Installation-and-Configuration)
Expand Down Expand Up @@ -146,8 +191,8 @@ Check out these wiki pages for more information.

- [Getting Started Contributing](../../wiki/Contribution-Guide)
- [Backend Development](../../wiki/Backend-Development)
- [Run **dcrdex** and **dexc** on simnet](../../wiki/Simnet-Testing). Recommended for development.
- [Run **dexc** on testnet](../../wiki/Testnet-Testing). Recommended for poking around.
- [Run **dcrdex** and **bisonw** on simnet](../../wiki/Simnet-Testing). Recommended for development.
- [Run **bisonw** on testnet](../../wiki/Testnet-Testing). Recommended for poking around.
- [Run the test app server](../../wiki/Test-App-Server). Useful for GUI development, or just to try everything out without needing to create wallets or connect to a **dcrdex** server.

## Source
Expand Down
16 changes: 8 additions & 8 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# $ docker volume create --name=dcrdex_data
#
# Run the docker image, mapping web access port.
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/dex/.dexc user/dcrdex
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/dex/.bisonw user/dcrdex
#

# frontend build
Expand All @@ -25,7 +25,7 @@ WORKDIR /root/dex/client/webserver/site/
RUN npm clean-install
RUN npm run build

# dexc binary build
# bisonw binary build

# The image below is golang:1.21.0-alpine3.18 (linux/amd64)
# It's pulled by the digest (immutable id) to avoid supply-chain attacks.
Expand All @@ -35,19 +35,19 @@ RUN npm run build
# Docker will print the digest of the new image after the pull has finished.
FROM golang@sha256:445f34008a77b0b98bf1821bf7ef5e37bb63cc42d22ee7c21cc17041070d134f AS gobuilder
COPY --from=nodebuilder /root/dex/ /root/dex/
WORKDIR /root/dex/client/cmd/dexc/
WORKDIR /root/dex/client/cmd/bisonw/
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build
WORKDIR /root/dex/client/cmd/dexcctl/
WORKDIR /root/dex/client/cmd/bwctl/
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build

# Final image
FROM debian:buster-slim
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
WORKDIR /dex
ENV HOME /dex
RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc
RUN mkdir -p /dex/.bisonw && chown 1000 /dex/.bisonw
USER 1000
COPY --from=gobuilder /root/dex/client/cmd/dexc/dexc ./
COPY --from=gobuilder /root/dex/client/cmd/dexcctl/dexcctl ./
COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./
COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./
EXPOSE 5758
CMD [ "./dexc", "--webaddr=0.0.0.0:5758" ]
CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]
16 changes: 8 additions & 8 deletions client/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
# $ docker volume create --name=dcrdex_data
#
# Run the docker image, mapping web access port.
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/dex/.dexc user/dcrdex
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/dex/.bisonw user/dcrdex
#

# dexc binary build
# bisonw binary build
FROM golang:1.20-alpine AS gobuilder
WORKDIR /root/dex
COPY . .
WORKDIR /root/dex/client/cmd/dexc/
WORKDIR /root/dex/client/cmd/bisonw/
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build
WORKDIR /root/dex/client/cmd/dexcctl/
WORKDIR /root/dex/client/cmd/bisonw/
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build

# Final image
FROM debian:buster-slim
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
WORKDIR /dex
ENV HOME /dex
RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc
RUN mkdir -p /dex/.bisonw && chown 1000 /dex/.bisonw
USER 1000
COPY --from=gobuilder /root/dex/client/cmd/dexc/dexc ./
COPY --from=gobuilder /root/dex/client/cmd/dexcctl/dexcctl ./
COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./
COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./
EXPOSE 5758
CMD [ "./dexc", "--webaddr=0.0.0.0:5758" ]
CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]
20 changes: 10 additions & 10 deletions client/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ type RPCConfig struct {

// RPC creates a rpc server configuration.
func (cfg *RPCConfig) RPC(c *core.Core, marketMaker *mm.MarketMaker, log dex.Logger) *rpcserver.Config {
dexcMajor, dexcMinor, dexcPatch, dexcPreRel, dexcBuildMeta, err := version.ParseSemVer(Version)
bwMajor, bwMinor, bwPatch, bwPreRel, bwBuildMeta, err := version.ParseSemVer(Version)
if err != nil {
panic(fmt.Errorf("failed to parse version: %w", err))
}

runtimeVer := strings.Replace(runtime.Version(), ".", "-", -1)
runBuildMeta := version.NormalizeString(runtimeVer)
build := version.NormalizeString(dexcBuildMeta)
build := version.NormalizeString(bwBuildMeta)
if build != "" {
dexcBuildMeta = fmt.Sprintf("%s.%s", build, runBuildMeta)
bwBuildMeta = fmt.Sprintf("%s.%s", build, runBuildMeta)
}
dexcVersion := &rpcserver.SemVersion{
bwVersion := &rpcserver.SemVersion{
VersionString: Version,
Major: dexcMajor,
Minor: dexcMinor,
Patch: dexcPatch,
Prerelease: dexcPreRel,
BuildMetadata: dexcBuildMeta,
Major: bwMajor,
Minor: bwMinor,
Patch: bwPatch,
Prerelease: bwPreRel,
BuildMetadata: bwBuildMeta,
}

rpcserver.SetLogger(log)
Expand All @@ -84,7 +84,7 @@ func (cfg *RPCConfig) RPC(c *core.Core, marketMaker *mm.MarketMaker, log dex.Log
Pass: cfg.RPCPass,
Cert: cfg.RPCCert,
Key: cfg.RPCKey,
DexcVersion: dexcVersion,
BWVersion: bwVersion,
CertHosts: []string{
defaultTestnetHost, defaultSimnetHost, defaultMainnetHost,
walletPairOneHost, walletPairTwoHost,
Expand Down
2 changes: 1 addition & 1 deletion client/asset/dcr/dcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -6500,7 +6500,7 @@ func (dcr *ExchangeWallet) ConfirmRedemption(coinID dex.Bytes, redemption *asset
"replaced by tx %s. core should not be replacing the transaction. maybe ConfirmRedemption "+
"is being run concurrently for the same redeem", mRedeem.txHash, secretHash, *txHash)
}
// Will hit this if dexc was restarted with an actively
// Will hit this if bisonw was restarted with an actively
// redeeming swap.
dcr.mempoolRedeemsMtx.Lock()
dcr.mempoolRedeems[secretHash] = &mempoolRedeem{txHash: *txHash, firstSeen: time.Now()}
Expand Down
2 changes: 1 addition & 1 deletion client/asset/eth/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ type baseWallet struct {
}

// assetWallet is a wallet backend for Ethereum and Eth tokens. The backend is
// how the DEX client app communicates with the Ethereum blockchain and wallet.
// how Bison Wallet communicates with the Ethereum blockchain and wallet.
// assetWallet satisfies the dex.Wallet interface.
type assetWallet struct {
*baseWallet
Expand Down
2 changes: 1 addition & 1 deletion client/asset/eth/nodeclient_harness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ func testApproveGas(t *testing.T) {
// data := []byte{}
// value := uint64(1)
walletDir := filepath.Join(dcrutil.AppDataDir("dexc", false), "simnet", "assetdb", dex.BipIDSymbol(60))
walletDir := filepath.Join(dcrutil.AppDataDir("bisonw", false), "simnet", "assetdb", dex.BipIDSymbol(60))
client, err := newNodeClient(getWalletDir(walletDir, dex.Simnet), dex.Simnet, tLogger.SubLogger("initiator"))
if err != nil {
t.Fatalf("unable to create node client %v", err)
Expand Down
9 changes: 4 additions & 5 deletions client/asset/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (wt WalletTrait) IsRescanner() bool {
// IsNewAddresser tests if the WalletTrait has the WalletTraitNewAddresser bit
// set, which indicates the presence of a NewAddress method that will generate a
// new address on each call. If this method does not exist, the Address method
// should be assumed to always return the same deposit address.
// should be assumed to always return the same receiving address.
func (wt WalletTrait) IsNewAddresser() bool {
return wt&WalletTraitNewAddresser != 0
}
Expand Down Expand Up @@ -505,8 +505,7 @@ type Wallet interface {
// known when the init transaction was created. The client should store this
// information for persistence across sessions.
Refund(coinID, contract dex.Bytes, feeRate uint64) (dex.Bytes, error)
// DepositAddress returns an address for depositing funds into the exchange
// wallet.
// DepositAddress returns an address for depositing funds into Bison Wallet.
DepositAddress() (string, error)
// OwnsDepositAddress indicates if the provided address can be used
// to deposit funds into the wallet.
Expand Down Expand Up @@ -1400,7 +1399,7 @@ type Order struct {
// Value is the amount required to satisfy the order. The Value does not
// include fees. Fees will be calculated internally based on the number of
// possible swaps (MaxSwapCount) and the exchange's configuration
// (DEXConfig).
// (Exchange).
Value uint64
// MaxSwapCount is the number of lots in the order, which is also the
// maximum number of transactions that an order could potentially generate
Expand Down Expand Up @@ -1438,7 +1437,7 @@ type MultiOrderValue struct {
// Value is the amount required to satisfy the order. The Value does not
// include fees. Fees will be calculated internally based on the number of
// possible swaps (MaxSwapCount) and the exchange's configuration
// (DEXConfig).
// (Exchange).
Value uint64
// MaxSwapCount is the number of lots in the order, which is also the
// maximum number of transactions that an order could potentially generate
Expand Down
2 changes: 1 addition & 1 deletion client/cmd/assetseed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func main() {
var appSeed string
flag.StringVar(&appSeed, "seed", "", "DEX client application seed (128 hexadecimal characters)")
flag.StringVar(&appSeed, "seed", "", "Bison Wallet application seed (128 hexadecimal characters)")
var assetID uint
flag.UintVar(&assetID, "asset", 0, "Asset ID. BIP-0044 coin type (integer).\n"+
"See https://github.com/satoshilabs/slips/blob/master/slip-0044.md")
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func mainCore() error {

// A single process cannot run multiple webview windows, so we run webview
// as a subprocess. We could create a simpler webview binary to call that
// would be substantially smaller than the dexc binary, but when done that
// would be substantially smaller than the bisonw binary, but when done that
// way, the opened window does not have the icon that the system associates
// with dexc and taskbar icons won't be stacked. Instead, we'll create a
// with bisonw and taskbar icons won't be stacked. Instead, we'll create a
// short path here and execute ourself with the --webview flag.
if cfg.Webview != "" {
runWebview(cfg.Webview)
Expand Down Expand Up @@ -181,7 +181,7 @@ func mainCore() error {
<-clientCore.Ready()

defer func() {
log.Info("Exiting dexc main.")
log.Info("Exiting bisonw main.")
cancel() // no-op with clean rpc/web server setup
wg.Wait() // no-op with clean setup and shutdown
}()
Expand Down Expand Up @@ -429,7 +429,7 @@ func runWebview(url string) {
if runtime.GOOS == "windows" { // windows can use icons in its resources section, or ico files
useIcon(w, "#32512") // IDI_APPLICATION, see winres.json and https://learn.microsoft.com/en-us/windows/win32/menurc/about-icons
} else {
useIconBytes(w, FavIcon) // useIcon(w, "src/dexc.png")
useIconBytes(w, Icon) // useIcon(w, "src/dexc.png")
}

width, height := limitedWindowWidthAndHeight(int(C.display_width()), int(C.display_height()))
Expand Down Expand Up @@ -484,7 +484,7 @@ func systrayOnReady(ctx context.Context, logDirectory string, openC chan<- struc
// mStarting.Hide()

mOpen := systray.AddMenuItem("Open", "Open DEX client window")
mOpen.SetIcon(SymbolBWIcon)
mOpen.SetIcon(FavIcon)
go func() {
for range mOpen.ClickedCh {
select {
Expand Down
Loading

0 comments on commit bf69c28

Please sign in to comment.