-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add security.md file * chore: run md formatter * feat: update readme structure * feat: update banners * test: padding * test: padding * add readme sections * add readme sections * add installation.md and usage.md * fix typo * remove ds_store * add documentation descriptions * fix typo * add discovery and system requirements * fix typo * fix typo" * fix readme * formatting * reword hosting-a-node * fix typos * hosting: add section about options * add solidity note * fix typos * fixes for pr comments * update readme description * change installation to build * change installation to build * Update docs/usage.md Co-authored-by: Pedro Gomes <[email protected]> * Update docs/usage.md Co-authored-by: Pedro Gomes <[email protected]> * Update README.md --------- Co-authored-by: Pedro Gomes <[email protected]>
- Loading branch information
1 parent
388617b
commit 6588f04
Showing
9 changed files
with
401 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,199 +1,68 @@ | ||
# Vechain Thor | ||
<p align="center"> | ||
<a href="https://www.vechain.org/vechainthor/"> | ||
<picture style="padding: 80px;"> | ||
<source srcset="docs/assets/banner-dark-mode.png" media="(prefers-color-scheme: dark)" > | ||
<img src="docs/assets/banner-light-mode.png" style="padding: 20px;"> | ||
</picture> | ||
</a> | ||
</p> | ||
|
||
A general purpose blockchain highly compatible with Ethereum's ecosystem. | ||
--- | ||
|
||
This is the first implementation written in golang. | ||
## Getting Started | ||
|
||
[![Go](https://img.shields.io/badge/golang-%3E%3D1.19-orange.svg)](https://golang.org) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/vechain/thor)](https://goreportcard.com/report/github.com/vechain/thor) | ||
![GitHub Action Status](https://github.com/vechain/thor/actions/workflows/test.yaml/badge.svg) | ||
[![License](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://github.com/vechain/thor/blob/master/LICENSE) | ||
[![TG](https://img.shields.io/badge/chat-on%20telegram-blue)](https://t.me/VechainDevCommunity) | ||
VechainThor is the layer 1 blockchain, highly compatible† with Ethereum, which powers the vechain ecosystem. | ||
VechainThor is a public blockchain that is designed for mass adoption of blockchain technology by enterprise users of | ||
all sizes and is intended to serve as a foundation for a sustainable and scalable enterprise blockchain ecosystem. | ||
|
||
## Table of contents | ||
- † - VechainThor is currently up-to-date with the Ethereum's `Paris` hard fork, supporting Solidity version `0.8.18`. | ||
|
||
* [Installation](#installation) | ||
* [Requirements](#requirements) | ||
* [Clone the repo](#clone-the-repo) | ||
* [Building](#building) | ||
* [Running Thor](#running-thor) | ||
* [Sub-commands](#sub-commands) | ||
* [Docker](#docker) | ||
* [Explorers](#explorers) | ||
* [Faucet](#testnet-faucet) | ||
* [RESTful API](#api) | ||
* [Acknowledgement](#acknowledgement) | ||
* [Contributing](#contributing) | ||
___ | ||
|
||
## Installation | ||
## Documentation | ||
|
||
### Requirements | ||
- [Build](./docs/build.md) - How to build the `thor` binary. | ||
- [Usage](./docs/usage.md) - How to run thor with different configurations. | ||
- [Hosting a Node](./docs/hosting-a-node.md) - Considerations and requirements for hosting a node. | ||
- [Core Concepts](https://docs.vechain.org/core-concepts) - Core concepts of the VechainThor blockchain. | ||
- [API Reference](https://mainnet.vechain.org) - The API reference for the VechainThor blockchain. | ||
|
||
Thor requires `Go` 1.19+ and `C` compiler to build. To install `Go`, follow this [link](https://golang.org/doc/install). | ||
--- | ||
|
||
### Clone the repo | ||
## Community | ||
|
||
Clone the Thor repo: | ||
The VechainThor community can be found on [Discourse](https://vechain.discourse.group/) where you can ask questions, | ||
voice ideas, and share your projects with other people. | ||
|
||
```shell | ||
git clone https://github.com/vechain/thor.git | ||
cd thor | ||
``` | ||
The Vechain Improvement Proposals (VIPs) repository can be found [here](https://github.com/vechain/VIPs). | ||
|
||
To see a list of all available commands, run `make help` | ||
To chat with other community members you can join: | ||
|
||
### Building | ||
- [Telegram](https://t.me/VechainDevCommunity) | ||
- [Discord](https://discord.gg/vechain) | ||
|
||
To build the main app `thor`, just run | ||
Do note that our [Code of Conduct](./docs/CODE_OF_CONDUCT.md) applies to all vechain community channels. Users are | ||
**highly encouraged** to read and adhere to them to avoid repercussions. | ||
|
||
```shell | ||
make | ||
``` | ||
--- | ||
|
||
or build the full suite: | ||
|
||
```shell | ||
make all | ||
``` | ||
|
||
If no errors are reported, all built executable binaries will appear in folder *bin*. | ||
|
||
## Running Thor | ||
|
||
Connect to Vechain's mainnet: | ||
|
||
```shell | ||
bin/thor --network main | ||
``` | ||
|
||
Connect to Vechain's testnet: | ||
|
||
```shell | ||
bin/thor --network test | ||
``` | ||
|
||
or startup a custom network | ||
|
||
```shell | ||
bin/thor --network <custom-net-genesis.json> | ||
``` | ||
|
||
An example genesis config file can be found at [genesis/example.json](https://raw.githubusercontent.com/vechain/thor/master/genesis/example.json). | ||
|
||
To show usages of all command line options: | ||
|
||
```shell | ||
bin/thor -h | ||
``` | ||
|
||
|
||
| Flag | Description | | ||
|-----------------------------|------------------------------------------------------------------------------------------------------------| | ||
| `--network` | The network to join (main\|test) or path to the genesis file | | ||
| `--data-dir` | Directory for blockchain databases (default: "/Users/darren/Library/Application Support/org.vechain.thor") | | ||
| `--cache` | Megabytes of RAM allocated to trie nodes cache (default: 4096) | | ||
| `--beneficiary` | Address for block rewards | | ||
| `--target-gas-limit` | Target block gas limit (adaptive if set to 0) (default: 0) | | ||
| `--api-addr` | API service listening address (default: "localhost:8669") | | ||
| `--api-cors` | Comma-separated list of domains from which to accept cross-origin requests to API | | ||
| `--api-timeout` | API request timeout value in milliseconds (default: 10000) | | ||
| `--api-call-gas-limit` | Limit contract call gas (default: 50000000) | | ||
| `--api-backtrace-limit` | Limit the distance between 'position' and best block for subscriptions APIs (default: 1000) | | ||
| `--api-allow-custom-tracer` | Allow custom JS tracer to be used for the tracer API | | ||
| `--verbosity` | Log verbosity (0-9) (default: 3) | | ||
| `--max-peers` | Maximum number of P2P network peers (P2P network disabled if set to 0) (default: 25) | | ||
| `--p2p-port` | P2P network listening port (default: 11235) | | ||
| `--nat` | Port mapping mechanism (any\|none\|upnp\|pmp\|extip:<IP>) (default: "any") | | ||
| `--bootnode` | 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 | ||
|
||
```shell | ||
# create new block when there is pending transaction | ||
bin/thor solo --on-demand | ||
|
||
# save blockchain data to disk(default to memory) | ||
bin/thor solo --persist | ||
|
||
# two options can work together | ||
bin/thor solo --persist --on-demand | ||
``` | ||
|
||
* `master-key` master key management | ||
|
||
```shell | ||
# print the master address | ||
bin/thor 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: | ||
|
||
```shell | ||
docker run -d\ | ||
-v {path-to-your-data-directory}/.org.vechain.thor:/home/thor/.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. `Thor` binds to `localhost` by default and it will not accept requests outside the container itself without the flag._ | ||
|
||
Release [v2.0.4](https://github.com/vechain/thor/releases/tag/v2.0.4) changed the default user from `root` (UID: 0) to `thor` (UID: 1000). Ensure that UID 1000 has `rwx` permissions on the data directory of the docker host. You can do that with ACL `sudo setfacl -R -m u:1000:rwx {path-to-your-data-directory}`, or update ownership with `sudo chown -R 1000:1000 {path-to-your-data-directory}`. | ||
|
||
|
||
### Docker Compose | ||
|
||
A `docker-compose.yml` file is provided for convenience. It will create a container with the same configuration as the command above. | ||
|
||
```yaml | ||
version: '3.8.' | ||
|
||
services: | ||
thor-node: | ||
image: vechain/thor | ||
container_name: thor-node | ||
command: --network test --api-addr 0.0.0.0:8669 | ||
volumes: | ||
- thor-data:/home/thor | ||
ports: | ||
- "8669:8669" | ||
- "11235:11235" | ||
- "11235:11235/udp" | ||
|
||
volumes: | ||
thor-data: | ||
``` | ||
## Explorers | ||
## Contributing | ||
|
||
* [Vechain Explorer (Official)](https://explore.vechain.org) | ||
* [VechainStats](https://vechainstats.com/) | ||
* [Insight](https://insight.vecha.in/) | ||
Contributions to VechainThor are welcome and highly appreciated. However, before you jump right into it, we would like | ||
you to review our [Contribution Guidelines](./docs/CONTRIBUTING.md) to make sure you have a smooth experience | ||
contributing to VechainThor. | ||
|
||
## Testnet faucet | ||
--- | ||
|
||
* [faucet.vecha.in](https://faucet.vecha.in) by *Vechain Foundation* | ||
## Security | ||
|
||
## API | ||
If you believe you have found a security vulnerability in Thor, we encourage you to **_responsibly disclose this and NOT | ||
open a public issue_**. We will investigate all legitimate reports. | ||
|
||
Once `thor` has started, the online *OpenAPI* documentation can be accessed in your browser. e.g. [http://localhost:8669/](http://localhost:8669) by default. | ||
Email `[email protected]` to disclose any security vulnerabilities. Alternatively, you can visit | ||
this [link](https://support.vechain.org/support/home) to submit a ticket or find more information. | ||
|
||
[![Thorest](https://raw.githubusercontent.com/vechain/thor/master/thorest.png)](http://localhost:8669/) | ||
--- | ||
|
||
## Acknowledgement | ||
|
||
|
@@ -203,10 +72,10 @@ A special shout out to following projects: | |
* [Swagger](https://github.com/swagger-api) | ||
* [Stoplight Elements](https://github.com/stoplightio/elements) | ||
|
||
## Contributing | ||
|
||
- Please refer to [CONTRIBUTING.md](https://github.com/vechain/thor/blob/master/.github/CONTRIBUTING.md) on how to contribute to this project. | ||
--- | ||
|
||
## License | ||
|
||
Vechain Thor is licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.html), also included in *LICENSE* file in repository. | ||
Vechain Thor is licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.html), | ||
also included in *LICENSE* file in repository. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Reporting Security Issues | ||
|
||
If you believe you have found a security vulnerability in Thor, we encourage you to **_responsibly disclose this and NOT open a public issue_**. We will investigate all legitimate reports. | ||
|
||
Email `[email protected]` to disclose any security vulnerabilities. Alternatively, you can visit this [link](https://support.vechain.org/support/tickets/new) to submit a ticket or find more information. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Build | ||
|
||
### Requirements | ||
|
||
Thor requires `Go` 1.19+ and `C` compiler to build. To install `Go`, follow this [link](https://golang.org/doc/install). | ||
|
||
### Clone the repo | ||
|
||
Clone the Thor repo: | ||
|
||
```shell | ||
git clone https://github.com/vechain/thor.git | ||
cd thor | ||
``` | ||
|
||
To see a list of all available commands, run `make help` | ||
|
||
### Building | ||
|
||
To build the main app `thor`, just run | ||
|
||
```shell | ||
make | ||
``` | ||
|
||
or build the full suite: | ||
|
||
```shell | ||
make all | ||
``` | ||
|
||
If no errors are reported, all built executable binaries will appear in folder *bin*. | ||
|
||
```shell | ||
./bin/thor help | ||
``` |
Oops, something went wrong.