diff --git a/.env b/.env index b2b7754e..edc977f1 100644 --- a/.env +++ b/.env @@ -8,6 +8,7 @@ OKP4_MEDIUM_URL='https://blog.okp4.network/' OKP4_TELEGRAM_URL='https://t.me/okp4network' OKP4_TWITTER_URL='https://twitter.com/OKP4_Protocol' OKP4_WEBSITE_URL='https://okp4.network/' +OKP4_WEBSITE_DOCS_URL='https://docs.okp4.network/' OKP4_EXPLORER_URL='https://explore.okp4.network/okp4%20testnet/staking/' OKP4_DOCS_URL='https://docs.okp4.network/whitepaper/abstract' OKP4_DOCS_NODES_URL='https://docs.okp4.network/docs/nodes/introduction' @@ -42,10 +43,22 @@ OKP4_GITHUB_PREDICATE_ADDRESS_URL='https://github.com/okp4/okp4d/blob/v4.1.0/x/l OKP4_GITHUB_LOGIC_MODULE_PREDICATES_URL='https://github.com/okp4/okp4d/tree/v4.1.0/x/logic/predicate' OKP4_GITHUB_PROLOG_TEMPLATE_URL='https://github.com/okp4/contracts/tree/v2.0.0/contracts/okp4-law-stone/examples/multiple-sources' OKP4_GITHUB_ONTOLOGY_RHIZOME_URL='https://github.com/okp4/ontology/blob/main/example/rhizome/dataset/0ea1fc7a-dd97-4adc-a10e-169c6597bcde.ttl' +OKP4_GITHUB_ONTOLOGY_S3_SERVICE_URL='https://github.com/okp4/ontology/blob/main/src/core.ttl' +OKP4_GITHUB_S3_SERVICE_METADATA_URL='https://github.com/okp4/ontology/blob/main/src/metadata-service-general.ttl' +OKP4_GITHUB_ONTOLOGY_CSV_DATASET_METADATA_URL='https://github.com/okp4/ontology/blob/main/src/metadata-dataset-general.ttl' +OKP4_GITHUB_SERVICE_REFERENCE_URL='https://github.com/okp4/ontology/blob/main/example/rhizome/service/d1b0b4d3-f9a6-4115-bcd8-ad97233a7b08.ttl' +OKP4_GITHUB_DATASET_REFERENCE_URL='https://github.com/okp4/ontology/blob/main/example/rhizome/dataset/1a4c5896-b13e-40f7-a603-5a5b3ed996a1.ttl' +OKP4_GITHUB_COGNITARIUM_PROLOG_CODE_URL='https://github.com/okp4/contracts/blob/main/contracts/okp4-cognitarium/examples/prolog-query/query.pl' +OKP4_GITHUB_COGNITARIUM_SERVICE_CATEGORY_URL='https://github.com/okp4/ontology/blob/main/src/vocab-category-service.ttl' +OKP4_GITHUB_COGNITARIUM_DATASET_MEDIATYPE_URL='https://github.com/okp4/ontology/blob/main/src/vocab-mediatype.ttl' +OKP4_GITHUB_STORAGE_SERVICE_URL='https://github.com/okp4/ontology/blob/d3209eb9395a0292927627004e5114b63bf3cab0/example/rhizome/service/d1b0b4d3-f9a6-4115-bcd8-ad97233a7b08.ttl#L10' +OKP4_GITHUB_DATASET_URL='https://github.com/okp4/ontology/blob/d3209eb9395a0292927627004e5114b63bf3cab0/example/rhizome/dataset/1a4c5896-b13e-40f7-a603-5a5b3ed996a1.ttl#L21C20-L21C39' OKP4_OBJECTARIUM_ADDRESS='okp41lppz4x9dtmccek2m6cezjlwwzup6pdqrkvxjpk95806c3dewgrfq602kgx' OKP4_OBJECTARIUM_ID='84a8090b72fa9d03acda18503e8182c13753d97183acfbd53abe57efe71ae025' OKP4_SMART_CONTRACT_LAW_STONE_CODE_ID='5' OKP4_SMART_CONTRACT_COGNITARIUM_CODE_ID='6' +OKP4_SMART_CONTRACT_TUTORIAL_URL='https://docs.okp4.network/tutorials/explorer-sc' +OKP4_DATA_COGNITARIUM_CODE_ID='7' OKP4_CHAIN_ADDRESS='okp41r0pf2d78w8w29sm9a6qm8x6yqshezm0k6vwcrg' GRAPHQL_URI='https://api.nemeton.staging.okp4.network/graphql' OKP4_KEPLR_WALLET_EXTENSION_URL='https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap' @@ -55,6 +68,15 @@ OKP4_FAUCET_URL='https://faucet.okp4.network/' OKP4_SWI_PROLOG_URL='https://www.swi-prolog.org/' OKP4_SWI_PROLOG_FUNCTIONS_URL='https://www.swi-prolog.org/pldoc/man?section=functions' OKP4_ONTOLOGY_DESCRIPTION_URL='https://blog.okp4.network/okp4-knowledge-sharing-through-ontology-driven-dataverse-a-new-approach-to-knowledge-description-f9b81d4484c8' +CSV_DATASET_URL='https://data.europa.eu/data/datasets/d043d1f8-f73e-47d1-a471-53156f5e051b?locale=en' +AWS_S3_URL='https://aws.amazon.com/fr/s3/' +SCALEWAY_OBJECT_STORAGE_URL='https://www.scaleway.com/fr/object-storage/' +GITHUB_UUID_TOOLS_URL='https://github.com/aarreedd/uuidtools.com' +OKP4_TUTORIALS_ONTOLOGY_URL='https://docs.okp4.network/tutorials/ontology-1' +OKP4_TESTNET_CONTRACT_LIST_URL='https://explore.okp4.network/OKP4%20testnet/cosmwasm/4/contracts' +BEYOND_TRADITIONAL_GOUVERNANCE_URL='https://blog.okp4.network/beyond-traditional-governance-embracing-on-chain-with-okp4-3-3-424f7a8eb2fc' +GRAZ_REACT_HOOKS_URL='https://graz.strange.love/docs/' +NEMETON_SUPPORT_URL='https://nemeton.okp4.network/support#support-page' OKP4_TASKS_SIDH_5_TYPEFORM_URL='https://okp4.typeform.com/Sidh-task5' OKP4_TASKS_IMBOLC_1_TYPEFORM_URL='https://okp4.typeform.com/Nemeton-RPC' OKP4_TASKS_IMBOLC_2_TYPEFORM_URL='https://okp4.typeform.com/NemetonSnapshot' @@ -73,3 +95,5 @@ OKP4_PHASE_SAMHAIN_START_DATE='2023-05-15T00:00:00Z' OKP4_PHASE_SAMHAIN_END_DATE='2023-10-31T23:59:59Z' OKP4_CHALLENGE_1_START_DATE='2023-06-12T12:00:00Z' OKP4_CHALLENGE_1_END_DATE='2023-06-28T12:00:00Z' +OKP4_CHALLENGE_2_START_DATE='2023-07-07T12:00:00Z' +OKP4_CHALLENGE_2_END_DATE='2023-08-30T12:00:00Z' diff --git a/environment.d.ts b/environment.d.ts index 54099c49..ed906046 100644 --- a/environment.d.ts +++ b/environment.d.ts @@ -10,6 +10,7 @@ declare namespace NodeJS { OKP4_TELEGRAM_URL: string OKP4_TWITTER_URL: string OKP4_WEBSITE_URL: string + OKP4_WEBSITE_DOCS_URL: string OKP4_EXPLORER_URL: string OKP4_DOCS_URL: string OKP4_DOCS_NODES_URL: string @@ -43,6 +44,16 @@ declare namespace NodeJS { OKP4_GITHUB_LOGIC_MODULE_PREDICATES_URL: string OKP4_GITHUB_PROLOG_TEMPLATE_URL: string OKP4_GITHUB_ONTOLOGY_RHIZOME_URL: string + OKP4_GITHUB_ONTOLOGY_S3_SERVICE_URL: string + OKP4_GITHUB_S3_SERVICE_METADATA_URL: string + OKP4_GITHUB_ONTOLOGY_CSV_DATASET_METADATA_URL: string + OKP4_GITHUB_SERVICE_REFERENCE_URL: string + OKP4_GITHUB_DATASET_REFERENCE_URL: string + OKP4_GITHUB_COGNITARIUM_PROLOG_CODE_URL: string + OKP4_GITHUB_COGNITARIUM_SERVICE_CATEGORY_URL: string + OKP4_GITHUB_COGNITARIUM_DATASET_MEDIATYPE_URL: string + OKP4_GITHUB_STORAGE_SERVICE_URL: string + OKP4_GITHUB_DATASET_URL: string GRAPHQL_URI: string OKP4_KEPLR_WALLET_EXTENSION_URL: string OKP4_KEPLR_DOCS_TUTORIALS_URL: string @@ -55,7 +66,18 @@ declare namespace NodeJS { OKP4_OBJECTARIUM_ID: string OKP4_SMART_CONTRACT_LAW_STONE_CODE_ID: string OKP4_SMART_CONTRACT_COGNITARIUM_CODE_ID: string + OKP4_SMART_CONTRACT_TUTORIAL_URL: string + OKP4_DATA_COGNITARIUM_CODE_ID: string OKP4_CHAIN_ADDRESS: string + CSV_DATASET_URL: string + AWS_S3_URL: string + SCALEWAY_OBJECT_STORAGE_URL: string + GITHUB_UUID_TOOLS_URL: string + OKP4_TUTORIALS_ONTOLOGY_URL: string + OKP4_TESTNET_CONTRACT_LIST_URL: string + BEYOND_TRADITIONAL_GOUVERNANCE_URL: string + GRAZ_REACT_HOOKS_URL: string + NEMETON_SUPPORT_URL: string OKP4_TASKS_SIDH_5_TYPEFORM_URL: string OKP4_TASKS_IMBOLC_1_TYPEFORM_URL: string OKP4_TASKS_IMBOLC_2_TYPEFORM_URL: string @@ -75,6 +97,8 @@ declare namespace NodeJS { OKP4_TASKS_LUGHNASAD_6_TYPEFORM_URL: string OKP4_CHALLENGE_1_START_DATE: string OKP4_CHALLENGE_1_END_DATE: string + OKP4_CHALLENGE_2_START_DATE: string + OKP4_CHALLENGE_2_END_DATE: string } } diff --git a/src/data/phase/samhain.tsx b/src/data/phase/samhain.tsx index 3b358e94..193095e5 100644 --- a/src/data/phase/samhain.tsx +++ b/src/data/phase/samhain.tsx @@ -21,6 +21,17 @@ export const samhain = ({ githubLogicModulePredicatesUrl, githubPrologTemplateUrl, githubOntologyRhizomeUrl, + githubOntologyS3ServiceUrl, + githubS3ServiceMetadataUrl, + githubOntologyCsvDatasetMetadataUrl, + githubServiceReferenceUrl, + githubDatasetReferenceUrl, + githubCognitariumPrologCodeUrl, + githubCognitariumServiceCategoryUrl, + githubCognitariumDatasetMediaTypeUrl, + githubStorageServiceUrl, + githubDatasetUrl, + githubContractsUrl, ontologyDescriptionUrl, swiPrologUrl, swiPrologFunctionsUrl, @@ -28,9 +39,21 @@ export const samhain = ({ objectariumID, smartContractLawStoneCodeID, smartContractCognitariumCodeID, + smartContractTutorialUrl, + dataCognitariumCodeID, chainAddress, tutorialsPrologUrl, - tutorialsCliUrl + tutorialsCliUrl, + csvDatasetUrl, + awsS3Url, + scaleWayObjectStorageUrl, + githubUuidToolsUrl, + tutorialsOntologyUrl, + testnetContractListUrl, + beyondTraditionalGovernanceUrl, + grazDocsUrl, + okp4WebsiteDocsUrl, + nemetonSupportUrl }, challenges } @@ -842,6 +865,687 @@ export const samhain = ({ } } ] + }, + { + challengeName: 'Invoke the power of Dagda - From July, 12th to August, 30th', + challengeStatus: getStatusByDuration(challenges[1].startDate, challenges[1].endDate), + challengeDescription: ( + <> +

+ + Summon the wisdom of the druids and harness the OKP4 Protocol - the key to unlocking + decentralized resource sharing. Delve into the enchanted tech to inscribe your own + runes of data, query their secrets, and craft user interfaces reminiscent of ancient + stone circles to establish consent rules for resources. Your journey begins here, + within the heart of this decentralized realm. + +

+

+ Complete these four challenges to imagine the tools and usages for the new world of + decentralized resource sharing! +

+ + ), + challengeTasks: [ + { + taskName: 'Reference within the OKP4 ontology a CSV file stored in S3', + taskContent: [ + { + id: 'description', + title: 'Description', + contentDescription: ( + <> +

+ (Difficulty: 2.5/5) +
{' '} + + In the timeless wisdom of the druids, to share one's knowledge, one must + first be able to name and reference it. This is the vital essence of ontology, + the ancient tree of understanding from which all information grows. Like the + sturdy oak representing the world, ontology thrives on RDF triplets, encoded + into the essence of a smart contract, adhering to the sacred text of the OKP4 + core specification. Just as druids believed in the interconnectedness of all + things, so does the dataverse interweave every piece of data into a living, + breathing digital grove. + +

+

+ Add a CSV dataset (like this{' '} + + one + {' '} + for exemple) to the dataverse. You should previously store the data in an + S3 service you control (you can use{' '} + + AWS + {' '} + or{' '} + + Scaleway + {' '} + for example). +

+

Generate a Turtle file with descriptions of:

+ +

+ If you need to generate identifiers, use{' '} + + uuid-v4 + + . Feel free to add any additional metadata! +

+

+ Store this semantic data on-chain; you should submit the whole by executing a + single insert_data message to a cognitarium smart + contract you've instantiated ( + CODE_ID = {dataCognitariumCodeID}). +
Provide “Nemeton-Dagda1” as a memo (add{' '} + --note "Nemeton-Dagda1" to your command if you use the + CLI). +

+ + ) + }, + { + id: 'rewards', + title: 'Rewards', + contentDescription:

An “OKP4 Dataverse precursor“ POAP (Stargaze POAP)

+ }, + { + id: 'criteria', + title: 'Judging Criteria', + contentDescription: ( +

+ The first 250 wallets with an eligible transaction will receive the on-chain badge + on August 31. +
It's useless to farm the POAP, don't expect related $KNOW airdrop + eligibility 😄 +

+ ) + }, + { + id: 'submit', + title: 'How to Submit', + contentDescription: ( +

+ You have to store the semantic data (Turtle format) in a cognitarium{' '} + instance with “Nemeton-Dagda1” as a memo of your insert_data{' '} + transaction. You don't need to do anything else. +

+ ) + }, + { + id: 'documentation', + title: 'Documentation, useful links', + contentDescription: ( + + ) + } + ], + taskDuration: { + from: '2023-07-12T12:00:00Z', + to: '2023-08-30T12:00:00Z' + } + }, + { + taskName: 'Prolog predicates to query the ontology', + taskContent: [ + { + id: 'description', + title: 'Description', + contentDescription: ( + <> +

+ (Difficulty: 3/5) +
+ + Under the celestial canopy of the OKP4 Protocol, Prolog unfolds as the sacred + language, defining and interpreting the laws inscribed upon the shared + resources. Craft your own druidic predicates, akin to the stones in a sacred + henge, making it simpler to divine the mysteries of the ontology within the + sacred script of Prolog code. + +

+

+ Look at the{' '} + + Prolog code example in the cognitarium contract GitHub repository + + . Acognitarium_dataset_tags(CognitariumAddr, DatasetDID, Tags){' '} + predicate allows you to get tags for a specific dataset (objects of{' '} + core:Tags and DatasetDID as subject). Similarly, write + several predicates to query the ontology from any Prolog program interpreted by + the OKP4 blockchain. +

+

Write generic predicates to query ontology:

+ +

+ Use these Prolog helpers to write specific predicates retrieving metadata of the + CSV you previously stored: +

+ +

+ Submit a unique Prolog program containing the five predicates with a{' '} + law-stone + smart contract instantiation ( + CODE_ID = {smartContractLawStoneCodeID}). You can set + {objectariumAddress} as the default storage address or{' '} + + any other available objectarium instance + + . +
+ Provide “Nemeton-Dagda2” as a memo (add{' '} + --note "Nemeton-Dagda2" to your command if you use the + CLI). +

+ + ) + }, + { + id: 'rewards', + title: 'Rewards', + contentDescription: ( + <> +

+ 100,000 $KNOW (0,05% of the total supply) + an “OKP4 Prolog query master” POAP + (Stargaze badge) for the first one to submit 5 valid expected predicates. +

+

+ The first wallet with an eligible transaction will receive the on-chain badge on + August 31, and the $KNOW tokens will be sent out when the mainnet is launched + (scheduled for late 2023). +

+ + ) + }, + { + id: 'criteria', + title: 'Judging Criteria', + contentDescription: ( + <> +

+ Each predicate will be evaluated. For example, a query like the one below, with + your deployed law-stone instance address as{' '} + $CONTRACT_ADDR, should return a + MediaType = application_vndms-excel substitution: +

+
+                    okp4d query wasm contract-state smart $CONTRACT_ADDR \
+                    
"{'{'}\"ask\": {'{'}\"query\": + \"cognitarium_dataset_mediatype(okp41ehq2u2k5n45malyrncr8ln3cu8uk94cpfgxs80mma8jwrwmxjj3sa9l5zl, + 0ea1fc7a-dd97-4adc-a10e-169c6597bcde, MediaType).\"{'}}'} + " +
+ + ) + }, + { + id: 'submit', + title: 'How to Submit', + contentDescription: ( +

+ You have to instantiate a law stone with a Prolog program containing + the five expected predicates. You should have instantiated with “Nemeton-Dagda2” + as a memo. You don't need to do anything else. +

+ ) + }, + { + id: 'documentation', + title: 'Documentation, useful links', + contentDescription: ( + + ) + } + ], + taskDuration: { + from: '2023-07-12T12:00:00Z', + to: '2023-08-30T12:00:00Z' + } + }, + { + taskName: 'Build a web interface to interact with the OKP4 blockchain', + taskContent: [ + { + id: 'description', + title: 'Description', + contentDescription: ( + <> +

+ (Difficulty: 4/5) +
{' '} + + With the wisdom of data referencing now in our grasp and Prolog - the ancient + druidic tongue for setting consent for sharing nature's gifts - in our + command, the dawn of creation is upon us. It is time to craft portals of + interaction, intuitive as the forest path, to empower all who wander in our + digital grove to share and dictate the sacred laws according to the innate + properties of the metadata. Like ancient druidic symbols carved on stones, + these user interfaces shall guide and simplify the journey for all seekers of + knowledge. + +

+

+ Create a front-end application to list and submit shared resources and rules + registered in the blockchain. You should then be able to retrieve data you + previously submitted and even use it to reference resources or add a new Prolog + program (resources rules or utils). +

+

Your web interface should at least have the following features:

+ +

+ For every transaction the UI submits, you should set in memo + “Nemeton-Dagda3-GH_REPO” with GH_REPO as the Github repo link of + the web interface you are developing. +

+

+ You can use any framework to develop your web interface. We advise you to look + at the{' '} + + graz + {' '} + React hooks. For example, to instantiate a law-stone with a{' '} + memo: +

+
+                    import {'{'} useInstantiateContract {'}'} from "graz";
+                    
+
+ const {'{'} instantiateContract {'}'} = useInstantiateContract({'{'}
{' '} + codeId: 5,
onError: () {'=>'} {'{}'},
onMutate: () {'=>'} {'{}'},{' '} +
onSuccess: () {'=>'} {'{}'}
+ {'}'});

+ instantiateContract({'{'}
msg: {'{'}
program: "base64 prolog + program",
{' '}storage_address: " + {objectariumAddress}" +
{'}'},
options: {'{'} +
{' '}memo: + "Nemeton-Dagda3-http://your-github-repo-with-your-OKP4-addr-in-README.link" +
{'}'} +
+ {'}'}); +
+ + ) + }, + { + id: 'rewards', + title: 'Rewards', + contentDescription: ( + <> +

+ 150 000 $KNOW tokens (0,075% of the total supply) + an “OKP4 interface + innovator” POAP (Stargaze badge) per validated web interface. +

+

+ 300,000 $KNOW will be sent to builders for this task. OKP4 team will manually + evaluate the user interfaces and reward the two most relevant ones. +

+

+ The web interface GitHub repository README should provide an OKP4 address where + to send the POAP and the $KNOW tokens. Wallets from elected interfaces will + receive the on-chain badge on August 31, and the $KNOW tokens will be sent out + when the mainnet is launched (scheduled for late 2023). +

+ + ) + }, + { + id: 'criteria', + title: 'Judging Criteria', + contentDescription: ( +

+ Your web interface should propose the required functionalities. Rewards will be + sent in priority to developers submitting early and/or providing the best UX + and/or further features. +

+ ) + }, + { + id: 'submit', + title: 'How to Submit', + contentDescription: ( +

+ All the transactions executed from the web application should have + “Nemeton-Dagda3” and your Github repository link in the transaction{' '} + memo. At least one transaction should have been executed from the + front end. Your Github repository should be an open-source project with a clear + README to launch the web application locally. To receive the rewards, the README + should contain your OKP4 address. +

+ ) + }, + { + id: 'documentation', + title: 'Documentation, useful links', + contentDescription: ( + + ) + } + ], + taskDuration: { + from: '2023-07-12T12:00:00Z', + to: '2023-08-30T12:00:00Z' + } + }, + { + taskName: + 'Open contribution, tweet a thread to explain the relevance of your OKP4 project', + taskContent: [ + { + id: 'description', + title: 'Description', + contentDescription: ( + <> +

+ (Difficulty: 4/5) +
{' '} + + Much like the boundless forests of old, the sacred protocol welcomes + contributions from every pilgrim. The Dagda challenges are stepping stones + shaped to help you navigate the undergrowth and grasp the fundamental lore. + Having now tamed the mystical beast of technology, you are as free as a druid + in his grove. Go forth, conjure up your own vision, and let your ideas bloom + like a sacred mistletoe on the mighty oaks of our digital woodland. + +

+

+ Get the OKP4 blockchain on your own. Do you think something is missing and + should be developed? Build it and get rewarded for it! +

+

Tweet a thread with the following:

+ +

Need inspiration? You could:

+ + + ) + }, + { + id: 'rewards', + title: 'Rewards', + contentDescription: ( + <> +

+ 100,000 $KNOW (0,05% of the total supply) + an “OKP4 visionary contributor” POAP + (Stargaze badge) per validated project. +

+

+ 300,000 $KNOW will be sent to builders for this task. OKP4 team will manually + evaluate the user interfaces and rewards the three most relevant ones. +

+

+ Your GitHub repo README should provide an OKP4 address where to send the POAP + and the $KNOW tokens. Wallets from elected projects will receive the on-chain + badge on August 31, and the $KNOW tokens will be sent out when the mainnet is + launched (scheduled for late 2023). +

+ + ) + }, + { + id: 'criteria', + title: 'Judging Criteria', + contentDescription: ( +

+ Your tweet and README should clearly state the problem you want to solve and why + it is a good contribution to the OKP4 community. Rewards will be sent in priority + to developers submitting innovative applications. Feel free to{' '} + + contact us + {' '} + if you want to discuss your project before developing it. +

+ ) + }, + { + id: 'submit', + title: 'How to Submit', + contentDescription: ( +

+ Send the tweet as required in the 'Description' part above. You + don't need to do anything else. +

+ ) + }, + { + id: 'documentation', + title: 'Documentation, useful links', + contentDescription: ( + + ) + } + ], + taskDuration: { + from: '2023-07-12T12:00:00Z', + to: '2023-08-30T12:00:00Z' + } + } + ] } ] }) diff --git a/src/lib/config.ts b/src/lib/config.ts index d4d95df6..f9ebe935 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -99,6 +99,17 @@ export const config: Config = { githubLogicModulePredicatesUrl: process.env.OKP4_GITHUB_LOGIC_MODULE_PREDICATES_URL, githubPrologTemplateUrl: process.env.OKP4_GITHUB_PROLOG_TEMPLATE_URL, githubOntologyRhizomeUrl: process.env.OKP4_GITHUB_ONTOLOGY_RHIZOME_URL, + githubOntologyS3ServiceUrl: process.env.OKP4_GITHUB_ONTOLOGY_S3_SERVICE_URL, + githubS3ServiceMetadataUrl: process.env.OKP4_GITHUB_S3_SERVICE_METADATA_URL, + githubOntologyCsvDatasetMetadataUrl: process.env.OKP4_GITHUB_ONTOLOGY_CSV_DATASET_METADATA_URL, + githubServiceReferenceUrl: process.env.OKP4_GITHUB_SERVICE_REFERENCE_URL, + githubDatasetReferenceUrl: process.env.OKP4_GITHUB_DATASET_REFERENCE_URL, + githubCognitariumPrologCodeUrl: process.env.OKP4_GITHUB_COGNITARIUM_PROLOG_CODE_URL, + githubCognitariumServiceCategoryUrl: process.env.OKP4_GITHUB_COGNITARIUM_SERVICE_CATEGORY_URL, + githubCognitariumDatasetMediaTypeUrl: process.env.OKP4_GITHUB_COGNITARIUM_DATASET_MEDIATYPE_URL, + githubStorageServiceUrl: process.env.OKP4_GITHUB_STORAGE_SERVICE_URL, + githubDatasetUrl: process.env.OKP4_GITHUB_DATASET_URL, + githubContractsUrl: process.env.OKP4_GITHUB_CONTRACTS_URL, okp4dDocsCommandsUrl: process.env.OKP4_OKP4D_DOCS_COMMANDS_URL, ontologyDescriptionUrl: process.env.OKP4_ONTOLOGY_DESCRIPTION_URL, swiPrologUrl: process.env.OKP4_SWI_PROLOG_URL, @@ -107,14 +118,31 @@ export const config: Config = { objectariumID: process.env.OKP4_OBJECTARIUM_ID, smartContractLawStoneCodeID: process.env.OKP4_SMART_CONTRACT_LAW_STONE_CODE_ID, smartContractCognitariumCodeID: process.env.OKP4_SMART_CONTRACT_COGNITARIUM_CODE_ID, + smartContractTutorialUrl: process.env.OKP4_SMART_CONTRACT_TUTORIAL_URL, + dataCognitariumCodeID: process.env.OKP4_DATA_COGNITARIUM_CODE_ID, chainAddress: process.env.OKP4_CHAIN_ADDRESS, tutorialsPrologUrl: process.env.OKP4_TUTORIALS_PROLOG_URL, - tutorialsCliUrl: process.env.OKP4_TUTORIALS_CLI_URL + tutorialsCliUrl: process.env.OKP4_TUTORIALS_CLI_URL, + csvDatasetUrl: process.env.CSV_DATASET_URL, + awsS3Url: process.env.AWS_S3_URL, + scaleWayObjectStorageUrl: process.env.SCALEWAY_OBJECT_STORAGE_URL, + githubUuidToolsUrl: process.env.GITHUB_UUID_TOOLS_URL, + tutorialsOntologyUrl: process.env.OKP4_TUTORIALS_ONTOLOGY_URL, + testnetContractListUrl: process.env.OKP4_TESTNET_CONTRACT_LIST_URL, + beyondTraditionalGovernanceUrl: process.env.BEYOND_TRADITIONAL_GOUVERNANCE_URL, + grazDocsUrl: process.env.GRAZ_REACT_HOOKS_URL, + okp4WebsiteDocsUrl: process.env.OKP4_WEBSITE_DOCS_URL, + nemetonSupportUrl: process.env.NEMETON_SUPPORT_URL + }, challenges: [ { startDate: process.env.OKP4_CHALLENGE_1_START_DATE, endDate: process.env.OKP4_CHALLENGE_1_END_DATE + }, + { + startDate: process.env.OKP4_CHALLENGE_2_START_DATE, + endDate: process.env.OKP4_CHALLENGE_2_END_DATE } ] } diff --git a/src/pages/builders/challenges.tsx b/src/pages/builders/challenges.tsx index 19e18588..64f6c50c 100644 --- a/src/pages/builders/challenges.tsx +++ b/src/pages/builders/challenges.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react' +import React, { useMemo, useCallback } from 'react' import type { GetServerSideProps, NextPage } from 'next' import moment from 'moment' import Phases from '@/data/phase' @@ -13,14 +13,15 @@ export type ChallengesProps = Pick const Challenges: NextPage = props => { const { phases } = props const challenges = useMemo( - () => Phases(phases)[Phases(phases).length - 1].challenges ?? [], + () => Phases(phases)[Phases(phases).length - 1].challenges?.reverse() ?? [], [phases] ) - const [activeIndex, setActiveIndex] = useAccordion() + const [activeTask, setActiveTask] = useAccordion() - const handleClick = (index: number) => () => { - activeIndex === index ? setActiveIndex(null) : setActiveIndex(index) - } + const handleClick = useCallback( + (taskName: string) => () => setActiveTask(activeTask === taskName ? null : taskName), + [activeTask, setActiveTask] + ) return (
@@ -53,7 +54,8 @@ const Challenges: NextPage = props => {
) - const active = activeIndex === index + + const active = activeTask === taskName return (
@@ -79,7 +81,7 @@ const Challenges: NextPage = props => { } iconProps={{ width: 21, height: 13 }} isExpanded={active} - onToggle={handleClick(index)} + onToggle={handleClick(taskName)} title={title} variant="tertiary" /> diff --git a/src/styles.scss b/src/styles.scss index b547fccd..95109e7a 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -246,6 +246,10 @@ main { .okp4-nemeton-web-page-challenges-content { padding: 0 121px; + h2 { + margin-top: 40px; + } + @media screen and (max-width: 1000px) { padding: 0; @@ -282,7 +286,7 @@ main { white-space: break-spaces; background-color: $black-300; border-radius: 6px; - line-height: 24px; + line-height: 33px; } pre { diff --git a/src/types/config.type.ts b/src/types/config.type.ts index bbe913f0..a8f01912 100644 --- a/src/types/config.type.ts +++ b/src/types/config.type.ts @@ -45,6 +45,17 @@ export type PhasesConfig = { githubLogicModulePredicatesUrl: string githubPrologTemplateUrl: string githubOntologyRhizomeUrl: string + githubOntologyS3ServiceUrl: string + githubS3ServiceMetadataUrl: string + githubOntologyCsvDatasetMetadataUrl: string + githubServiceReferenceUrl: string + githubDatasetReferenceUrl: string + githubCognitariumPrologCodeUrl: string + githubCognitariumServiceCategoryUrl: string + githubCognitariumDatasetMediaTypeUrl: string + githubStorageServiceUrl: string + githubDatasetUrl: string + githubContractsUrl: string okp4dDocsCommandsUrl: string ontologyDescriptionUrl: string swiPrologUrl: string @@ -53,9 +64,21 @@ export type PhasesConfig = { objectariumID: string smartContractLawStoneCodeID: string smartContractCognitariumCodeID: string + smartContractTutorialUrl: string + dataCognitariumCodeID: string chainAddress: string tutorialsPrologUrl: string tutorialsCliUrl: string + csvDatasetUrl: string + awsS3Url: string + scaleWayObjectStorageUrl: string + githubUuidToolsUrl: string + tutorialsOntologyUrl: string + testnetContractListUrl: string + beyondTraditionalGovernanceUrl: string + grazDocsUrl: string + okp4WebsiteDocsUrl: string, + nemetonSupportUrl: string } challenges: Array<{ startDate: string