bux-cli

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 1 Imported by: 0

README

BUX: CLI

Command line application for interacting with BUX

Release Downloads Build Status Report Go
Mergify Status Makefile Included Sponsor Donate


Table of Contents


Installation

Install with brew

brew tap BuxOrg/bux-cli && brew install bux-cli
buxcli

Install using a compiled binary on Linux or Mac (Mac example)

curl -LkSs https://github.com/BuxOrg/bux-cli/releases/download/v0.1.5/bux-cli_macOS_64-bit.tar.gz -o app.tar.gz
tar -zxf app.tar.gz && cd ./app/
./buxcli

Install with go

go get github.com/BuxOrg/bux-cli
cd /$GOPATH/src/github.com/BuxOrg/bux-cli && make install
buxcli

What is BUX?

Read more about BUX


Getting Started

The default configuration will use a config.json and datastore.db file.

These files are located in your home directory (~/buxcli/).


Start by creating a new xpriv using the xpriv command.

buxcli xpriv new

Next, create a new xpub using the xpub command.

buxcli xpub new <xpriv> --metadata='{ "name": "xpub_1", "description": "my xpub description"}'

Now you can create a new destination using the destination command.

buxcli destination new <xpub> --metadata='{ "name": "destination_1", "description": "my destination description"}'

Send a small amount of BSV to the address generated by the above destination command.

Finally, you can record a transaction using the transaction command. (IE: an incoming transaction)

buxcli transaction record <xpub> --txid=<tx_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'

Commands

destination

Create a new destination using optional metadata

buxcli destination new <xpub> --metadata='{ "name": "destination_1", "description": "my destination description"}'

Get an existing destination from id

buxcli destination get <destination_id> -x=<xpub_id>

Get an existing destination from locking script

buxcli destination get <locking_script> -x=<xpub_id>

Get an existing destination from address

buxcli destination get <address> -x=<xpub_id>

Get address information from BUX and WhatsOnChain

buxcli destination get <address> -x=<xpub_id> -w

Get help for the destination command

buxcli destination --help



transaction

Start a new draft transaction in BUX

buxcli transaction new <xpub> --txconfig='{"send_all_to":{"to":"1L6Tqxe..."},"expires_in":300000000000}' --metadata='{"name":"test draft tx"}'

Record a transaction using a Transaction ID into BUX

buxcli transaction record <xpub> --txid=<tx_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'

Record a transaction using hex into BUX with optional metadata

buxcli transaction record <xpub> --hex=<tx_hex> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'

Record a transaction using hex and a previously generated draft id into BUX

buxcli transaction record <xpub> --hex=<tx_hex> --draft=<draft_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'

Send a new transaction in BUX using your xpriv to sign the transaction

buxcli transaction send <xpub> --xpriv='xprv9s21ZrQH143K2....' --txconfig='{"send_all_to":{"to":"1L6Tqxe..."},"expires_in":300000000000}' --metadata='{"name":"test send tx"}'

Get transaction information from BUX

buxcli transaction info <xpub_id> --txid=<tx_id>

Get transaction information from BUX and WhatsOnChain

buxcli transaction info <xpub_id> --txid=<tx_id> -w

Run transaction tasks (IE: broadcast, sync, etc)

buxcli transaction tasks

Get help for the transaction command

buxcli transaction --help



xpub

Create a new xpub with optional metadata

buxcli xpub new <xpriv> --metadata='{ "name": "xpub_1", "description": "my xpub description"}'

Get an existing xpub record from full xpub key

buxcli xpub get <xpub>

Get an existing xpub record from xpub id

buxcli xpub get <xpub_id>

Get an existing xpub record using metadata

buxcli xpub get -m=<metadata_json>

Get help for the xpub command

buxcli xpub --help



xpriv

Create a new xpriv key

buxcli xpriv new

Get information about an existing xpriv key

buxcli xpriv info <xpriv>

Get help for the xpriv command

buxcli xpriv --help

Documentation

Get started with the examples. View the generated golang godocs.

All the generated command documentation can be found in docs/commands.

Supported Operating Systems
  • Linux
  • Mac
  • Windows (coming soon)

Custom Configuration

The configuration file should be located in your $HOME/buxcli folder and named config.json.

View the example config file.

You can also specify a custom configuration file using --config "~/folder/path/config.json"

Local Database (Cache)

The database is located in your $HOME/buxcli folder.

To clear the entire database:

buxcli --flush-cache

Run commands ignoring local cache:

buxcli some_command --no-cache
Package Dependencies
Application Deployment

goreleaser for easy binary deployment to GitHub and can be installed via: brew install goreleaser.

The .goreleaser.yml file is used to configure goreleaser.

Use make release-snap to create a snapshot version of the release, and finally make release to ship to production.

The release can also be deployed to a homebrew repository: homebrew-bux-cli.

Makefile Commands

View all makefile commands

make help

List of all current commands:

all                      Runs multiple commands
build                    Build all binaries (darwin, linux, windows)
clean                    Remove previous builds and any test cache data
clean-mods               Remove all the Go mod cache
coverage                 Shows the test coverage
darwin                   Build for Darwin (macOS amd64)
diff                     Show the git diff
gen-docs                 Generate documentation from all available commands (fresh install)
generate                 Runs the go generate command in the base of the repo
gif-render               Render gifs in .github dir (find/replace text etc)
godocs                   Sync the latest tag with GoDocs
help                     Show this help message
install                  Install the application
install-go               Install the application (Using Native Go)
install-releaser         Install the GoReleaser application
lint                     Run the golangci-lint application (install if not found)
linux                    Build for Linux (amd64)
release                  Full production release (creates release in Github)
release                  Runs common.release then runs godocs
release-snap             Test the full release (build binaries)
release-test             Full production test release (everything except deploy)
replace-version          Replaces the version in HTML/JS (pre-deploy)
tag                      Generate a new tag and push (tag version=0.0.0)
tag-remove               Remove a tag if found (tag-remove version=0.0.0)
tag-update               Update an existing tag to current commit (tag-update version=0.0.0)
test                     Runs lint and ALL tests
test-ci                  Runs all tests via CI (exports coverage)
test-ci-no-race          Runs all tests via CI (no race) (exports coverage)
test-ci-short            Runs unit tests via CI (exports coverage)
test-no-lint             Runs just tests
test-short               Runs vet, lint and tests (excludes integration tests)
test-unit                Runs tests and outputs coverage
uninstall                Uninstall the application (and remove files)
update-linter            Update the golangci-lint package (macOS only)
update-terminalizer      Update the terminalizer application
vet                      Run the Go vet application
windows                  Build for Windows (amd64)

Examples & Tests

All unit tests and examples run via GitHub Actions and uses Go version 1.19.x. View the configuration file.

Run all tests (including integration tests)

make test

Code Standards

Read more about this Go project's code standards.


Usage

View all the examples and see the commands above

All the generated command documentation can be found in docs/commands.


Maintainers

MrZ
MrZ

Contributing

View the contributing guidelines and please follow the code of conduct.

How can I help?

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬. You can also support this project by becoming a sponsor on GitHub 👏 or by making a bitcoin donation to ensure this journey continues indefinitely! 🚀

Stars


License

License

Documentation

Overview

BUX CLI

This CLI app is used for interacting with BUX databases or servers.

Learn more about BUX: https://GetBux.io

Directories

Path Synopsis
Package chalker is a logging interface for the commands->stdout and uses the chalk package
Package chalker is a logging interface for the commands->stdout and uses the chalk package
Package cmd is all the available commands for the bux-cli application
Package cmd is all the available commands for the bux-cli application
Package database is for a local storage layer for the application
Package database is for a local storage layer for the application

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL