did-registry-lists
A lib read and write DID Registry Lists.
run
Requires at least node 12.
run npm install git+ssh://git@code.lab10.io:graz/13-midas/did-registry-lists.git#build
.
In typescript:
import { DidRegistryLists } from 'did-registry-lists';
import Ipfs from 'did-registry-lists/build/ipfs';
import Sender from 'did-registry-lists/build/sender';
import getCalldataForSetAttribute from 'did-registry-lists/build/getCalldataForSetAttribute';
const networks = {
networks: [
{
name: process.env.REGI_NET || 'artis_t1',
registry: process.env.REGI_ADDR || '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b',
rpcUrl: process.env.CHAIN_RPC || 'https://rpc.tau1.artis.network'
},
]
};
const ipfs = new Ipfs({
protocol: process.env.IPFS_PROTO || 'https',
host: process.env.IPFS_HOST || 'midas-ipfs-api.mars.lab10.io',
port: parseInt(process.env.IPFS_PORT || '443'),
headers: {
// without auth header, the call will fail with HTTPError
authorization: process.env.IPFS_AUTH || '',
},
timeout: parseInt(process.env.IPFS_TO || '10000'), // ms
});
const sender = new Sender(
process.env.RELAYER_URL || 'http://midas-relayer.dev.lab10.io:8635/v1/relay',
process.env.RELAYER_AUTH || ''
);
const didRegLists = new DidRegistryLists(networks, ipfs, sender, getCalldataForSetAttribute);
didRegLists.readLists(...);
didRegLists.addNewList(...);
...
license
AGPLv3