workshare

module
v0.0.0-...-e4e12f0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: LGPL-3.0

README

Workshare

A blockchain of worker for everybody to make smart contracts or DApp.

This is the first implementation written in golang, now version 0.01, cann't be used now.

The goal is I help everybody, everybody help me--this means share.

So who want to make smart contracts or DApp on worker blockchain, then who should running a worker node for a longtime. The node can be a nat node.

It's compatible with Ethereum's ecosystem.

Table of contents

Installation

Requirements

Workshare requires Go 1.17+ and C compiler to build. To install Go, follow this link.

Getting the source

Clone the Workshare repo:

git clone https://github.com/miniBamboo/workshare.git
cd workshare
Dependency management

Simply run:

make dep

If you keep getting network error, it is suggested to use Go Module Proxy. https://proxy.golang.org/ is one option.

Building

To build the main app workshare, just run

make

or build the full suite:

make all

If no error reported, all built executable binaries will appear in folder bin.

Running Workshare

Connect to Workshare's mainnet:

bin/workshare --network main

Connect to Workshare's testnet:

bin/workshare --network test

or startup a custom network

bin/workshare --network <custom-net-genesis.json>

To find out usages of all command line options:

bin/workshare -h
  • --network value the network to join (main|test) or path to genesis file
  • --data-dir value directory for block-chain databases
  • --cache value megabytes of ram allocated to internal caching (default: 2048)
  • --beneficiary value address for block rewards
  • --target-gas-limit value target block gas limit (adaptive if set to 0) (default: 0)
  • --api-addr value API service listening address (default: "localhost:51991")
  • --api-cors value comma separated list of domains from which to accept cross origin requests to API
  • --api-timeout value API request timeout value in milliseconds (default: 10000)
  • --api-call-gas-limit value limit contract call gas (default: 50000000)
  • --api-backtrace-limit value limit the distance between 'position' and best block for subscriptions APIs (default: 1000)
  • --verbosity value log verbosity (0-9) (default: 3)
  • --max-peers value maximum number of P2P network peers (P2P network disabled if set to 0) (default: 25)
  • --p2p-port value P2P network listening port (default: 11235)
  • --nat value port mapping mechanism (any|none|upnp|pmp|extip:) (default: "none")
  • --bootnode value comma separated list of bootnode IDs
  • --skip-logs skip writing event|transfer logs (/logs API will be disabled)
  • --pprof turn on go-pprof
  • --disable-pruner disable state pruner to keep all history
  • --help, -h show help
  • --version, -v print the version
Sub-commands
  • solo client runs in solo mode for test & dev
bin/workshare solo --on-demand               # create new block when there is pending transaction
bin/workshare solo --persist                 # save blockchain data to disk(default to memory)
bin/workshare solo --persist --on-demand     # two options can work together
  • master-key master key management
# print the master address
bin/workshare master-key

# export master key to keystore
bin/workshare master-key --export > keystore.json


# import master key from keystore
cat keystore.json | bin/workshare master-key --import

Docker

Docker is one quick way for running a Workshare node:

docker run -d\
  -v {path-to-your-data-directory}/.link.workshare.chain:/root/.link.workshare.chain\
  -p 127.0.0.1:51991:51991 -p 11235:11235 -p 11235:11235/udp\
  --name workshare-node miniBamboo/workshare --network test

Do not forget to add the --api-addr 0.0.0.0:51991 flag if you want other containers and/or hosts to have access to the RESTful API. worksharebinds to localhost by default and it will not accept requests outside the container itself without the flag.

API

Once workshare started, online OpenAPI doc can be accessed in your browser. e.g. http://localhost:51991/ by default.

Acknowledgement

A Special shout out to following projects:

Contributing

Thanks you so much for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

Please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base.

Forking Workshare

When you "Fork" the project, GitHub will make a copy of the project that is entirely yours; it lives in your namespace, and you can push to it.

Getting ready for a pull request

Please check the following:

  • Code must be adhere to the official Go Formatting guidelines.
  • Get the branch up to date, by merging in any recent changes from the master branch.
Making the pull request
  • On the GitHub site, go to "Code". Then click the green "Compare and Review" button. Your branch is probably in the "Example Comparisons" list, so click on it. If not, select it for the "compare" branch.
  • Make sure you are comparing your new branch to master. It probably won't be, since the front page is the latest release branch, rather than master now. So click the base branch and change it to master.
  • Press Create Pull Request button.
  • Give a brief title.
  • Explain the major changes you are asking to be code reviewed. Often it is useful to open a second tab in your browser where you can look through the diff yourself to remind yourself of all the changes you have made.

License

Workshare is licensed under the GNU Lesser General Public License v3.0, also included in LICENSE file in repository.

Directories

Path Synopsis
api
doc
Package doc generated by go-bindata.// sources: swagger-ui/favicon-16x16.png swagger-ui/favicon-32x32.png swagger-ui/index.html swagger-ui/oauth2-redirect.html swagger-ui/swagger-ui-bundle.js swagger-ui/swagger-ui-standalone-preset.js swagger-ui/swagger-ui.css swagger-ui/swagger-ui.js workshare.yaml
Package doc generated by go-bindata.// sources: swagger-ui/favicon-16x16.png swagger-ui/favicon-32x32.png swagger-ui/index.html swagger-ui/oauth2-redirect.html swagger-ui/swagger-ui-bundle.js swagger-ui/swagger-ui-standalone-preset.js swagger-ui/swagger-ui.css swagger-ui/swagger-ui.js workshare.yaml
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
cmd
bootnode
disco runs a bootstrap node for the Ethereum Discovery Protocol.
disco runs a bootstrap node for the Ethereum Discovery Protocol.
builtin/gen
Package gen Code generated by go-bindata.
Package gen Code generated by go-bindata.
poa
vrf
Package vrf provides optimized Secp256k1Sha256Tai functions.
Package vrf provides optimized Secp256k1Sha256Tai functions.
Package lowrlp provides methods to perform low-level rlp encoding.
Package lowrlp provides methods to perform low-level rlp encoding.
Package muxdb implements the storage layer for block-chain.
Package muxdb implements the storage layer for block-chain.
discv5
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
rpc
Package state manages the main accounts trie.
Package state manages the main accounts trie.
Package tracers is a manager for transaction tracing engines.
Package tracers is a manager for transaction tracing engines.
native
Package native is a collection of tracers written in go.
Package native is a collection of tracers written in go.
Package trie implements Merkle Patricia Tries.
Package trie implements Merkle Patricia Tries.
vm
Package vm implements the Ethereum Virtual Machine.
Package vm implements the Ethereum Virtual Machine.
bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
bn256/google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.

Jump to

Keyboard shortcuts

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