@astralprotocol/core
Documentation about the Astral Protocol Core Package.
Description
The @astralprotocol/core package is a Typescript NPM package that is responsible for any CRUD operations performed on the DID Documents. This includes the creation of DID Documents, loading the DID Documents, as well as updating them. The package also has utilities that enable the creation of the collision resistant GeoDID IDs, a custom **** did-resolver that enables DID Resolution, as well as pinning features for storing the Documents on IPFS or FFS. This package is meant to be used in conjunction with the @astralprotocol/contracts **** and @astralprotocol/subgraph **** packages. However, the package can also be used independently if the user does not want to rely on the Ethereum network.
This package is not responsible for persistence of the documents (mappings, etc.), the created DID Documents are persisted through IPFS/FFS, and the metadata regarding the DID Documents are persisted through the subgraph and smart contracts.
To add Astral Protocol Core to your application
To develop or try the Astral Protocol Core locally
Set up a local Powergate Client
In order to store the GeoDIDs created by the core package, you will need to start up a local Powergate client or connect to an existing hosted client. Below will be a brief overview on how to setup a local Powergate client on your system. Further information is available at: https://github.com/textileio/powergate.
In order to setup the Powergate Client locally on your system you must have Docker, Docker-Compose, and Go 1.16 installed.
In your terminal, create a new directory and clone the Powergate repo into it:
git clone https://github.com/textileio/powergate.git
After you clone the repo, enter the following commands:
cd powergate/docker
make localnet
For more
information regarding Powergate's Localnet mode, please refer to their documentation: https://github.com/textileio/powergate#localnet-mode
Check an implementation of core package:
Run the script
Last updated