All Downloads are FREE. Search and download functionalities are using the official Maven repository.

shgraph.hapi.0.54.2.source-code.file_create.proto Maven / Gradle / Ivy

There is a newer version: 0.54.0
Show newest version
syntax = "proto3";

package proto;

/*-
 * ‌
 * Hedera Network Services Protobuf
 * ​
 * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC
 * ​
 * 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.
 * ‍
 */

option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "timestamp.proto";

/**
 * Create a new file, containing the given contents.
 * After the file is created, the FileID for it can be found in the receipt, or record, or retrieved
 * with a GetByKey query.
 *
 * The file contains the specified contents (possibly empty). The file will automatically disappear
 * at the expirationTime, unless its expiration is extended by another transaction before that time.
 * If the file is deleted, then its contents will become empty and it will be marked as deleted
 * until it expires, and then it will cease to exist.
 * 
 * The keys field is a list of keys. All keys within the top-level key list must sign (M-M) to
 * create or modify a file. However, to delete the file, only one key (1-M) is required to sign from
 * the top-level key list.  Each of those "keys" may itself be threshold key containing other keys
 * (including other threshold keys). In other words, the behavior is an AND for create/modify, OR
 * for delete. This is useful for acting as a revocation server. If it is desired to have the
 * behavior be AND for all 3 operations (or OR for all 3), then the list should have only a single
 * Key, which is a threshold key, with N=1 for OR, N=M for AND. If the auto_renew_account field 
 * is set, the key of the referenced account must sign.
 *
 * If a file is created without ANY keys in the keys field, the file is immutable and ONLY the
 * expirationTime of the file can be changed with a FileUpdate transaction. The file contents or its
 * keys cannot be changed.
 *
 * An entity (account, file, or smart contract instance) must be created in a particular realm. If
 * the realmID is left null, then a new realm will be created with the given admin key. If a new
 * realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an
 * admin key is given, then any transaction to create/modify/delete an entity in that realm must be
 * signed by that key, though anyone can still call functions on smart contract instances that exist
 * in that realm. A realm ceases to exist when everything within it has expired and no longer
 * exists.
 *
 * The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0
 * and realm 0, with a null key. Future versions of the API will support multiple realms and
 * multiple shards.
 */
message FileCreateTransactionBody {
    /**
     * The time at which this file should expire (unless FileUpdateTransaction is used before then
     * to extend its life)
     */
    Timestamp expirationTime = 2;

    /**
     * All keys at the top level of a key list must sign to create or modify the file. Any one of
     * the keys at the top level key list can sign to delete the file.
     */
    KeyList keys = 3;

    /**
     * The bytes that are the contents of the file
     */
    bytes contents = 4;

    /**
     * Shard in which this file is created
     */
    ShardID shardID = 5;

    /**
     * The Realm in which to the file is created (leave this null to create a new realm)
     */
    RealmID realmID = 6;

    /**
     * If realmID is null, then this the admin key for the new realm that will be created
     */
    Key newRealmAdminKey = 7;

    /**
     * The memo associated with the file (UTF-8 encoding max 100 bytes)
     */
    string memo = 8;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy