Exonum uses Protobuf as its serialization format for storage of data. Thus, we need to describe our structures using the Protobuf interface description language first.
syntax = "proto3";
// Allows to use `exonum.PublicKey` structure already described in `exonum`
// library.
import "helpers.proto";
// Wallet structure used to persist data within the service.
message Wallet {
exonum.PublicKey pub_key = 1;
string name = 2;
uint64 balance = 3;
}
// Transaction type for creating a new wallet.
message TxCreateWallet {
// UTF-8 string with the owner's name.
string name = 1;
}
// Transaction type for transferring tokens between two wallets.
message TxTransfer {
// Public key of the receiver.
exonum.PublicKey to = 1;
// Number of tokens to transfer from the sender's account to the receiver's
// account.
uint64 amount = 2;
// Auxiliary number to guarantee non-idempotence of transactions.
uint64 seed = 3;
}
// Copyright 2019 The Exonum Team
//
// 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.
syntax = "proto3";
import "helpers.proto";
package exonum.doc_tests;
message CreateWallet { string name = 1; }
message Point {
int32 x = 1;
int32 y = 2;
}
message TxA {
// Transaction fields
}
message TxB {
/// ...
}
message MyTransaction { exonum.PublicKey public_key = 1; }
message MyStructSmall {
exonum.PublicKey key = 1;
uint32 num_field = 2;
string string_field = 3;
}
message MyStructBig {
exonum.Hash hash = 1;
MyStructSmall my_struct_small = 2;
}
// Copyright 2019 The Exonum Team
//
// 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.
syntax = "proto3";
package exonum;
message Hash { bytes data = 1; }
message PublicKey { bytes data = 1; }
message Signature { bytes data = 1; }
message BitVec {
bytes data = 1;
uint64 len = 2;
}
// Copyright 2019 The Exonum Team
//
// 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.
syntax = "proto3";
package exonum;
message IndexMetadata {
uint32 index_type = 1;
bool is_family = 2;
}
// Copyright 2019 The Exonum Team
//
// 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.
syntax = "proto3";
package exonum;
import "helpers.proto";
message Block {
uint32 proposer_id = 1;
uint64 height = 2;
uint32 tx_count = 3;
exonum.Hash prev_hash = 4;
exonum.Hash tx_hash = 5;
exonum.Hash state_hash = 6;
}
message ConfigReference {
uint64 actual_from = 1;
exonum.Hash cfg_hash = 2;
}
message TxLocation {
uint64 block_height = 1;
uint64 position_in_block = 2;
}
message TransactionResult {
uint32 status = 1;
string description = 2;
}