Reference documentation and code samples for the Universal Ledger V1 API class Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.
Client for the UniversalLedger service.
A service for interacting with the Google Cloud Universal Ledger. Endpoints are pre-created and managed by Google and cannot be modified by users. The names of available endpoints will be provided in the public documentation. An endpoint is a regional resource within a Universal Ledger network. Requests sent to an endpoint may be routed to different validators in the given network within the given region.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the UniversalLedger Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all UniversalLedger clients ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the UniversalLedger Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#get_endpoint
def get_endpoint(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::Endpoint
def get_endpoint(name: nil) -> ::Google::Cloud::UniversalLedger::V1::EndpointGets the details of a specific endpoint.
def get_endpoint(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::Endpointget_endpoint via a request object, either of type
GetEndpointRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::GetEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_endpoint(name: nil) -> ::Google::Cloud::UniversalLedger::V1::Endpointget_endpoint via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The name of the endpoint to retrieve.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::Endpoint)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::GetEndpointRequest.new # Call the get_endpoint method. result = client.get_endpoint request # The returned object is of type Google::Cloud::UniversalLedger::V1::Endpoint. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new UniversalLedger client object.
- (config) — Configure the UniversalLedger client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a client using a custom configuration client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new do |config| config.timeout = 10.0 end
#list_endpoints
def list_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>
def list_endpoints(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>Lists all endpoints for a given project and location.
def list_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>list_endpoints via a request object, either of type
ListEndpointsRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::ListEndpointsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_endpoints(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>list_endpoints via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The parent, which owns this collection of endpoints.
Format:
projects/{project}/locations/{location} - page_size (::Integer) — Optional. The maximum number of endpoints to return. The service may return fewer than this value. If unspecified, at most 50 endpoints will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
ListEndpointscall. Provide this to retrieve the subsequent page.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::ListEndpointsRequest.new # Call the list_endpoints method. result = client.list_endpoints request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::UniversalLedger::V1::Endpoint. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#query_account
def query_account(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryAccountResponse
def query_account(endpoint: nil, account_id: nil, round_id: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryAccountResponseDeprecated: Use the QueryData method instead. Queries all the information stored about an account in the network. The returned account details may vary between calls, because an endpoint may route requests to different validators within the network and region, and the validators may not be at the same round ID at any given time.
def query_account(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryAccountResponsequery_account via a request object, either of type
QueryAccountRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::QueryAccountRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def query_account(endpoint: nil, account_id: nil, round_id: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryAccountResponsequery_account via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
endpoint (::String) — Required. The endpoint to serve the request.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}The location is a region. - account_id (::String) — Required. The account ID to get information about. The value is limited to 60 characters.
- round_id (::Integer) — Optional. The ID of the execution round (similar to block "height") at which to request data. The returned account information will be accurate for the world state at this execution round. If unspecified, uses the latest finalized round as known by the serving validator. The state at a given round ID is always consistent and canonical.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::QueryAccountResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::QueryAccountRequest.new # Call the query_account method. result = client.query_account request # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryAccountResponse. p result
#query_data
def query_data(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryDataResponse
def query_data(endpoint: nil, serialized_signed_query_request: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryDataResponseQueries the network for information stored on the ledger, such as accounts and transactions.
Access to certain sensitive fields, such as account balances, may be
restricted based on the identity of the sender derived from the signature
in the request. If the sender lacks permission, sensitive fields will be
redacted from the response and reported in the redacted_fields field.
def query_data(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryDataResponsequery_data via a request object, either of type
QueryDataRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::QueryDataRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def query_data(endpoint: nil, serialized_signed_query_request: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryDataResponsequery_data via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
endpoint (::String) — Required. The endpoint to serve the request.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}The location is a region. - serialized_signed_query_request (::String) — Required. A protobuf serialized SignedQueryRequest to query the Universal Ledger network.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::QueryDataResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::QueryDataRequest.new # Call the query_data method. result = client.query_data request # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryDataResponse. p result
#query_transaction_state
def query_transaction_state(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse
def query_transaction_state(endpoint: nil, transaction_digest_hex: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponseDeprecated: Use the QueryData method instead. Queries the state of a transaction. This method can be called for any transaction submitted to the network. The returned transaction details may vary between calls, because an endpoint may route requests to different validators within the network and region, and the validators may not be at the same round ID at any given time.
def query_transaction_state(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponsequery_transaction_state via a request object, either of type
QueryTransactionStateRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def query_transaction_state(endpoint: nil, transaction_digest_hex: nil) -> ::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponsequery_transaction_state via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
endpoint (::String) — Required. The endpoint to serve the request.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}The location is a region. - transaction_digest_hex (::String) — Required. The transaction ID to get the state of.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest.new # Call the query_transaction_state method. result = client.query_transaction_state request # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse. p result
#submit_operational_transaction
def submit_operational_transaction(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse
def submit_operational_transaction(endpoint: nil, serialized_signed_operational_transaction: nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponseSubmits an operational transaction to the network. This method returns only after the transaction has been replicated across a majority of validators in the network, or if the transaction fails.
def submit_operational_transaction(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponsesubmit_operational_transaction via a request object, either of type
SubmitOperationalTransactionRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def submit_operational_transaction(endpoint: nil, serialized_signed_operational_transaction: nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponsesubmit_operational_transaction via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
endpoint (::String) — Required. The endpoint to serve the request.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}The location is a region. - serialized_signed_operational_transaction (::String) — Required. A protobuf serialized SignedTransaction to submit to the ledger. The enclosed client transaction must be an operational transaction, and the sender must be the platform operator. Using a serialized format ensures that all validators compute the same transaction ID as the SHA-256 digest of the serialized bytes.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest.new # Call the submit_operational_transaction method. result = client.submit_operational_transaction request # The returned object is of type Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse. p result
#submit_transaction
def submit_transaction(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse
def submit_transaction(endpoint: nil, serialized_signed_transaction: nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponseSubmits a transaction to the network. The request is first validated for basic correctness. If validation fails, the request will fail immediately. If validation succeeds, this method returns only after the transaction has been replicated across a majority of validators in the network, or until the request fails.
def submit_transaction(request, options = nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponsesubmit_transaction via a request object, either of type
SubmitTransactionRequest or an equivalent Hash.
- request (::Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def submit_transaction(endpoint: nil, serialized_signed_transaction: nil) -> ::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponsesubmit_transaction via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
endpoint (::String) — Required. The endpoint to submit the transaction to.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}The location is a region. - serialized_signed_transaction (::String) — Required. A protobuf serialized SignedTransaction to submit to the ledger. Using a serialized format ensures that all validators compute the same transaction ID as the SHA-256 digest of the serialized bytes.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/universal_ledger/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest.new # Call the submit_transaction method. result = client.submit_transaction request # The returned object is of type Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)