Pad CLI
Operations
To deploy pads we need a number of steps:
- build: This generates the ditribution files along with configuration specific for the given pad.yml
- publish: Upload the dist folder to IPFS. Update the hash in the pad.yml
- register: Use pad.yml to generate a record in WNS.
All this operations can be resumed with one command:
yarn dx pad deploy
Build pad.
Before you publish your pad you need to build it using dx pad build
.
Your pad.yml
MUST be present and it must have name
and version
defined.
You can specify the following params in your pad.yml
:
-
build
: Build command. Defaults toyarn dist
.
Example:
name: 'dxos.org/example-pad'
displayName: 'Example Pad'
version: 0.0.0
build: yarn dist
Then run:
yarn run dx pad build
Publish to IPFS
yarn run dx pad publish
Registration
In package root folder:
- make sure
pad.yml
is presented, withname
andversion
fields. E.g.:
name: 'dxos.org/example-pad'
displayName: 'Example Pad'
version: 0.0.1
build: yarn dist
package: <IPFS HASH ID GENERATED BY PUBLISH>
- register pad:
yarn run dx pad register
Query
yarn run dx pad query --name 'dxos.org/example-pad'
[
{
"id": "QmUSmSPUBhPSXSGaHhUDxBn3cjG2gjJ9BiUznvUBiJo37F",
"type": "wrn:pad",
"name": "dxos.org/example-pad",
"version": "0.0.1",
"owners": [
"6ee3328f65c8566cd5451e49e97a767d10a8adf7"
],
"bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
"createTime": "2020-03-10T15:35:04.132179296",
"expiryTime": "2021-03-10T15:35:04.132179296",
"attributes": {
"displayName": "Example Pad",
"name": "dxos.org/example-pad",
"type": "wrn:pad",
"version": "0.0.1"
}
}
]