Description of the module [...].
concept
: for referencing code variables, types, function names, file names, etc.- vitalik: for making emphasis
- bold: only for very important things, such as warning, notes, etc
You can use graphviz diagrams, which will be rendered in the idocs:
digraph hierarchy {
node [color=pink,shape=box]
edge [color=grey]
RollupTx->{L1 L2 L3}
L1->{CreateAccount Deposit}
L2->{Transfer Exit}
L3->WTF
{rank=same;WTF CreateAccount Deposit} // Put them on the same level
}
sequenceDiagram
Holder->>IssuerServer: req. Credential + auth?
IssuerServer->>IssuerServer: Auto/Manual check
IssuerServer->>IssuerServer: Add Claim to MT
IssuerServer->>Holder: Future(Credential)
IssuerServer->>SmartContract: Publish Root
SmartContract->>IssuerServer: Ok
Holder->>IssuerServer: Poll(Future(Credential))
IssuerServer->>Holder: Credential
You also can use https://draw.io to make diagrams.
If you use this option, when exporting the *.png
file, make sure that the checkbox of 'Include a copy of my diagram' is checked. And store the picture in the same directory where lives the markdown file that uses the image, in order to edit the diagram in the future.
- When doing a list of items,
- it's important to don't leave space between items,
- because if there is a space,
- the markdown puts too much space
- between all the items
Adding an img:
![](path/file.png)
How to add an img with different size:
<img src="path/file.png" style="width:50%;" />
As we are using Go as language, we define the structs and methods directly with Go, so the types and the parameters are well specified. The idea of this, is that a person who needs to integrate another module with this one, will be able to know all the interface details directly from the spec, without needing to wait until the module is coded.
// Tx contains all the parameters from a transaction
type Tx struct {
From common.Address
To common.Address
TAmount uint64
Amount uint64
Data struct {
Title string
Content []byte
}
}
// NewTx returns a new tx object
func NewTx(from, to common.Address, amount uint64) (*Tx, error)
// Bytes returns the *Tx parsed in an array of bytes following the codification order
func (tx *Tx) Bytes() []byte
// UpdateAmount description [...]
func (tx *Tx) UpdateAmount(amount uint64) error
// Sign performs the signature of a *Tx by an *Account private key [...]
func (account *Account) Sign(tx *Tx) error
// SwapEndianness [...]
func SwapEndianness(b []byte) []byte