Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
63a85f0
add approved projects from review
Prometheo May 27, 2025
15ba094
remove payout address from grantpicks
Prometheo May 28, 2025
a9c6922
add approved application to projects
Prometheo May 28, 2025
02a3383
use project owner account instance
Prometheo May 28, 2025
82c81c5
add minimum_deposit
Prometheo Jun 2, 2025
44e0e38
change stellar testnet address
Prometheo Jun 18, 2025
20f871e
starting ledger
Prometheo Jun 18, 2025
1a96c3f
change contract:
Prometheo Jul 3, 2025
dfa7c76
change contract address
Prometheo Jul 3, 2025
7bd3ab3
change contract id
Prometheo Jul 8, 2025
a3978d8
upgrade stellar sdk
Prometheo Jul 21, 2025
7ccd5eb
update stellar address
Prometheo Jul 24, 2025
94bf1e8
index campaigns
Prometheo Jul 29, 2025
8b2a160
Merge pull request #171 from PotLock/campaign-indexing
Prometheo Jul 29, 2025
d688f0f
Merge pull request #172 from PotLock/testnet
Prometheo Jul 29, 2025
c7fa558
add script to backfil
Prometheo Jul 31, 2025
bc3ccf5
Merge pull request #173 from PotLock/backfil-script
Prometheo Jul 31, 2025
c5b9d24
Merge pull request #174 from PotLock/testnet
Prometheo Jul 31, 2025
09d4594
feat: implement filters
Prometheo Aug 5, 2025
700a538
Merge pull request #175 from PotLock/testnet
Prometheo Aug 5, 2025
482f8c7
update campaign totals
Prometheo Aug 5, 2025
768e453
campaign id tla
Prometheo Aug 5, 2025
087d462
Merge pull request #176 from PotLock/testnet
Prometheo Aug 5, 2025
6a4907e
add status field
Prometheo Aug 13, 2025
6aaae06
Merge pull request #177 from PotLock/testnet
Prometheo Aug 13, 2025
13a9b9f
stellar update
Prometheo Aug 18, 2025
74c0e35
pick address from env
Prometheo Aug 27, 2025
24a5dfd
Merge pull request #178 from PotLock/testnet
Prometheo Aug 27, 2025
fe97729
change stellar mainnet rpc
Prometheo Aug 27, 2025
bf4c280
Merge pull request #179 from PotLock/testnet
Prometheo Aug 27, 2025
79cc8d8
add asyncio wait for to tackle task execution hanging
Prometheo Aug 31, 2025
ebb7f6a
Merge pull request #180 from PotLock/testnet
Prometheo Aug 31, 2025
3c8bb8a
lax timeout
Prometheo Sep 4, 2025
b24c327
Merge pull request #182 from PotLock/testnet
Prometheo Sep 4, 2025
69a6b37
allow app to dev:
Prometheo Sep 8, 2025
378ea96
Merge pull request #183 from PotLock/testnet
Prometheo Sep 8, 2025
41fdf96
change applications project to actual grantpicks project
Prometheo Sep 16, 2025
e651c61
create application for approved projects by owner
Prometheo Sep 16, 2025
2e193ab
index lists on stellar
Prometheo Sep 23, 2025
5061ac0
add chain to serializer
Prometheo Sep 24, 2025
504efcc
fetch list detail by chain and id
Prometheo Sep 24, 2025
a4ded25
make chain query param for list deets
Prometheo Sep 24, 2025
4a9a375
filter by chain name
Prometheo Sep 24, 2025
b78a6d0
fix susbcription:
Prometheo Sep 26, 2025
707b33f
make video url optional
Prometheo Oct 10, 2025
27cc912
list registration
Prometheo Oct 11, 2025
f2684cf
filter with chain name
Prometheo Oct 11, 2025
18e01d2
fix list update on stellar
Prometheo Oct 13, 2025
7f60e0f
extend cors
Prometheo Oct 14, 2025
5a20bba
extend cors
Prometheo Oct 14, 2025
3f2ba37
fix get or create
Prometheo Oct 22, 2025
8bcab7a
add onchain id to list reg
Prometheo Oct 22, 2025
9f9f2da
replace public address
Prometheo Oct 24, 2025
98e8df1
add list reg update
Prometheo Oct 26, 2025
bc6a349
add model constraint
Prometheo Oct 26, 2025
23a1b02
addd logging
Prometheo Oct 26, 2025
114a7cc
addd logging
Prometheo Oct 26, 2025
0feae39
fix list reg updte
Prometheo Oct 26, 2025
c10ed44
Merge pull request #184 from PotLock/testnet
Prometheo Oct 27, 2025
2fd8090
fix: remove caching
Prometheo Nov 3, 2025
6295826
fix campaign delete
Prometheo Nov 25, 2025
19cbea7
Merge pull request #185 from PotLock/testnet
Prometheo Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ media/
# Celery beat schedule file
celerybeat-schedule
dump.rdb
celerybeat-schedule.db

# Flask stuff:
instance/
Expand Down Expand Up @@ -135,3 +136,5 @@ dmypy.json
# static

/static/

.DS_Store
29 changes: 29 additions & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
DonorsAPI,
)
from base.api import StatsAPI, ReclaimProofRequestView
from campaigns.api import (
AllCampaignDonationsAPI,
CampaignContractConfigAPI,
CampaignDetailAPI,
CampaignDonationsAPI,
CampaignsAPI,
)
from donations.api import DonationContractConfigAPI
from grantpicks.api import AccountProjectListAPI, ProjectListAPI, ProjectRoundVotesAPI, ProjectStatsAPI, RoundApplicationsAPI, RoundDetailAPI, RoundsListAPI
from lists.api import (
Expand Down Expand Up @@ -102,6 +109,28 @@
DonationContractConfigAPI.as_view(),
name="donate_contract_config_api",
),
# campaigns
path("v1/campaigns", CampaignsAPI.as_view(), name="campaigns_api"),
path(
"v1/campaigns/<int:campaign_id>",
CampaignDetailAPI.as_view(),
name="campaigns_api_by_id",
),
path(
"v1/campaigns/<int:campaign_id>/donations",
CampaignDonationsAPI.as_view(),
name="campaigns_donations_api",
),
path(
"v1/campaign_donations",
AllCampaignDonationsAPI.as_view(),
name="all_campaign_donations_api",
),
path(
"v1/campaign_contract_config",
CampaignContractConfigAPI.as_view(),
name="campaign_contract_config_api",
),
# donors
path("v1/donors", DonorsAPI.as_view(), name="donors_api"),
# lists
Expand Down
30 changes: 15 additions & 15 deletions base/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
app.autodiscover_tasks()

app.conf.beat_schedule = {
"update_account_statistics_every_5_minutes": {
"task": "indexer_app.tasks.update_account_statistics",
"schedule": crontab(minute="*/5"), # Executes every 5 minutes
"options": {"queue": "beat_tasks"},
},
"fetch_usd_prices_every_5_minutes": {
"task": "indexer_app.tasks.fetch_usd_prices",
"schedule": crontab(minute="*/5"), # Executes every 5 minutes
"options": {"queue": "beat_tasks"},
},
"update_pot_statistics_every_5_minutes": {
"task": "indexer_app.tasks.update_pot_statistics",
"schedule": crontab(minute="*/5"), # Executes every 5 minutes
"options": {"queue": "beat_tasks"},
},
# "update_account_statistics_every_5_minutes": {
# "task": "indexer_app.tasks.update_account_statistics",
# "schedule": crontab(minute="*/5"), # Executes every 5 minutes
# "options": {"queue": "beat_tasks"},
# },
# "fetch_usd_prices_every_5_minutes": {
# "task": "indexer_app.tasks.fetch_usd_prices",
# "schedule": crontab(minute="*/5"), # Executes every 5 minutes
# "options": {"queue": "beat_tasks"},
# },
# "update_pot_statistics_every_5_minutes": {
# "task": "indexer_app.tasks.update_pot_statistics",
# "schedule": crontab(minute="*/5"), # Executes every 5 minutes
# "options": {"queue": "beat_tasks"},
# },
"fetch_stellar_events_every_minute": {
"task": "indexer_app.tasks.stellar_event_indexer",
"schedule": crontab(minute="*/1"), # Executes every 1 minutes
Expand Down
67 changes: 50 additions & 17 deletions base/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@

# SECURITY WARNING: keep the secret key used in production secret!
# TODO: update before prod release
SECRET_KEY = os.environ.get("PL_DJANGO_SECRET_KEY", "django-insecure-=r_v_es6w6rxv42^#kc2hca6p%=fe_*cog_5!t%19zea!enlju")
SECRET_KEY = os.environ.get(
"PL_DJANGO_SECRET_KEY",
"django-insecure-=r_v_es6w6rxv42^#kc2hca6p%=fe_*cog_5!t%19zea!enlju",
)

ALLOWED_HOSTS = [
"ec2-100-27-57-47.compute-1.amazonaws.com",
"ec2-44-208-38-31.compute-1.amazonaws.com",
"127.0.0.1",
"dev.potlock.io",
"test-dev.potlock.io",
"api.potlock.io"
"api.potlock.io",
# "alpha.potlock.io",
]

Expand All @@ -62,34 +65,58 @@
RECLAIM_APP_ID = os.environ.get("PL_RECLAIM_APP_ID")
RECLAIM_APP_SECRET = os.environ.get("PL_RECLAIM_APP_SECRET")
RECLAIM_TWITTER_PROVIDER_ID = os.environ.get("PL_RECLAIM_TWITTER_PROVIDER_ID")
INDEXER_STREAMER_WAIT_TIME = os.environ.get(
"PL_INDEXER_STREAMER_WAIT_TIME", 300
) # in seconds

# POTLOCK_TLA = "potlock.testnet" if ENVIRONMENT == "testnet" else "potlock.near"
POTLOCK_TLA = "potlock.testnet" if ENVIRONMENT == "testnet" else ("staging.potlock.near" if ENVIRONMENT == "dev" else "potlock.near")
POTLOCK_TLA = (
"potlock.testnet"
if ENVIRONMENT == "testnet"
else ("staging.potlock.near" if ENVIRONMENT == "dev" else "potlock.near")
)
# NADABOT_TLA = "nadabot.testnet" if ENVIRONMENT == "testnet" else "nadabot.near"
NADABOT_TLA = "nadabot.testnet" if ENVIRONMENT == "testnet" else ("staging.nadabot.near" if ENVIRONMENT == "dev" else "nadabot.near")
STELLAR_CONTRACT_ID = "CA7A2776JYIOYXPAJFONDC7BVPDWWLZU524UTGIJIQH6HWWOR6LKYQQT" if ENVIRONMENT == "testnet" else ("" if ENVIRONMENT == "dev" else "")
STELLAR_PROJECTS_REGISTRY_CONTRACT = "CA56XSY7YEZ7CJ5FYG7YODQIWE3JNRGZ5S7E7VJAQ675KDS4BLZJ5NJH" if ENVIRONMENT == "testnet" else ("" if ENVIRONMENT == "dev" else "")
NADABOT_TLA = (
"nadabot.testnet"
if ENVIRONMENT == "testnet"
else ("staging.nadabot.near" if ENVIRONMENT == "dev" else "nadabot.near")
)
STELLAR_CONTRACT_ID = os.environ.get("PL_STELLAR_CONTRACT_ID", "")
STELLAR_PROJECTS_REGISTRY_CONTRACT = os.environ.get(
"PL_STELLAR_PROJECTS_REGISTRY_CONTRACT", ""
)
STELLAR_LIST_CONTRACT = os.environ.get("PL_STELLAR_LIST_CONTRACT", "")
NEAR_SOCIAL_CONTRACT_ADDRESS = (
"v1.social08.testnet" if ENVIRONMENT == "testnet" else "social.near"
)
NEAR_GRANTPICKS_CONTRACT_ID = "v2.grantpicks.potlock.testnet" if ENVIRONMENT == "testnet" else ("" if ENVIRONMENT == "dev" else "")
NEAR_GRANTPICKS_CONTRACT_ID = (
"v2.grantpicks.potlock.testnet"
if ENVIRONMENT == "testnet"
else ("" if ENVIRONMENT == "dev" else "")
)
# TODO: split settigns file by enviroment
if ENVIRONMENT == "testnet":
POTLOCK_PATTERN = r'\.potlock\.testnet$'
NADABOT_PATTERN = r'\.nadabot\.testnet$'
POTLOCK_PATTERN = r"\.potlock\.testnet$"
NADABOT_PATTERN = r"\.nadabot\.testnet$"
elif ENVIRONMENT == "dev":
POTLOCK_PATTERN = r'\.staging\.potlock\.near$'
NADABOT_PATTERN = r'\.staging\.nadabot\.near$'
POTLOCK_PATTERN = r"\.staging\.potlock\.near$"
NADABOT_PATTERN = r"\.staging\.nadabot\.near$"
else: # mainnet/prod
POTLOCK_PATTERN = r'(?<!\.staging)\.potlock\.near$'
NADABOT_PATTERN = r'(?<!\.staging)\.nadabot\.near$'
POTLOCK_PATTERN = r"(?<!\.staging)\.potlock\.near$"
NADABOT_PATTERN = r"(?<!\.staging)\.nadabot\.near$"

FASTNEAR_RPC_URL = (
"https://rpc.web4.testnet.page"
if ENVIRONMENT == "testnet"
else "https://rpc.web4.near.page"
)

STELLAR_RPC_URL = (
"https://soroban-testnet.stellar.org"
if ENVIRONMENT == "testnet"
else "https://stellar-soroban-public.nodies.app"
)

BLOCK_SAVE_HEIGHT = os.environ.get("BLOCK_SAVE_HEIGHT")

COINGECKO_URL = (
Expand Down Expand Up @@ -125,7 +152,8 @@
"tokens",
"nadabot",
"chains",
"grantpicks"
"grantpicks",
"campaigns",
]

DEFAULT_PAGE_SIZE = 30
Expand Down Expand Up @@ -197,7 +225,7 @@
"https://testnet.potlock.org",
"https://testnet.potlock.xyz",
"https://testnet.potlock.app",
"https://testnet.potlock.io"
"https://testnet.potlock.io",
]
elif ENVIRONMENT == "dev":
CORS_ALLOWED_ORIGINS = [
Expand All @@ -206,6 +234,11 @@
"https://staging.alpha.potlock.app",
"http://dev.local",
"https://dev.local",
"https://app.potlock.app",
"https://app.potlock.org",
"http://alpha.potlock.org",
"https://alpha.potlock.xyz",
"https://alpha.potlock.app",
]
else:
CORS_ALLOWED_ORIGINS = [
Expand All @@ -232,14 +265,14 @@
"https://bos.potlock.io",
"https://app.potlock.io",
"https://bos.potlock.app",
"https://app.potlock.app"
"https://app.potlock.app",
]

CORS_ALLOWED_ORIGIN_REGEXES = [
"^https:\/\/potlock-next-[\w-]+-potlock\.vercel\.app\/?$",
"^https?:\/\/.*\.?grantpicks\.com$",
"^https:\/\/staging\.app\.potlock\.(org|io|xyz|app)\/?$",
"^https:\/\/staging\.alpha\.potlock\.(org|io|xyz|app)\/?$"
"^https:\/\/staging\.alpha\.potlock\.(org|io|xyz|app)\/?$",
]

# REDIS / CACHE CONFIGS
Expand Down
Empty file added campaigns/__init__.py
Empty file.
Loading
Loading