Skip to content

Commit

Permalink
Update copy.ts
Browse files Browse the repository at this point in the history
copy update v2 1/2
  • Loading branch information
golmek authored Jun 19, 2024
1 parent 07a9223 commit c716bf8
Showing 1 changed file with 35 additions and 23 deletions.
58 changes: 35 additions & 23 deletions frontend/src/utils/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const md = new Remarkable();
export const copy: any = (() => {
return {
[UserState.DISCONNECTED]: {
title: "Disconnected",
title: "Hello Golem Developer!",
message: {
__html: md.render(
`Welcome to our example service for Deposit payments on Golem. We're glad to have you here. This version will show you step by step how Golem deposit payments work and how You can benefit from it on your very own service. \\
Expand Down Expand Up @@ -42,7 +42,10 @@ export const copy: any = (() => {
title: "You are Registered!",
message: {
__html:
md.render(`Congratulations! You are now successfully registered with our example service. The next step in the process is to provide approval for the GLM tokens stored in your wallet. This approval is given to the Deposit Smart Contract (0x9CB8Ecc74e299eF9D3cBcf8f806F5C7b76CA08D3) and can be revoked or extended at any time. It is a necessary step to create a deposit later on. It is important to emphasize that this step has to be done by the service user.
md.render(
`Congratulations! You are now successfully registered with our example service. \\
\\
The next step in the process is to provide approval for the GLM tokens stored in your wallet. This approval is given to the Deposit Smart Contract (0x9CB8Ecc74e299eF9D3cBcf8f806F5C7b76CA08D3) and can be revoked or extended at any time. It is a necessary step to create a deposit later on. It is important to emphasize that this step has to be done by the service user.
`),
},
},
Expand All @@ -53,11 +56,13 @@ export const copy: any = (() => {
title: "Approval successfully given!",
message: {
__html:
md.render(`Great job! With Approval in place now is time to create a Deposit.
The deposit consists of three values:
amount: that is the amount of GLM tokens You are willing to spend on the service. This amount will be locked so that there is a limited risk of the user running out without paying :) That value should be provided by the User.
fee: that is a fee that will be sent to the Service Owner. In this instance, it is Golem Factory. However, for Your own service, it will be You! It is not mandatory but can be utilized to make your service profitable or at least refund the costs of running it. In normal conditions, this value should be set by the Service user. However, in this example, we make it editable so that You can play around with it.
timestamp: it points to the place in time till which Deposit will be held on the Smart Contract. As already mentioned this mechanism is chosen to limit the risk of people running away without paying for service.
md.render(
`Great job! With Approval in place now is time to create a Deposit. \\
\\
The deposit consists of three values: \\
- amount: that is the amount of GLM tokens You are willing to spend on the service. This amount will be locked so that there is a limited risk of the user running out without paying :) That value should be provided by the User. \\
- fee: that is a fee that will be sent to the Service Owner. In this instance, it is Golem Factory. However, for Your own service, it will be You! It is not mandatory but can be utilized to make your service profitable or at least refund the costs of running it. In normal conditions, this value should be set by the Service user. However, in this example, we make it editable so that You can play around with it. \\
- timestamp: it points to the place in time till which Deposit will be held on the Smart Contract. As already mentioned this mechanism is chosen to limit the risk of people running away without paying for service.
`),
},
},
Expand All @@ -69,8 +74,10 @@ timestamp: it points to the place in time till which Deposit will be held on the
title: "Time to create Allocation!",
message: {
__html:
md.render(`Allocation is a logical entity created in Yagna, which keeps track of how much money the Requestor wishes to pay the Provider for his computation power. In our scenario Allocation will be created for the same amount as the Deposit. It is because those two entities are interconnected in Deposit Payments as GLMs stored at the Deposit will be used to cover Allocation payments.
In a normal scenario, Allocation should be created automatically by Yagna so User interaction is not needed. However, in our example service we let you create it manually so there is a better understanding of what is happening behind the UI. Click "Create" next to Allocation.
md.render(
`Allocation is a logical entity created in Yagna, which keeps track of how much money the Requestor wishes to pay the Provider for his computation power. In our scenario Allocation will be created for the same amount as the Deposit. It is because those two entities are interconnected in Deposit Payments as GLMs stored at the Deposit will be used to cover Allocation payments. \\
\\
In a normal scenario, Allocation should be created automatically by Yagna so User interaction is not needed. However, in our example service we let you create it manually so there is a better understanding of what is happening behind the UI. Click "Create" next to Allocation.
`),
},
},
Expand All @@ -81,33 +88,38 @@ In a normal scenario, Allocation should be created automatically by Yagna so Use
title: "Let’s find a Golem Provider for the job!",
message: {
__html:
md.render(`It is high time to sign the Agreement and find our Golem Provider. By clicking "Create" next to the Agreement section You will trigger Yagna to start looking for a Provider on the Golem network to run our file scanning example. It might take a while, but when it is done Agreement will be signed between Service Owner Yagna and the Provider.
The provider will also be ready to accept files for us to scan. What is more, We will start to receive "debit notes" from a Provider, which will inform us about how many GLM tokens we own at this moment. Please remember that Providers can also charge for a time they are ready to receive work and not only for work being done. You will see the amount You own Provider under Due payments. It is refreshed in real-time..
md.render(
`It is high time to sign the Agreement and find our Golem Provider. \\
\\
By clicking "Create" next to the Agreement section You will trigger Yagna to start looking for a Provider on the Golem network to run our file scanning example. It might take a while, but when it is done Agreement will be signed between Service Owner Yagna and the Provider. The provider will also be ready to accept files for us to scan. \\
\\
What is more, We will start to receive "debit notes" from a Provider, which will inform us about how many GLM tokens we own at this moment. Please remember that Providers can also charge for a time they are ready to receive work and not only for work being done. You will see the amount You own Provider under Due payments. It is refreshed in real-time..
`),
},
},
[UserState.HAS_AGREEMENT]: {
title: "You have agreement signed!",
title: "Time to scan the files!",
message: {
__html:
md.render(`You have successfully signed the agreement with the Provider.
Now it is time to upload the file for scanning.
You can do it by clicking the "Upload" button.
After the file is uploaded, it will be scanned by the Provider.
Once the scan is completed, you will receive event with the results
md.render(
`After signing the Agreement witj Provider, it is time to upload the files that you want to scan. \\
\\
You can do it by clicking the "Upload" button. The results of the scan will be displayed in the event log on the left-hand side of the interface.
`),
},
},
["HAS_FILE_SCANNED"]: {
title: "You have scanned your first file!",
message: {
__html:
md.render(`We hope that the results are negative :) At this point, You can either continue scanning more files or release the Agreement.
When You decide to release the agreement following things will happen:
The provider will send a final invoice for his services
Deposit Payment will be sent to cover the invoice
When Payment is done, You can check it out on Etherscan by clicking on Transaction ID in the event log on the left. At this point Amount Locked on the Deposit should be equal to the remaining Allocation value.
md.render(
`We hope that the results are negative :) \\
\\
At this point, You can either continue scanning more files or release the Agreement. When You decide to release the agreement following things will happen: \\
- The provider will send a final invoice for his services \\
- Deposit Payment will be sent to cover the invoice \\
\\
When Payment is done, You can check it out on Etherscan by clicking on Transaction ID in the event log on the left. At this point Amount Locked on the Deposit should be equal to the remaining Allocation value.
`),
},
},
Expand Down

0 comments on commit c716bf8

Please sign in to comment.