Register Package
Packages are needed for consumers to stake to in order for DAPP Service Providers to provide services. Packages are disabled by default.
Once the register command has been run with cleos or zeus, the package must be enabled! See Enable/Disable Package
1
npm install -g @liquidapps/zeus-cmd
2
# the package must be chosen from the following list:
3
# packages: (ipfs, cron, log, oracle, readfn, vaccounts, storage, auth)
4
export PACKAGE=ipfs
5
export DSP_ACCOUNT=
6
# active key to sign package creation trx
7
export DSP_PRIVATE_KEY=
8
# customizable and unique name for your package
9
export PACKAGE_ID=package1
10
export EOS_CHAIN=mainnet
11
# or
12
export EOS_CHAIN=kylin
13
# the minimum stake quantity is the amount of DAPP and/or DAPPHDL that must be staked to meet the package's threshold for use
14
export MIN_STAKE_QUANTITY="10.0000"
15
# package period is in seconds, so 86400 = 1 day, 3600 = 1 hour
16
export PACKAGE_PERIOD=86400
17
# the time to unstake is the greater of the package period remaining and the minimum unstake period, which is also in seconds
18
export MIN_UNSTAKE_PERIOD=3600
19
# QUOTA is the measurement for total actions allowed within the package period to be processed by the DSP. 1.0000 QUOTA = 10,000 actions. 0.0001 QUOTA = 1 action
20
export QUOTA="1.0000"
21
export DSP_ENDPOINT=https://acme-dsp.com
22
# package json uri is the link to your package's information, this is customizable without a required syntax
23
export PACKAGE_JSON_URI=https://acme-dsp.com/package1.dsp-package.json
24
# The annual inflation rate of the DAPP token may be tuned by the community. This is done by DSP's specifying a desired inflation rate during package registration. All existing packages default to the original annual inflation rate of 2.71%
25
export ANNUAL_INFLATION=2.71
26
27
cd $(readlink -f `which setup-dsp` | xargs dirname)/../..
28
zeus register dapp-service-provider-package \
29
$PACKAGE $DSP_ACCOUNT $PACKAGE_ID \
30
--key $DSP_PRIVATE_KEY \
31
--min-stake-quantity $MIN_STAKE_QUANTITY \
32
--package-period $PACKAGE_PERIOD \
33
--quota $QUOTA \
34
--network $EOS_CHAIN \
35
--api-endpoint $DSP_ENDPOINT \
36
--package-json-uri $PACKAGE_JSON_URI \
37
--min-unstake-period $MIN_UNSTAKE_PERIOD \
38
--inflation $ANNUAL_INFLATION
Copied!

Or in cleos:

1
# currently available services: (ipfsservice1, cronservices, logservices1, oracleservic, readfndspsvc, accountless1)
2
# the services use EOS account names to fascilitate usage
3
# service contract names may be found in the boxes/groups/services/SERVICE_NAME/models/dapp-services/*.json file as the ( contract ) parameter
4
export SERVICE=ipfsservice1
5
# zeus command automatically adds QUOTA / DAPP, so we must add it here
6
export QUOTA="1.0000 QUOTA"
7
export MIN_STAKE_QUANTITY="10.0000 DAPP"
8
export EOS_ENDPOINT=https://kylin-dsp-2.liquidapps.io # or mainnet: https://api.eosnewyork.io
9
cleos -u $EOS_ENDPOINT push action dappservices regpkg "{\"newpackage\":{\"api_endpoint\":\"$DSP_ENDPOINT\",\"enabled\":0,\"id\":0,\"min_stake_quantity\":\"$MIN_STAKE_QUANTITY\",\"min_unstake_period\":\"$MIN_UNSTAKE_PERIOD\",\"package_id\":\"$PACKAGE_ID\",\"package_json_uri\":\"$PACKAGE_JSON_URI\",\"package_period\":\"$PACKAGE_PERIOD\",\"provider\":\"$DSP_ACCOUNT\",\"quota\":\"$QUOTA\",\"service\":\"$SERVICE\"},
10
\"annual_inflation\":$ANNUAL_INFLATION}" -p $DSP_ACCOUNT
Copied!
Example service contract name for LiquidAccounts: https://github.com/liquidapps-io/zeus-sdk/blob/master/boxes/groups/services/vaccounts-dapp-service/models/dapp-services/vaccounts.json#L7
List of all services, please note some of which may not be testable yet: https://github.com/liquidapps-io/zeus-sdk/tree/master/boxes/groups/services, see the stage for each service to monitor its development maturity (WIP - work in progress, Alpha, Beta, Stable).
output should be:
1
⚡registering package:package1
2
✔️package:package1 registered successfully
Copied!
For more options:
1
zeus register dapp-service-provider-package --help
Copied!
Don’t forget to stake CPU/NET to your DSP account:
1
cleos -u $DSP_ENDPOINT system delegatebw $DSP_ACCOUNT $DSP_ACCOUNT "5.000 EOS" "95.000 EOS" -p $DSP_ACCOUNT@active
Copied!
Copy link
Contents