multivac

command module
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 16 Imported by: 0

README

MultiVAC Main

Installation

$ export GOPATH=$HOME/go
$ export GOBIN=$GOPATH/bin
$ export PATH=$PATH:$GOBIN
$ curl https://glide.sh/get | sh
  • Install lint libs
$ brew install golangci/tap/golangci-lint
$ go get -u golang.org/x/lint/golint
  • Run the following commands to obtain MultiVAC and install it:
$ git clone https://github.com/multivactech/MultiVAC $GOPATH/src/github.com/multivactech/MultiVAC
$ cd $GOPATH/src/github.com/multivactech/MultiVAC
$ glide update && glide install
$ ./install
  • A binary MultiVAC should be generated in GOBIN. Run it.
$ cd $GOBIN
$ MultiVAC

Development

Resolving dependencies

We use glide for dependency management. For the instruction on how to install glide and update dependencies with glide, please see https://glide.sh/.

Format your code

Call hooks/format.py to format your go code on any path under MultiVAC code base before committing changes:

$ $MultiVAC_PATH/hooks/format.py
Dependency injection

Check https://github.com/google/wire for detailed instruction.

The TL;DR instructions are:

  • Run go get github.com/google/wire/cmd/wire and ensuring that $GOPATH/bin is added to your $PATH.
  • Whenever you add a new injector file (with wire.Build, for example, adding a file like sync/injector.go), go to that package in command line, and run wire. Check if a generated wire_gen.go is generated in that package. But ignore this step if you did not add any injector file, normally you don't need this step.
  • Use ./install in root package to install MultiVAC instead of mere "go install".
Pre-submit

Install git hooks, you can trigger the following script from any path:

$ python $MultiVAC_PATH/hooks/install-hooks.py

If for any reason you don't want to run test for commit (such as in your local branch), you can run git commit --no-verify. But please specify the reason for skipping tests in commit message.

You can also run the pre-submit locally with command

$ $MultiVAC_PATH/hooks/pre-commit.py
Unit test

You might find yourself in the need to mock some interfaces. There are certain open source tools to help mock in golang easier. Such as mockery, you could follow the instructions in https://github.com/vektra/mockery. And you could refer to controller_test.go in processor/controller as an example.

Local end-to-end test

Check https://github.com/multivactech/testing-tools

Resources

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
base
db
rlp
vrf
configs
interface
isync
Package isync defines the interface of sync
Package isync defines the interface of sync
btclog
Package btclog defines an interface and default implementation for subsystem logging.
Package btclog defines an interface and default implementation for subsystem logging.
model
chaincfg
Package chaincfg defines chain configuration parameters.
Package chaincfg defines chain configuration parameters.
chaincfg/chainhash
Package chainhash provides abstracted hash functionality.
Package chainhash provides abstracted hash functionality.
wire
Package wire implements the bitcoin wire protocol.
Package wire implements the bitcoin wire protocol.
p2p
addrmgr
Package addrmgr implements concurrency safe Bitcoin address manager.
Package addrmgr implements concurrency safe Bitcoin address manager.
connmgr
Package connmgr implements a generic Bitcoin network connection manager.
Package connmgr implements a generic Bitcoin network connection manager.
peer
Package peer provides a common base for creating and managing Bitcoin network peers.
Package peer provides a common base for creating and managing Bitcoin network peers.
pos
processor
rpc
btcjson
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.
rpcclient
Package rpcclient implements a websocket-enabled Bitcoin JSON-RPC client.
Package rpcclient implements a websocket-enabled Bitcoin JSON-RPC client.
rpcserver/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.

Jump to

Keyboard shortcuts

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