Skip to content

dgonzalez/go-spacemesh

 
 

Repository files navigation

Spacemesh logo

Make blockchain decentralized again™

go-spacemesh

Thanks for your interest in this open source project. This is the go implementation of the Spacemesh p2p node. Spacemesh is a decentralized blockchain computer using a new race-free consensus protocol that doesn't involve energy-wasteful proof of work. Spacemesh is designed to build a secure decentralized network formed by a large number of desktop PCs at home.

To learn more about SpaceMesh head over to our wiki.

Motivation

SpacemeshOS 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 OS 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 value related features to their apps at scale. Our goal is to create a truly decentralized cryptocoin 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.

Diggin' Deeper

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

Getting

install Go 1.9.2 or later for your platform

go get https://github.com/spacemeshos/go-spacemesh

or create this directory GOPATH$/src/spacemeshos/ and clone the repo into it using:

git clone https://github.com/spacemeshos/go-spacemesh

Next, get the dependencies using govendor. Run this from the project root directory:

go get -u github.com/kardianos/govendor
govendor sync

Building

To build go-spacemesh for your current system architecture use:

make

or

go build

from the project root directory. The binary go-spacemesh will be saved in the project root directory.

To build a binary for a specific architecture directory use:

make darwin | linux | windows

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

Running

./go-spacemesh

Testing

go test ./...

or

make test

Contributing

Thank you for considering to contribute to the go-spacemesh open source project. We welcome contributions large and small!

  • go-spacemesh is part of The Spacemesh open source project, and is MIT licensed open source software.
  • We welcome major contributors to the spacemesh core dev team.
  • Please make sure to scan the issues.
  • Search the closed ones before reporting things, and help us with the open ones.

Guidelines

  • Read the Spacemesh project white paper (coming soon)
  • Read all docs in the docs/ folder
  • Ask questions or talk about things in Issues or on spacemash gitter.
  • Ensure you are able to contribute (no legal issues please)
  • For any code contribution, please **fork from the develop branch and not from master), apply your changes and submit a pull request. We follow this git workflow
  • Before starting to work on large contributions please chat with the core dev team on our gitter channel to get some initial feedback prior to doing lots of work.
  • Check for 3rd-party packages in the vendor folder before adding a new 3rd party dependency.
  • Add new 3rd-party packages required by your code to vendor.json - don't use any other kind of deps importing.
  • Add the package name to your commit comment. e.g. node: added additional tests.
  • Squash your changes down to a single commit before submitting a PR and rebase on master so we can keep the commit timeline linear.
  • We adhere to the go standard formatting. Run go fmt before pushing any code
  • Get in touch with @avive about how best to contribute
  • Your code must be commented using go commentary
  • Have fun hacking away our blockchain future!

Few things you can do right now to help out:

  • Check out existing open issues. This would be especially useful for modules in active development.
  • Add tests. There can never be enough tests.

Next Steps...

  • Please read everything in /docs

Got Questions?

Additional info

Working with protobufs

Install:

go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go

To compile .proto files you need to install the protobufs go support After installing. You can compile a .proto file using:

cd pb
protoc --go_out=. ./*.proto

Working with Dependencies

We use govendor for all 3rd party packages. We commit to git all 3rd party packages in the vendor folder so we have our own copy of versioned releases. To update a 3rd party package use vendor.json and govendor commands.

About

Go Implementation of the Spacemesh blockchain p2p node

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.5%
  • Makefile 0.5%