Skip to content

Commit e0cfddb

Browse files
Merge pull request #963 from Concordium/sc-doc-improvements
SC documentation improvements
2 parents 1761e94 + 6fd795c commit e0cfddb

33 files changed

+367
-344
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,18 @@ Images must have :alt: text for accessibility. Generally, image width is 100%. F
316316

317317
GIFs can be inserted but should only be used when it gives clarity to more complex actions. When using GIFs, the :alt: text is StreamPlayer and :align: is center.
318318

319+
### Videos
320+
321+
To embed a video in a topic, use the `raw` directive.
322+
323+
``` restructuredtext
324+
.. raw:: html
325+
326+
<iframe src="https://www.youtube.com/embed/0UIyAlZjvLg?si=D0lguDkUjiHCKLcu" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
327+
```
328+
329+
Remove any fixed dimensions from the embed link information you copied from the video source. The sizing is handled in the stylesheet.
330+
319331
## Preview
320332

321333
For non-technical users that might not want to install the tools above, you can request a preview in the GitHub pull request. The preview is added as a comment in the pull request and opens as a web page.

source/_static/css/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ a.current.reference.internal:hover{
136136
padding-right: 0.5em;
137137
}
138138

139+
/*Video handling*/
140+
141+
iframe {
142+
width: 100%;
143+
aspect-ratio: 16 /9;
144+
}
145+
139146
/*Topnav styling*/
140147
.navbar{
141148
position: fixed;

source/mainnet/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@
368368
"./net/resources/legal": "net/resources/terms-and-conditions.html",
369369
"./en/mainnet/smart-contracts/onboarding-guide-solana-developers/index": "en/mainnet/smart-contracts/onboarding-guide-solana-developers/overview.html",
370370
"./net/references/grpc": "net/references/grpc2.html",
371+
"./en/mainnet/smart-contracts/guides/contract-testing-guides": "./en/mainnet/smart-contracts/guides/integration-test-contract",
372+
"./en/mainnet/smart-contracts/best-practices/index": "./en/mainnet/smart-contracts/best-practices/development",
371373
}
372374

373375
# -- Tags that enables the .. only option ----------------

source/mainnet/net/guides/dapp-examples.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dApp examples
77

88
Select an example to see more information about it, such as a hosted dApp for you to try, links to tutorials, repositories, and more.
99

10+
Starting a new project on the Concordium blockchain? Have a look at the `dApp starter template <https://github.com/Concordium/concordium-dapp-starter>`__!
11+
1012
.. dropdown:: Piggy bank
1113

1214
`Demo front end <https://piggybank.testnet.concordium.com>`__ where you can try the functionality on Concordium's testnet
@@ -84,7 +86,8 @@ Select an example to see more information about it, such as a hosted dApp for yo
8486
.. dropdown:: Wallet test bench
8587

8688
This tool is for testing wallets and shows a great overview of the available interactions between wallets and front end.
87-
Deploy and initialize scenarios are available on the browser wallet (will be implemented in the mobile wallets in the future).
89+
90+
Deploy and initialize scenarios are available on the |bw|.
8891

8992
`Demo front end <https://wallet-test-bench.testnet.concordium.com/>`__ where you can test wallet interactions
9093

source/mainnet/net/guides/developer-page.rst

Lines changed: 60 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,61 @@ Developer resources
77

88
The following developer resources help you get started developing on the Concordium network.
99

10-
Official resources
11-
==================
10+
All of our repositories are on `GitHub <https://github.com/Concordium>`__.
1211

13-
- See :ref:`Node setup<node-requirements>` for information about the requirements to run a node and the available platforms for nodes.
12+
.. dropdown:: Standards
1413

15-
- See :ref:`SDKs and APIs<sdks-apis>` for links to SDKs and APIs for development
14+
- `Concordium standards and updates <https://proposals.concordium.software/>`_
1615

17-
- See :ref:`Smart contracts <introduction>` for general information about smart contracts
18-
19-
- `Smart contract libraries <https://crates.io/crates/concordium-std>`_
16+
- `CIS-0 standard detections <https://proposals.concordium.software/CIS/cis-0.html>`_
2017

21-
- To ease deployment and initialization, you can use the `Smart contract deploy and initialize tool <https://sctools.mainnet.concordium.software/>`__ instead of the process below. It works with the |bw| to deploy and initialize smart contracts to Mainnet and Testnet.
18+
- `CIS-2 token standard <https://proposals.concordium.software/CIS/cis-2.html>`_
2219

23-
- `GitHub <https://github.com/Concordium>`_
20+
- `CIS-3 sponsored transaction standard <https://proposals.concordium.software/CIS/cis-3.html>`_
2421

25-
- `Concordium standards and updates <https://proposals.concordium.software/>`_
22+
.. dropdown:: Nodes
2623

27-
- `CIS-0 standard detections <https://proposals.concordium.software/CIS/cis-0.html>`_
24+
See :ref:`Node setup<node-requirements>` for information about the requirements to run a node and the available platforms for nodes.
2825

29-
- Applicable for Smart contracts v1:
26+
For testing purposes, a node is available on testnet to use when testing smart contracts and dApps. You can use this node for API calls of chain methods only with gRPC v2 and gRPC web. The address is node.testnet.concordium.com on port 20000 (gRPCv2 and gRPC-web). You can use this node for API calls of *chain methods only*. This node is maintained by Concordium, but Concordium does not guarantee availability. The status of this node is available on the `Testnet status page <https://status.testnet.concordium.software>`__.
3027

31-
- `CIS-2 token standard <https://proposals.concordium.software/CIS/cis-2.html>`_
28+
.. dropdown:: SDKs and APIs
3229

33-
- `CIS-3 sponsored transaction standard <https://proposals.concordium.software/CIS/cis-3.html>`_
30+
The following SDKs and APIs exist for developing on the Concordium network.
3431

35-
- See :ref:`How to create proofs for dApps and services <create-proofs>` for information about how to write statements that interact with Concordium wallets.
32+
- `Concordium Rust SDK <https://github.com/Concordium/concordium-rust-sdk>`_
33+
- `Concordium Javascript (Node / Web) SDK <https://github.com/Concordium/concordium-node-sdk-js>`_
34+
- `Concordium Java SDK <https://github.com/Concordium/concordium-java-sdk>`_
35+
- `Concordium .NET (C#) SDK <https://github.com/Concordium/concordium-net-sdk>`_
36+
- `Concordium Rosetta SDK <https://github.com/Concordium/concordium-rosetta>`_
37+
- `Concordium go SDK <https://github.com/Concordium/concordium-go-sdk>`_
3638

37-
- For information about how to create proofs to verify identity for dApps and services see :ref:`Create proofs<create-proofs>`.
39+
There is also a :ref:`Concordium gRPC V2 API<grpc2-documentation>`. It is recommended to use the SDKs.
3840

39-
- See :ref:`dApp examples<dapp-examples>` for a list of dApp examples and their resources.
41+
The following NPM libraries are useful for building web-based dApps:
4042

41-
- For testing purposes, a node is available on testnet to use when testing smart contracts and dApps. You can use this node for API calls of chain methods only with gRPC v2 and gRPC web. The address is node.testnet.concordium.com on port 20000 (gRPCv2 and gRPC-web). You can use this node for API calls of *chain methods only*. This node is maintained by Concordium, but Concordium does not guarantee availability. The status of this node is available on the `Testnet status page <https://status.testnet.concordium.software>`__.
43+
- `@concordium/web-sdk <https://www.npmjs.com/package/@concordium/web-sdk>`_ (for interacting with a chain).
44+
- `@concordium/ccd-js-gen <https://www.npmjs.com/package/@concordium/ccd-js-gen>`_ (for generating smart contract clients in JavaScript).
45+
- `@concordium/react-components <https://www.npmjs.com/package/@concordium/react-components>`_ (for React projects).
46+
- `@concordium/wallet-connectors <https://www.npmjs.com/package/@concordium/wallet-connectors>`_ (for connecting to wallets in non-React projects).
4247

43-
- The `VSCode extension <https://marketplace.visualstudio.com/items?itemName=Concordium.concordium-smart-contracts>`__ can help you develop Concordium smart contracts. The extension sets up the editor for development, installs the ``cargo-concordium`` smart contract development tool for all supported platforms, and provides commands in the editor for the essential workflows, such as building and testing smart contracts.
48+
.. dropdown:: Smart contracts
4449

45-
You can watch a video about how to use the VSCode extension.
50+
See :ref:`Smart contracts <introduction>` for general information about smart contracts, including a list of the available :ref:`smart contract development tools<sc-dev-tools>` to make creation, testing, and deployment easier.
4651

47-
.. image:: https://img.youtube.com/vi/9qjcsGDeveg/maxresdefault.jpg
48-
:alt: video about smart contract lifecycle
49-
:target: https://www.youtube.com/watch?v=9qjcsGDeveg
52+
`The main library for developing smart contracts can be found on crates.io <https://crates.io/crates/concordium-std>`__.
5053

51-
- An external `transaction logger <https://github.com/Concordium/concordium-transaction-logger>`_ service
54+
.. dropdown:: Proofs
5255

53-
Concordium Proof Explorer
54-
-------------------------
56+
See :ref:`How to create proofs for dApps and services <create-proofs>` for information about how to write statements that interact with Concordium wallets.
5557

56-
If you want to familiarize yourself with how proofs work and can be constructed, you can use the `Concordium Proof Explorer <https://web3id-proof-explorer.testnet.concordium.com/>`__ to create proofs and send them to a |bw| to see how they interact with account credentials and verifiable credentials. The Concordium Proof Explorer works on Testnet. You can use the `Web3Id Issuer Front End <https://web3id-issuer-frontend.testnet.concordium.com/>`__ to create verifiable credential to test with the proof explorer.
58+
For information about how to create proofs to verify identity for dApps and services see :ref:`Create proofs<create-proofs>`.
5759

58-
.. _example-dapps:
60+
If you want to familiarize yourself with how proofs work and can be constructed, you can use the `Concordium Proof Explorer <https://web3id-proof-explorer.testnet.concordium.com/>`__ to create proofs and send them to a |bw| to see how they interact with account credentials and verifiable credentials. The Concordium Proof Explorer works on Testnet. You can use the `Web3Id Issuer Front End <https://web3id-issuer-frontend.testnet.concordium.com/>`__ to create verifiable credential to test with the proof explorer.
5961

60-
Example dApps
61-
-------------
62+
.. dropdown:: dApps
6263

63-
Concordium has a selection of example dApps that you can clone to make your own dApps or for inspiration. Additionally, all of these example dApps are hosted so you can try the functionality on Concordium's testnet.
64+
Concordium has a selection of example dApps that you can clone to make your own dApps or for inspiration. Additionally, all of these example dApps are hosted so you can try the functionality on Concordium's testnet.
6465

6566
- Piggy bank: :ref:`Piggy bank tutorial<piggy-bank>` / `Piggy bank dApp <https://piggybank.testnet.concordium.com>`__
6667
- wCCD: :ref:`wCCD tutorial<wCCD>` / `wCCD dApp <https://wccd.testnet.concordium.com/>`_
@@ -69,47 +70,53 @@ Concordium has a selection of example dApps that you can clone to make your own
6970
- eSealing: :ref:`eSealing tutorial<eSealing>` / `eSealing dApp <https://esealing.testnet.concordium.com>`_
7071
- signMessage: `Front end code <https://github.com/Concordium/concordium-dapp-examples/tree/main/signMessage>`__ / `signMessage dApp <http://signmessage.testnet.concordium.com/>`__
7172

72-
.. _block-explorers:
73+
For a full list of dApp examples and resources, see :ref:`dApp examples<dapp-examples>`.
7374

74-
Block explorers
75-
---------------
75+
Starting a new project on the Concordium blockchain? Have a look at the `dApp starter template <https://github.com/Concordium/concordium-dapp-starter>`__!
7676

77-
The following are links to the block, node, and status explorers.
77+
.. dropdown:: Block explorers and analytics
7878

79-
Concordium status pages
80-
^^^^^^^^^^^^^^^^^^^^^^^
79+
.. _block-explorers:
8180

82-
For information about the status pages, see :ref:`Status pages<dashboards>`.
81+
The following are links to the block, node, and status explorers.
8382

84-
- `Mainnet status page <https://status.mainnet.concordium.software>`_
83+
**Concordium status pages**
84+
85+
- `Mainnet status page <https://status.mainnet.concordium.software>`__
8586

8687
- `Testnet status page <https://status.testnet.concordium.software>`__
8788

88-
CCDScan
89-
^^^^^^^
89+
For information about the status pages, see :ref:`Status pages<dashboards>`.
9090

91-
For information about CCDScan, see :ref:`CCDScan<ccd-scan>`.
91+
**CCDScan**
9292

9393
- `CCDScan <https://ccdscan.io>`_
9494

95-
Grafana® node dashboard
96-
^^^^^^^^^^^^^^^^^^^^^^^
95+
For information about CCDScan, see :ref:`CCDScan<ccd-scan>`.
9796

98-
For node runners using Grafana, Concordium provides a node performance dashboard using the exposed Prometheus metrics. You can `download it from the Grafana marketplace <https://grafana.com/grafana/dashboards/18983-concordium-node-external/>`__.
97+
**Grafana® node dashboard**
9998

100-
Social media and support
101-
------------------------
99+
For node runners using Grafana, Concordium provides a node performance dashboard using the exposed Prometheus metrics. You can `download it from the Grafana marketplace <https://grafana.com/grafana/dashboards/18983-concordium-node-external/>`__.
102100

103-
- `Discourse <https://support.concordium.software/>`_
101+
**Transaction logger**
104102

105-
- `Telegram <https://t.me/concordium_official>`_
103+
An external `transaction logger <https://github.com/Concordium/concordium-transaction-logger>`_ service
106104

107-
- `Discord <https://discord.com/invite/xWmQ5tp>`_
105+
**Indexers**
108106

109-
Community resources
110-
===================
107+
See :ref:`Indexers<indexers-intro>` for more information.
108+
109+
.. dropdown:: Social media and support
110+
111+
- `Concordium's official support <https://support.concordium.software/>`_
112+
113+
- `Telegram <https://t.me/concordium_official>`_
114+
115+
- `Discord <https://discord.com/invite/xWmQ5tp>`_
116+
117+
.. dropdown:: Community resources
111118

112-
- `Block explorer built by a user in the Netherlands <https://concordium-explorer.nl/>`_
119+
- `Block explorer built by a user in the Netherlands <https://concordium-explorer.nl/>`_
113120

114121
.. toctree::
115122
:hidden:

source/mainnet/net/guides/run-node-ubuntu.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can also watch the video to learn how to run a node with Ubuntu.
1010

1111
.. raw:: html
1212

13-
<iframe width="560" height="315" src="https://www.youtube.com/embed/lFqf0tgS_r0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
13+
<iframe src="https://www.youtube.com/embed/lFqf0tgS_r0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1414

1515

1616
Prerequisites

source/mainnet/net/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ index
4141

4242
Introduction <../smart-contracts/general/introduction>
4343
Quick start guide <../smart-contracts/guides/quick-start>
44-
Contract development guides <../smart-contracts/guides/contract-dev-guides>
45-
Contract testing guides <../smart-contracts/guides/contract-testing-guides>
46-
On-chain guides <../smart-contracts/guides/on-chain-index>
47-
Best practices <../smart-contracts/best-practices/index>
4844
Ethereum developer onboarding <../smart-contracts/onboarding-guide-ethereum-developers/faq>
4945
Solana developer onboarding <../smart-contracts/onboarding-guide-solana-developers/overview>
46+
Contract development guides <../smart-contracts/guides/contract-dev-guides>
47+
Test contracts <../smart-contracts/guides/integration-test-contract>
48+
On-chain guides <../smart-contracts/guides/on-chain-index>
49+
Best practices <../smart-contracts/best-practices/development>
5050
References <../smart-contracts/references/index>
5151
V0 smart contracts <../smart-contracts-v0/sc-v0-rollup>
5252

source/mainnet/net/indexers/intro.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _indexers-intro:
2+
13
=================
24
What are indexers
35
=================

source/mainnet/net/indexers/subquery.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _subquery:
2+
13
========
24
SubQuery
35
========

source/mainnet/net/nodes/run-node-ubuntu.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can also watch the video to learn how to run a node with Ubuntu.
1010

1111
.. raw:: html
1212

13-
<iframe width="560" height="315" src="https://www.youtube.com/embed/lFqf0tgS_r0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
13+
<iframe src="https://www.youtube.com/embed/lFqf0tgS_r0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1414

1515

1616
Prerequisites

source/mainnet/smart-contracts-v0/guides/setup-tools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The `VSCode extension <https://marketplace.visualstudio.com/items?itemName=Conco
4646

4747
You can watch a video about how to use the VSCode extension.
4848

49-
.. image:: https://img.youtube.com/vi/9qjcsGDeveg/maxresdefault.jpg
50-
:alt: video about smart contract lifecycle
51-
:target: https://www.youtube.com/watch?v=9qjcsGDeveg
49+
.. raw:: html
50+
51+
<iframe src="https://www.youtube.com/embed/9qjcsGDeveg?si=zGDkjMAdP5JjRMd8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
5252

5353
Concordium software
5454
===================

source/mainnet/smart-contracts/best-practices/development.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
Development best practices
55
==========================
66

7-
This document provides guidelines for developing smart contracts.
7+
This document provides guidelines for developing smart contracts, including best practices for smart contract development, audit, information about common pitfalls and security vulnerabilities, and how to avoid them.
8+
89
It starts with some general thoughts about smart contract development and then gives more details about writing smart contracts in Rust for Concordium.
910

1011
Mindset
@@ -15,7 +16,7 @@ Smart contract development involves many risks that do not show up in, for examp
1516
- the cost of mistakes is very high;
1617
- possibilities for fixing bugs are limited;
1718
- the area is evolving constantly, with new vulnerabilities being discovered regularly;
18-
- malicious parties deliberately try to break your contract, for example, to steal the funds from the contract account.
19+
- malicious parties deliberately try to break your contract, for example, to steal the funds from the contract or account.
1920

2021
Therefore, it is not sufficient to defend your code against known vulnerabilities.
2122
You can think about smart contracts as mission-critical software, or software for embedded devices rather than a web application.
@@ -66,8 +67,7 @@ Concordium Rust Smart Contracts
6667
===============================
6768

6869
This section provides recommendations for developing smart contracts in Rust.
69-
See :ref:`introduction` for basic information.
70-
70+
See :ref:`Introduction to smart contracts<introduction>` for basic information.
7171

7272
.. _best-practices-code-structure:
7373

source/mainnet/smart-contracts/best-practices/index.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)