Skip to content

Commit

Permalink
more mesh (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaying-peng authored Jun 12, 2024
1 parent 0e493d1 commit 85a8c5f
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 129 deletions.
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to rosetta-sdk-go
# Contributing to mesh-sdk-go

## Code of Conduct

Expand All @@ -10,11 +10,11 @@ You can contribute to this repository by asking questions, providing feedback, a

### Asking Questions

Submit your questions via the [Rosetta Community boards][13].
Submit your questions via the [Mesh Community boards][13].

### Providing Feedback

You can also use the [Rosetta Community boards][13] to provide feedback.
You can also use the [Mesh Community boards][13] to provide feedback.

### Reporting Issues

Expand Down Expand Up @@ -72,17 +72,17 @@ All support requests must be made via [our support team][3].
© 2022 Coinbase

<!-- Before adding link 15, populate link 4. One you do that, please erase this note. --->
[1]: https://github.com/coinbase/rosetta-sdk-go/issues
[1]: https://github.com/coinbase/mesh-sdk-go/issues
[2]: https://chris.beams.io/posts/git-commit/#seven-rules
[3]: https://support.coinbase.com/customer/en/portal/articles/2288496-how-can-i-contact-coinbase-support-
<!--- [4]: link removed --->
[5]: https://github.com/coinbase/rosetta-sdk-go/issues/new/choose
[6]: https://github.com/coinbase/rosetta-sdk-go/issues/new?assignees=&labels=bug&template=bug_report.md&title=
[7]: https://github.com/coinbase/rosetta-sdk-go/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=
[8]: https://github.com/coinbase/rosetta-sdk-go/pulls
[9]: https://github.com/coinbase/rosetta-sdk-go/compare
[5]: https://github.com/coinbase/mesh-sdk-go/issues/new/choose
[6]: https://github.com/coinbase/mesh-sdk-go/issues/new?assignees=&labels=bug&template=bug_report.md&title=
[7]: https://github.com/coinbase/mesh-sdk-go/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=
[8]: https://github.com/coinbase/mesh-sdk-go/pulls
[9]: https://github.com/coinbase/mesh-sdk-go/compare
[10]: https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/working-with-your-remote-repository-on-github-or-github-enterprise/creating-an-issue-or-pull-request#creating-an-issue
[11]: https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/working-with-your-remote-repository-on-github-or-github-enterprise/creating-an-issue-or-pull-request#creating-a-pull-request
[12]: https://hackerone.com/coinbase
[13]: https://community.rosetta-api.org
[14]: https://github.com/coinbase/rosetta-sdk-go/security
[13]: https://community.mesh-api.org
[14]: https://github.com/coinbase/mesh-sdk-go/security
112 changes: 56 additions & 56 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions asserter/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Asserter

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/asserter?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/asserter?tab=doc)

The Asserter package is used to validate the correctness of Rosetta types. It is
The Asserter package is used to validate the correctness of Mesh types. It is
important to note that this validation only ensures that required fields are
populated, fields are in the correct format, and transaction operations only
contain types and statuses specified in the /network/status endpoint.

If you want more intensive validation, try running the
[Rosetta CLI](https://github.com/coinbase/rosetta-cli).
[Mesh CLI](https://github.com/coinbase/mesh-cli).

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/asserter
go get github.com/coinbase/mesh-sdk-go/asserter
```

## Validation file
Expand Down
8 changes: 4 additions & 4 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Client

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/client?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/client?tab=doc)

The Client package reduces the work required to communicate with a Rosetta server.
The Client package reduces the work required to communicate with a Mesh server.

If you want a higher-level interface that automatically asserts that server responses
are correct, check out the [Fetcher](/fetcher).

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/client
go get github.com/coinbase/mesh-sdk-go/client
```

## Examples
Check out the [examples](/examples) to see how easy
it is to connect to a Rosetta server.
it is to connect to a Mesh server.
20 changes: 10 additions & 10 deletions constructor/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Constructor

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/constructor?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/constructor?tab=doc)

The `constructor` package is used for coordinating the construction
and broadcast of transactions on any blockchain that implements the
Rosetta API. It was designed to power automated Construction API
testing in the [`rosetta-cli (check:construction)`](https://github.com/coinbase/rosetta-cli#checkconstruction-1)
but could be useful for anyone building a Rosetta API wallet.
Mesh API. It was designed to power automated Construction API
testing in the [`mesh-cli (check:construction)`](https://github.com/coinbase/mesh-cli#checkconstruction-1)
but could be useful for anyone building a Mesh API wallet.

## Framework
When first learning about a new topic, it is often useful to understand the
Expand All @@ -31,10 +31,10 @@ in other `Scenarios`. The syntax for accessing this shared state can be found

`Actions` are discrete operations that can be performed in the context of a
`Scenario`. A full list of all `Actions` that can be performed can be found
[here](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/constructor/job#ActionType).
[here](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/constructor/job#ActionType).

If you have suggestions for more actions, please
[open an issue in `rosetta-sdk-go`](https://github.com/coinbase/rosetta-sdk-go/issues)!
[open an issue in `mesh-sdk-go`](https://github.com/coinbase/mesh-sdk-go/issues)!

### Broadcast Invocation
If you'd like to broadcast a transaction at the end of a `Scenario`,
Expand All @@ -59,12 +59,12 @@ a transaction broadcast if you set the follow field:

The suggested fee will then be stored as `<scenario>.suggested_fee` for use by
other `Scenarios` in the same `Job`. You can find an example of this in the
[Ethereum configuration](https://github.com/coinbase/rosetta-ethereum/blob/master/rosetta-cli-conf/testnet/ethereum.ros).
[Ethereum configuration](https://github.com/coinbase/mesh-ethereum/blob/master/mesh-cli-conf/testnet/ethereum.ros).

*If this field is not populated or set to `false`, the transaction
will be constructed, signed, and broadcast.*

### Using with rosetta-cli
### Using with mesh-cli
If you use the `constructor` for automated Construction API testing (without prefunded
accounts), you MUST implement 2 required `Workflows`:
* `create_account`
Expand All @@ -76,7 +76,7 @@ Please note that `create_account` can contain a transaction broadcast if
on-chain origination is required for new accounts on your blockchain.

If you plan to run the `constructor` in CI, you may wish to
provide [`prefunded accounts`](https://pkg.go.dev/github.com/coinbase/rosetta-cli/configuration#ConstructionConfiguration)
provide [`prefunded accounts`](https://pkg.go.dev/github.com/coinbase/mesh-cli/configuration#ConstructionConfiguration)
when running the tester (otherwise you would need to manually fund generated
accounts).

Expand All @@ -87,7 +87,7 @@ created during testing).

### Writing Workflows
It is possible to write `Workflows` from scratch using JSON, however, it is
highly recommended to use the [Rosetta Constructor DSL](dsl/README.md). You can
highly recommended to use the [Mesh Constructor DSL](dsl/README.md). You can
see an example of how these two approaches compare below:

#### Without DSL
Expand Down
22 changes: 11 additions & 11 deletions constructor/dsl/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Rosetta Constructor DSL
The Rosetta Constructor DSL ([domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language))
# Mesh Constructor DSL
The Mesh Constructor DSL ([domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language))
makes it easy to write `Workflows` for the `constructor` package.

This DSL is most commonly used for writing automated Construction API
tests for the [`rosetta-cli`](https://github.com/coinbase/rosetta-cli#writing-checkconstruction-tests).
tests for the [`mesh-cli`](https://github.com/coinbase/mesh-cli#writing-checkconstruction-tests).

_Before reading more about the Rosetta Constructor DSL, we recommend learning
_Before reading more about the Mesh Constructor DSL, we recommend learning
about the frameworks used in the [`constructor`](/constructor/README.md)
to coordinate the creation of transactions._

## Syntax
At a basic level, the Rosetta Constructor DSL syntax looks like this:
At a basic level, the Mesh Constructor DSL syntax looks like this:
```text
// line comment
<workflow name>(<concurrency>){
Expand Down Expand Up @@ -147,7 +147,7 @@ would look like:
]
```
Note, if you plan to run the automated Construction API tester in CI for `create_account` workflow, you may wish to
provide [`prefunded accounts`](https://pkg.go.dev/github.com/coinbase/rosetta-cli/configuration#ConstructionConfiguration)
provide [`prefunded accounts`](https://pkg.go.dev/github.com/coinbase/mesh-cli/configuration#ConstructionConfiguration)
when running the tester (otherwise you would need to manually fund generated
accounts).

Expand Down Expand Up @@ -189,7 +189,7 @@ It is also important to note that `Workflows` containing multiple
```

### Functions
In the Rosetta Constructor DSL, it is possible to invoke functions (where
In the Mesh Constructor DSL, it is possible to invoke functions (where
the function name is an `Action.Type`) but not possible to define your own
functions (yet!).

Expand All @@ -198,15 +198,15 @@ The input for all functions is a JSON blob that will be evaluated by
the `Worker`. It is possible to reference other variables
in an input using the syntax `{{var}}` where `var` must follow
[this syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md).
The Rosetta Constructor DSL compiler will automatically check that referenced
The Mesh Constructor DSL compiler will automatically check that referenced
variables are previously defined.

#### End Line
Function invocations can span multiple lines (if you "pretty print" the JSON
blob) but each function call line must end with a semi-colon.

#### Native Invocation
The Rosetta Constructor DSL provides optional "native invocation" support for 2 `Action.Types`:
The Mesh Constructor DSL provides optional "native invocation" support for 2 `Action.Types`:
* `math`
* `set_variable`

Expand Down Expand Up @@ -262,7 +262,7 @@ It is possible to add new line comments of comments at the end of lines
using a double slash (`//`).

## Status
The Rosetta Constructor DSL should be considered `ALPHA` and may
The Mesh Constructor DSL should be considered `ALPHA` and may
include breaking changes in later releases. If you have any ideas on how to improve
the language, please
[open an issue in `rosetta-sdk-go`](https://github.com/coinbase/rosetta-sdk-go/issues)!
[open an issue in `mesh-sdk-go`](https://github.com/coinbase/mesh-sdk-go/issues)!
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Examples

This folder demonstrates how to write a Rosetta server and how
This folder demonstrates how to write a Mesh server and how
to use either the Client package or Fetcher package to communicate
with that server.

Expand Down
12 changes: 6 additions & 6 deletions fetcher/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Fetcher

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/fetcher?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/fetcher?tab=doc)

The Fetcher package provides a simplified client interface to communicate
with a Rosetta server. It also provides automatic retries and concurrent block
with a Mesh server. It also provides automatic retries and concurrent block
fetches.

If you want a lower-level interface to communicate with a Rosetta server,
If you want a lower-level interface to communicate with a Mesh server,
check out the [Client](/client).

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/fetcher
go get github.com/coinbase/mesh-sdk-go/fetcher
```

## Create a Fetcher
Creating a basic Fetcher is as easy as providing a context and Rosetta server URL:
Creating a basic Fetcher is as easy as providing a context and Mesh server URL:
```go
fetcher := fetcher.New(ctx, serverURL)
```
Expand All @@ -30,4 +30,4 @@ fetcher := fetcher.New(ctx, serverURL, fetcher.WithBlockConcurrency(10))

## More Examples
Check out the [examples](/examples) to see how easy
it is to connect to a Rosetta server.
it is to connect to a Mesh server.
6 changes: 3 additions & 3 deletions parser/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Parser

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/parser?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/parser?tab=doc)

The Parser package provides support for parsing Rosetta blocks. This includes
The Parser package provides support for parsing Mesh blocks. This includes
things like calculating all the balance changes that occurred in a block and
grouping related operations.

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/parser
go get github.com/coinbase/mesh-sdk-go/parser
```
12 changes: 6 additions & 6 deletions reconciler/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Reconciler

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/reconciler?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/reconciler?tab=doc)

The Reconciler package is used to ensure that balance changes derived from
parsing Rosetta blocks are equivalent to the balance changes computed by the
parsing Mesh blocks are equivalent to the balance changes computed by the
node. If you want to see an example of how to use this package, take
a look at [rosetta-cli](https://github.com/coinbase/rosetta-cli).
a look at [mesh-cli](https://github.com/coinbase/mesh-cli).

## Features
* Customizable `Helper` and `Handler` to define your own logic for retrieving
Expand All @@ -18,7 +18,7 @@ debugging)
## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/reconciler
go get github.com/coinbase/mesh-sdk-go/reconciler
```

## Reconciliation Strategies
Expand All @@ -32,5 +32,5 @@ error.
The reconciler 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 Data API. Recall that all balance-changing
operations must be returned by the Rosetta Data API.
returned by the Mesh Data API. Recall that all balance-changing
operations must be returned by the Mesh Data API.
6 changes: 3 additions & 3 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Server

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/server?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/server?tab=doc)

The Server package reduces the work required to write your own Rosetta server.
The Server package reduces the work required to write your own Mesh server.
In short, this package takes care of the basics (boilerplate server code
and request validation) so that you can focus on code that is unique to your
implementation.

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/server
go get github.com/coinbase/mesh-sdk-go/server
```

## Components
Expand Down
8 changes: 4 additions & 4 deletions syncer/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Syncer

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/syncer?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/syncer?tab=doc)

The Syncer package provides support for syncing blocks from any Rosetta Data API
The Syncer package provides support for syncing blocks from any Mesh Data API
implementation. If you want to see an example of how to use this package, take
a look at [rosetta-cli](https://github.com/coinbase/rosetta-cli).
a look at [mesh-cli](https://github.com/coinbase/mesh-cli).

## Features
* Automatic handling of block re-orgs
Expand All @@ -15,7 +15,7 @@ processed blocks to a db or print our balance changes)
## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/syncer
go get github.com/coinbase/mesh-sdk-go/syncer
```

## Future Work
Expand Down
8 changes: 4 additions & 4 deletions templates/docs/client.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Client

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/client?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/client?tab=doc)

The Client package reduces the work required to communicate with a Rosetta server.
The Client package reduces the work required to communicate with a Mesh server.

If you want a higher-level interface that automatically asserts that server responses
are correct, check out the [Fetcher](/fetcher).

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/client
go get github.com/coinbase/mesh-sdk-go/client
```

## Examples
Check out the [examples](/examples) to see how easy
it is to connect to a Rosetta server.
it is to connect to a Mesh server.
6 changes: 3 additions & 3 deletions templates/docs/types.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Types

[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/rosetta-sdk-go/types?tab=doc)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=shield)](https://pkg.go.dev/github.com/coinbase/mesh-sdk-go/types?tab=doc)

Types contains a collection of auto-generated Rosetta types. Using this
Types contains a collection of auto-generated Mesh types. Using this
package ensures that you don't need to automatically generate code on your
own.

## Installation

```shell
go get github.com/coinbase/rosetta-sdk-go/types
go get github.com/coinbase/mesh-sdk-go/types
```
Loading

0 comments on commit 85a8c5f

Please sign in to comment.