bystack

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: AGPL-3.0

README

Bystack

Build Status AGPL v3

Official golang implementation of the Bystack protocol.

Automated builds are available for stable releases and the unstable master branch. Binary archives are published at https://github.com/Bytom/bystack/releases.

What is Bystack?

Bystack is software designed to operate and connect to highly scalable blockchain networks confirming to the Bystack Blockchain Protocol, which allows partipicants to define, issue and transfer digitial assets on a multi-asset shared ledger. Please refer to the White Paper for more details.

In the current state bystack is able to:

  • Manage key, account as well as asset
  • Send transactions, i.e., issue, spend and retire asset

Installing with Homebrew

brew tap bytom/bystack && brew install bystack

Building from source

Requirements
  • Go version 1.8 or higher, with $GOPATH set to your preferred directory
Installation

Ensure Go with the supported version is installed properly:

$ go version
$ go env GOROOT GOPATH
  • Get the source code
$ git clone https://github.com/Bytom/bystack.git $GOPATH/src/github.com/bytom/bystack
  • Build source code
$ cd $GOPATH/src/github.com/bytom/bystack
$ make bystackd    # build bystackd
$ make bystackcli  # build bystackcli

When successfully building the project, the bystackd and bystackcli binary should be present in cmd/bystackd and cmd/bystackcli directory, respectively.

Executables

The Bystack project comes with several executables found in the cmd directory.

Command Description
bystackd bystackd command can help to initialize and launch bystack domain by custom parameters. bystackd --help for command line options.
bystackcli Our main Bystack CLI client. It is the entry point into the Bystack network (main-, test- or private net), capable of running as a full node archive node (retaining all historical state). It can be used by other processes as a gateway into the Bystack network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. bystackcli --help and the bystackd Wiki page for command line options.

Running bystack

Currently, bystack is still in active development and a ton of work needs to be done, but we also provide the following content for these eager to do something with bystack. This section won't cover all the commands of bystackd and bystackcli at length, for more information, please the help of every command, e.g., bystackd help.

Initialize

First of all, initialize the node:

$ cd ./cmd/bystackd
$ ./bystackd init --chain_id mainnet

There are three options for the flag --chain_id:

  • mainnet: connect to the mainnet.
  • testnet: connect to the testnet wisdom.
  • solonet: standalone mode.

After that, you'll see config.toml generated, then launch the node.

launch
$ ./bystackd node

available flags for bystackd node:

Flags:
      --auth.disable                     Disable rpc access authenticate
      --chain_id string                  Select network type
  -h, --help                             help for node
      --log_file string                  Log output file (default "log")
      --log_level string                 Select log level(debug, info, warn, error or fatal)
      --p2p.dial_timeout int             Set dial timeout (default 3)
      --p2p.handshake_timeout int        Set handshake timeout (default 30)
      --p2p.keep_dial string             Peers addresses try keeping connecting to, separated by ',' (for example "1.1.1.1:46657;2.2.2.2:46658")
      --p2p.laddr string                 Node listen address. (0.0.0.0:0 means any interface, any port) (default "tcp://0.0.0.0:46656")
      --p2p.lan_discoverable             Whether the node can be discovered by nodes in the LAN (default true)
      --p2p.max_num_peers int            Set max num peers (default 50)
      --p2p.node_key string              Node key for p2p communication
      --p2p.proxy_address string         Connect via SOCKS5 proxy (eg. 127.0.0.1:1086)
      --p2p.proxy_password string        Password for proxy server
      --p2p.proxy_username string        Username for proxy server
      --p2p.seeds string                 Comma delimited host:port seed nodes
      --p2p.skip_upnp                    Skip UPNP configuration
      --prof_laddr string                Use http to profile bystackd programs
      --vault_mode                       Run in the offline enviroment
      --wallet.disable                   Disable wallet
      --wallet.rescan                    Rescan wallet
      --wallet.txindex                   Save global tx index
      --web.closed                       Lanch web browser or not
      --ws.max_num_concurrent_reqs int   Max number of concurrent websocket requests that may be processed concurrently (default 20)
      --ws.max_num_websockets int        Max number of websocket connections (default 25)

Global Flags:
      --home string   root directory for config and data
  -r, --root string   DEPRECATED. Use --home (default "/Users/zcc/Library/Application Support/Bystack")
      --trace         print out full stack trace on errors

Given the bystackd node is running, the general workflow is as follows:

  • create key, then you can create account and asset.
  • send transaction, i.e., build, sign and submit transaction.
  • query all kinds of information, let's say, avaliable key, account, key, balances, transactions, etc.
Dashboard

Access the dashboard:

$ open http://localhost:9888/
In Docker

Ensure your Docker version is 17.05 or higher.

$ docker build -t bystack .

For the usage please refer to running-in-docker-wiki.

Contributing

Thank you for considering helping out with the source code! Any contributions are highly appreciated, and we are grateful for even the smallest of fixes!

If you run into an issue, feel free to bystack issues in this repository. We are glad to help!

License

AGPL v3

Directories

Path Synopsis
Package accesstoken provides storage and validation of Chain Core credentials.
Package accesstoken provides storage and validation of Chain Core credentials.
Package account stores and tracks accounts within a Bystack Core.
Package account stores and tracks accounts within a Bystack Core.
blockchain
pseudohsm
Package pseudohsm provides a pseudo HSM for development environments.
Package pseudohsm provides a pseudo HSM for development environments.
rpc
signers
Package signers associates signers and their corresponding keys.
Package signers associates signers and their corresponding keys.
txbuilder
Package txbuilder builds a Chain Protocol transaction from a list of actions.
Package txbuilder builds a Chain Protocol transaction from a list of actions.
cmd
Package common contains various helper functions.
Package common contains various helper functions.
bech32
Package bech32 provides a Go implementation of the bech32 format specified in BIP 173.
Package bech32 provides a Go implementation of the bech32 format specified in BIP 173.
ed25519/chainkd
Package chainkd This is an extension to ed25519.Sign that is compatible with NaCl `crypto_sign` function taking 64-byte expanded private key (where the left part is a pre-multiplied scalar and the right part is "prefix" used for generating a nonce).
Package chainkd This is an extension to ed25519.Sign that is compatible with NaCl `crypto_sign` function taking 64-byte expanded private key (where the left part is a pre-multiplied scalar and the right part is "prefix" used for generating a nonce).
scrypt
import "golang.org/x/crypto/scrypt"
import "golang.org/x/crypto/scrypt"
sha3pool
Package sha3pool is a freelist for SHA3-256 hash objects.
Package sha3pool is a freelist for SHA3-256 hash objects.
sm2
crypto/x509 add sm2 support
crypto/x509 add sm2 support
sm3
sm4
storage
Package storage is a generated protocol buffer package.
Package storage is a generated protocol buffer package.
encoding
base32
Package base32 implements base32 encoding as specified by RFC 4648.
Package base32 implements base32 encoding as specified by RFC 4648.
blockchain
Package blockchain provides the tools for encoding data primitives in blockchain structures
Package blockchain provides the tools for encoding data primitives in blockchain structures
bufpool
Package bufpool is a freelist for bytes.Buffer objects.
Package bufpool is a freelist for bytes.Buffer objects.
Package env provides a convenient way to convert environment variables into Go data.
Package env provides a convenient way to convert environment variables into Go data.
Package errors implements a basic error wrapping pattern, so that errors can be annotated with additional information without losing the original error.
Package errors implements a basic error wrapping pattern, so that errors can be annotated with additional information without losing the original error.
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
lib
github.com/tendermint/go-wire/data
Data is designed to provide a standard interface and helper functions to easily allow serialization and deserialization of your data structures in both binary and json representations.
Data is designed to provide a standard interface and helper functions to easily allow serialization and deserialization of your data structures in both binary and json representations.
github.com/tendermint/tmlibs/flowrate
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
math
checked
Package checked implements basic arithmetic operations with underflow and overflow checks.
Package checked implements basic arithmetic operations with underflow and overflow checks.
net
http/httperror
Package httperror defines the format for HTTP error responses from Chain services.
Package httperror defines the format for HTTP error responses from Chain services.
http/httpjson
Package httpjson creates HTTP handlers to map request and response formats onto Go function signatures.
Package httpjson creates HTTP handlers to map request and response formats onto Go function signatures.
http/reqid
Package reqid creates request IDs and stores them in Contexts.
Package reqid creates request IDs and stores them in Contexts.
http/static
Package static provides a handler for serving static assets from an in-memory map.
Package static provides a handler for serving static assets from an in-memory map.
p2p
discover/dht
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
upnp
Taken from taipei-torrent
Taken from taipei-torrent
bc
Package bc is a generated protocol buffer package.
Package bc is a generated protocol buffer package.
vm
toolbar
mnemonic
Package bip39 is the official Golang implementation of the BIP39 spec.
Package bip39 is the official Golang implementation of the BIP39 spec.

Jump to

Keyboard shortcuts

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