Skip to content

Commit

Permalink
ATL-6668: Delete more files related to VCs
Browse files Browse the repository at this point in the history
This commit deletes even more files related to VC operations. It also
removes some dependencies on the old SDK
  • Loading branch information
EzequielPostan committed Apr 15, 2024
1 parent ffdf528 commit dd34eae
Show file tree
Hide file tree
Showing 27 changed files with 923 additions and 1,299 deletions.
19 changes: 5 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,10 @@ lazy val Dependencies = new {

// We have to exclude bouncycastle since for some reason bitcoinj depends on bouncycastle jdk15to18
// (i.e. JDK 1.5 to 1.8), but we are using JDK 11
val prismCredentials =
"io.iohk.atala" % "prism-credentials-jvm" % versions.prismSdk excludeAll ExclusionRule(
organization = "org.bouncycastle"
)
val prismProtos =
"io.iohk.atala" % "prism-protos-jvm" % versions.prismSdk % "protobuf-src" intransitive ()
val vaultProtos =
"io.iohk.atala" % "vault-api-jvm" % versions.vaultSdk % "protobuf-src" intransitive ()
// Can be used only in tests!
val prismApi =
"io.iohk.atala" % "prism-api-jvm" % versions.prismSdk % Test excludeAll ExclusionRule(
organization = "org.bouncycastle"
)
val prismCrypto =
"io.iohk.atala" % "prism-crypto-jvm" % versions.prismSdk
val prismIdentity =
"io.iohk.atala" % "prism-identity-jvm" % versions.prismSdk

// Test dependencies
val catsScalatest =
Expand Down Expand Up @@ -163,7 +154,7 @@ lazy val Dependencies = new {
val sttpDependencies = Seq(sttpCore, sttpCE2)
val tofuDependencies = Seq(tofu, tofuLogging, tofuDerevoTagless)
val prismDependencies =
Seq(prismCredentials, prismProtos, prismApi, vaultProtos)
Seq(prismCrypto, prismIdentity)
val scalapbDependencies = Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
Expand Down
122 changes: 122 additions & 0 deletions node/src/main/protobuf/common_models.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
syntax = "proto3";

option java_multiple_files = true;
option java_package = "io.iohk.atala.prism.protos";

package io.iohk.atala.prism.protos;

import "status.proto";
import "google/protobuf/timestamp.proto";

/**
* A request that can be used to check service health.
* All PRISM services expose an RPC that accepts this message as request.
*/
message HealthCheckRequest {}

/**
* A response that represents service health.
* Status code 0 with empty response represents a healthy and reachable service,
* while all other status codes represent issues with the service.
*/
message HealthCheckResponse {}

/**
* Represents a date by its parts (day, month, year).
*/
message Date {
int32 year = 1; // A positive value.
int32 month = 2; // A value in the [1, 12] range.
int32 day = 3; // A value in the [1, 31] range (depending on the month, the maximum value might be 28).
}

/**
* Represents a time interval between two given timestamps.
* The message represents a closed interval (i.e. both ends are inclusive and mandatory).
*/
message TimeInterval {
/**
* The starting timestamp.
* start_timestamp must be before or equal to end_timestamp.
*/
google.protobuf.Timestamp start_timestamp = 1;
/**
* The ending timestamp.
* end_timestamp must be after or equal to start_timestamp.
*/
google.protobuf.Timestamp end_timestamp = 2;
}

/**
* This enum provides a way for some RPC requests to specify the direction so that the response values are sorted
* the way you want them to.
* Note that it specifies the direction only and doesn't say anything about a comparator
* (e.g. natural order, some RPC-specific order etc).
*/
enum SortByDirection {
SORT_BY_DIRECTION_UNKNOWN = 0; // Nothing provided, each API can define whether to fail or take a default value (commonly ASCENDING).
SORT_BY_DIRECTION_ASCENDING = 1; // Sort the results in ascending order.
SORT_BY_DIRECTION_DESCENDING = 2; // Sort the results in descending order.
}

/**
* The supported ledger types. Specifies which chain is used for storing transactions.
*/
enum Ledger {
reserved 2; // Removed BITCOIN_TESTNET
reserved "BITCOIN_TESTNET";
reserved 3; // Removed BITCOIN_MAINNET
reserved "BITCOIN_MAINNET";

UNKNOWN_LEDGER = 0; // Invalid default value.
IN_MEMORY = 1; // Store transactions in memory instead of blockchain, used only for development.
CARDANO_TESTNET = 4; // Cardano testnet, used for testing.
CARDANO_MAINNET = 5; // Cardano mainnet, used in production.
}

/**
* Information about a ledger block.
* See Ledger documentation for details on which ledgers are possible.
*/
message BlockInfo {
reserved 2; // Removed timestamp_deprecated field
reserved "timestamp_deprecated";

int32 number = 1; // Number of the block in the ledger.
int32 index = 3; // Index of the transaction within the block.
google.protobuf.Timestamp timestamp = 4; // Timestamp when the block was created.
}

/**
* Information about a ledger transaction and the block that the transaction is included in.
*/
message TransactionInfo {
string transaction_id = 1; // Transaction ID.
Ledger ledger = 2; // Ledger the transaction was published to.
BlockInfo block = 3; // Block the transaction was included in.
}

/**
* The status of an Atala operation.
*/
enum OperationStatus {
UNKNOWN_OPERATION = 0; // The operation hasn't been received by the node service yet.
PENDING_SUBMISSION = 1; // The transaction containing this operation hasn't been published to the chain yet.
AWAIT_CONFIRMATION = 2; // The transaction containing this operation has been published to the chain, but hasn't been processed by PRISM yet.
CONFIRMED_AND_APPLIED = 3; // The operation has been successfully applied to the PRISM.
CONFIRMED_AND_REJECTED = 4; // The operation has been processed by PRISM, but rejected because of some error.
}

message AtalaErrorMessage {
google.rpc.Status status = 1;
}

message AtalaMessage {
oneof message {
AtalaErrorMessage atala_error_message = 9;
}
}

message ConnectionsStatusRequest {
repeated string connection_tokens = 1;
}
63 changes: 63 additions & 0 deletions node/src/main/protobuf/health.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2015 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// The canonical version of this proto can be found at
// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto

syntax = "proto3";

package grpc.health.v1;

option csharp_namespace = "Grpc.Health.V1";
option go_package = "google.golang.org/grpc/health/grpc_health_v1";
//option java_multiple_files = true;
//option java_outer_classname = "HealthProto";
//option java_package = "io.grpc.health.v1";

message HealthCheckRequest {
string service = 1;
}

message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
}
ServingStatus status = 1;
}

service Health {
// If the requested service is unknown, the call will fail with status
// NOT_FOUND.
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);

// Performs a watch for the serving status of the requested service.
// The server will immediately send back a message indicating the current
// serving status. It will then subsequently send a new message whenever
// the service's serving status changes.
//
// If the requested service is unknown when the call is received, the
// server will send a message setting the serving status to
// SERVICE_UNKNOWN but will *not* terminate the call. If at some
// future point, the serving status of the service becomes known, the
// server will send a new message with the service's serving status.
//
// If the call terminates with status UNIMPLEMENTED, then clients
// should assume this method is not supported and should not retry the
// call. If the call terminates with any other status (including OK),
// clients should retry the call with appropriate exponential backoff.
rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
}
Loading

0 comments on commit dd34eae

Please sign in to comment.