Skip to content

Commit

Permalink
Readme refactor (#708)
Browse files Browse the repository at this point in the history
* 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
darrenvechain and otherview authored Apr 22, 2024
1 parent 388617b commit 6588f04
Show file tree
Hide file tree
Showing 9 changed files with 401 additions and 182 deletions.
225 changes: 47 additions & 178 deletions README.md
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)
&nbsp;&nbsp; [![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

Expand All @@ -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.
9 changes: 5 additions & 4 deletions .github/CONTRIBUTING.md → docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ current development landscape.
```bash
make test
```
- **Note:**: Please refer to the [README](https://github.com/vechain/thor/blob/master/README.md) for information on
- **Note**: Please refer to the [README](https://github.com/vechain/thor/blob/master/README.md) for information on
how to start the node and interact with the API.
5. Make your changes and commit them with a clear and concise commit message.
6. Push your changes to your forked repository. **Note:** All commits must be signed with a GPG key. If you haven't
already set up a GPG key, please refer to the GitHub documentation
on [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account).
6. Push your changes to your forked repository.
```bash
git push origin feature/your-feature-name
```
- **Note:** All commits must be signed with a GPG key. If you haven't already set up a GPG key, please refer to the
GitHub documentation
on [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account).
7. Create a pull request to the `master` branch of the `vechain/thor` repository.
8. Ensure your PR description clearly explains your changes and the problem it solves.
- Explain the major changes you are submitting for review. Often it is useful to open a second tab in your browser
Expand Down
5 changes: 5 additions & 0 deletions docs/SECURITY.md
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.
Binary file added docs/assets/banner-dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/banner-light-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/build.md
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
```
Loading

0 comments on commit 6588f04

Please sign in to comment.