Skip to content

Commit 2ba6dcd

Browse files
authored
Merge pull request #525 from AmbireTech/config-improvement-and-docs
Config docs and improvements
2 parents 54fa330 + 3adf7a3 commit 2ba6dcd

File tree

18 files changed

+231
-205
lines changed

18 files changed

+231
-205
lines changed

adview-manager/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1111

1212
[dependencies]
1313
# Domain
14-
adex_primitives = { path = "../primitives", package = "primitives", features = [
15-
"test-util",
16-
] }
14+
adex_primitives = { path = "../primitives", package = "primitives", features = ["test-util"] }
1715
chrono = "0.4"
1816
num-integer = "0.1"
1917
# (De)Serialization & Http requests

adview-manager/serve/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ publish = false
1010

1111
[dependencies]
1212
# Domain
13-
adex_primitives = { path = "../../primitives", package = "primitives", features = [
14-
"test-util",
15-
] }
13+
adex_primitives = { path = "../../primitives", package = "primitives", features = ["test-util"] }
1614
adview-manager = { path = "../" }
1715
chrono = "0.4"
1816

docs/config/dev.toml

Lines changed: 0 additions & 101 deletions
This file was deleted.

docs/config/ganache.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ all_campaigns_timeout = 5000
2525
channel_tick_timeout = 8000
2626

2727
ip_rate_limit = { type = 'ip', timeframe = 1200000 }
28-
sid_rate_limit = { type = 'sid', timeframe = 0 }
2928

3029
creators_whitelist = []
3130
validators_whitelist = []

docs/config/prod.toml

Lines changed: 93 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,101 @@ fetch_timeout = 10000
2020
all_campaigns_timeout = 10000
2121
channel_tick_timeout = 10000
2222

23-
ip_rate_limit = { type = 'ip', timeframe = 1200000 }
24-
sid_rate_limit = { type = 'sid', timeframe = 0 }
23+
# 2h
24+
ip_rate_limit = { type = 'ip', timeframe = 7200000 }
2525

2626
creators_whitelist = []
2727
validators_whitelist = []
28+
# Galya (for analytics)
2829
admins = ['0x5d6A3F1AD7b124ecDFDf4841D9bB246eD5fBF04c']
2930

30-
[[token_address_whitelist]]
31-
# DAI
32-
# Polygon: https://polygonscan.com/token/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063
33-
address = '0x6b175474e89094c44da98b954eedeac495271d0f'
34-
# 1 * 10^-10 = 0.0_000_000_001
35-
min_campaign_budget = '100000000'
36-
min_validator_fee = '100000000'
37-
precision = 18
38-
39-
[[token_address_whitelist]]
40-
# SAI
41-
address = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359'
42-
# 1 * 10^-10 = 0.0_000_000_001
43-
min_campaign_budget = '100000000'
44-
min_validator_fee = '100000000'
45-
precision = 18
46-
47-
[[token_address_whitelist]]
48-
# USDT
49-
# Polygon: https://polygonscan.com/token/0xc2132d05d31c914a87c6611c10748aeb04b58e8f
50-
address = '0xdac17f958d2ee523a2206206994597c13d831ec7'
51-
# 1.000_000
52-
min_campaign_budget = '1000000'
53-
# 0.001
54-
min_validator_fee = '1000'
55-
precision = 6
56-
57-
[[token_address_whitelist]]
58-
# USDC
59-
# Polygon: https://polygonscan.com/token/0x2791bca1f2de4661ed88a30c99a7a9449aa84174
60-
address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
61-
# 1.000_000
62-
min_campaign_budget = '100000000'
63-
# 0.001
64-
min_validator_fee = '1000'
65-
precision = 6
31+
[platform]
32+
# This should be changed for tests and use the wiremock url
33+
url = "https://platform.adex.network"
34+
# 20 minutes in milliseconds
35+
keep_alive_interval = 1200000
36+
37+
[limits.units_for_slot]
38+
# The maximum number of campaigns a publisher can earn from
39+
# This will limit the returned Campaigns to the set number
40+
max_campaigns_earning_from = 25
41+
42+
# 0.01 (UnifiedNum) per 1000 impressions
43+
# 1_000 * (per) 1_000 / 10^8 = 0.01
44+
global_min_impression_price = '1000000'
45+
46+
[chain."Ethereum Mainnet"]
47+
chain_id = 1
48+
rpc = 'https://mainnet.infura.io/v3/' # todo
49+
outpace = '0x0000000000000000000000000000000000000000' # todo
50+
51+
[chain."Ethereum Mainnet".token."DAI"]
52+
address = '0x6b175474e89094c44da98b954eedeac495271d0f' # checked
53+
precision = 18
54+
# 1 * 10^18 = 1.0000 TOKEN
55+
min_campaign_budget = '1000000000000000000' # todo
56+
# multiplier = 10^12 - 10^18 (token precision) = 10^-6
57+
# 1 * 10^-6 = 0.000_001
58+
min_validator_fee = '1000000000000' # todo
59+
60+
[chain."Ethereum Mainnet".token."SAI"]
61+
address = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359' # checked
62+
precision = 18
63+
# multiplier = 10^8 - 10^18 (token precision) = 10^-10
64+
# 1 * 10^-10 = 0.0_000_000_001
65+
min_campaign_budget = '100000000' # todo
66+
# multiplier = 10^8 - 10^18 (token precision) = 10^-10
67+
# 1 * 10^-10 = 0.0_000_000_001
68+
min_validator_fee = '100000000' # todo
69+
70+
[chain."Ethereum Mainnet".token."USDT"]
71+
address = '0xdac17f958d2ee523a2206206994597c13d831ec7' # checked
72+
precision = 6
73+
# 1 * 10^6 = 1.0000 TOKEN
74+
min_campaign_budget = '1000000' # todo
75+
# 1 * 10^-6 = 0.000_001
76+
min_validator_fee = '1' # todo
77+
78+
[chain."Ethereum Mainnet".token."USDC"]
79+
# Polygon: https://polygonscan.com/token/0x2791bca1f2de4661ed88a30c99a7a9449aa84174
80+
address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' # checked
81+
precision = 6
82+
# 1 * 10^6 = 1.0000 TOKEN
83+
min_campaign_budget = '1000000' # todo
84+
# 1 * (10^3 - 10^6) = 0.001
85+
min_validator_fee = '1000' # todo
86+
87+
88+
[chain."Polygon Mainnet"]
89+
chain_id = 137
90+
rpc = 'https://rpc-mainnet.maticvigil.com/' # todo
91+
outpace = '0x0000000000000000000000000000000000000000' # todo
92+
93+
[chain."Polygon Mainnet".token."DAI"]
94+
# https://polygonscan.com/token/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063
95+
address = '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063' # checked
96+
precision = 18
97+
# 1 * 10^18 = 1.0000 TOKEN
98+
min_campaign_budget = '1000000000000000000' # todo
99+
# multiplier = 10^12 - 10^18 (token precision) = 10^-6
100+
# 1 * 10^-6 = 0.000_001
101+
min_validator_fee = '1000000000000' # todo
102+
103+
[chain."Polygon Mainnet".token."USDT"]
104+
# https://polygonscan.com/token/0xc2132d05d31c914a87c6611c10748aeb04b58e8f
105+
address = '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' # checked
106+
precision = 6
107+
# 1 * 10^6 = 1.0000 TOKEN
108+
min_campaign_budget = '1000000' # todo
109+
# 1 * 10^-6 = 0.000_001
110+
min_validator_fee = '1' # todo
111+
112+
[chain."Ethereum Mainnet".token."USDC"]
113+
# https://polygonscan.com/token/0x2791bca1f2de4661ed88a30c99a7a9449aa84174
114+
address = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' # checked
115+
precision = 6
116+
# 1 * 10^6 = 1.0000 TOKEN
117+
min_campaign_budget = '1000000' # todo
118+
# 1 * (10^3 - 10^6) = 0.001
119+
min_validator_fee = '1000' # todo
120+

primitives/src/ad_slot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct AdSlot {
2525
/// see IAB ad unit guidelines and iab_flex_{adUnitName} (see IAB's new ad portfolio and PDF)
2626
#[serde(rename = "type")]
2727
pub ad_type: String,
28-
// HashMap<DepositAsset, UnifiedNum> for the minimum payment accepted per impression
28+
/// HashMap<DepositAsset, UnifiedNum> for the minimum payment accepted per impression
2929
#[serde(default)]
3030
pub min_per_impression: Option<HashMap<Address, UnifiedNum>>,
3131
#[serde(default)]

0 commit comments

Comments
 (0)