avax-python is a Python library and utils for the exploration of the Avalanche AVAX network.
Includes an implementation of basic AVAX API calls.
Clone the git repo and run scripts within the downloaded avax-python/
subdirectory.
git clone https://github.com/ojrdevcom/avax-python.git
cd avax-python
If you don't have a git
client available, you may download a ZIP archive instead.
First, generate user/password credentials for your node.
Then, enter your username and password on userpass.txt
.
Then run:
python3 send-x-p.py <dest_P_addr> <amount_nAVA>
to send funds from X-Chain to P-Chain, then
python3 platform.addDefaultSubnetValidator.py
Done!
python3 ipcs.publishBlockchains.py
apimeta.py
If you update the api.specification
file, then you must regenerate the API metainformation file apimeta.py
To recreate it, run generate_api.py:
python3 generate_api.py
The spec2py.py
script reads the API specification in api.specification
, the grammar in api.tatsu
and generates an AST which can be used to implement the API in any language.
If you need to customize the API, the api.specification
file format is very simple.
api.specification
file and follow the same syntax for function definitions.To customize the generator grammar, see the Tatsu documentation
Note that changing the grammar will require changes to spec2py.py
. The generator uses hard coded offsets which will break if the grammar is modified.
If you plan on generating the python files from api.specification
, then spec2py.py
requires TatSu
sudo pip install TatSu
This software released under the MIT license.
See the LICENSE file in this distribution for details.
Avalanche and AVAX are registered trademarks of Ava Labs Inc.
This is not an official Ava Labs project. We are in no way affiliated with Ava Labs.
This free open source software provided for Avalanche AVAX learning and exploration purposes.