cleanup readme

This commit is contained in:
Ethan Buchman 2017-01-29 12:43:30 -08:00
parent 8262d0cc71
commit 7bb21c4795
1 changed files with 15 additions and 28 deletions

View File

@ -10,9 +10,7 @@ Basecoin is a sample [ABCI application](https://github.com/tendermint/abci) desi
## Contents
1. [Installation](#installation)
1. [Learn Go](#learn-go)
1. [Using the plugin system](#using-the-plugin-system)
1. [Forking the codebase](#forking-the-codebase)
1. [Tutorials and other reading](#tutorials-and-other-reading)
## Installation
@ -26,15 +24,15 @@ make get_vendor_deps
make install
```
This will create the `basecoin` binary.
## Learn Go
Check out our [guide to programming in Go](/docs/go_basics.md).
This will create the `basecoin` binary in `$GOPATH/bin`.
## Using the Plugin System
Basecoin handles public-key authentication of transaction, maintaining the balance of arbitrary types of currency (BTC, ATOM, ETH, MYCOIN, ...), sending currency (one-to-one or n-to-n multisig), and providing merkle-proofs of the state. These are common factors that many people wish to have in a crypto-currency system, so instead of trying to start from scratch, you can take advantage of the basecoin plugin system.
Basecoin is designed to serve as a common base layer for developers building cryptocurrency applications.
It handles public-key authentication of transactions, maintaining the balance of arbitrary types of currency (BTC, ATOM, ETH, MYCOIN, ...),
sending currency (one-to-one or n-to-m multisig), and providing merkle-proofs of the state.
These are common factors that many people wish to have in a crypto-currency system,
so instead of trying to start from scratch, developers can extend the functionality of Basecoin using the plugin system!
The Plugin interface is defined in `types/plugin.go`:
@ -49,28 +47,17 @@ type Plugin interface {
}
```
`RunTx` is where you can handle any special transactions directed to your application. To see a very simple implementation, look at the demo [counter plugin](./plugins/counter/counter.go). If you want to create your own currency using a plugin, you don't have to fork basecoin at all. Just make your own repo, add the implementation of your custom plugin, and then build your own main script that instatiates BaseCoin and registers your plugin.
`RunTx` is where you can handle any special transactions directed to your application.
To see a very simple implementation, look at the demo [counter plugin](./plugins/counter/counter.go).
If you want to create your own currency using a plugin, you don't have to fork basecoin at all.
Just make your own repo, add the implementation of your custom plugin, and then build your own main script that instatiates Basecoin and registers your plugin.
An example is worth a 1000 words, so please take a look [at this example](https://github.com/tendermint/basecoin/blob/abci_proof/cmd/paytovote/main.go#L25-L31), in a dev branch for now. You can use the same technique in your own repo.
There are a lot of changes on the dev branch, which should be merged in my early February, so experiment, but things will change soon....
## Forking the Codebase
If you do want to fork basecoin, we would be happy if this was done in a public repo and any enhancements made as PRs on github. However, this is under the Apache license and you are free to keep the code private if you wish.
If you don't have much experience forking in go, there are a few tricks you want to keep in mind to avoid headaches. Basically, all imports in go are absolute from GOPATH, so if you fork a repo with more than one directory, and you put it under github.com/MYNAME/repo, all the code will start caling github.com/ORIGINAL/repo, which is very confusing. My prefered solution to this is as follows:
* Create your own fork on github, using the fork button.
* Go to the original repo checked out locally (from `go get`)
* `git remote rename origin upstream`
* `git remote add origin git@github.com:YOUR-NAME/basecoin.git`
* `git push -u origin master`
* You can now push all changes to your fork and all code compiles, all other code referencing the original repo, now references your fork.
* If you want to pull in updates from the original repo:
* `git fetch upstream`
* `git rebase upstream/master` (or whatever branch you want)
An example is worth a 1000 words, so please take a look [at this example](https://github.com/tendermint/basecoin/blob/develop/cmd/paytovote/main.go#L25-L31).
Note for now it is in a dev branch.
You can use the same technique in your own repo.
## Tutorials and Other Reading
See our [introductory blog post](https://cosmos.network/blog/cosmos-creating-interoperable-blockchains-part-1), which explains the motivation behind Basecoin.
We are working on some tutorials that will show you how to set up the genesis block, build a plugin to add custom logic, deploy to a tendermint testnet, and connect a UI to your blockchain. They should be published during the course of February 2017, so stay tuned....