mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
Cleanup docs before testnet2 (#798)
* move FAQ.md to https://github.com/mimblewimble/docs/wiki/FAQ and unduplicate (Troubleshooting segment already present on its own wiki page) * Update doc/style and move it into CONTRIBUTING. * group up docs overview for more clarity * link to previously unlinked content in the docs overview * update + cleanup doc/build * Update links to reflect troubleshooting is now only in the wiki * More link fixes and spelling * Remove doc/usage.md that I've faile to keep updated, and use a wiki page instead * Last forgotten CONTRIBUTING.md fix
This commit is contained in:
parent
2fb97eb87f
commit
7c3994e521
7 changed files with 175 additions and 280 deletions
|
@ -13,8 +13,51 @@ Find us:
|
|||
* Chat: [Gitter](https://gitter.im/grin_community/Lobby).
|
||||
* Mailing list: join the [~MimbleWimble team](https://launchpad.net/~mimblewimble) and subscribe on Launchpad.
|
||||
|
||||
## Style Guide
|
||||
# Grin Style Guide
|
||||
|
||||
For info on the Grin style guide, see the [style docs](doc/style.md).
|
||||
Grin uses `rustfmt` to maintain consistent formatting.
|
||||
Please use the git commit hook as explained below.
|
||||
|
||||
Grin leverages `rustfmt` to maintain consistent formatting (and a [git commit hook](doc/style.md) to run it).
|
||||
## Install rustfmt
|
||||
|
||||
You should use rustup. See [build docs](doc/build.md) for more info.
|
||||
|
||||
```
|
||||
rustup component add rustfmt-preview
|
||||
rustup update
|
||||
rustfmt --version
|
||||
```
|
||||
|
||||
and verify you did get version `0.3.4-nightly (6714a44 2017-12-23)` or newer.
|
||||
|
||||
## Install git pre-commit hook
|
||||
|
||||
There is a basic git [pre-commit](../.hooks/pre-commit) hook in the repo.
|
||||
|
||||
The pre-commit hook will not prevent commits if style issues are present but it will
|
||||
indicate any files that need formatting.
|
||||
|
||||
To enable this, create a symlink in `.git/hooks` (note the relative path) -
|
||||
|
||||
```
|
||||
cd .git/hooks
|
||||
ln -s -f ../../.hooks/pre-commit
|
||||
```
|
||||
|
||||
## Running rustfmt
|
||||
|
||||
You can run rustfmt (i.e. rustfmt-preview) on one file or on all files.
|
||||
|
||||
First try a dry-run on a file you've worked on, say:
|
||||
`rustfmt --write-mode diff -- client.rs`
|
||||
|
||||
Any errors or rustfmt failures? Fix those manually.
|
||||
|
||||
Then let rustfmt make any further changes and save you the work:
|
||||
|
||||
`rustfmt --write-mode overwrite -- client.rs`
|
||||
|
||||
*Please add the rustfmt corrections as a separate commit at the end of your Pull Request to make the reviewers happy.*
|
||||
|
||||
|
||||
And don't use ~~`cargo +nightly fmt`~~ if at all possible.
|
||||
|
|
52
doc/FAQ.md
52
doc/FAQ.md
|
@ -1,52 +0,0 @@
|
|||
# FAQ
|
||||
|
||||
- Q: What is grin? A: An implementation of [MimbleWimble](https://download.wpsoftware.net/bitcoin/wizardry/mimblewimble.txt)
|
||||
- Q: Similar to Bitcoin? A: Both are outputs-based, PoW. See also [Grin for Bitcoiners](grin4bitcoiners.md)
|
||||
- Q: Mining? A: Testnet only. CPU, synchronous. GPU or asynchronous is not yet supported.
|
||||
- Q: Block height? A: HTTP GET /v1/chain on a public peer node, for example http://testnet1.yeastplume.com:13413/v1/chain or [grintest.net](https://grintest.net/)
|
||||
- Q: Store of value? A: Not yet. Wait for Mainnet. Testnet1 can still disappear and reappear unexpectedly.
|
||||
- Q: Block size limit? Target mean block time? A: Target mean block time is 1 block per 60 seconds. The size is limited by transaction "weight", though there is also a hard cap on the order of tens of MB.
|
||||
- Q: Does grin scale? A: Yes, it might eventually do, thanks to transaction cut-through and possible layer 2 solutions.
|
||||
- Q: Fees? Monetary policy? A: https://github.com/mimblewimble/grin/wiki/fees-mining
|
||||
- Q: Roadmap? A: Moving fast, changing things. Maybe look at [issues and milestones](https://github.com/mimblewimble/grin/milestones)
|
||||
- Q: Proof of payment? A: Planned. Maybe in Testnet2
|
||||
- Q: Microtransactions? A: On Testnet1, fees are 0.8% on a transaction of 1.0 coins.
|
||||
- Q: Could grin ever support or make use of:
|
||||
☑ Probably, or ☐ Probably not
|
||||
A: ☑ Contracts, ☑ [Pruning](pruning.md), ☐ Identity, like bitauth, ☑ SNARKs, [☑ Cross chain atomic swaps, ☑ multisig, ☑ time locks, ☑ lightning network](grin4bitcoiners.md#scripting), ☑ Payment channels, ☑ hidden nodes / onion routing, ☑ [Scripting - clean & native w/ tiny limits](https://lists.launchpad.net/mimblewimble/msg00029.html)
|
||||
- Q: HW requirements for mining? A: Not much. Don't invest in equipment yet, there's not even a final beta released, and a lot can change before any official blockchain is launched.
|
||||
- Q: Quantum safe? A: No. Given sufficient warning, some QC resistance can be introduced through softforks.
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
## Coins are 'confirmed but still locked'?
|
||||
Like other cryptocurrencies, newly mined coins are time locked, so mined coins can't be spent immediately.
|
||||
|
||||
## "Peer request error" or other peer/network issues after restarting grin server
|
||||
Possible workaround is `rm -rf .grin/peers/*` then restart.
|
||||
|
||||
## grin server or wallet crashes or hangs
|
||||
Yes, this still happens quite often. You'll need to babysit grin.
|
||||
Very welcome any solutions to give grin a "watchdog" solution that can restart
|
||||
grin in case of trouble.
|
||||
|
||||
## Build error: Could not compile `tokio-retry`.
|
||||
You might want to remove any previous rust installations to avoid conflicts.
|
||||
Use `rustup` to [reinstall rust and cargo as described](build.md).
|
||||
|
||||
NOTE: If you install rust or cargo with your package manager (most Linuxes
|
||||
anno 2017) you'll get too old versions. On Debian, you might have to manually
|
||||
compile cmake or get it from non-default repositories.
|
||||
|
||||
## Build error: `failed to select a version for 'serde_json'`
|
||||
Run `cargo update` to fix this
|
||||
|
||||
## Build error: Panic during rocksdb compilation.
|
||||
This is caused by missing Linux headers. Install the development headers with
|
||||
your favorite package manager (usually they are called `linux-headers`).
|
||||
On some platforms, installing `clang` is also required.
|
||||
|
||||
# Short term plans
|
||||
## Transaction types
|
||||
- (DONE) A temporary simple transaction exchange. Temporary - will be deprecated.
|
||||
- (months) Maybe in testnet2 Full transaction; an exchange which involves a full roundtrip between sender and receiver using aggregate (Schnorr) signatures. Usable as proof of payment and for multisig.
|
209
doc/build.md
209
doc/build.md
|
@ -1,85 +1,79 @@
|
|||
# Grin - Build, Configuration, and Running
|
||||
|
||||
# Building
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
Note that it's still too early in development to declare 'officially supported' plaforms, but at the moment, the situation is:
|
||||
Longer term, most platforms will likely be supported to some extent.
|
||||
Grin's programming language `rust` has build targets for most platforms.
|
||||
|
||||
* Linux - Primary platform (x86 only, at present, but also known to work on ARMv7), as most development and testing is happening here
|
||||
* Mac OS - Known to work, but may be slight hiccups
|
||||
* Windows - Known to compile, but working status unknown, and not a focus for the development team at present. Note that no mining plugins will be present on a Windows system after building Grin.
|
||||
|
||||
The instructions below will assume a Linux system.
|
||||
|
||||
## Build Prerequisites
|
||||
|
||||
In order to compile and run Grin on your machine, you should have installed:
|
||||
|
||||
* <b>Git</b> - to clone the repository
|
||||
* <b>cmake</b> - 3.2 or greater should be installed and on your $PATH. Used by the build to compile the mining plugins found in the included [Cuckoo Miner](https://github.com/mimblewimble/cuckoo-miner)
|
||||
* <b>clang</b> - required by rocksdb dependency, used by grin as a datastore
|
||||
* <b>libncurses</b> - required for a nicer terminal experience, look for `libncurses5` and `libncurses5w` packages.
|
||||
* <b>Rust</b> - 1.21.0 or greater via [Rustup](https://www.rustup.rs/) - Can be installed via your package manager or manually via the following commands:
|
||||
```
|
||||
curl https://sh.rustup.rs -sSf | sh
|
||||
source $HOME/.cargo/env
|
||||
```
|
||||
Note that the compiler also requires up to 2Gb of available memory.
|
||||
|
||||
## Build Instructions (Linux/Unix)
|
||||
What's working so far?
|
||||
* Linux x86_64 and MacOS [grin + mining + development]
|
||||
* Not Windows 10 yet [grin kind-of builds. No mining yet. Help wanted!]
|
||||
|
||||
|
||||
### Clone Grin
|
||||
## Requirements
|
||||
|
||||
```
|
||||
git clone https://github.com/mimblewimble/grin.git
|
||||
```
|
||||
See [Requirements on the wiki](https://github.com/mimblewimble/docs/wiki/Building).
|
||||
|
||||
But basically:
|
||||
- rust 1.21+ (use [rustup]((https://www.rustup.rs/))- i.e. `curl https://sh.rustup.rs -sSf | sh; source $HOME/.cargo/env`)
|
||||
- cmake 3.2+ (for [Cuckoo mining plugins]((https://github.com/mimblewimble/cuckoo-miner)))
|
||||
- rocksdb + libs for compiling rocksdb:
|
||||
- clang (clanglib or clang-devel or libclang-dev)
|
||||
- llvm (Fedora llvm-devel, Debian llvm-dev)
|
||||
- ncurses and libs (ncurses ncurses5w)
|
||||
- linux-headers (reported needed on Alpine linux)
|
||||
|
||||
|
||||
## Build steps
|
||||
|
||||
### Build Grin
|
||||
```sh
|
||||
cd grin
|
||||
# if running a testnet1 node, check out the correct branch:
|
||||
git checkout milestone/testnet1
|
||||
cargo build
|
||||
git clone https://github.com/mimblewimble/grin.git
|
||||
cd grin
|
||||
# Decide yourself if you want master, another branch, or tag
|
||||
cargo update # first time, in case you have some old stuff
|
||||
cargo build
|
||||
# or: cargo install && cargo clean # if you don't plan to build again soon
|
||||
```
|
||||
## Build errors
|
||||
See [Troubleshooting](FAQ.md#troubleshooting)
|
||||
|
||||
#### Cross-compiling
|
||||
|
||||
It should be fairly easy and cheap to build and run a validating node everywhere (wherever Rust can run). That being said, it is possible to cross-compile `grin` on a x86 Linux platform and produce ARM binaries, for example, in order to run on a Raspberry Pi. You will need to use the `milestone/testnet1` branch and uncomment the `no-plugin-build` feature as documented [below](#cuckoo-miner-considerations) to avoid compiling and running the mining plugins.
|
||||
### Cross-builds
|
||||
|
||||
If you have any issues with native cross-compilation in your host system, you can try using Docker and [rust-on-raspberry-docker](https://github.com/kargakis/rust-on-raspberry-docker).
|
||||
Rust (cargo) can build grin for many platforms, so in theory running `grin`
|
||||
as a validating node on your low powered device might be possible.
|
||||
To cross-compile `grin` on a x86 Linux platform and produce ARM binaries,
|
||||
say, for a Raspberry Pi, uncomment or add the `no-plugin-build` feature in
|
||||
`grin.toml` to avoid the mining plugins.
|
||||
|
||||
### Cuckoo-Miner considerations
|
||||
|
||||
If you're having issues with building cuckoo-miner plugins (which will usually manifest as a lot of C errors when building the `grin_pow` crate, you can turn mining plugin builds off by editing the file `pow/Cargo.toml' as follows:
|
||||
### Building the Cuckoo-Miner plugins
|
||||
|
||||
```toml
|
||||
# uncomment this feature to turn off plugin builds
|
||||
Building `grin_pow` might fail if you're not on a x86_64 system,
|
||||
because that crate also builds external Cuckoo mining plugins.
|
||||
|
||||
To avoid building mining plugins, ensure your `pow/Cargo.toml' has a line
|
||||
|
||||
```
|
||||
features=["no-plugin-build"]
|
||||
```
|
||||
|
||||
This may help when building on 32 bit systems or non x86 architectures. You can still use the internal miner to mine by setting:
|
||||
and that it's not commented out.
|
||||
|
||||
```toml
|
||||
use_cuckoo_miner = false
|
||||
```
|
||||
## Build errors
|
||||
See [Troubleshooting](https://github.com/mimblewimble/docs/wiki/Troubleshooting)
|
||||
|
||||
In `grin.toml`
|
||||
## What was built?
|
||||
|
||||
## What have I just built?
|
||||
A successful build gets you:
|
||||
|
||||
Provided all of the prerequisites were installed and there were no issues, there should be 3 things in your project directory that you need to pay attention to in order to configure and run grin. These are:
|
||||
- `target/debug/grin` - the main grin binary
|
||||
|
||||
* The Grin binary, which should be located in your project directory as target/debug/grin
|
||||
- `target/debug/plugins/*` - mining plugins (optional)
|
||||
|
||||
* A set of mining plugins, which should be in the 'plugins' directory located next to the grin executable
|
||||
With the included `grin.toml` unchanged,
|
||||
if you execute `cargo run`
|
||||
you get a `.grin` subfolder that grin starts filling up.
|
||||
|
||||
* A configuration file in the root project directory named grin.toml
|
||||
|
||||
For the time being, it's recommended just to put the built version of grin on your path, e.g. via:
|
||||
While testing, put the grin binary on your path like this:
|
||||
|
||||
```
|
||||
export PATH=/path/to/grin/dir/target/debug:$PATH
|
||||
|
@ -87,87 +81,88 @@ export PATH=/path/to/grin/dir/target/debug:$PATH
|
|||
|
||||
# Configuration
|
||||
|
||||
Grin is currently configured via a combination of configuration file and command line switches, with any provided switches overriding the contents of the configuration file. To see a list of commands and switches use:
|
||||
Grin has a good defaults, a configuration file `grin.toml` that's documented inline that can override the defaults,
|
||||
and command line switches that has top priority and overrides all others.
|
||||
|
||||
The `grin.toml` file can placed in one of several locations, using the first one it finds:
|
||||
|
||||
1. The current working directory
|
||||
2. In the directory that holds the grin executable
|
||||
3. {USER_HOME}/.grin
|
||||
|
||||
For help on grin commands and their switches, try:
|
||||
|
||||
```
|
||||
grin help
|
||||
grin wallet help
|
||||
grin client help
|
||||
```
|
||||
|
||||
At startup, grin looks for a configuration file called 'grin.toml' in the following places in the following order, using the first one it finds:
|
||||
|
||||
* The current working directory
|
||||
* The directory in which the grin executable is located
|
||||
* {USER_HOME}/.grin
|
||||
# Using grin
|
||||
|
||||
If no configuration file is found, command line switches must be given to grin in order to start it. If a configuration file is found but no command line switches are provided, grin starts in server mode using the values found in the configuration file.
|
||||
The wiki page [How to use grin](https://github.com/mimblewimble/docs/wiki/How-to-use-grin)
|
||||
and linked pages have more information on what features we have,
|
||||
troubleshooting, etc.
|
||||
|
||||
At present, the relevant modes of operation are 'server' and 'wallet'. When running in server mode, any command line switches provided will override the values found in the configuration file. Running in wallet mode does not currently use any values from the configuration file other than logging output parameters.
|
||||
## Basic usage
|
||||
|
||||
# Basic Execution
|
||||
Running just `grin` with no command line switches starts `grin server` using defaults and any settings from `grin.toml` if found.
|
||||
|
||||
For a basic example simulating a single node network, create a directory called 'node1' and change your working directory to it. You'll use this directory to run a wallet and create a new blockchain via a server running in mining mode.
|
||||
|
||||
You'll need a config file - the easiest is to copy over the grin.toml file from the root grin directory into the node1 directory you just made.
|
||||
## Simulating: a chain and a few nodes
|
||||
|
||||
Before running your mining server, a wallet server needs to be set up and listening so that the mining server knows where to send mining rewards. Do this from the first node directory with the following commands:
|
||||
For a basic example, make a directory 'node1' and enter it.
|
||||
We'll run a wallet listener and a server that creates a new local blockchain.
|
||||
|
||||
Copy over the grin.toml file from the grin folder and into your new node1 folder.
|
||||
|
||||
The miner needs a wallet to send mining rewards to, or else it can't mine.
|
||||
|
||||
So begin with the wallet listener in node1:
|
||||
|
||||
```
|
||||
node1$ grin wallet init
|
||||
node1$ grin wallet -p "password" listen
|
||||
```
|
||||
|
||||
See [wallet](wallet.md) for more info on the various Grin wallet commands and options.
|
||||
Also try `grin wallet help`.
|
||||
|
||||
This will create a wallet server listening on the default port 13415 with the password "password". Next, in another terminal window in the 'node1' directory, run a full mining node with the following command:
|
||||
The above created a wallet listener on the default port 13415,
|
||||
using the wallet.seed and the password "password".
|
||||
|
||||
Now open another terminal window on the same machine.
|
||||
Go to the 'node1' directory, and run a node that is mining:
|
||||
|
||||
```
|
||||
node1$ grin server -m run
|
||||
```
|
||||
|
||||
This creates a new .grin database directory in the current directory, and begins mining new blocks (with no transactions, for now). Note this starts two services listening on two default ports,
|
||||
port 13414 for the peer-to-peer (P2P) service which keeps all nodes synchronized, and 13413 for the Rest API service used to verify transactions and post new transactions to the pool (for example). These ports can be configured via command line switches, or via a grin.toml file in the working directory.
|
||||
A new .grin folder is created, and starts filling up with new blocks having
|
||||
just one coinbase transaction
|
||||
|
||||
Let the mining server find a few blocks, then stop (just ctrl-c) the mining server and the wallet server. You'll notice grin has created a database directory (.grin) in which the blockchain and peer data is stored. There should also be a wallet.dat file in the current directory, which contains a few coinbase mining rewards created each time the server mines a new block.
|
||||
Note that `server run` starts two services listening on two default ports:
|
||||
|
||||
# Running a Node
|
||||
- port 13414 for the peer-to-peer (P2P) service which keeps all nodes synchronized
|
||||
- and 13413 for the Rest API service that can verify transactions and post new transactions to the pool.
|
||||
|
||||
The following are minimal instructions to get a testnet1 node up and running.
|
||||
The port numbers can be configured in grin.toml or on the command line, explained above.
|
||||
|
||||
After following the instructions above to build a testnet executable and ensuring it's on your system path, create two directories wherever you prefer. Call one 'wallet' and one 'server'.
|
||||
Let the mining server find a few blocks, then stop (just ctrl-c) the mining server and the wallet server.
|
||||
|
||||
In the 'wallet' directory (preferably in a separate terminal window), run the following command to create a wallet seed:
|
||||
Now take a look in .grin. Here grin built the blockchain, peer data, and more.
|
||||
You should also have a wallet.dat file which contains some coinbase mining rewards.
|
||||
They are created each time the server starts on a new block.
|
||||
If you have multiple miners active, you might see unused coinbase rewards,
|
||||
and/or if your transaction gets orphaned, a similar situation can occur.
|
||||
The not usable outputs are expected to be cleaned out over time, so it's ok
|
||||
and nothing to worry about.
|
||||
|
||||
```
|
||||
grin wallet init
|
||||
```
|
||||
And if you see "slogger: dropped messages" in your mining node window it's
|
||||
nothing to worry. It means your grin is so busy that it can't show on screen
|
||||
(or in grin.log) all the details, unless you slow it down.
|
||||
|
||||
Then, to run a publicly listening wallet receiver, run the following command:
|
||||
## Advanced Examples
|
||||
|
||||
```
|
||||
grin wallet -p password -e listen
|
||||
```
|
||||
|
||||
Next, in the 'server' directory in another terminal window, copy the grin.toml file from the project root:
|
||||
|
||||
```
|
||||
server$ cp /path/to/project/root/grin.toml .
|
||||
server$ grin server -m run
|
||||
```
|
||||
|
||||
The server should start, connect to the seed and any available peers, and place mining rewards into your running wallet listener.
|
||||
|
||||
From your 'wallet' directory, you should be able to check your wallet contents with the command:
|
||||
|
||||
```
|
||||
grin wallet -p password info
|
||||
```
|
||||
as well as see the individual outputs with:
|
||||
```
|
||||
grin wallet -p password outputs
|
||||
```
|
||||
|
||||
See [wallet](wallet.md) for more info on the various Grin wallet commands and options.
|
||||
|
||||
For further information on a more complicated internal setup for testing, see the [local net documentation](local_net.md)
|
||||
|
||||
The [grin.toml](../grin.toml) configuration file has further information about the various options available.
|
||||
See [usage](usage.md) and on the wiki
|
||||
[How to use grin](https://github.com/mimblewimble/docs/wiki/How-to-use-grin).
|
||||
|
|
|
@ -11,7 +11,8 @@ List of files tracked in `git` and some files you'll create when you use grin.
|
|||
- [rustfmt.toml](../rustfmt.toml) - configuration file for rustfmt. Required before contributing _new_ code.
|
||||
|
||||
## Folder structure
|
||||
List of folders in the grin git repo, and the `wallet` and `server` folders which you're [recommended to create yourself](build.md#running-a-node).
|
||||
After checking out grin, building and using, these are the folders you'll have:
|
||||
|
||||
- api
|
||||
Code for ApiEndpoints accessible over REST.
|
||||
- chain
|
||||
|
@ -43,14 +44,15 @@ List of folders in the grin git repo, and the `wallet` and `server` folders whic
|
|||
- store
|
||||
Data store - a thin wrapper for Rocksdb, a key-value database forked from LevelDB.
|
||||
- target
|
||||
Where the grin binary ends up, after the compile and build process finishes. In case of trouble, see [troubleshooting](FAQ.md#troubleshooting)
|
||||
Where the grin binary ends up, after the compile and build process finishes.
|
||||
In case of trouble, see [troubleshooting](https://github.com/mimblewimble/docs/wiki/Troubleshooting)
|
||||
- util
|
||||
Low-level rust utilities.
|
||||
- wallet
|
||||
A folder you're [supposed to create](build.md#running-a-node), before creating your wallet: cd to project root; mkdir wallet; cd wallet; grin wallet init
|
||||
A folder you're [supposed to create](build.md), before creating your wallet: cd to project root; mkdir wallet; cd wallet; grin wallet init
|
||||
- wallet.dat - your "outputs", that once confirmed and matured, can be spent with the [`grin wallet send`](wallet.md) command. (locally created, _not_ in git)
|
||||
- wallet.seed - your secret wallet seed. (locally created, _not_ in git)
|
||||
|
||||
## grin dependencies
|
||||
- [secp256k1](https://github.com/mimblewimble/rust-secp256k1-zkp)
|
||||
Integration and rust bindings for libsecp256l1, and some changes waiting to be upstreamed. Imported in util/Cargo.toml.
|
||||
Integration and rust bindings for libsecp256k1, and some changes waiting to be upstreamed. Imported in util/Cargo.toml.
|
||||
|
|
47
doc/style.md
47
doc/style.md
|
@ -1,47 +0,0 @@
|
|||
# Grin Style Guide
|
||||
|
||||
Grin uses [rustfmt](https://github.com/rust-lang-nursery/rustfmt) to maintain consistent formatting.
|
||||
|
||||
## Install rustfmt (nightly)
|
||||
|
||||
Note: we assume Rust has been installed via [Rustup](https://www.rustup.rs/).
|
||||
See [build docs](./build.md) for more info.
|
||||
|
||||
```
|
||||
rustup component add rustfmt-preview
|
||||
rustup update
|
||||
```
|
||||
|
||||
## Install git pre-commit hook
|
||||
|
||||
There is a basic git [pre-commit](../.hooks/pre-commit) hook in the repo.
|
||||
|
||||
The pre-commit hook will not prevent commits if style issues are present but it will
|
||||
indicate any files that need formatting.
|
||||
|
||||
To enable this, create a symlink in `.git/hooks` (note the relative path) -
|
||||
|
||||
```
|
||||
cd .git/hooks
|
||||
ln -s -f ../../.hooks/pre-commit
|
||||
```
|
||||
|
||||
## Running rustfmt
|
||||
|
||||
To run rustfmt against a single file, this __new__ command works with latest rust and after having done `rustup component add rustfmt-preview` and by setting --write-mode it doesn't overwrite files.
|
||||
|
||||
First maybe try a dry-run to see what changes would be made:
|
||||
`rustfmt --write-mode diff -- client.rs`
|
||||
|
||||
Then if you don't want to do any other cleanups manually, make rustfmt make the changes
|
||||
|
||||
`rustfmt -- client.rs`
|
||||
|
||||
and add that as a separate commit at the end of your Pull Request.
|
||||
|
||||
|
||||
The old method would typically change formatting in _nearly every file_ in the grin repo. If you feel adventurous, try this:
|
||||
|
||||
`cargo +nightly fmt -- ./core/src/lib.rs`
|
||||
|
||||
(and please take care, since the ending `-- file/names.rs` actually doesn't have any effect)
|
|
@ -1,15 +1,30 @@
|
|||
# Documentation structure
|
||||
- [FAQ](faq.md) - Frequently Asked Questions
|
||||
- [build](build.md) - Explaining how to build and run the Grin binaries
|
||||
|
||||
## Explaining grin
|
||||
- [intro](intro.md) - Technical introduciton to grin
|
||||
- [grin4bitcoiners](grin4bitcoiners.md) - Explaining grin from a bitcoiner's perspective
|
||||
|
||||
## Understand the grin implementation
|
||||
- [chain_sync](chain/chain_sync.md) - About how Grin's blockchain is synchronized
|
||||
- [blocks_and_headers](chain/blocks_and_headers.md) - How Grin tracks blocks and headers on the chain
|
||||
- [contractideas](contractideas.md) - Ideas on how to implement contracts
|
||||
- [grin4bitcoiners](grin4bitcoiners.md) - Explaining grin from a bitcoiner's perspective
|
||||
- [dandelion/dandelion](dandelion/dandelion.md) - About transaction propagation and cut-through. Stemming and fluffing!
|
||||
- [dandelion/simulating](dandelion/simulating.md) - Dandelium simulation - aggregating transaction without lock_height Stemming and fluffing!
|
||||
- [internal/pool](internal/pool.md) - Technical explanation of the transaction pool
|
||||
- [intro](intro.md) - Technical introduciton to grin
|
||||
- [local_net](local_net.md) - Technical explanation of how to test Grin locally, simulating several peers, for full integration testing and network simulations
|
||||
- [merkle](merkle.md) - Technical explanation of grin's favorite kind of merkle trees
|
||||
- [merkle_proof graph](merkle_proof/merkle_proof.png) - Example merkle proof with pruning applied
|
||||
- [pruning](pruning.md) - Technical explanation of pruning
|
||||
- [rangeproofs](rangeproofs.md) - Technical explanation of range proofs
|
||||
- [style](style.md) - About code formatting
|
||||
- [transaction UML](transaction/aggregating transaction without lock_height) - UML of an interactive transaction
|
||||
|
||||
## Build and use
|
||||
- [build](build.md) - Explaining how to build and run the Grin binaries
|
||||
- [usage](usage.md) - Explaining how to use grin in Testnet1
|
||||
- [local_net](local_net.md) - Technical explanation of how to test Grin locally, simulating several peers, for full integration testing and network simulations
|
||||
- [wallet](wallet.md) - Explains the wallet design and `grin wallet` sub-commands
|
||||
|
||||
# External (wiki)
|
||||
- [FAQ](https://github.com/mimblewimble/docs/wiki/FAQ) - Frequently Asked Questions
|
||||
- [Building grin](https://github.com/mimblewimble/docs/wiki/Building)
|
||||
- [How to use grin](https://github.com/mimblewimble/docs/wiki/How-to-use-grin)
|
||||
- [Hacking and contributing](https://github.com/mimblewimble/docs/wiki/Hacking-and-contributing)
|
||||
|
|
61
doc/usage.md
61
doc/usage.md
|
@ -1,61 +0,0 @@
|
|||
# Using grin
|
||||
Welcome! grin is so far useable for testing only. Currently on Testnet1.
|
||||
Please try it out and help finding bugs.
|
||||
|
||||
## Participate on Testnet1
|
||||
|
||||
Please participate in testing grin!
|
||||
Ask about errors you see, and try retelling the answers in your own words.
|
||||
That brings attention to them, so we can make them more understandable for
|
||||
users, and improve the [troubleshooting](FAQ.md#troubleshooting) section.
|
||||
|
||||
As a user, you can already try to:
|
||||
|
||||
- ☐ sync the chain
|
||||
- BUG: Some block(s) have transaction(s) which seem to crash `grin server`
|
||||
- BUG: chain minority forks occur often, and are not quickly abandoned
|
||||
- BUG: `grin server` can jump between chains and fail to converge on the
|
||||
chain with the most accumulated work.
|
||||
- ☑ mine, using any of these PoW implementations:
|
||||
- ☑ reference Cuckoo implementation
|
||||
- ☑ cpu_mean_compat mining plugin (typical performance: 1000 graphs/s)
|
||||
- ☑ cpu_mean mining plugin (typical performance: 2000 graphs/s)
|
||||
- ☐ GPU mining not yet functional
|
||||
- ☑ view your wallets "outputs" (that *sometimes* equals spendable assets)
|
||||
- BUG: spendable outputs might be hidden or forgotten.
|
||||
WORKAROUND: Backup, then edit wallet.dat manually.
|
||||
A wallet reconstruction command is in development
|
||||
[#295](https://github.com/mimblewimble/grin/issues/295)
|
||||
- BUG: when chain sync fails, coins might be incorrectly marked "Spent".
|
||||
WORKAROUND: Search-replace "Spent" with "Unconfirmed" and resync
|
||||
- BUG: when you activate mining, outputs are created that can be shown as
|
||||
having a value (50.0) and just awaiting confirmation; but if you don't get
|
||||
at least 1 confirmation within 1-5 minutes you can be sure they never will.
|
||||
WORKAROUND: wait until chain can fully sync before you start mining, and
|
||||
then babysit your mining process in case it forks off
|
||||
- ☑ send simple transactions (the transaction format is not final)
|
||||
- BUG: after you create a transaction, the outputs it consumes are Locked
|
||||
until the transaction confirms.
|
||||
WORKAROUND: create transactions on the command line, use `-s smallest`
|
||||
and if your recipient fails to claim in a reasonable time, you can always
|
||||
claim it back yourself, loosing only the fee. Or do a full resync...
|
||||
|
||||
Legend for the above: `☑ Probably yes now, or ☐ Probably not now.`
|
||||
|
||||
## Known problems
|
||||
When you run into problems, please see [troubleshooting](FAQ.md#troubleshooting)
|
||||
and ask on [gitter chat](https://gitter.im/grin_community/Lobby).
|
||||
|
||||
Especially if you're not sure you've found a new bug,
|
||||
[please ask on the chat]()
|
||||
or on the [maillist](https://launchpad.net/~mimblewimble)
|
||||
|
||||
And before you file a new bug, please take a quick look through
|
||||
[known bugs](https://github.com/mimblewimble/grin/issues?utf8=%E2%9C%93&q=label%3Abug+)
|
||||
and other existing issues.
|
||||
|
||||
### Developers, developers, developers!
|
||||
|
||||
Please see our list of
|
||||
[known requests and bugs](https://github.com/mimblewimble/grin/issues)
|
||||
and of course come say hello in the chat or the maillist linked above.
|
Loading…
Reference in a new issue