Skip to content

build: publish 'hedera-protobuf-java-api' from services repo #17737

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

Merged
merged 6 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
17 changes: 7 additions & 10 deletions hapi/build.gradle.kts → hapi/hapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@ tasks.withType<JavaCompile>().configureEach {
}

sourceSets {
val protoApiSrc = "../hedera-protobuf-java-api/src/main/proto"
main {
pbj {
srcDir(layout.projectDirectory.dir("hedera-protobufs/services"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/streams"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/block"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/platform"))
srcDir(layout.projectDirectory.dir("internal-protobufs/network"))
srcDir(layout.projectDirectory.dir(protoApiSrc))
exclude("mirror", "sdk")
}
// The below should be replaced with a 'requires com.hedera.protobuf.java.api'
// in testFixtures scope - #14026
proto {
srcDir(layout.projectDirectory.dir("hedera-protobufs/services"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/streams"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/block"))
srcDir(layout.projectDirectory.dir("hedera-protobufs/platform"))
srcDir(layout.projectDirectory.dir("internal-protobufs/network"))
srcDir(layout.projectDirectory.dir(protoApiSrc))
exclude("mirror", "sdk")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ syntax = "proto3";
package com.hedera.node.internal.network;

// SPDX-License-Identifier: Apache-2.0
import "state/addressbook/node.proto";
import "state/roster/roster.proto";
import "services/state/addressbook/node.proto";
import "services/state/roster/roster.proto";

option java_package = "com.hedera.node.internal.network.legacy";
// <<<pbj.java_package = "com.hedera.node.internal.network">>> This comment is special code for setting PBJ Compiler java package
Expand Down
7 changes: 7 additions & 0 deletions hapi/hedera-protobuf-java-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
plugins {
id("org.hiero.gradle.module.library")
id("org.hiero.gradle.feature.protobuf")
}

description = "Hedera Protobuf Java API"
22 changes: 22 additions & 0 deletions hapi/hedera-protobuf-java-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: Apache-2.0
module com.hedera.protobuf.java.api {
exports com.hedera.hapi.block.protoc;
exports com.hedera.hapi.block.stream.input.protoc;
exports com.hedera.hapi.block.stream.output.protoc;
exports com.hedera.hapi.block.stream.protoc;
exports com.hedera.hapi.node.state.tss.legacy;
exports com.hedera.hapi.platform.event.legacy;
exports com.hedera.hapi.platform.state.legacy;
exports com.hedera.hapi.services.auxiliary.hints.legacy;
exports com.hedera.hapi.services.auxiliary.history.legacy;
exports com.hedera.hapi.services.auxiliary.tss.legacy;
exports com.hedera.services.stream.proto;
exports com.hederahashgraph.api.proto.java;
exports com.hederahashgraph.service.proto.java;

requires transitive com.google.common;
requires transitive com.google.protobuf;
requires transitive io.grpc.stub;
requires transitive io.grpc;
requires io.grpc.protobuf;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ option java_package = "com.hedera.hapi.block.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "stream/block.proto";
import "stream/block_item.proto";
import "services/basic_types.proto";
import "block/stream/block.proto";
import "block/stream/block_item.proto";

/**
* Publish a stream of block items.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ option java_package = "com.hedera.hapi.block.stream.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "stream/block_item.proto";
import "block/stream/block_item.proto";

/**
* A single complete Hedera block chain block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ option java_package = "com.hedera.hapi.block.stream.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "event/event_transaction.proto";
import "stream/block_proof.proto";
import "stream/record_file_item.proto";
import "stream/input/event_metadata.proto";
import "stream/input/round_header.proto";
import "stream/output/block_header.proto";
import "stream/output/state_changes.proto";
import "stream/output/transaction_output.proto";
import "stream/output/transaction_result.proto";
import "platform/event/event_transaction.proto";
import "block/stream/block_proof.proto";
import "block/stream/record_file_item.proto";
import "block/stream/input/event_metadata.proto";
import "block/stream/input/round_header.proto";
import "block/stream/output/block_header.proto";
import "block/stream/output/state_changes.proto";
import "block/stream/output/transaction_output.proto";
import "block/stream/output/transaction_result.proto";

/**
* A single item within a block stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ option java_package = "com.hedera.hapi.block.stream.input.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.input">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "event/event_core.proto";
import "platform/event/event_core.proto";

/**
* A header for a single event.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "timestamp.proto";
import "services/basic_types.proto";
import "services/timestamp.proto";

/**
* A Block Header.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ syntax = "proto3";

package com.hedera.hapi.block.stream.output;

import "custom_fees.proto";
import "services/custom_fees.proto";

// SPDX-License-Identifier: Apache-2.0
option java_package = "com.hedera.hapi.block.stream.output.protoc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "custom_fees.proto";
import "basic_types.proto";
import "services/custom_fees.proto";
import "services/basic_types.proto";

/**
* Block Stream data for a `approveAllowances` transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "services/basic_types.proto";

/**
* Block Stream data for a `createSchedule` transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "contract_types.proto";
import "sidecar_file.proto";
import "services/contract_types.proto";
import "streams/sidecar_file.proto";

/**
* Block Stream data for a `contractCallMethod` transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,40 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
option java_multiple_files = true;

import "google/protobuf/wrappers.proto";
import "basic_types.proto";
import "exchange_rate.proto";
import "state/addressbook/node.proto";
import "state/blockrecords/block_info.proto";
import "state/blockrecords/running_hashes.proto";
import "state/blockstream/block_stream_info.proto";
import "state/congestion/congestion_level_starts.proto";
import "state/consensus/topic.proto";
import "state/contract/bytecode.proto";
import "state/contract/storage_slot.proto";
import "state/file/file.proto";
import "state/recordcache/recordcache.proto";
import "state/roster/roster.proto";
import "state/roster/roster_state.proto";
import "state/schedule/schedule.proto";
import "state/throttles/throttle_usage_snapshots.proto";
import "state/token/account.proto";
import "state/token/account_pending_airdrop.proto";
import "state/token/network_staking_rewards.proto";
import "state/token/nft.proto";
import "state/token/staking_node_info.proto";
import "state/token/token.proto";
import "state/token/token_relation.proto";
import "state/platform_state.proto";
import "timestamp.proto";
import "auxiliary/tss/tss_message.proto";
import "auxiliary/tss/tss_vote.proto";
import "state/tss/tss_encryption_keys.proto";
import "state/tss/tss_message_map_key.proto";
import "state/tss/tss_vote_map_key.proto";
import "state/hints/hints_types.proto";
import "state/history/history_types.proto";
import "state/entity/entity_counts.proto";
import "auxiliary/hints/crs_publication.proto";
import "services/basic_types.proto";
import "services/exchange_rate.proto";
import "services/state/addressbook/node.proto";
import "services/state/blockrecords/block_info.proto";
import "services/state/blockrecords/running_hashes.proto";
import "services/state/blockstream/block_stream_info.proto";
import "services/state/congestion/congestion_level_starts.proto";
import "services/state/consensus/topic.proto";
import "services/state/contract/bytecode.proto";
import "services/state/contract/storage_slot.proto";
import "services/state/file/file.proto";
import "services/state/recordcache/recordcache.proto";
import "services/state/roster/roster.proto";
import "services/state/roster/roster_state.proto";
import "services/state/schedule/schedule.proto";
import "services/state/throttles/throttle_usage_snapshots.proto";
import "services/state/token/account.proto";
import "services/state/token/account_pending_airdrop.proto";
import "services/state/token/network_staking_rewards.proto";
import "services/state/token/nft.proto";
import "services/state/token/staking_node_info.proto";
import "services/state/token/token.proto";
import "services/state/token/token_relation.proto";
import "platform/state/platform_state.proto";
import "services/timestamp.proto";
import "services/auxiliary/tss/tss_message.proto";
import "services/auxiliary/tss/tss_vote.proto";
import "services/state/tss/tss_encryption_keys.proto";
import "services/state/tss/tss_message_map_key.proto";
import "services/state/tss/tss_vote_map_key.proto";
import "services/state/hints/hints_types.proto";
import "services/state/history/history_types.proto";
import "services/state/entity/entity_counts.proto";
import "services/auxiliary/hints/crs_publication.proto";

/**
* A set of state changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "custom_fees.proto";
import "services/custom_fees.proto";

/**
* Block Stream data for a `createToken` transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "stream/output/schedule_service.proto";
import "stream/output/util_service.proto";
import "stream/output/crypto_service.proto";
import "stream/output/token_service.proto";
import "stream/output/smart_contract_service.proto";
import "stream/output/consensus_service.proto";
import "block/stream/output/schedule_service.proto";
import "block/stream/output/util_service.proto";
import "block/stream/output/crypto_service.proto";
import "block/stream/output/token_service.proto";
import "block/stream/output/smart_contract_service.proto";
import "block/stream/output/consensus_service.proto";

/**
* Output from a transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream.output">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "response_code.proto";
import "timestamp.proto";
import "services/basic_types.proto";
import "services/response_code.proto";
import "services/timestamp.proto";

/**
* While we have the state changes as part of the block stream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ option java_package = "com.hedera.hapi.block.stream.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "timestamp.proto";
import "sidecar_file.proto";
import "services/basic_types.proto";
import "services/timestamp.proto";
import "streams/sidecar_file.proto";

/**
* A Block Item for record files.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package com.hedera.mirror.api.proto;

option java_multiple_files = true; // Required for the reactor-grpc generator to work correctly
option java_package = "com.hedera.mirror.api.proto";

import "services/basic_types.proto";
import "services/timestamp.proto";

/**
* Request object to query an address book for its list of nodes
*/
message AddressBookQuery {
/**
* The ID of the address book file on the network. Can be either 0.0.101 or 0.0.102.
*/
.proto.FileID file_id = 1;

/**
* The maximum number of node addresses to receive before stopping. If not set or set to zero it will return all node addresses in the database.
*/
int32 limit = 2;
}

/**
* Provides cross network APIs like address book queries
*/
service NetworkService {
/*
* Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The
* response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on
* the network since it is reconstructed from a normalized database table.
*/
rpc getNodes (AddressBookQuery) returns (stream .proto.NodeAddress);
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ package com.hedera.hapi.platform.event;
* limitations under the License.
*/

import "basic_types.proto";
import "event/event_descriptor.proto";
import "timestamp.proto";
import "services/basic_types.proto";
import "platform/event/event_descriptor.proto";
import "services/timestamp.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ package com.hedera.hapi.platform.event;
* limitations under the License.
*/

import "basic_types.proto";
import "event/event_descriptor.proto";
import "timestamp.proto";
import "services/basic_types.proto";
import "platform/event/event_descriptor.proto";
import "services/timestamp.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ syntax = "proto3";
package com.hedera.hapi.platform.event;

// SPDX-License-Identifier: Apache-2.0
import "event/state_signature_transaction.proto";
import "platform/event/state_signature_transaction.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package com.hedera.hapi.platform.event;
* limitations under the License.
*/

import "event/event_core.proto";
import "platform/event/event_core.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ option java_package = "com.hedera.hapi.platform.state.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.state">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "timestamp.proto";
import "services/basic_types.proto";
import "services/timestamp.proto";

/**
* The current state of platform consensus.<br/>
Expand Down
Loading
Loading