Learn how to generate transaction builders for your target SDK language.
The catbuffer library defines the protocol to serialize and deserialize Symbol entities. The library comes with code generators for different languages. SDKs and applications use the generated code to interact with REST transaction endpoint.
The library accomplishes the following properties:
Large networks compute a large number of transactions. Working with binary optimized in size makes the communication faster. Furthermore, reading entities from memory buffers—or just a part of them—is memory efficient.
REST transaction endpoints handle the calls to update the blockchain state. The serialized payload of a transaction is appended to the body of the POST call. These endpoints allow the addition of new functionality to the server-side without modifying the API contract.
Applications can embed the generated code without managing dependencies, which is particularly desirable in highly-secure environments. Besides, sharing a common codebase enables the addition of new features with less effort.
The schemas define the entities’ data structure. The library generates the leanest code necessary to serialize and deserialize defined entities.
git clone https://github.com/nemtech/catbuffer-generators
pip install -r requirements.txt
catbufferrepository inside the
git clone https://github.com/nemtech/catbuffer
schemas folder of the catbuffer repository, you can find the entities’ data structure. With the help of a code generator, you can produce the leanest code necessary to serialize and deserialize those entities.
For example, run the following command to generate C++ transaction builders for a TransferTransaction:
python main.py --schema schemas/transfer/transfer.cats --generator cpp_builder
You can also generate code for all the schemas running the following command under the
python ../scripts/generate_all.sh cpp_builder
The generator creates a new file for every schema under the
Did you find what you were looking for? Give us your feedback.