Set of code generators to serialize and deserialize Catapult entities in different programming languages.
In combination with the catbuffer-parser project and catbuffer-schemas developers can generate builder classes for a given set of programming languages. For example, the Symbol SDKs use the generated code to operate with the entities in binary form before announcing them to the network.
- C++
- Java
- TypeScript/JavaScript
- Python
- Python >= 3.6
- openjdk-8-jdk or openjdk-11-jdk
- nvm
nvm install --lts
Currently python generator requires python 3.7
No addtional requirements.
- Clone the
catbuffer-generators
repository:
git clone https://github.com/nemtech/catbuffer-generators
- Clone catbuffer-schemas repository
cd catbuffer-generators
git clone --depth 1 --branch v1.0.1 https://github.com/nemtech/catbuffer-schemas.git
- Install the package requirements:
cd catbuffer-generators
python3 -m pip install -r requirements.txt
Use language-specific generate
script inside scripts
directory. For example:
scripts/generate_java.sh
Most of these scripts, after producing the code will compile it into an output artifact in the build
folder.
NOTE: These scripts require Bash 4 or higher.
python3 -m pip install -r test_requirements.txt
python3 -m pip install -r lint_requirements.txt
pylint --load-plugins pylint_quotes generators
pycodestyle --config=.pycodestyle .