src/main/java/com/hedera/hashgraph/identity/hcs/HcsIdentityNetwork.java
/**
   * Instantiates existing identity network using an address book file read from Hedera File Service.
   *
   * @param client            The Hedera network client.
   * @param network           The Hedera network.
   * @param addressBookFileId The FileID of {@link AddressBook} file stored on Hedera File Service.
   * @return The identity network instance.
   * @throws TimeoutException        In the event the client is unable to connect to Hedera in a timely fashion
   * @throws PrecheckStatusException If the query fails validation
   */
Instantiates existing identity network using an address book file read from Hedera File Service.

@param client            The Hedera network client.
@param network           The Hedera network.
@param addressBookFileId The FileID of  AddressBook file stored on Hedera File Service.
@return The identity network instance.
@throws TimeoutException        In the event the client is unable to connect to Hedera in a timely fashion
@throws PrecheckStatusException If the query fails validation
Instantiates existing identity network using an address book file read from Hedera File Service . @param client The Hedera network client . @param network The Hedera network . @param addressBookFileId The FileID of AddressBook file stored on Hedera File Service . @return The identity network instance . @throws TimeoutException In the event the client is unable to connect to Hedera in a timely fashion @throws PrecheckStatusException If the query fails validation
public static HcsIdentityNetwork fromAddressBookFile(final Client client, final String network,
                                                       final FileId addressBookFileId)
          throws TimeoutException, PrecheckStatusException {
    Hbar fileContentsQueryCost = new FileContentsQuery().setFileId(addressBookFileId).getCost(client);
    final FileContentsQuery fileQuery = new FileContentsQuery().setFileId(addressBookFileId);
    fileQuery.setMaxQueryPayment(fileContentsQueryCost);
    final ByteString contents = fileQuery.execute(client);
    HcsIdentityNetwork result = new HcsIdentityNetwork();
    result.network = network;
    result.addressBook = AddressBook.fromJson(contents.toString(Charsets.UTF_8), addressBookFileId);
    return result;
  }
public static HcsIdentityNetwork fromAddressBookFile ( final Client client , final String network , final FileId addressBookFileId ) throws TimeoutException , PrecheckStatusException { Hbar fileContentsQueryCost = new FileContentsQuery ( ) . setFileId ( addressBookFileId ) . getCost ( client ) ; final FileContentsQuery fileQuery = new FileContentsQuery ( ) . setFileId ( addressBookFileId ) ; fileQuery . setMaxQueryPayment ( fileContentsQueryCost ) ; final ByteString contents = fileQuery . execute ( client ) ; HcsIdentityNetwork result = new HcsIdentityNetwork ( ) ; result . network = network ; result . addressBook = AddressBook . fromJson ( contents . toString ( Charsets . UTF_8 ) , addressBookFileId ) ; return result ; }
Instantiates existing identity network using an address book file read from Hedera File Service.
Instantiates existing identity network using an address book file read from Hedera File Service .