Skip to content

Commit

Permalink
Update README.md and fix linting errors (#3407)
Browse files Browse the repository at this point in the history
## Motivation

I updated some outdated information in the README.md file and fixed issues reported by [markdownlint](https://github.com/DavidAnson/markdownlint)

## Changes

* Updated formatting of README.md
* Removed or corrected outdated information

## Test Plan

No code change, only needs review for correctness.

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
  • Loading branch information
fasmat committed Aug 5, 2022
1 parent bfc209e commit 014fe9b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ COPY scripts/* scripts/

# does not required yet
# RUN go run scripts/check-go-version.go --major 1 --minor 15
RUN go mod download
RUN go mod download
RUN GO111MODULE=off go get golang.org/x/lint/golint

# This image builds the go-spacemesh server
Expand Down
110 changes: 61 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<h1>
<a href="https://spacemesh.io">Spacemesh: A Programmable Cryptocurrency</a>
</h1>

<a href="https://github.com/spacemeshos/go-spacemesh/blob/master/LICENSE"><img src="https://img.shields.io/packagist/l/doctrine/orm.svg"/></a>
<a href="https://github.com/spacemeshos/go-spacemesh/releases"><img src="https://img.shields.io/github/v/release/spacemeshos/go-spacemesh?include_prereleases"/></a>
<img src="https://img.shields.io/badge/platform-win--64 | macos--64 | linux--64 | freebsd-lightgrey.svg"/>
<a href="https://golang.org/"><img src="https://img.shields.io/github/go-mod/go-version/spacemeshos/go-spacemesh?logo=go"/></a>
<a href="https://github.com/spacemeshos/go-spacemesh/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues-raw/spacemeshos/go-spacemesh/help%20wanted?logo=github"/></a>
<a href="http://chat.spacemesh.io/"><img src="https://img.shields.io/discord/623195163510046732?label=discord&logo=discord"/></a>
<a href="https://spacemesh.io"><img src="https://img.shields.io/badge/madeby-spacemeshos-blue.svg"/></a>
# [Spacemesh: A Programmable Cryptocurrency](https://spacemesh.io)

[![license](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://github.com/spacemeshos/go-spacemesh/blob/master/LICENSE)
[![release](https://img.shields.io/github/v/release/spacemeshos/go-spacemesh?include_prereleases)](https://github.com/spacemeshos/go-spacemesh/releases)
![platform](https://img.shields.io/badge/platform-win--64%20|%20macos--64%20|%20linux--64%20|%20freebsd-lightgrey.svg)
[![go version](https://img.shields.io/github/go-mod/go-version/spacemeshos/go-spacemesh?logo=go)](https://go.dev/)
[![open help wanted issues](https://img.shields.io/github/issues-raw/spacemeshos/go-spacemesh/help%20wanted?logo=github)](https://github.com/spacemeshos/go-spacemesh/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
[![discord](https://img.shields.io/discord/623195163510046732?label=discord&logo=discord)](http://chat.spacemesh.io/)
[![made by](https://img.shields.io/badge/madeby-spacemeshos-blue.svg)](https://spacemesh.io)
[![Go Report Card](https://goreportcard.com/badge/github.com/spacemeshos/go-spacemesh)](https://goreportcard.com/report/github.com/spacemeshos/go-spacemesh)
[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/22421)
<a href="https://godoc.org/github.com/spacemeshos/go-spacemesh"><img src="https://img.shields.io/badge/godoc-LGTM-blue.svg"/></a>
[![godoc](https://img.shields.io/badge/godoc-LGTM-blue.svg)](https://godoc.org/github.com/spacemeshos/go-spacemesh)
[![CI: passing](https://img.shields.io/badge/CI-passing-success?logo=github&style=flat)](https://github.com/spacemeshos/go-spacemesh/blob/develop/ci.md#ci-status)

## go-spacemesh

💾⏰💪

Thanks for your interest in this open source project. This repo is the go implementation of the [Spacemesh](https://spacemesh.io) p2p full node software.

Spacemesh is a decentralized blockchain computer using a new race-free consensus protocol that doesn't involve energy-wasteful `proof of work`.
Expand All @@ -29,20 +29,25 @@ To learn more about Spacemesh head over to [https://spacemesh.io](https://spacem
To learn more about the Spacemesh protocol [watch this video](https://www.youtube.com/watch?v=jvtHFOlA1GI).

### Motivation

Spacemesh is designed to create a decentralized blockchain smart contracts computer and a cryptocurrency that is formed by connecting the home PCs of people from around the world into one virtual computer without incurring massive energy waste and mining pools issues that are inherent in other blockchain computers, and provide a provably-secure and incentive-compatible smart contracts execution environment.

Spacemesh is designed to be ASIC-resistant and in a way that doesn’t give an unfair advantage to rich parties who can afford setting up dedicated computers on the network. We achieve this by using a novel consensus protocol and optimize the software to be most effectively be used on home PCs that are also used for interactive apps.

### What is this good for?

Provide dapp and app developers with a robust way to add value exchange and other value related features to their apps at scale. Our goal is to create a truly decentralized cryptocurrency that fulfills the original vision behind bitcoin to become a secure trustless store of value as well as a transactional currency with extremely low transaction fees.

### Target Users

go-spacemesh is designed to be installed and operated on users' home PCs to form one decentralized computer. It is going to be distributed in the Spacemesh App but people can also build and run it from source code.

### Project Status

We are working hard towards our first major milestone - a public permissionless testnet running the Spacemesh consensus protocol.

### Contributing

Thank you for considering to contribute to the go-spacemesh open source project!

We welcome contributions large and small and we actively accept contributions.
Expand All @@ -60,25 +65,20 @@ We welcome contributions large and small and we actively accept contributions.
- Get ethereum awards for your contribution by working on one of our [gitcoin funded issues](https://gitcoin.co/profile/spacemeshos).

### Diggin' Deeper

Please read the Spacemesh [full FAQ](https://github.com/spacemeshos/go-spacemesh/wiki/Spacemesh-FAQ).

### go-spacemesh Architecture
![](https://raw.githubusercontent.com/spacemeshos/product/master/resources/go-spacemesh-architecture.png)

### High Level Design
![](https://raw.githubusercontent.com/spacemeshos/go-spacemesh/master/research/sp_arch_3.png)

### Client Software Architecture
![](https://raw.githubusercontent.com/spacemeshos/go-spacemesh/master/research/sm_arch_4.png)
![Architecture](https://raw.githubusercontent.com/spacemeshos/product/master/resources/go-spacemesh-architecture.png)

### Getting

```bash
git clone [email protected]:spacemeshos/go-spacemesh.git
```
_-- or --_

Fork the project from https://github.com/spacemeshos/go-spacemesh
or fork the project from <https://github.com/spacemeshos/go-spacemesh>

Since the project uses Go Modules it is best to place the code **outside** your `$GOPATH`. Read [this](https://github.com/golang/go/wiki/Modules#how-to-install-and-activate-module-support) for alternatives.

Expand All @@ -88,18 +88,21 @@ Building is supported on OS X, Linux, FreeBSD, and Windows.

Install [Go 1.18 or later](https://golang.org/dl/) for your platform, if you haven't already.

On Windows you need to install `make` via [msys2](https://www.msys2.org/), [MingGW-w64](http://mingw-w64.org/doku.php) or [mingw] (https://chocolatey.org/packages/mingw)
On Windows you need to install `make` via [msys2](https://www.msys2.org/), [MingGW-w64](http://mingw-w64.org/doku.php) or [mingw](https://chocolatey.org/packages/mingw)

Ensure that `$GOPATH` is set correctly and that the `$GOPATH/bin` directory appears in `$PATH`.

Before building we need to set up the golang environment. Do this by running:

```bash
make install
```

### Building

To build `go-spacemesh` for your current system architecture, from the project root directory, use:
```

```bash
make build
```

Expand All @@ -108,18 +111,21 @@ make build
This will build the `go-spacemesh` binary, saving it in the `build/` directory.

To build a binary for a specific architecture directory use:
```

```bash
make darwin | linux | freebsd | windows
```

Platform-specific binaries are saved to the `/build` directory.

### Using `go build` and `go test` without `make`

To build code without using `make` the `CGO_LDFLAGS` environment variable must be set
appropriately. The required value can be obtained by running `make print-ldflags` or
`make print-test-ldflags`.

This can be done in 3 ways:

1. Setting the variable in the shell environment (e.g., in bash run `CGO_LDFLAGS=$(make print-ldflags)`).
2. Prefixing the key and value to the `go` command (e.g., `CGO_LDFLAGS=$(make print-ldflags) go build`).
3. Using `go env -w CGO_LDFLAGS=$(make print-ldflags)`, which persistently adds this value to Go's
Expand All @@ -138,62 +144,61 @@ To run go-spacemesh you need to specify the parameters shared between all instan
You specify these parameters by providing go-spacemesh with a json config file. Other CLI flags control local node behavior and override default values.

#### Joining a Testnet (without mining)

1. Build go-spacemesh from source code.
2. Download the testnet's json config file. Make sure your local config file suffix is .json.
2. Download the testnet's json config file. Make sure your local config file suffix is `.json`.
3. Start go-spacemesh with the following arguments:

```bash
./go-spacemesh --tcp-port [a_port] --config [configFileLocation] -d [nodeDataFilesPath]
```
```bash
./go-spacemesh --listen [a_multiaddr] --config [configFileLocation] -d [nodeDataFilesPath]
```

##### Example
Assuming tn1.json is a testnet config file saved in the same directory as go-spacemesh, use the following command to join the testnet. The data folder will be created in the same directory as go-spacemesh. The node will use TCP port 7513 and UDP port 7513 for p2p connections:
**Example:**

```bash
./go-spacemesh --tcp-port 7513 --config ./tn1.json -d ./sm_data
```
Assuming `tn1.json` is a testnet config file saved in the same directory as go-spacemesh, use the following command to join the testnet. The data folder will be created in the same directory as go-spacemesh. The node will use TCP port 7513 and UDP port 7513 for p2p connections:

4. Build the [CLI Wallet](https://github.com/spacemeshos/CLIWallet) from source code and run it:
```bash
./go-spacemesh --listen /ip4/0.0.0.0/tcp/7513 --config ./tn1.json -d ./sm_data
```

4. Build the [CLI Wallet](https://github.com/spacemeshos/CLIWallet) from source code and run it:
5. Use the CLI Wallet commands to setup accounts, start smeshing and execute transactions.


```bash
./cli_wallet
```

#### Joining a Testnet (with mining)

1. Run go-spacemesh to join a testnet without mining (see above).
2. Run the CLI Wallet to create a coinbase account. Save your coinbase account public address - you'll need it later.
3. Stop go-spacemesh and start it with the following params:
```bash
./go-spacemesh --tcp-port [a_port] --config [configFileLocation] -d [nodeDataFilesPath] --coinbase [coinbase_account] --start-mining --post-datadir [dir_for_post_data]
```

##### Example
```bash
./go-spacemesh --tcp-port 7513 --config ./tn1.json -d ./sm_data --coinbase 0x36168c60e06abbb4f5df6d1dd6a1b15655d71e75 --start-mining --post-datadir ./post_data
```
```bash
./go-spacemesh --listen [a_multiaddr] --config [configFileLocation] -d [nodeDataFilesPath] --coinbase [coinbase_account] --start-mining --post-datadir [dir_for_post_data]
```
4. Use the CLI wallet to check your coinbase account balance and to transact
**Example:**
#### Joining Spacemesh ([TweedleDee](https://testnet.spacemesh.io/#/?id=what-is-spacemesh-01-tweedledee)) Testnet
Find the latest Testnet release in the [releases](https://github.com/spacemeshos/go-spacemesh/releases/) and download the precompiled binary for your platform of choice (or you can compile `go-spacemesh` yourself, from source, using the release tag). The release notes contain a link to a `config.json` file that you'll need to join the testnet.
```bash
./go-spacemesh --listen /ip4/0.0.0.0/tcp/7513 --config ./tn1.json -d ./sm_data --coinbase 0x36168c60e06abbb4f5df6d1dd6a1b15655d71e75 --start-mining --post-datadir ./post_data
```
Note that you must download (or build) precisely this version (latest Testnet release) of `go-spacemesh`, and the compatible config file, in order to join the current testnet. Older versions of the code may be incompatible with this testnet, and a different config file will not work.
4. Use the CLI wallet to check your coinbase account balance and to transact
---
### Testing
*NOTE*: if tests are hanging try running `ulimit -n 400`. some tests require that to work.
```
```bash
make test
```
or
```
```bash
make cover
```
Expand All @@ -202,14 +207,18 @@ make cover
We've enabled continuous integration on this repository in GitHub. You can read more about [our CI workflows](ci.md).

### Docker

A `Dockerfile` is included in the project allowing anyone to build and run a docker image:

```bash
docker build -t spacemesh .
docker run -d --name=spacemesh spacemesh
```

### Windows

On Windows you will need the following prerequisites:

- Powershell - included by in Windows by default since Windows 7 and Windows Server 2008 R2
- [Git for Windows](https://gitforwindows.org/) - after installation remove `C:\Program Files\Git\bin` from [System PATH](https://www.java.com/en/download/help/path.xml) (if present) and add `C:\Program Files\Git\cmd` to System PATH (if not already present)
- [Make](http://gnuwin32.sourceforge.net/packages/make.htm) - after installation add `C:\Program Files (x86)\GnuWin32\bin` to System PATH
Expand All @@ -219,16 +228,19 @@ On Windows you will need the following prerequisites:
Close and reopen powershell to load the new PATH. You can then run the command `make install` followed by `make build` as on UNIX-based systems.
### Running a Local Testnet
- You can run a local Spacemesh Testnet with 6 full nodes, 6 user accounts, and 1 POET support service on your computer using docker.
- The local testnet full nodes are built from this repo.
- This is a great way to get a feel for the protocol and the platform and to start hacking on Spacemesh.
- Follow the steps in our [Local Testnet Guide](https://testnet.spacemesh.io/#/README)
#### Next Steps...
#### Next Steps
- Please visit our [wiki](https://github.com/spacemeshos/go-spacemesh/wiki)
- Browse project [go docs](https://godoc.org/github.com/spacemeshos/go-spacemesh)
- Spacemesh Protocol [video overview](https://www.youtube.com/watch?v=jvtHFOlA1GI)
### Got Questions?
- Introduce yourself and ask anything on [Discord](http://chat.spacemesh.io/).
- DM [@teamspacemesh](https://twitter.com/teamspacemesh)
4 changes: 2 additions & 2 deletions legal.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ By participating in the program, you agree to these terms and conditions.

The bounty program is an experimental and discretionary rewards program to
encourage and reward those who are helping to improve the platform. It is not
a competition.
a competition.

You should know that we can cancel or amend the terms of the
program at any time, and we have the sole discretion to determine whether or
not the criteria to qualifications for compensation hereunder are met in a
satisfactory manner.
satisfactory manner.

When compensated in Ethereum cryptocoins, the amount will be determined according to the $ value of the cryptocoin on the
date of payment.
Expand Down

0 comments on commit 014fe9b

Please sign in to comment.