Python version of the Alastria Identity lib
pip install alastria-identity
or you could use Poetry
poetry add alastria-identity
Execute tests
docker-compose run --rm identity poetry run python -m coverage run -m pytest alastria_identity -v .
Create and check test coverage
docker-compose run --rm identity poetry run coverage html
python -m http.server 8000
Open http://localhost:8000
in your browser
You can check the examples in this folder, we'll continue updating the documentation.
You can check in different files utilities that might be useful to you.
- Types: We use these dataclasses so it's easier to interact with the library, feel free to use them to make it easier on yourself. :-)
- JWT tokens handling: This service makes encoding decoding jwt tokens easier.
- Config builder: The config builder receives an url and a parser class and parses the configuration so It can be read by the transaction service. You can check the test to see how this structure ends up.
- Transaction service: The service in charge of building a transaction and "talking" to the smart contract, it receives a configuration to know which parameters can use and what's available.
- Provider node url: It's the url (with
/rpc
endpoint) of the node you want to connect in which the library can interact with the Alastria identity smart contracts. - Contracts info: It's the file Alastria members created to be loaded to the identity libraries. You can't change it using the javascript library but you can set it in this one. We generate the configuration the Transaction service uses on the fly.
- Contract names: The contract names you need to use the library, in this case you can check the Alastria examples in the ContractsInfo file. You can check it better formatted pasting it to codebeautify.org.
- Contract addresses: As the one above It's self-explanatory, the address of the smart contract deployed you want to use.
This READMEAdd more code examplesYou can check them hereCreate the PyPI package and push it to pypi.orgTest the connection with the identity Alastria network nodeDelegate calls is still a WIP, we need to finish thatGet address from the ContractInfo data
Started with ❤️ by the Wealize Team.