Skip to content
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
6 changes: 5 additions & 1 deletion exonum-java-binding/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
The release is based on Exonum 0.11

### Added
- `toOptional()` method to `EntryIndexProxy`. (#790)
- `toOptional()` method to `EntryIndexProxy`. (#790)

### Changed
- Service HTTP APIs provided with `Service#createPublicApiHandlers` are now mounted
on `/api/services` instead of `/api` for consistency with Exonum Core.

## [0.5.0] - 2019-03-13

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class StoredConfigurationGsonSerializerTest {
+ "\"majority_count\": null,\n"
+ "\"services\": {\n"
+ " \"configuration\": null,\n"
+ " \"cryptocurrency-demo-service\": null\n"
+ " \"cryptocurrency-demo\": null\n"
+ "}\n"
+ "}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ echo "ARTIFACT_PATH=${ARTIFACT_PATH}"

# Prepare the services configuration file
SERVICES_CONFIG_FILE="services.toml"
SERVICE_NAME="cryptocurrency-demo-service"
SERVICE_NAME="cryptocurrency-demo"
echo "[user_services]" > ${SERVICES_CONFIG_FILE}
echo "${SERVICE_NAME} = '${ARTIFACT_PATH}'" >> ${SERVICES_CONFIG_FILE}

Expand Down
2 changes: 1 addition & 1 deletion exonum-java-binding/core/rust/exonum-java/start_qa_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo "ARTIFACT_PATH=${ARTIFACT_PATH}"

# Prepare the services configuration file
SERVICES_CONFIG_FILE="services.toml"
SERVICE_NAME="ejb-qa-service"
SERVICE_NAME="qa"
echo "[user_services]" > ${SERVICES_CONFIG_FILE}
echo "${SERVICE_NAME} = '${ARTIFACT_PATH}'" >> ${SERVICES_CONFIG_FILE}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ default List<HashCode> getStateHashes(Snapshot snapshot) {
* equal to the service name.
*
* <p>Please note that the path prefix is stripped from the request path when it is forwarded to
* the given router. For example, if your service name is «cryptocurrency»,
* and you have two endpoints «/send-money» and «/balance», use these names when
* defining handlers, and they will be available by paths «/cryptocurrency/send-money»
* and «/cryptocurrency/balance»:
* the given router. For example, if your service name is «timestamping»,
* and you have an endpoint «/timestamp», use this name when defining the handler and it will be
* available by path «/api/services/timestamping/timestamp»:
*
* <pre><code>
* router.get("/balance").handler((rc) -> {
* rc.response().end("$1’000’000");
* rc.response().end("2019-04-01T10:15:30+02:00[Europe/Kiev]");
* });
* </code></pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class UserServiceAdapter {

private static final Logger logger = LogManager.getLogger(UserServiceAdapter.class);

private static final String API_ROOT_PATH = "/api";
private static final String API_ROOT_PATH = "/api/services";

private final Service service;
private final Server server;
Expand Down Expand Up @@ -164,7 +164,8 @@ public String initialize(long forkHandle) {

public void mountPublicApiHandler(long nodeNativeHandle) {
try {
checkState(node == null, "There is a node already: are you calling this method twice?");
checkState(node == null, "There is a node already (%s): are you calling this method twice?",
node);
node = new NodeProxy(nodeNativeHandle);
Router router = server.createRouter();
service.createPublicApiHandlers(node, router);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void mountPublicApiHandler() {
.thenReturn(serviceName);

serviceAdapter.mountPublicApiHandler(0x0A);
verify(server).mountSubRouter(eq("/api/service1"), eq(router));
verify(server).mountSubRouter(eq("/api/services/service1"), eq(router));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PER_PAGE = 10
const MAX_VALUE = 2147483647

function getWallet (publicKey) {
return axios.get(`/api/cryptocurrency-demo-service/wallet/${publicKey}`)
return axios.get(`/api/services/cryptocurrency-demo/wallet/${publicKey}`)
.then(response => response.data)
.then(data => {
return {
Expand Down Expand Up @@ -112,7 +112,7 @@ module.exports = {
},

getHistory (publicKey) {
return axios.get(`/api/cryptocurrency-demo-service/wallet/${publicKey}/history`).then(r => r.data)
return axios.get(`/api/services/cryptocurrency-demo/wallet/${publicKey}/history`).then(r => r.data)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public interface CryptocurrencyService extends Service {
short ID = 42;
String NAME = "cryptocurrency-demo-service";
String NAME = "cryptocurrency-demo";

Optional<Wallet> getWallet(PublicKey ownerKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public interface QaService extends Service {

short ID = 127;
String NAME = "ejb-qa-service";
String NAME = "qa";

HashCode submitCreateCounter(String counterName);

Expand Down