@astralprotocol/contracts
Documentation about the Astral Protocol Contracts Package.
Description
These contracts serve as the Registry for the Astral Protocol GeoDIDs. It allows binding of a GeoDID to an ethereum address and CID name resolving.
By registering a spatial asset Smart Contract events are triggered, which are picked up by the subgraph indexer to build the tree of relationships for easy querying.
To add Astral Protocol Contracts to your application
yarn add @astralprotocol/contractsTo develop or try the Astral Protocol Contracts locally
Clone the astralprotocol repository and go to packages/contracts:
git clone git@github.com:AstralProtocol/astralprotocol.git
cd astralprotocol/packages/contractsRun ganache
yarn ganacheIn a new terminal, deploy contracts with
yarn truffleRun tests with
yarn truffle-testYou can deploy an instance by running
yarn new-instance. It builds a GeoDID tree with hardcoded GeoDID ids and CIDs.You can test the removal of some links by running
yarn remove-links.Watch the changes in a locally deployed subgraph.
Do coverage check up by killing the
ganacheprocess in the first terminal and runningyarn coverage
To deploy your own contracts in the Ropsten testnet
Create a
.envfile in/packages/contractswith aMNEMONICandROPSTEN_API_KEY
MNEMONIC="mnemonic phrase goes here with testnet ether in address[0] on ropsten cool"
ROPSTEN_API_KEY=https://ropsten.infura.io/v3/<PROJECT ID HERE>Last updated
Was this helpful?