*: add more package-specific documentation

For the most important packages at least.
This commit is contained in:
Roman Khimov 2021-03-19 12:11:48 +03:00
parent c1b2a79cfe
commit b56e028733
27 changed files with 129 additions and 1 deletions

4
pkg/compiler/doc.go Normal file
View file

@ -0,0 +1,4 @@
/*
Package compiler implements Go to NEF smart contract compiler.
*/
package compiler

4
pkg/config/doc.go Normal file
View file

@ -0,0 +1,4 @@
/*
Package config contains NeoGo node configuration definition.
*/
package config

View file

@ -0,0 +1,4 @@
/*
Package netmode contains well-known network magic numbers.
*/
package netmode

7
pkg/consensus/doc.go Normal file
View file

@ -0,0 +1,7 @@
/*
Package consensus contains Neo consensus node implementation.
It uses external dBFT library for the core algorithm and basically joins this
library with Neo node internals implemented in NeoGo.
*/
package consensus

6
pkg/core/block/doc.go Normal file
View file

@ -0,0 +1,6 @@
/*
Package block contains Neo block definition.
This is one of the core structures of Neo blockchain.
*/
package block

7
pkg/core/interop/doc.go Normal file
View file

@ -0,0 +1,7 @@
/*
Package interop contains implementations of Neo interop functions.
This is not the package you use from smart contracts, refer to pkg/interop
for that.
*/
package interop

4
pkg/core/native/doc.go Normal file
View file

@ -0,0 +1,4 @@
/*
Package native contains Neo native contracts.
*/
package native

View file

@ -0,0 +1,6 @@
/*
Package transaction contains Neo transaction definition.
This is one of the core structures of Neo blockchain.
*/
package transaction

6
pkg/crypto/doc.go Normal file
View file

@ -0,0 +1,6 @@
/*
Package crypto contains implementation of crypto functions used by Neo.
This package itself just has some useful interfaces.
*/
package crypto

6
pkg/crypto/hash/doc.go Normal file
View file

@ -0,0 +1,6 @@
/*
Package hash contains wrappers for Neo hashing algorithms.
It also implements Merkle tree.
*/
package hash

4
pkg/crypto/keys/doc.go Normal file
View file

@ -0,0 +1,4 @@
/*
Package keys wraps public/private keys and implements NEP-2 and WIF.
*/
package keys

View file

@ -0,0 +1,4 @@
/*
Package address implements conversion of script hash to/from Neo address.
*/
package address

View file

@ -0,0 +1,4 @@
/*
Package bigint implements Neo-specific big.Int (de)serialization to/from []byte.
*/
package bigint

View file

@ -0,0 +1,4 @@
/*
Package fixedn implements fixed point integers with arbitrary precision.
*/
package fixedn

View file

@ -1,3 +1,6 @@
/*
Package math provides access to useful numeric functions available in Neo VM.
*/
package math package math
import "github.com/nspcc-dev/neo-go/pkg/interop/neogointernal" import "github.com/nspcc-dev/neo-go/pkg/interop/neogointernal"

View file

@ -1,3 +1,7 @@
/*
Package crypto provides interface to CryptoLib native contract.
It implements some cryptographic functions.
*/
package crypto package crypto
import ( import (

View file

@ -1,3 +1,7 @@
/*
Package gas provides interface to GasToken native contract.
It implements regular NEP-17 functions for GAS token.
*/
package gas package gas
import ( import (

View file

@ -1,3 +1,7 @@
/*
Package ledger provides interface to LedgerContract native contract.
It allows to access ledger contents like transactions and blocks.
*/
package ledger package ledger
import ( import (

View file

@ -1,3 +1,7 @@
/*
Package management provides interface to ContractManagement native contract.
It allows to get/deploy/update contracts as well as get/set deployment fee.
*/
package management package management
import ( import (

View file

@ -1,3 +1,7 @@
/*
Package nameservice provides interface to NameService native contract.
It's a NEP-11 contract implementing a domain name service.
*/
package nameservice package nameservice
import ( import (

View file

@ -1,3 +1,9 @@
/*
Package neo provides interface to NeoToken native contract.
NEO token is special, it's not just a regular NEP-17 contract, it also
provides access to chain-specific settings and implements commmittee
voting system.
*/
package neo package neo
import ( import (

View file

@ -1,3 +1,8 @@
/*
Package notary provides interface to Notary native contract.
This contract is a NeoGo extension and is not available on regular Neo
networks. To use it you need to have this extension enabled on the network.
*/
package notary package notary
import ( import (

View file

@ -1,3 +1,8 @@
/*
Package oracle provides interface to OracleContract native contract.
Oracles allow you to get external (non-blockchain) data using HTTPS or NeoFS
protocols.
*/
package oracle package oracle
import ( import (

View file

@ -1,3 +1,7 @@
/*
Package policy provides interface to PolicyContract native contract.
This contract holds various network-wide settings.
*/
package policy package policy
import ( import (

View file

@ -1,3 +1,8 @@
/*
Package roles provides interface to RoleManagement native contract.
Role management contract is used by committee to designate some nodes as
providing some service on the network.
*/
package roles package roles
import ( import (
@ -15,6 +20,7 @@ type Role byte
const ( const (
StateValidator Role = 4 StateValidator Role = 4
Oracle Role = 8 Oracle Role = 8
// P2PNotary is an extension of Neo protocol available on specifically configured NeoGo networks.
P2PNotary Role = 128 P2PNotary Role = 128
) )

View file

@ -1,3 +1,7 @@
/*
Package std provides interface to StdLib native contract.
It implements various useful conversion functions.
*/
package std package std
import ( import (

View file

@ -0,0 +1,5 @@
/*
Package neogointernal contains definitions of compiler intrinsics.
It's not intended to be used directly by smart contracts.
*/
package neogointernal