-
Notifications
You must be signed in to change notification settings - Fork 36
SC documentation improvements #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b1af949
SC documentation improvements
dg-concordium 10dbf77
Merge branch 'main' into sc-doc-improvements
dg-concordium fe46117
Merge branch 'main' into sc-doc-improvements
dg-concordium a4c9070
Merge branch 'sc-doc-improvements' of https://github.com/Concordium/c…
dg-concordium 6aaac07
Fix lint errors
dg-concordium 0b996d5
Update source/mainnet/net/guides/developer-page.rst
dg-concordium d702f36
Update source/mainnet/smart-contracts/general/introduction.rst
dg-concordium 5a648b2
Update source/mainnet/smart-contracts/guides/local-simulate.rst
dg-concordium 55c4b00
Update source/mainnet/smart-contracts/guides/setup-tools.rst
dg-concordium 0568bbf
Update source/shared/setup-env.rst
dg-concordium ffe2a9d
Update source/mainnet/net/guides/developer-page.rst
dg-concordium 8e4e839
Update source/mainnet/smart-contracts/general/introduction.rst
dg-concordium 1523aa7
Address some review comments
dg-concordium 978df17
Fix lint error, formatting
dg-concordium 45cee38
Embed SC youtube videos
dg-concordium 34d5882
Merge branch 'main' into sc-doc-improvements
dg-concordium a216275
Undo change until it is actually made
dg-concordium ceca3c3
Merge branch 'sc-doc-improvements' of https://github.com/Concordium/c…
dg-concordium 9e04f09
Embedded video sizing
dg-concordium 22e670d
Add tip to relevant files
dg-concordium 6fd795c
Merge branch 'main' into sc-doc-improvements
dg-concordium File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _indexers-intro: | ||
|
||
================= | ||
What are indexers | ||
================= | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _subquery: | ||
|
||
======== | ||
SubQuery | ||
======== | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
source/mainnet/smart-contracts/general/contract-lifecycle.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _sc-lifecycle: | ||
|
||
============================== | ||
Life cycle of a smart contract | ||
============================== | ||
|
||
A smart contract is first deployed to the chain as part of a :ref:`contract | ||
module <contract-module>`. After this a smart contract can be *initialized* to | ||
obtain a :ref:`smart contract instance <contract-instances>`. Finally a smart | ||
contract instance can be repeatedly updated according to its own logic. | ||
|
||
.. image:: images/smart-contract-lifecycle.png | ||
:width: 100% | ||
:alt: flow diagram with different actions | ||
|
||
#. In ``cargo-concordium`` :ref:`run the init command<setup-contract>` to start a new project. | ||
|
||
#. Edit your contract, including the entrypoints, functions, and parameters necessary to execute what is needed. If :ref:`using a schema<build-schema>`, make sure that the contract is prepared for this. You can also run your code off-chain for testing purposes. | ||
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#. In ``cargo-concordium`` :ref:`run the build command<compile-module>` to build the Wasm module that can be deployed on chain. | ||
|
||
#. In ``concordium-client`` :ref:`run the deploy command<deploy-module>` to deploy the Wasm module. This makes the contract available on chain. | ||
|
||
#. In ``concordium-client`` :ref:`run the init command<initialize-contract>` to initialize the contract on chain. This gives you a new instance of the smart contract with a fresh state. | ||
|
||
#. In ``concordium-client`` you can then :ref:`run invoke<invoke-instance>` to simulate your contract and see how much energy it uses or to call a view entrypoint which returns some data derived from the contract state; use :ref:`show<inspect-instance>` to see the schema or parameters in the contract, or :ref:`update<interact-instance>` to execute transactions and update the state. | ||
|
||
You can also watch a video about the smart contract lifecycle. | ||
|
||
.. image:: https://img.youtube.com/vi/84_-C-4cK4E/maxresdefault.jpg | ||
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:alt: video about smart contract lifecycle | ||
:target: https://www.youtube.com/watch?v=84_-C-4cK4E |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.