24.05.2022
3
Beğenme
7
Görüntülenme
I attended a NEAR Protocol class from Patika.dev website. It’s completely free to attend the class and it’s English. Visit the link below to go to the course:
Hayal ettiğin yazılım kariyerini yakalaman için ihtiyaç duyduğun her şey
(Patika also has courses that range from data science courses to game development courses that you can only access as an enrollment)
Firstly, I want to explain the application superficially. My project is a new generation Web3 Decentralized Advertising Application. The main purpose of this project is giving a chance to everyone for sharing their ads with the people all around the world, and it also provides the other people to access other ads via the app.
Before we start, if you want to try my project by yourself, you need clone the project from project’s GitHub address (Also if you want and you liked the project, you can give star 😃 ⭐️). You can use the link below for cloning the project.
After cloning the project, please run
yarn
in order to install all of the necessary packages for the project to run correctly.
The contract is located in under the assembly folder, after editing the contract you can run
yarn build:release
in order to build the contract and get the .wasm file , if you want to build and deploy the contract at the same time, you can run
yarn dev
This will create a test account and deploy the contract into it.
After the contract is deployed, it is necessary to run the following command in the terminal in order to be able to run the contract
export CONTRACT=ACCOUNT_ID
where the ACCOUNT_ID will be returned after the contract deployment.
Now I want to explain the project with the details!
In this project, the functions that whose names are
were used. Probably you can feel the functions’ tasks based on their names, but I will explain these functions basically.
Example call:
near call $CONTRACT healthCheck '{"req":"$TYPE_ANYTHING", "rep":"$TYPE_ANYTHING"}' --accountId $NEAR_ACCOUNT
Example call:
near call $CONTRACT publishAdvertising '{"text":"$TYPE_ANYTHING"}' --accountId $NEAR_ACCOUNT
Example call:
near call $CONTRACT bringAdvertising '{"id":$TYPE_ADVERTISING_ID}' --accountId $NEAR_ACCOUNT
Example call:
near call $CONTRACT readAdvertising --accountId $NEAR_ACCOUNT
${id} is successfully deleted
or if it's not your saying ${id} is not your saying.Can not delete.
Example call:
near call $CONTRACT deleteAdvertising '{"id": $TYPE_ADVERTISING_ID}' --accountId $NEAR_ACCOUNT
Example call:
near call $CONTRACT sendGratitude '{"advertisingman": "$NEAR_ACCOUNT"}' --accountId $NEAR_ACCOUNT
That is all. Thank you for taking the time for me. See you in the next article.
Don’t forget to follow me on Github, LinkedIn, and Medium.🙋♂️
Kullanıcı yorumlarını görüntüleyebilmek için kayıt olmalısınız!