Skip to content

Latest commit

 

History

History
121 lines (89 loc) · 2.8 KB

TAB.md

File metadata and controls

121 lines (89 loc) · 2.8 KB

TAB Conf 6 Workshop

  • Clone, install, build
git clone https://github.com/bnonni/drpm.tools && cd drpm.tools
npm install
npm run build
  • Setup .npmrc
npm run tab:1-setup-npmrc

# Alternatives
# 1. Open `.npmrc` and copy + paste the lines into a `.npmrc` file at your `$HOME` dir.
# 2. Copy `.npmrc` to every `npm` project you want or need it in.
# 3. Setup aliases for `npm install` and `npm publish` either in each interactive shell or in your shell rc/profile (i.e. .bashrc, .zshrc, etc)
#     * `alias drpm-install='npm install --registry http://localhost:2092'`
#     * `alias drpm-publish='npm publish --registry http://localhost:2092'`
  • Start DWN
npm run tab:2-start-dwn
  • Create a did
npm run tab:3-create-did
  • Configure DRPM protocol in DWN
npm run tab:4-configure-protocol
  • Start DRPM Registry
npm run tab:5-start-registry
  • Get your did methodSpecificIdentifier
npm run tab:6-get-did
# Alternative: Open `./.drpm/profile.json` and copy the did
  • Create dpk1
mkdir dpk1
cd dpk1
npm init
npm install @web5/api @web5/dids @tbd54566975/dwn-sdk-js did-btc-sdk
  • Configure dpk1
  1. Open dpk1 in an IDE
  2. Change package.json "name": "dpk1" to "name": "@drpm/dpk1~<methodSpecificIdentifier>
  3. Create an index.ts file and add console.log('Hello DRPM, from dpk1!');
cd dpk1
npm publish
# Alternatives:
# npm publish --registry http://localhost:2092
# drpm-publish
  • Checkout your newly published package record and package/release record via browser:

  • Package record: http://localhost:3000/did:dht:dhdsxf8w7rd36i5jx8hcpw8hkg1cg8sjhepm1n9iuj55zd3gpjdy/read/protocols/aHR0cHM6Ly9kcnBtLnRvb2xzL3Byb3RvY29scy9kcnBt/package?filter.tags.name=@drpm/dpk1~dhdsxf8w7rd36i5jx8hcpw8hkg1cg8sjhepm1n9iuj55zd3gpjdy

  • Package/release record: http://localhost:3000/did:dht:dhdsxf8w7rd36i5jx8hcpw8hkg1cg8sjhepm1n9iuj55zd3gpjdy/read/protocols/aHR0cHM6Ly9kcnBtLnRvb2xzL3Byb3RvY29scy9kcnBt/package/release?filter.tags.name=@drpm/dpk1~dhdsxf8w7rd36i5jx8hcpw8hkg1cg8sjhepm1n9iuj55zd3gpjdy

  • Create dpk2

mkdir dpk2
cd dpk2
npm init
npm install @web5/api @web5/dids @tbd54566975/dwn-sdk-js did-btc-sdk
  • Configure dpk2
  1. Open dpk2 in an IDE
  2. Change package.json "name": "dpk2" to "name": "@drpm/dpk2~<methodSpecificIdentifier>
  3. Create an index.ts file and add console.log('Hello DRPM, from dpk2!');
  • Install dpk1 into dpk2
cd dpk2
npm install `@drpm/dpk1~<methodSpecificIdentifier>`
# Alternatives:
# npm install --registry http://localhost:2092 `@drpm/dpk1~<methodSpecificIdentifier>`
# drpm-install `@drpm/dpk1~<methodSpecificIdentifier>`
  • Publish dpk2
cd dpk2
npm publish
# Alternatives:
# npm publish --registry http://localhost:2092
# drpm-publish
  • Congratulations! You published your first DPKs!