Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove syncer and reconciler #18

Merged
merged 2 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![License](https://img.shields.io/github/license/coinbase/rosetta-cli.svg)](https://github.com/coinbase/rosetta-cli/blob/master/LICENSE.txt)

## What is Rosetta?
Rosetta is a new project from Coinbase to standardize the process
Rosetta is a new project to standardize the process
of deploying and interacting with blockchains. With an explicit
specification to adhere to, all parties involved in blockchain
development can spend less time figuring out how to integrate
Expand Down Expand Up @@ -181,9 +181,9 @@ Global Flags:
* `make release` to run one last check before opening a PR

### Helper/Handler
Many of the internal packages use a `Helper/Handler` interface pattern to acquire
Many of the packages use a `Helper/Handler` interface pattern to acquire
required information or to send events to some client implementation. An example
of this is in the `internal/reconciler` package where a `Helper` is used to get
of this is in the `reconciler` package where a `Helper` is used to get
the account balance and the `Handler` is called to incidate whether the
reconciliation of an account was successful.

Expand All @@ -194,9 +194,7 @@ examples // examples of different config files
internal
logger // logic to write syncing information to stdout/files
processor // Helper/Handler implementations for reconciler, storage, and syncer
reconciler // checks for equality between computed balance and node balance
storage // persists block to temporary storage and allows for querying balances
syncer // coordinates block syncing (inlcuding re-orgs)
utils // useful functions
```

Expand All @@ -220,24 +218,22 @@ negative from any operations.

### Balance Reconciliation
#### Active Addresses
The validator checks that the balance of an account computed by
The CLI checks that the balance of an account computed by
its operations is equal to the balance of the account according
to the node. If this balance is not identical, the validator will
to the node. If this balance is not identical, the CLI will
exit.

#### Inactive Addresses
The validator randomly checks the balances of accounts that aren't
The CLI randomly checks the balances of accounts that aren't
involved in any transactions. The balances of accounts could change
on the blockchain node without being included in an operation
returned by the Rosetta Server. Recall that all balance-changing
operations must be returned by the Rosetta Server.
returned by the Rosetta Node API. Recall that all balance-changing
operations should be returned by the Rosetta Node API.

## Future Work
* Move syncer, reconciler, and storage packages to rosetta-sdk-go for better re-use.
* Automatically test the correctness of a Rosetta Client SDK by constructing,
signing, and submitting a transaction. This can be further extended by ensuring
broadcast transactions eventually land in a block.
* Change logging to utilize a more advanced output mechanism than CSV.

## License
This project is available open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
Expand Down
4 changes: 2 additions & 2 deletions cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (

"github.com/coinbase/rosetta-cli/internal/logger"
"github.com/coinbase/rosetta-cli/internal/processor"
"github.com/coinbase/rosetta-cli/internal/reconciler"
"github.com/coinbase/rosetta-cli/internal/storage"
"github.com/coinbase/rosetta-cli/internal/syncer"
"github.com/coinbase/rosetta-cli/internal/utils"

"github.com/coinbase/rosetta-sdk-go/fetcher"
"github.com/coinbase/rosetta-sdk-go/reconciler"
"github.com/coinbase/rosetta-sdk-go/syncer"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module github.com/coinbase/rosetta-cli
go 1.13

require (
github.com/coinbase/rosetta-sdk-go v0.1.10
github.com/coinbase/rosetta-sdk-go v0.1.11-0.20200512194317-06d0663c9207
github.com/dgraph-io/badger v1.6.0
github.com/mattn/goveralls v0.0.5 // indirect
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.5.1
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
golang.org/x/tools v0.0.0-20200507205054-480da3ebd79c // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/coinbase/rosetta-sdk-go v0.1.9 h1:HW60xBt2h54QL0AlfMpBM05lrwlV4FE/ZnM
github.com/coinbase/rosetta-sdk-go v0.1.9/go.mod h1:Z3yIflVjfPH1tYN/ucYcnJuXnxIr1xzO26YLla6jYLw=
github.com/coinbase/rosetta-sdk-go v0.1.10 h1:AzmvZXhsTNjXAcLfkgdbO0OWTj++ZeyW4ZXFyd9Gn1w=
github.com/coinbase/rosetta-sdk-go v0.1.10/go.mod h1:Z3yIflVjfPH1tYN/ucYcnJuXnxIr1xzO26YLla6jYLw=
github.com/coinbase/rosetta-sdk-go v0.1.11-0.20200512194317-06d0663c9207 h1:Xg6sVVLsMjrlg3CFylzW8uNy258DJ81BMSggrXSQZjg=
github.com/coinbase/rosetta-sdk-go v0.1.11-0.20200512194317-06d0663c9207/go.mod h1:XKM7urGHLqGQJi9kM97N+GpMLJuCAGYXy2wOm3KzxEE=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
Expand Down
3 changes: 1 addition & 2 deletions internal/processor/storage_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ import (
"context"
"fmt"

"github.com/coinbase/rosetta-cli/internal/reconciler"

"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/fetcher"
"github.com/coinbase/rosetta-sdk-go/parser"
"github.com/coinbase/rosetta-sdk-go/reconciler"
"github.com/coinbase/rosetta-sdk-go/types"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/processor/syncer_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"log"

"github.com/coinbase/rosetta-cli/internal/logger"
"github.com/coinbase/rosetta-cli/internal/reconciler"
"github.com/coinbase/rosetta-cli/internal/storage"
"github.com/coinbase/rosetta-sdk-go/reconciler"

"github.com/coinbase/rosetta-sdk-go/fetcher"
"github.com/coinbase/rosetta-sdk-go/types"
Expand Down
Loading