A general purpose blockchain highly compatible with Ethereum's ecosystem
Clone or download
Latest commit 0501b01 Nov 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github doc: reorg issue template directory Jul 3, 2018
abi add license May 17, 2018
api test: optimize api block test Nov 2, 2018
block refactor(thor): remove signer cache Jun 4, 2018
builtin fix(builtin): incorrect 'listed' value when there's only one node Jun 29, 2018
cache add license May 17, 2018
chain FORK: reschedule the hotfix to block #1072000 Oct 26, 2018
cmd Update VERSION Nov 7, 2018
co feat(co): add Signal class Aug 27, 2018
comm perf(comm): set max size of offered blocks to 512KB Aug 21, 2018
consensus feat(consensus): NewRuntimeForReplay Oct 29, 2018
genesis FORK: reschedule the hotfix to block #1072000 Oct 26, 2018
kv add license May 17, 2018
logdb feat: filter events by multiple contracts and refactor transferfilter Sep 4, 2018
lvldb feat(lvldb): recover db on corrupted error Jun 27, 2018
metric add license May 17, 2018
p2psrv remove p2psrv/discv5, instead using go-ethereum's Aug 26, 2018
packer solo: prettify log output && add block gas limit flag Aug 21, 2018
poa style(poa): typo Jun 3, 2018
runtime feat(rt): add tx executor to allow step over clause Oct 29, 2018
stackedmap add license May 17, 2018
state feat(state): add method BuildStorageTrie for debug purpose Oct 29, 2018
thor FORK: reschedule the hotfix to block #1072000 Oct 26, 2018
tracers refactor(debug): use new feats of cons and cons to simplify tracer code Oct 29, 2018
trie feat(trie): save secure key preimage mapping into db Oct 29, 2018
tx refactor(tx): accept variable args for IntrinsicGas; add some tests Jun 22, 2018
txpool feat(txpool): use bool pointer to present tx status Jul 6, 2018
vendor @ ace02b4 update deps Oct 29, 2018
vm refactor(runtime): reorg codes Jun 7, 2018
xenv perf(builtin.extension): reduce gas cost for extension methods; code … Jun 26, 2018
.gitignore ci(makefile): add dep option; use timestamp for fake gopath suffix Jun 20, 2018
.gitmodules deps: update goleveldb to fix 1T panic; add github.com/gorilla/websocket Aug 24, 2018
.travis.yml ci: turn on osx cases Aug 31, 2018
Dockerfile ci(docker): add dockerfile Jul 5, 2018
Gopkg.lock update deps Oct 29, 2018
Gopkg.toml using new vendor Aug 26, 2018
LICENSE chore(license): add license file Apr 17, 2018
Makefile build: add flag -vendor-only for dep ensure Aug 23, 2018
README.md build: add flag -vendor-only for dep ensure Aug 23, 2018
thorest.png doc: update api snapshot in readme Aug 29, 2018

README.md

VeChain Thor    Gitter

A general purpose blockchain highly compatible with Ethereum's ecosystem.

This is the first implementation written in golang.

Go Go Report Card Travis License

Table of contents

Installation

Requirements

Thor requires Go 1.10+ and C compiler to build. To install Go, follow this link.

Getting the source

Clone the Thor repo:

git clone https://github.com/vechain/thor.git
cd thor

Dependency management

Simply run:

make dep

To manually install dependencies, choices are

  • dep, Golang's official dependency management tool

    dep ensure -vendor-only
    

    (Note that to make dep work, you should put the source code at $GOPATH/src/github.com/vechain/thor)

  • git submodule

    git submodule update --init
    

Building

To build the main app thor, just run

make

or build the full suite:

make all

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

Running Thor

Connect to VeChain's mainnet:

bin/thor --network main

Connect to VeChain's testnet:

bin/thor --network test

To find out usages of all command line options:

bin/thor -h
  • --network value the network to join (main|test)
  • --data-dir value directory for block-chain databases
  • --beneficiary value address for block rewards
  • --api-addr value API service listening address (default: "localhost:8669")
  • --api-cors value comma separated list of domains from which to accept cross origin requests to API
  • --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")
  • --help, -h show help
  • --version, -v print the version

Sub-commands

  • solo client runs in solo mode for test & dev
bin/thor solo --on-demand               # create new block when there is pending transaction
bin/thor solo --persist                 # save blockchain data to disk(default to memory)
bin/thor solo --persist --on-demand     # two options can work together
  • master-key import and export master key
# export master key to keystore
bin/thor master-key --export > keystore.json


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

Docker

Docker is one quick way for running a vechain node:

docker run -d\
  -v {path-to-your-data-directory}/.org.vechain.thor:/root/.org.vechain.thor\
  -p 127.0.0.1:8669:8669 -p 11235:11235 -p 11235:11235/udp\
  --name thor-node vechain/thor --network test

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

The Dockerfile is designed to build the last release of the source code and will publish docker images to dockerhub by release, feel free to fork and build Dockerfile for your own purpose.

Explorers

Awesome explorers built by the community:

Testnet faucet

curl -X POST -d '{"to":"Your_Address"}' -H "Content-Type: application/json" https://faucet.outofgas.io/requests

API

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

Thorest

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 Thor

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

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