node
>v18.15.0
yarn
> yarn install
> yarn compile
The following folders should be generated as the result:
artifacts
- completed contract specificationtypechain-types
- typescript bindings for contracts
> yarn test
contracts/auth/AccountControl.sol
- contract to manage permissions for account transactionscontracts/auth/RoleControl.sol
- contract to manage (assign/revoke) account roles.contracts/cl/CredentialDefinitionRegistry
- contract to manage (create/resolve) credential definitionscontracts/cl/SchemaRegistry
- contract to manager (create/resolve) schemascontracts/did/DidRegistry
- contract to manage (create/update/deactivate/resolve) DID doucmentscontracts/network/ValidatorControl.sol
- contract to manage network validator nodes.
You can find sample scripts demonstrating the usage of deployed contracts in the demo folder.
- Account management - deploy/read/writer transactions.
> yarn demo/account
- Demo flow - create/resolve DID/Schema/Credential Definition using
did:indy2
method.> yarn demo/flow
- Demo flow - create/resolve DID/Schema/Credential Definition using
did:ethr
method.> yarn demo/flow-with-did-ethr
- Roles management - get/assign/revoke role to/from account.
> yarn demo/roles
- Upgrade management - propose/approve upgradable contract implementation.
> yarn demo/upgrade
- Validators management - get list of current validators.
> yarn demo/validators
-
genesis
- helper scripts to generate genesis blocks for injecting contracts.Find more details regarding the scripts in the genesis section of this document.
socl
tool must be installed on the machine.
This section describes how to inject smart contracts into the genesis state of the network.
-
Prepare the input file with the initial state of each contract.
-
Compile contracts:
yarn solc-compile
artifacts
andcompiled-contracts
folders with compiled contracts will be generated as the result of the execution.
- Execute script generating the contracts content for the network genesis file:
yarn genesis/generate
ContractsGenesis.json
file will be generated as the result
-
Put the whole block into the
alloc
section of the network genesis file. -
If you changed the default address of
ValidatorControl
contract: Set address ofValidatorControl
contract intovalidatorcontractaddress
field of theqbft
section of the genesis file. -
If you changed the default address of
AccountControl
contract: Set address ofAccountControl
contract intopermissions-accounts-contract-address
field of theconfig.toml
file.