Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(BUX-586): renames bux-server to spv-wallet #465

Merged
merged 54 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9791c9c
chore(BUX-586): renames bux-server to spv-wallet
jakubmkowalski Feb 13, 2024
3a027d3
chore(BUX-586): removes unnecessary files
jakubmkowalski Feb 13, 2024
7902a08
chore(BUX-586): renames bux-server to spv-wallet in README
jakubmkowalski Feb 13, 2024
a12b2cd
chore(BUX-586): fixes package comment
jakubmkowalski Feb 13, 2024
6b9165c
deps(BUX-417): update bux; get rid of centrifuge dependency; upgrade …
dorzepowski Feb 14, 2024
008612f
Merge pull request #466 from BuxOrg/deps/update-bux-and-other-depende…
dorzepowski Feb 14, 2024
3653aa4
chore(BUX-586): renames bux-server to spv-wallet
jakubmkowalski Feb 13, 2024
91cd6cb
chore(BUX-586): removes unnecessary files
jakubmkowalski Feb 13, 2024
98d7e66
chore(BUX-586): renames bux-server to spv-wallet in README
jakubmkowalski Feb 13, 2024
a2e832b
chore(BUX-586): fixes package comment
jakubmkowalski Feb 13, 2024
714213e
feat(BUX-603): adds models
jakubmkowalski Feb 16, 2024
ca323cf
feat(BUX-602): adds engine
jakubmkowalski Feb 16, 2024
eff55f5
chore(BUX-586): fixes licences
jakubmkowalski Feb 16, 2024
c87d05d
chore(BUX-586): migrates from BuxOrg to bitcoin-sv
jakubmkowalski Feb 16, 2024
fdae78e
chore(BUX-586): renames leftovers after migration, fixes imports
jakubmkowalski Feb 16, 2024
606257d
chore(BUX-586): README and CODEOWNERS leftovers rename
jakubmkowalski Feb 16, 2024
6b2dee1
chore(BUX-586): removes unnecessary files after migration
jakubmkowalski Feb 16, 2024
cd2146c
Merge branch 'chore/586-rename' of github.com:BuxOrg/bux-server into …
jakubmkowalski Feb 16, 2024
fa9da98
chore(BUX-586): fixes readme
jakubmkowalski Feb 16, 2024
dfdcd84
chore(BUX-586): fixes p_r_template
jakubmkowalski Feb 16, 2024
beff593
chore(BUX-586): minor rename fixes
jakubmkowalski Feb 16, 2024
b31ad16
chore(BUX-586): renames pulse
jakubmkowalski Feb 16, 2024
96b4aac
chore(BUX-586): renames spvwalletmodels to models, renames SPV to Spv…
jakubmkowalski Feb 19, 2024
ea5ea86
chore(BUX-586): reverts changes in CODEOWNERS
jakubmkowalski Feb 19, 2024
bdc5cee
chore(BUX-586): renames SPV in functions
jakubmkowalski Feb 20, 2024
bd0696a
chore(BUX-586): removes bash in CODE_STANDARDS
jakubmkowalski Feb 20, 2024
8ab1b83
chore(BUX-586): renames spvwalletmetrics to enginemetrics
jakubmkowalski Feb 20, 2024
e38c145
chore(BUX-586): moves environment variable prefix to const string
jakubmkowalski Feb 20, 2024
32b48ac
chore(BUX-586): changes letters to uppercase in occurrences of SPV Wa…
jakubmkowalski Feb 20, 2024
8674581
chore(BUX-586): moves main.go from cmd/server to /cmd
jakubmkowalski Feb 20, 2024
8334ff1
chore(BUX-586): fixing examples after moving main.go
jakubmkowalski Feb 20, 2024
12ac1a8
chore: moves to single file
jakubmkowalski Feb 20, 2024
e0a94da
chore: changes about in readme
jakubmkowalski Feb 20, 2024
6a4da55
chore: changes package description
jakubmkowalski Feb 20, 2024
938e882
chore: changes naming convention in package module names
jakubmkowalski Feb 20, 2024
7020a6b
chore: changes spvwalleterrors to apierrors
jakubmkowalski Feb 20, 2024
1151b64
chore: changes names in Dockerfile
jakubmkowalski Feb 20, 2024
6372cc9
chore: changes name check_pulse -> check_block_header_service
jakubmkowalski Feb 20, 2024
df8e28c
fix: code review changes/fixes (#471)
wregulski Feb 21, 2024
2908a15
chore: fixes after CR
jakubmkowalski Feb 21, 2024
c765e97
chore: renames in docker-compose
jakubmkowalski Feb 21, 2024
1d42fde
chore: regenerates swagger docs
jakubmkowalski Feb 21, 2024
6db097f
chore: code review changes, fixes after introducing EnvPrefix
jakubmkowalski Feb 21, 2024
3f313f0
chore(BUX-586): fix linter errors
Feb 21, 2024
bc6ec92
ci(BUX-586): merge makefiles from bux and bux-server; adjust run-test…
Feb 21, 2024
47637df
chore: renames bux_... files, capital W i Wallet
jakubmkowalski Feb 21, 2024
2cc42d5
Merge branch 'chore/586-rename' of github.com:BuxOrg/bux-server into …
jakubmkowalski Feb 21, 2024
10dcc85
ci(BUX-586): try to make tests output prettier
Feb 21, 2024
a67885b
fix(BUX-586): fix loading configuration from env
Feb 21, 2024
c0a8ad9
ci(BUX-586): revert showing tests prettier because of error
Feb 21, 2024
74c46ec
chore: fixes GetUserAgent test
jakubmkowalski Feb 21, 2024
2d9a7df
Merge branch 'chore/586-rename' of github.com:BuxOrg/bux-server into …
jakubmkowalski Feb 21, 2024
7607cfb
ci(BUX-586): run all tests from server, engine and models with make
Feb 21, 2024
f06685a
test(BUX-586): fix test for merkle root
Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 0 additions & 49 deletions .all-contributorsrc

This file was deleted.

6 changes: 3 additions & 3 deletions .github/CODE_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ Additional information and guidelines on Conventional Commits can be found [here

Good example:

```bash
feat: add possibility to create a new user by admin (#BUX-123)
```
feat(#123): add possibility to create a new user by admin
chris-4chain marked this conversation as resolved.
Show resolved Hide resolved
```

Bad example:

```bash
```
debugo feature - checkpoint full work
```

Expand Down
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

Binary file removed .github/IMAGES/go-share-image.png
Binary file not shown.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# Pull Request Checklist

- [ ] πŸ“– I created my PR using provided : [CODE_STANDARDS](https://github.com/BuxOrg/bux-server/blob/main/.github/CODE_STANDARDS.md)
- [ ] πŸ“– I have read the short Code of Conduct: [CODE_OF_CONDUCT](https://github.com/BuxOrg/bux-server/blob/main/.github/CODE_OF_CONDUCT.md)
- [ ] πŸ“– I created my PR using provided : [CODE_STANDARDS](https://github.com/bitcoin-sv/spv-wallet/blob/main/.github/CODE_STANDARDS.md)
- [ ] πŸ“– I have read the short Code of Conduct: [CODE_OF_CONDUCT](https://github.com/bitcoin-sv/spv-wallet/blob/main/.github/CODE_OF_CONDUCT.md)
- [ ] 🏠 I tested my changes locally.
- [ ] βœ… I have provided tests for my changes.
- [ ] πŸ“ I have used conventional commits.
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
FROM golang:1.21.6 as builder

# Set the working directory
WORKDIR /go/src/github.com/BuxOrg/bux-server
WORKDIR /go/src/github.com/bitcoin-sv/spv-wallet

COPY . ./

# Build binary
RUN GOOS=linux go build -o bux cmd/server/main.go
RUN GOOS=linux go build -o spvwallet cmd/server/main.go

# Get runtime image
FROM registry.access.redhat.com/ubi9-minimal

# Version
LABEL version="1.0" name="Bux"
LABEL version="1.0" name="SPVWallet"

# Set working directory
WORKDIR /

# Copy binary to runner
COPY --from=builder /go/src/github.com/BuxOrg/bux-server/bux .
COPY --from=builder /go/src/github.com/bitcoin-sv/spv-wallet/engine .

# Set entrypoint
ENTRYPOINT ["/bux"]
ENTRYPOINT ["/spvwallet"]
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MIT License

Copyright (c) 2023 BSV Blockchain Association ("BA")
dorzepowski marked this conversation as resolved.
Show resolved Hide resolved
Copyright (c) 2022 @BuxOrg

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ include .make/go.mk

## Not defined? Use default repo name which is the application
ifeq ($(REPO_NAME),)
REPO_NAME="bux-server"
REPO_NAME="spv-wallet"
endif

## Not defined? Use default repo owner
ifeq ($(REPO_OWNER),)
REPO_OWNER="BuxOrg"
REPO_OWNER="bitcoin-sv"
endif


Expand Down
62 changes: 32 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<div align="center">

# BUX: Server
# SPV Wallet


[![Release](https://img.shields.io/github/release-pre/BuxOrg/bux-server.svg?logo=github&style=flat&v=3)](https://github.com/BuxOrg/bux-server/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/BuxOrg/bux-server/run-tests.yml?branch=master&v=3)](https://github.com/BuxOrg/bux-server/actions)
[![Report](https://goreportcard.com/badge/github.com/BuxOrg/bux-server?style=flat&v=3)](https://goreportcard.com/report/github.com/BuxOrg/bux-server)
[![codecov](https://codecov.io/gh/BuxOrg/bux-server/branch/master/graph/badge.svg?v=3)](https://codecov.io/gh/BuxOrg/bux-server)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/BuxOrg/bux-server&style=flat&v=3)](https://mergify.io)
[![Release](https://img.shields.io/github/release-pre/bitcoin-sv/spv-wallet.svg?logo=github&style=flat&v=3)](https://github.com/bitcoin-sv/spv-wallet/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/bitcoin-sv/spv-wallet/run-tests.yml?branch=master&v=3)](https://github.com/bitcoin-sv/spv-wallet/actions)
[![Report](https://goreportcard.com/badge/github.com/bitcoin-sv/spv-wallet?style=flat&v=3)](https://goreportcard.com/report/github.com/bitcoin-sv/spv-wallet)
[![codecov](https://codecov.io/gh/bitcoin-sv/spv-wallet/branch/master/graph/badge.svg?v=3)](https://codecov.io/gh/bitcoin-sv/spv-wallet)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/bitcoin-sv/spv-wallet&style=flat&v=3)](https://mergify.io)
<br>

[![Go](https://img.shields.io/github/go-mod/go-version/BuxOrg/bux-server?v=3)](https://golang.org/)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&v=3)](https://gitpod.io/#https://github.com/BuxOrg/bux-server)
[![Go](https://img.shields.io/github/go-mod/go-version/bitcoin-sv/spv-wallet?v=3)](https://golang.org/)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&v=3)](https://gitpod.io/#https://github.com/bitcoin-sv/spv-wallet)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat&v=3)](https://github.com/RichardLitt/standard-readme)
[![Makefile Included](https://img.shields.io/badge/Makefile-Supported%20-brightgreen?=flat&logo=probot&v=3)](Makefile)
<br/>
</div>

> Get started using [BUX](https://getbux.io) in five minutes

## Table of Contents

- [About](#about)
Expand All @@ -36,36 +34,39 @@

## About

[Read more about BUX](https://getbux.io)
A comprehensive non-custodial wallet for BSV digital currency.

<br/>

## Installation

**bux-server** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy).
**spv-wallet** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy).

```shell script
go get -u github.com/BuxOrg/bux-server
go get -u github.com/bitcoin-sv/spv-wallet
```

#### build

```shell script
go build -o bux-server cmd/server/*
go build -o spv-wallet cmd/*
dorzepowski marked this conversation as resolved.
Show resolved Hide resolved
```

#### run

```shell script
./bux-server
./spv-wallet
```
<br/>

## Documentation

View the generated [documentation](https://pkg.go.dev/github.com/BuxOrg/bux-server)
View the generated [documentation](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet)

[![GoDoc](https://godoc.org/github.com/bitcoin-sv/spv-wallet?status.svg&style=flat&v=3)](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet)
View the generated [documentation](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet)

[![GoDoc](https://godoc.org/github.com/BuxOrg/bux-server?status.svg&style=flat&v=3)](https://pkg.go.dev/github.com/BuxOrg/bux-server)
[![GoDoc](https://godoc.org/github.com/bitcoin-sv/spv-wallet?status.svg&style=flat&v=3)](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet)

<br/>

Expand Down Expand Up @@ -105,7 +106,7 @@ This repository was created using [MrZ's `go-template`](https://github.com/mrz18
<br/>

- [BitcoinSchema/go-bitcoin](https://github.com/BitcoinSchema/go-bitcoin)
- [BuxOrg/bux](https://github.com/BuxOrg/bux)
- [bitcoin-sv/spv-wallet](https://github.com/bitcoin-sv/spv-wallet)
- [mrz1836/go-api-router](https://github.com/mrz1836/go-api-router)
- [mrz1836/go-sanitize](https://github.com/mrz1836/go-sanitize)
- [stretchr/testify](https://github.com/stretchr/testify)
Expand Down Expand Up @@ -195,7 +196,7 @@ vet Run the Go vet application

### Defaults

If you run Bux-Server without editing anything, it will use the default configuration from file [defaults.go](/config/defaults.go). It is set up to use _freecache_, _sqlite_ with enabled _paymail_ with _signing disabled_ and with _beef_.
If you run spv-wallet without editing anything, it will use the default configuration from file [defaults.go](/config/defaults.go). It is set up to use _freecache_, _sqlite_ with enabled _paymail_ with _signing disabled_ and with _beef_.


### Config Variables
Expand All @@ -218,17 +219,17 @@ Available flags:

To generate config file with defaults, use the --dump flag, or:
```bash
go run ./cmd/server/main.go -d
go run ./cmd/main.go -d
```

The default config file path is **project root**, and the default file name is **config.yaml**. This can be overridden by -C flag.
```bash
go run ./cmd/server/main.go -C /my/config.json
go run ./cmd/main.go -C /my/config.json
```

#### Environment variables

To override any config variable with ENV, use the "BUX\_" prefix with mapstructure annotation path with "_" as a delimiter in all uppercase. Example:
To override any config variable with ENV, use the "SPV\_" prefix with mapstructure annotation path with "_" as a delimiter in all uppercase. Example:
dorzepowski marked this conversation as resolved.
Show resolved Hide resolved

Let's take this fragment of AppConfig from `config.example.yaml`:

Expand All @@ -240,9 +241,9 @@ auth:
signing_disabled: true
```

To override admin_key in auth config, use the path with "_" as a path delimiter and BUX\_ as prefix. So:
To override admin_key in auth config, use the path with "_" as a path delimiter and SPV\_ as prefix. So:
```bash
BUX_AUTH_ADMIN_KEY="admin_key"
SPV_AUTH_ADMIN_KEY="admin_key"
```

To be able to use TAAL API Key is needed.
Expand All @@ -265,7 +266,8 @@ To use your API key put key in ``token`` field in ```config.example.yaml```

### Examples & Tests

All unit tests run via [GitHub Actions](https://github.com/BuxOrg/bux-server/actions) and
All unit tests run via [GitHub Actions](https://github.com/bitcoin-sv/spv-wallet/actions) and
All unit tests run via [GitHub Actions](https://github.com/bitcoin-sv/spv-wallet/actions) and
uses [Go version 1.19.x](https://golang.org/doc/go1.19). View the [configuration file](.github/workflows/run-tests.yml).

<br/>
Expand Down Expand Up @@ -297,16 +299,16 @@ make bench

### Docker Compose Quickstart

To get started with development, `bux-server` provides a `start.sh` script
which is using `docker-compose.yml` file to starts up Bux Server with selected database
To get started with development, `spv-wallet` provides a `start.sh` script
which is using `docker-compose.yml` file to starts up SPV Wallet serer with selected database
dorzepowski marked this conversation as resolved.
Show resolved Hide resolved
and cache storage. To start, we need to fill the config json which we want to use,
for example: `config/envs/development.json`.

Main configuration is done when running the script.

There are two way of running this script:
1. with manual configuration - Every option is displayed in terminal and user can choose
which database/cache storage use and configure how to run bux-server.
which database/cache storage use and configure how to run spv-wallet.
```bash
./start.sh
```
Expand All @@ -316,7 +318,7 @@ There are two way of running this script:
./start.sh -db postgresql -c redis -bs true -env development -b false
```

`-l/--load` option add possibility to use previously created `.env.config` file and run bux-server with simple command:
`-l/--load` option add possibility to use previously created `.env.config` file and run spv-wallet with simple command:
```bash
./start.sh -l
```
Expand All @@ -338,4 +340,4 @@ View the [contributing guidelines](.github/CODE_STANDARDS.md#3-contributing) and

## License

[![License](https://img.shields.io/github/license/BuxOrg/bux-server.svg?style=flat&v=3)](LICENSE)
[![License](https://img.shields.io/github/license/bitcoin-sv/spv-wallet.svg?style=flat&v=3)](LICENSE)
2 changes: 1 addition & 1 deletion actions/access_keys/access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package accesskeys
import (
"testing"

"github.com/BuxOrg/bux-server/tests"
"github.com/bitcoin-sv/spv-wallet/tests"
apirouter "github.com/mrz1836/go-api-router"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down
14 changes: 7 additions & 7 deletions actions/access_keys/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package accesskeys
import (
"net/http"

"github.com/BuxOrg/bux"
"github.com/BuxOrg/bux-server/actions"
"github.com/BuxOrg/bux-server/mappings"
"github.com/bitcoin-sv/spv-wallet/actions"
"github.com/bitcoin-sv/spv-wallet/engine"
"github.com/bitcoin-sv/spv-wallet/mappings"
"github.com/julienschmidt/httprouter"
apirouter "github.com/mrz1836/go-api-router"
)
Expand All @@ -20,22 +20,22 @@ import (
// @Param conditions query string false "conditions"
// @Success 200
// @Router /v1/access-key/count [post]
// @Security bux-auth-xpub
// @Security x-auth-xpub
func (a *Action) count(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
reqXPubID, _ := bux.GetXpubIDFromRequest(req)
reqXPubID, _ := engine.GetXpubIDFromRequest(req)

// Parse the params
params := apirouter.GetParams(req)
_, metadataModel, conditions, err := actions.GetQueryParameters(params)
metadata := mappings.MapToBuxMetadata(metadataModel)
metadata := mappings.MapToSpvWalletMetadata(metadataModel)
if err != nil {
apirouter.ReturnResponse(w, req, http.StatusExpectationFailed, err.Error())
return
}

// Record a new transaction (get the hex from parameters)a
var count int64
if count, err = a.Services.Bux.GetAccessKeysByXPubIDCount(
if count, err = a.Services.SpvWalletEngine.GetAccessKeysByXPubIDCount(
req.Context(),
reqXPubID,
metadata,
Expand Down
12 changes: 6 additions & 6 deletions actions/access_keys/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package accesskeys
import (
"net/http"

"github.com/BuxOrg/bux"
"github.com/BuxOrg/bux-server/mappings"
"github.com/bitcoin-sv/spv-wallet/engine"
"github.com/bitcoin-sv/spv-wallet/mappings"
"github.com/julienschmidt/httprouter"
apirouter "github.com/mrz1836/go-api-router"
)
Expand All @@ -18,9 +18,9 @@ import (
// @Param metadata query string false "metadata"
jakubmkowalski marked this conversation as resolved.
Show resolved Hide resolved
// @Success 201
// @Router /v1/access-key [post]
// @Security bux-auth-xpub
// @Security x-auth-xpub
func (a *Action) create(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
reqXPub, _ := bux.GetXpubFromRequest(req)
reqXPub, _ := engine.GetXpubFromRequest(req)

// Parse the params
params := apirouter.GetParams(req)
Expand All @@ -29,10 +29,10 @@ func (a *Action) create(w http.ResponseWriter, req *http.Request, _ httprouter.P
metadata := params.GetJSON("metadata")

// Create a new accessKey
accessKey, err := a.Services.Bux.NewAccessKey(
accessKey, err := a.Services.SpvWalletEngine.NewAccessKey(
req.Context(),
reqXPub,
bux.WithMetadatas(metadata),
engine.WithMetadatas(metadata),
)
if err != nil {
apirouter.ReturnResponse(w, req, http.StatusUnprocessableEntity, err.Error())
Expand Down
Loading
Loading