More on Packages
A deeper dive into an example of a package being registered
DAPP Service providers register their package with the dappservices:regpkg command. Examples can be seen on the eosq block explorer.
Below we can see the structure of a new package that is created.
1
{
2
"newpackage": {
3
# API endpoint the DSP is reachable at, default PORT 3115
4
"api_endpoint": "https://node1.dappfund.io",
5
# packages are disabled when created and require the dappservices:enablepkg command
6
"enabled": 0,
7
# id
8
"id": 0,
9
# minimum stake required to receive designated QUOTA per package period
10
"min_stake_quantity": "10.0000 DAPP",
11
# min time in seconds before a stake can be refunded
12
"min_unstake_period": 3600,
13
# package name, must be 1-12 characters a-z, eosio name format
14
"package_id": "fairfund1",
15
# url of DSP JSON file, similar to BP JSON
16
"package_json_uri": "https://dappfund.io/dsp-package.json",
17
# period in seconds where QUOTA refills to 100%, example has 1 day in seconds, each day user will have 1 QUOTA
18
"package_period": 86400,
19
# DSP account name
20
"provider": "thedappfund1",
21
# QUOTA to provide per package period, more on QUOTA below
22
"quota": "1.0000 QUOTA",
23
# service name, more on this and where to find this below
24
"service": "stakeservice"
25
}
26
}
Copied!
The following go into more detail on the settings above.

enabled

To enable you can visit bloks.io's block explorer here to submit the dappservices:enablepkg action, this requires the package id, DSP name, and service name

min_unstake_period

The greater of this and the remaining time in thepackage_period is the total unstake time. For example if you are 12 hours into a 24 hour package period and the min_unstake_period is an hour, you have to wait 12 hours to refund your stake.

package_json_uri

This is the link to the package json information to be standardized and used by DAPP Service Provider portals.
1
{
2
"name": "pricefeed5m",
3
"description": "Price feed oracle 5 minute interval",
4
"dsp_json_uri": "https://dsp_provider.io/dsp.json",
5
"logo":{
6
"logo_256":"https://....",
7
"logo_1024":"https://....",
8
"logo_svg":"https://...."
9
},
10
"apis" {
11
"ipfs":"ipfs.dsp_provider.io",
12
"dsp_api":"dsp.dsp_provider.io",
13
"state_history":"state.dsp_provider.io",
14
"hyperion":"hyperion.dsp_provider.io",
15
"dfuse":"dfuse.dsp_provider.io",
16
"dfuse_dgraphql":"dfuse.dsp_provider.io",
17
"dfuse_fire_hose":"dfuse.dsp_provider.io",
18
"dfuse_push_guarantee":"dfuse.dsp_provider.io"
19
},
20
"contacts" [],
21
"locations":[
22
{
23
"name": "Atlantis",
24
"country": "ATL",
25
"latitude": 2.082652,
26
"longitude": 1.781132
27
}
28
]
29
}
30
{
31
"dsp_account_name": "eosnationftw",
32
"org": {
33
"candidate_name": "EOS Nation",
34
"website": "https://eosnation.io",
35
"ownership_disclosure": "https://eosnation.io/ownership-disclosure",
36
"code_of_conduct": "https://steemit.com/eos/@eosnation/eos-nation-roadmap-on-values-community-project-timeline-finances-and-transparency",
37
"email": "[email protected]",
38
"github_user": [
39
"deniscarriere",
40
"matthewdarwin"
41
],
42
"chain_resources": "https://snapshots.eosnation.io",
43
"branding": {
44
"logo_256": "https://eosnation.keybase.pub/logo_256.png",
45
"logo_1024": "https://eosnation.keybase.pub/logo_1024.png",
46
"logo_svg": "https://eosnation.keybase.pub/logo.svg"
47
},
48
"location": {
49
"name": "Canada",
50
"country": "CA",
51
"latitude": 45.425532,
52
"longitude": -75.700269
53
},
54
"social": {
55
"medium": "eosnationbp",
56
"hive": "eosnation",
57
"steemit": "eosnation",
58
"twitter": "EOS_Nation",
59
"facebook": "groups/EOSNation",
60
"github": "EOS-Nation",
61
"telegram": "EOSNation",
62
"youtube": "channel/UCXgAY9DyooykrubRXw3xK1g",
63
"reddit": "EOSNation",
64
"keybase": "eosnation",
65
"wechat": "Eosnation"
66
}
67
},
68
"nodes": [
69
{
70
"location": {
71
"name": "Canada",
72
"country": "CA",
73
"latitude": 45.425532,
74
"longitude": -75.700269
75
},
76
"node_type": "query",
77
"features": [
78
"chain-api",
79
"account-query"
80
],
81
"api_endpoint": "http://api.eosn.io",
82
"ssl_endpoint": "https://api.eosn.io"
83
},
84
{
85
"location": {
86
"name": "Canada",
87
"country": "CA",
88
"latitude": 45.425532,
89
"longitude": -75.700269
90
},
91
"node_type": "seed",
92
"p2p_endpoint": "peer.eosn.io:9876"
93
},
94
{
95
"location": {
96
"name": "Canada",
97
"country": "CA",
98
"latitude": 45.425532,
99
"longitude": -75.700269
100
},
101
"node_type": "producer"
102
},
103
{
104
"location": {
105
"name": "Canada",
106
"country": "CA",
107
"latitude": 45.425532,
108
"longitude": -75.700269
109
},
110
"node_type": "query",
111
"features": [
112
"chain-api",
113
"dfuse"
114
],
115
"ssl_endpoint": "https://eos.dfuse.eosnation.io"
116
},
117
{
118
"location": {
119
"name": "Canada",
120
"country": "CA",
121
"latitude": 45.425532,
122
"longitude": -75.700269
123
},
124
"node_type": "query",
125
"features": [
126
"firehose"
127
],
128
"ssl_endpoint": "https://eos.firehose.eosnation.io"
129
}
130
]
131
}
Copied!

quota

Each DSP service action, fetching a vRAM table row, performing an oracle request, scheduling a re-occurring action, each of these are examples where by default 0.0001 QUOTA is used. Let's show
service
The service name can be found in the model file of the service, let's go to the directory of services on Github. If we go into the /models/dapp-services/oracle.json we will see the following:
1
{
2
# this is the short name for the service, used in zeus commands
3
"name": "oracle",
4
# port service runs on
5
"port": 13112,
6
# alternative port to run on
7
"alt": 26224,
8
# this is what needs to be used for the "service" field when registering a package
9
# this is also the contract that hosts the service and is included on usage billing
10
"contract": "oracleservic",
11
# pretty name of the service
12
"prettyName": "LiquidHarmony",
13
# wip,poc,beta,alpha
14
"stage": "Beta",
15
"version": "0.9",
16
"description": "Web/IBC/XIBC/VCPU/SQL Services",
17
# list of commands callable for the service
18
"commands": {
19
# main oracle calling function, all actions preceded with x (xgeturi)
20
"geturi": {
21
# if true, blocking will treat the command as a synchronous event
22
# if false it will be treated as an asynchonous event
23
"blocking": true,
24
# broadcast to other DSPs being staked to by the consumer
25
# triggers a promise.allSettled which awaits each DSPs response or timeout
26
"broadcast": true,
27
# specifies requested parameter for action
28
"request": {
29
"uri": "std::vector<char>"
30
},
31
# specifies callback response
32
"callback": {
33
"size": "uint32_t",
34
"uri": "std::vector<char>",
35
"data": "std::vector<char>"
36
},
37
# specify what data is required to signal a DSP to responsd to
38
"signal": {
39
"size": "uint32_t",
40
"uri": "std::vector<char>"
41
}
42
},
43
# action to remove failed oracle rows
44
"orcclean": {
45
# does not rely on other context, perform async
46
"blocking": false,
47
"request": {
48
"uri": "std::vector<char>"
49
},
50
"callback": {
51
"size": "uint32_t",
52
"uri": "std::vector<char>"
53
},
54
"signal": {
55
"size": "uint32_t",
56
"uri": "std::vector<char>"
57
}
58
}
59
}
60
}
Copied!
Last modified 7mo ago