vapor

module
v4.8.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: AGPL-3.0

README

Vapor

Build Status AGPL v3

Golang implemented sidechain for Bytom.

Requirements

  • Go version 1.11 or higher, with $GOPATH set to your preferred directory

Get source code

$ cd $GOPATH/src/github.com/bytom
$ git clone https://github.com/Bytom/vapor.git

Then, you have two ways to get vapor executable file:

  1. compile source code
  2. build it using Docker

Installation

$ cd $GOPATH/src/github.com/bytom/vapor
$ make install

Run Directly

Firstly, you need initialize node:

$ vapord init --chain_id=mainnet --home <vapor-data-path>

The default vapor data path (on the host) is:

  • Mac: ~/Library/Application Support/Vapor
  • Linux: ~/.vapor
  • Windows: %APPDATA%\Vapor

Then, start your node:

$ vapord node --home <vapor-data-path>

Running in Docker

Build the image
$ cd $GOPATH/src/github.com/bytom/vapor
$ docker build -t vapor .
Enter the iterative mode
$ docker run -it --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest

vapor data directory has three config files:

  • config.toml
  • federation.json
  • node_key.txt

Use exit to exit Docker's iterative mode.

Daemon mode

For example,

$ docker run -d --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest vapord node --web.closed --auth.disable

To list the running containners and check their container id, image, corresponding command, created time, status, name and ports being used:

$ docker container ls

or

$ docker ps

To execute a command inside a containner, for example:

$ docker exec -it <containerId> vaporcli create-access-token <tokenId>

To stop a running containner:

$ docker stop <containerId>

To remove a containner:

$ docker rm <containerId>
Reward distribution tool

After the supernode and alternative node receive the reward from the node, they will allocate the reward

according to the interest rate.

The reward calculation rules:

calculate the reward (consensus reward * interest rate * voting weight) according to the weight of votes

cast in consensus around, and choose how many rounds of consensus to allocate the reward flexibly.

Tool usage details

Merger utxo

UTXO has been merged to solve the problem that too much UTXO input causes a failed send transaction to fail. details

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 Bytom Core.
Package account stores and tracks accounts within a Bytom Core.
application
mov
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.
csp
ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
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).
sha3pool
Package sha3pool is a freelist for SHA3-256 hash objects.
Package sha3pool is a freelist for SHA3-256 hash objects.
storage
Package storage is a generated protocol buffer package.
Package storage is a generated protocol buffer package.
encoding
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.
compiler
Package equity provides a compiler for Bytom's Equity contract language.
Package equity provides a compiler for Bytom's Equity contract language.
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.
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/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 Just enough UPnP to be able to forward ports
Taken from taipei-torrent Just enough UPnP to be able to forward ports
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