move things to _attic

This commit is contained in:
Ethan Buchman
2018-01-06 15:35:22 -05:00
parent c5aeef3f2f
commit e45ad068fb
196 changed files with 2 additions and 3 deletions
@@ -1,58 +0,0 @@
# Run your own (super) lightweight node
In addition to providing command-line tooling that goes cryptographic verification
on all the data your receive from the node, we have implemented a proxy mode, that
allows you to run a super lightweight node. It does not follow the chain on
every block or even every header, but only as needed. But still providing the
same security as running a full non-validator node on your local machine.
Basically, it runs as a proxy that exposes the same rpc interface as the full node
and connects to a (potentially untrusted) full node. Every response is cryptographically
verified before being passed through, returning an error if it doesn't match.
You can expect 2 rpc calls for every query plus <= 1 query for each validator set
change. Going offline for a while allows you to verify multiple validator set changes
with one call. Cuz at 1 block/sec and 1000 tx/block, it just doesn't make sense
to run a full node just to get security
## Setup
Just initialize your client with the proper validator set as in the [README](README.md)
```
$ export BCHOME=~/.lightnode
$ basecli init --node tcp://<host>:<port> --chain-id <chain>
```
## Running
```
$ basecli proxy --serve tcp://localhost:7890
...
curl localhost:7890/status
curl localhost:7890/block\?height=20
```
You can even subscribe to events over websockets and they are all verified
before passing them though. Though if you want every block, you might as
well run a full (nonvalidating) node.
## Seeds
Every time the validator set changes, the light node verifies if it is legal,
and then creates a seed at that point. These "seeds" are verified checkpoints
that we can trace any proof back to, starting with one on `init`.
To make sure you are based on the most recent header, you can run:
```
basecli seeds update
basecli seeds show
```
## Feedback
This is the first release of basecli and the light-weight proxy. It is secure, but
may not be useful for your workflow. Please try it out and open github issues
for any enhancements or bugs you find. I am aiming to make this a very useful
tool by tendermint 0.11, for which I need community feedback.
-53
View File
@@ -1,53 +0,0 @@
# Basic run through of using basecli....
To keep things clear, let's have two shells...
`$` is for basecoin (server), `%` is for basecli (client)
## Set up your basecli with a new key
```
% export BCHOME=~/.democli
% basecli keys new demo
% basecli keys get demo -o json
```
And set up a few more keys for fun...
```
% basecli keys new buddy
% basecli keys list
% ME=$(basecli keys get demo | awk '{print $2}')
% YOU=$(basecli keys get buddy | awk '{print $2}')
```
## Set up a clean basecoin, initialized with your account
```
$ export BCHOME=~/.demoserve
$ basecoin init $ME
$ basecoin start
```
## Connect your basecli the first time
```
% basecli init --chain-id test_chain_id --node tcp://localhost:46657
```
## Check your balances...
```
% basecli query account $ME
% basecli query account $YOU
```
## Send the money
```
% basecli tx send --name demo --amount 1000mycoin --sequence 1 --to $YOU
-> copy hash to HASH
% basecli query tx $HASH
% basecli query account $YOU
```
-91
View File
@@ -1,91 +0,0 @@
package main
import (
"os"
"github.com/spf13/cobra"
"github.com/tendermint/tmlibs/cli"
"github.com/cosmos/cosmos-sdk/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands/auto"
"github.com/cosmos/cosmos-sdk/client/commands/commits"
"github.com/cosmos/cosmos-sdk/client/commands/keys"
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
"github.com/cosmos/cosmos-sdk/client/commands/query"
rpccmd "github.com/cosmos/cosmos-sdk/client/commands/rpc"
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
authcmd "github.com/cosmos/cosmos-sdk/modules/auth/commands"
basecmd "github.com/cosmos/cosmos-sdk/modules/base/commands"
coincmd "github.com/cosmos/cosmos-sdk/modules/coin/commands"
feecmd "github.com/cosmos/cosmos-sdk/modules/fee/commands"
ibccmd "github.com/cosmos/cosmos-sdk/modules/ibc/commands"
noncecmd "github.com/cosmos/cosmos-sdk/modules/nonce/commands"
rolecmd "github.com/cosmos/cosmos-sdk/modules/roles/commands"
)
// BaseCli - main basecoin client command
var BaseCli = &cobra.Command{
Use: "basecli",
Short: "Light client for Tendermint",
Long: `Basecli is a certifying light client for the basecoin abci app.
It leverages the power of the tendermint consensus algorithm get full
cryptographic proof of all queries while only syncing a fraction of the
block headers.`,
}
func main() {
commands.AddBasicFlags(BaseCli)
// Prepare queries
query.RootCmd.AddCommand(
// These are default parsers, but optional in your app (you can remove key)
query.TxQueryCmd,
query.KeyQueryCmd,
coincmd.AccountQueryCmd,
noncecmd.NonceQueryCmd,
rolecmd.RoleQueryCmd,
ibccmd.IBCQueryCmd,
)
// set up the middleware
txcmd.Middleware = txcmd.Wrappers{
feecmd.FeeWrapper{},
rolecmd.RoleWrapper{},
noncecmd.NonceWrapper{},
basecmd.ChainWrapper{},
authcmd.SigWrapper{},
}
txcmd.Middleware.Register(txcmd.RootCmd.PersistentFlags())
// you will always want this for the base send command
txcmd.RootCmd.AddCommand(
// This is the default transaction, optional in your app
coincmd.SendTxCmd,
coincmd.CreditTxCmd,
// this enables creating roles
rolecmd.CreateRoleTxCmd,
// these are for handling ibc
ibccmd.RegisterChainTxCmd,
ibccmd.UpdateChainTxCmd,
ibccmd.PostPacketTxCmd,
)
// Set up the various commands to use
BaseCli.AddCommand(
commands.InitCmd,
commands.ResetCmd,
keys.RootCmd,
commits.RootCmd,
rpccmd.RootCmd,
query.RootCmd,
txcmd.RootCmd,
proxy.RootCmd,
commands.VersionCmd,
auto.AutoCompleteCmd,
)
cmd := cli.PrepareMainCmd(BaseCli, "BC", os.ExpandEnv("$HOME/.basecli"))
cmd.Execute()
}