Skip to content

Commit

Permalink
Enable rosetta_rpc feature by default (near#6280)
Browse files Browse the repository at this point in the history
As we’re starting to test Rosetta RPC more and offering a public test
instances with Rosetta enabled, enable the support by default so we
don’t have to deal with multiple versions of binaries (some with and
some without support for Rosetta).

Note that the implementation needs to be activated explicitly at run
time so enabling the feature does not automatically mean the node will
have Rosetta end thread enabled.
  • Loading branch information
mina86 authored Feb 15, 2022
1 parent 5568df6 commit a622bc2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ steps:
- label: "cargo test nightly not integration-tests*"
command: |
source ~/.cargo/env && set -eux
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --workspace --features nightly_protocol,nightly_protocol_features,test_features,rosetta_rpc -p '*' --exclude 'integration-tests*'
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --workspace --features nightly_protocol,nightly_protocol_features,test_features -p '*' --exclude 'integration-tests*'
timeout: 60
agents:
Expand Down
13 changes: 10 additions & 3 deletions chain/rosetta-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,18 @@ rosetta-cli check:construction --configuration-file=./rosetta.cfg

## How to Compile

Follow [the standard nearcore procedures to run a node compiled from the source code](https://docs.near.org/docs/community/contribute/contribute-nearcore)
enabling `rosetta_rpc` feature:
To compile the `neard` executable you’ll need Rust and make installed.
With those dependencies fulfilled, simply invoke `make neard` to build
fully optimised executable. Such executable is adequate for running
in production and will be located at `./target/release/neard`.

Alternatively, during development and testing it may be better to
follow the method recommended when [contributing to
nearcore](https://docs.near.org/docs/community/contribute/contribute-nearcore)
which creates a slightly less optimised executable but does it faster:

```bash
cargo build --release --package neard --bin neard --features rosetta_rpc
cargo build --release --package neard --bin neard
```

## How to Configure
Expand Down
2 changes: 1 addition & 1 deletion nearcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ near-jsonrpc-primitives = { path = "../chain/jsonrpc-primitives" }
primitive-types = "0.10"

[features]
default = ["json_rpc"]
default = ["json_rpc", "rosetta_rpc"]

performance_stats = [
"near-performance-metrics/performance_stats",
Expand Down
2 changes: 1 addition & 1 deletion neard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ near-performance-metrics = { path = "../utils/near-performance-metrics" }
near-state-viewer = { path = "../tools/state-viewer", package = "state-viewer" }

[features]
default = ["json_rpc", "jemalloc"]
default = ["json_rpc", "rosetta_rpc", "jemalloc"]

jemalloc = ["tikv-jemallocator"]
performance_stats = ["nearcore/performance_stats"]
Expand Down
4 changes: 2 additions & 2 deletions nightly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ honest I can’t vouch whether it even works.
Lastly, at the end of the test specification line additional features
can be given in the form of `--features <features>` arguments.
Similarly to `--release`, this results in given features being enabled
in builds. Note that the `test_features` and `rosetta_rpc` features
are always enabled so there's no need to specify it explicitly.
in builds. Note that the `test_features` Cargo feature is always
enabled so there's no need to specify it explicitly.

Note that with `--skip-build` switch the `--release` and `--features`
flags are essentially ignored since they only affect the build and are
Expand Down

0 comments on commit a622bc2

Please sign in to comment.