Skip to content

Commit a3bf1fa

Browse files
committed
Documentation: check for invalid references in CI
Uses https://github.com/serokell/xrefcheck to check for invalid references on CI. Also, fix all the present invalid references to make sure the new job passes.
1 parent 981613c commit a3bf1fa

30 files changed

+176
-100
lines changed

.xrefcheck.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Parameters of repository traversal.
2+
traversal:
3+
# Files and folders which we pretend do not exist
4+
# (so they are neither analyzed nor can be referenced).
5+
ignored:
6+
# Git files
7+
- .git
8+
# Build artifacts
9+
- _build
10+
- _opam
11+
# Git submodules
12+
- src/external
13+
- src/lib/marlin
14+
- src/lib/snarky
15+
- frontend/wallet/tablecloth
16+
17+
# Verification parameters.
18+
verification:
19+
# On 'anchor not found' error, how much similar anchors should be displayed as
20+
# hint. Number should be between 0 and 1, larger value means stricter filter.
21+
anchorSimilarityThreshold: 0.5
22+
23+
# When checking external references, how long to wait on request before
24+
# declaring "Response timeout".
25+
externalRefCheckTimeout: 10s
26+
27+
# Prefixes of files, references in which should not be analyzed.
28+
notScanned:
29+
- .github/pull_request_template.md
30+
- .github/issue_template.md
31+
- .github/PULL_REQUEST_TEMPLATE
32+
- .github/ISSUE_TEMPLATE
33+
34+
# Glob patterns describing the files which do not physically exist in the
35+
# repository but should be treated as existing nevertheless.
36+
virtualFiles:
37+
- ../../../issues
38+
- ../../../issues/*
39+
- ../../../pulls
40+
- ../../../pulls/*
41+
42+
# POSIX extended regular expressions that match external references
43+
# that have to be ignored (not verified).
44+
# It is an optional parameter, so it can be omitted.
45+
ignoreRefs:
46+
- "https://github.com/.*" # Otherwise Resource unavailable (429 too many requests)
47+
48+
# Check localhost links.
49+
checkLocalhost: false
50+
51+
# Skip links which return 403 or 401 code.
52+
ignoreAuthFailures: true
53+
54+
# Parameters of scanners for various file types.
55+
scanners:
56+
markdown:
57+
# Flavor of markdown, e.g. GitHub-flavor.
58+
#
59+
# This affects which anchors are generated for headers.
60+
flavor: GitHub

CODE_OF_CONDUCT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If a community member engages in unacceptable behavior, the community organizers
5454

5555
## 6. Reporting Guidelines
5656

57-
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify the Mina community as soon as possible by emailing [email protected]. Please see the [Reporting Guidelines](/docs/reporting-guidelines.md). You can also contact an admin in the [Discord server](https://bit.ly/MinaDiscord).
57+
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify the Mina community as soon as possible by emailing [email protected]. You can also contact an admin in the [Discord server](https://bit.ly/MinaDiscord).
5858

5959
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
6060

@@ -68,6 +68,6 @@ This Code of Conduct and its related procedures also applies to unacceptable beh
6868

6969
## 8. License and attribution
7070

71-
This Code of Conduct is adapted from the [Stumptown Syndicate](http://stumptownsyndicate.org) Code of Conduct under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
71+
This Code of Conduct is adapted from the [Stumptown Syndicate](https://github.com/stumpsyn) Code of Conduct under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
7272

7373
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).

CONTRIBUTING.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ basic setup you need to get up and running to build and edit Coda.
1010
Here's the summary if you want to contribute code:
1111

1212
1. Learn some OCaml. The [Real World OCaml](https://dev.realworldocaml.org/toc.html) book is good. Jane Street also has [some exercises](https://github.com/janestreet/learn-ocaml-workshop).
13-
2. Learn how we use OCaml. We have [a style guide](https://github.com/CodaProtocol/coda/blob/master/docs/style_guide.md) that goes over the important things.
13+
2. Learn how we use OCaml. We have [a style guide](https://docs.minaprotocol.com/en/developers/style-guide) that goes over the important things.
1414
3. Fork and clone the repo, then set up your development environment. See the [developer README](README-dev.md) for details.
15-
4. Find a good first issue. The best issues to start with are those tagged [`category-mentored`](https://github.com/CodaProtocol/coda/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Acategory-mentored). These have a detailed description on how to approach the issue and someone appointed to help people solve it. Once you're famliar with the codebase, [`category-quick-fix`](https://github.com/CodaProtocol/coda/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc++label%3Acategory-quick-fix+) is a good source of reasonably well-defined tasks.
15+
4. Find a good first issue. The best issues to start with are those tagged [`easy`](https://github.com/MinaProtocol/mina/labels/easy).
1616
5. Create a branch in your local clone and implement the solution.
1717
6. Push the branch to your GitHub fork and create a pull request.
1818
7. 🙌
@@ -21,7 +21,8 @@ Here's the summary if you want to contribute code:
2121

2222
Bug reports should include, at minimal, the `coda -version` output and
2323
a description of the error. See the [bug report
24-
template](.github/ISSUE_TEMPLATES/bug_report.md).
24+
template](.github/ISSUE_TEMPLATE/1-BUG_REPORT.yml). Documentation
25+
issues and failing tests should be reported using respective templates.
2526

2627
All bugs need to be reproduced before they can be fixed. Anyone can try and
2728
reproduce a bug! If you have trouble reproducing a bug, please comment with what
@@ -35,8 +36,7 @@ Maintainers should label bug reports with `bug`, and any other relevant labels.
3536

3637
We'll consider any feature requests, although the most successful feature
3738
requests usually aren't immediately posted to the issue tracker. The most
38-
successful feature requests start with discussion in the community! See the
39-
[feature request template](.github/ISSUE_TEMPLATES/feature_request.md).
39+
successful feature requests start with discussion in the community!
4040

4141
Maintainers should label feature requests with `feature`, and any other relevant
4242
labels.
@@ -47,9 +47,10 @@ All pull requests go through CircleCI, which makes sure the code doesn't need to
4747
be reformatted, builds Coda in its various configurations, and runs all the
4848
tests.
4949

50-
All pull requests must get _code reviewed_. Anyone can do a code review! Check
51-
out the [code review guide](docs/code_review.md) for what to look for. Just leave
52-
comments on the "Files changed" view.
50+
All pull requests must get _code reviewed_. Anyone can do a code
51+
review! Check out the [code review
52+
guide](https://docs.minaprotocol.com/en/developers/code-reviews) for
53+
what to look for. Just leave comments on the "Files changed" view.
5354

5455
All pull requests must be approved by at least one member of the "core eng"
5556
team on github.
@@ -77,12 +78,13 @@ Changes to the software should come with changes to the documentation.
7778

7879
## RFCs
7980

80-
The `rfcs` directory contains files documenting major changes to the software,
81-
how we work together, or the protocol. To make an RFC, just copy the
82-
`0000-template.md` to `0000-shortname.md` and fill it out! Then, open a pull
83-
request where the title starts with `[RFC]`. The idea is that we can discuss the
84-
RFC and come to consensus on what to do. Not all RFCs are merged, only the ones
85-
that we agree to implement.
81+
The [`rfcs`](rfcs/) directory contains files documenting major changes
82+
to the software, how we work together, or the protocol. To make an
83+
RFC, just copy the `0000-template.md` to `0000-shortname.md` and fill
84+
it out! Then, open a pull request where the title starts with
85+
`[RFC]`. The idea is that we can discuss the RFC and come to consensus
86+
on what to do. Not all RFCs are merged, only the ones that we agree to
87+
implement.
8688

8789
This process isn't final, but in general:
8890

README-dev.md

+7-35
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Mina is a new cryptocurrency protocol with a lightweight, constant-sized blockchain.
44

5-
- [Developer homepage](https://codaprotocol.com/code.html)
6-
- [Roadmap](https://codaprotocol.com/docs/developers)
5+
- [Developer homepage](https://docs.minaprotocol.com/en/developers)
76
- [Repository Readme](README.md)
87

98
If you haven't seen it yet, [CONTRIBUTING.md](CONTRIBUTING.md) has information
@@ -38,7 +37,7 @@ Refer to [/dev](/dev).
3837
- If this is your first time using OCaml, be sure to run `eval $(opam config env)`
3938
- Invoke `rustup toolchain install 1.52.1`
4039
- Invoke `make build`
41-
- Jump to [customizing your editor for autocomplete](#dev-env)
40+
- Jump to [customizing your editor for autocomplete](#customizing-your-dev-environment-for-autocompletemerlin)
4241

4342
### Developer Setup (Linux)
4443

@@ -50,9 +49,8 @@ Refer to [/dev](/dev).
5049

5150
Mina has a variety of opam and system dependencies.
5251

53-
You can see [`Dockerfile-toolchain`](/dockerfiles/Dockerfile-toolchain) for how we
54-
install them all in the container. To get all the opam dependencies
55-
you need, you run `opam switch import src/opam.export`.
52+
To get all the opam dependencies you need, you run `opam switch import
53+
src/opam.export`.
5654

5755
Some of our dependencies aren't taken from `opam`, and aren't integrated
5856
with `dune`, so you need to add them manually, by running `scripts/pin-external-packages.sh`.
@@ -68,6 +66,7 @@ ocaml-rocksdb.
6866
- [Ubuntu Setup Instructions](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
6967

7068
#### Customizing your dev environment for autocomplete/merlin
69+
[dev-env]: #dev-env
7170

7271
- If you use vim, add this snippet in your vimrc to use merlin. (REMEMBER to change the HOME directory to match yours)
7372

@@ -113,9 +112,6 @@ It also knows how to use Docker automatically.
113112
These are the most important `make` targets:
114113

115114
- `build`: build everything
116-
- `docker`: build the container
117-
- `container`: restart the development container (or start it if it's not yet)
118-
- `dev`: does `docker`, `container`, and `build`
119115
- `test`: run the tests
120116
- `libp2p_helper`: build the libp2p helper
121117
- `web`: build the website, including the state explorer
@@ -136,29 +132,13 @@ the submodule's repository, it will be automatically re-pinned in CI.
136132

137133
If you add a new package in the Mina repository or as a submodule, you must do all of the following:
138134

139-
1. Update [`Dockerfile-toolchain`](/dockerfiles/Dockerfile-toolchain) as required; there are
140-
comments that distinguish the treatment of submodules from other packages
141-
2. Update [`scripts/macos-setup.sh`](scripts/macos-setup.sh) with the required commands for Darwin systems
142-
3. Bust the circle-ci Darwin cache by incrementing the version number in the cache keys as required inside [`.circleci/config.yml.jinja`](.circleci/config.yml.jinja)
143-
4. Commit your changes
144-
5. Rebuild the container with `make docker-toolchain`.
145-
6. Re-render the jinja template `make update-deps`
146-
7. Commit your changes again
147-
148-
Rebuilding the docker toolchain will take a long time. Running circleci for
149-
macos once you've busted the cache will also take a long time. However, only
150-
you have to do the waiting and all other developers will get the fast path.
151-
152-
The automatic re-pinning of modified packages does take some CI time, so eventually,
153-
you'll want to rebuild the Docker toolchain to save that time.
135+
1. Update [`scripts/macos-setup.sh`](scripts/macos-setup.sh) with the required commands for Darwin systems
136+
2. Update [`dockerfiles/stages/`](dockerfiles/stages) with the required packages
154137

155138
## Common dune tasks
156139

157140
To run unit tests for a single library, do `dune runtest lib/$LIBNAME`.
158141

159-
You can use `dune exec coda` to build and run `coda`. This is especially useful
160-
in the form of `dune exec coda -- integration-tests $SOME_TEST`.
161-
162142
You might see a build error like this:
163143

164144
```text
@@ -170,14 +150,6 @@ Error: Files src/lib/mina_base/mina_base.objs/account.cmx
170150
You can work around it with `rm -r src/_build/default/src/$OFFENDING_PATH` and a rebuild.
171151
Here, the offending path is `src/lib/mina_base/mina_base.objs`.
172152

173-
## Docker Image Family Tree
174-
175-
Container Stages:
176-
177-
- Stage 0: Initial Image [ocaml/opam2:debian-9-ocaml-4.07](https://hub.docker.com/r/ocaml/opam2/) (opam community image, ~880MB)
178-
- Stage 1: [coda toolchain](https://github.com/MinaProtocol/coda/blob/master/dockerfiles/Dockerfile-toolchain) (built by us, stored on docker hub, ~2GB compressed)
179-
- Stage 2: [codabuilder](https://github.com/MinaProtocol/coda/blob/master/dockerfiles/Dockerfile) (built with `make codabuilder`, used with `make build`, ~2GB compressed)
180-
181153
## Overriding Genesis Constants
182154

183155
Mina genesis constants consists of constants for the consensus algorithm, sizes for various data structures like transaction pool, scan state, ledger etc.

automation/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Repository Purpose
77

8-
This repository is designed to show an opinionated example on how to operate a network of Coda Daemons. It implements the entire node lifecycle using a modern Infrastructure as Code toolset. Community contributions are warmly encouraged, please see the [contribution guidelines](#to-do) for more details. The code is designed to be as modular as possible, allowing the end-user to "pick and choose" the parts they would like to incorporate into their own infrastructure stack.
8+
This repository is designed to show an opinionated example on how to operate a network of Mina Daemons. It implements the entire node lifecycle using a modern Infrastructure as Code toolset. Community contributions are warmly encouraged, please see the [contribution guidelines](../CONTRIBUTING.md) for more details. The code is designed to be as modular as possible, allowing the end-user to "pick and choose" the parts they would like to incorporate into their own infrastructure stack.
99

1010
If you have any issues setting up your testnet or have any other questions about this repository, join the public [Discord Server](https://discord.gg/ShKhA7J) and get help from the Coda community.
1111

@@ -129,7 +129,7 @@ Next, you must create a new testnet in `terraform/testnets/`. For ease of use, y
129129
- Name of testnet
130130
- number of nodes to deploy
131131
- Location of the Genesis Ledger
132-
- Kubernetes [context](https://github.com/MinaProtocol/Mina-automation/commit/141db8821a133501d3d4ed9b739fcad1f9b88bef) for indicating which managed *k8s* cluster to deploy to
132+
- Kubernetes context for indicating which managed *k8s* cluster to deploy to
133133

134134
### Manage *k8s* Cluster for Deployment
135135

@@ -156,7 +156,7 @@ Once decided on a cluster/context to deploy, use the following command to retrie
156156

157157
#### Configure testnet module `k8s_context`
158158

159-
There is a testnet module variable which determines the *Kubernetes* context to deploy to. Reference the module's [variable definitions](https://github.com/MinaProtocol/mina/automation/blob/master/terraform/modules/kubernetes/testnet/variables.tf) for more details on how to properly configure.
159+
There is a testnet module variable which determines the *Kubernetes* context to deploy to. Reference the module's [variable definitions](./terraform/modules/kubernetes/testnet/variables.tf) for more details on how to properly configure.
160160

161161
```variable "k8s_context" {
162162
type = string

automation/services/buildkite/prometheus-exporter/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ docker run --rm --detach --env BUILDKITE_API_KEY="XXXXXXXX" \
4646

4747
## Metrics
4848

49-
Metrics will be made available on port `8000` by default, or you can pass environment variable ```METRICS_PORT``` to override this. An example printout of the metrics you should expect to see can be found in [METRICS.md](https://github.com/CodaProtocol/coda-automation/blob/master/services/buildkite/prometheus-exporter/METRICS.md).
49+
Metrics will be made available on port `8000` by default, or you can pass environment variable ```METRICS_PORT``` to override this. An example printout of the metrics you should expect to see can be found in [METRICS.md](METRICS.md).

automation/services/echo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a simple node service that listens for transactions to a specific addres
44

55
## Usage
66

7-
First you'll need to have a `coda` daemon running on your machine. See the docs [here](https://codaprotocol.com/docs/getting-started/) for instructions on getting a node, then run the following command:
7+
First you'll need to have a `mina` daemon running on your machine. See the docs [here](https://docs.minaprotocol.com/en/getting-started/) for instructions on getting a node, then run the following command:
88

99
```
1010
$ mina daemon -rest-port 49370 -peer beta.o1test.net:8303

automation/services/faucet/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ The faucet service is a simple Discord bot that listens for requests for `CODA`
44

55
## Usage
66

7-
First you'll need to have a `coda` daemon running on your machine. See the docs [here](https://codaprotocol.com/docs/getting-started/) for instructions on getting a node, then run the following command:
7+
First you'll need to have a `coda` daemon running on your machine. See the docs [here](https://docs.minaprotocol.com/en/getting-started) for instructions on getting a node, then run the following command:
88

99
```
1010
$ mina daemon -rest-port 49370 -peer beta.o1test.net:8303
1111
```
1212

1313
This process must be running for this service to work. Open a new terminal session before you continue.
1414

15-
The service requires [Python 3.7]() to be installed on your system, and uses [pip]() as the package manager. To make things easy, a docker-compose environment has been provided that allows you to start the service simply. First, copy the example and update your environment variables:
15+
The service requires Python 3.7 to be installed on your system, and uses pip as the package manager. To make things easy, a docker-compose environment has been provided that allows you to start the service simply. First, copy the example and update your environment variables:
1616

1717
```
1818
cp docker-compose.yml.example docker-compose.yml
@@ -30,4 +30,4 @@ environment:
3030
docker-compose up
3131
```
3232

33-
**NOTE:** Host networking is enabled in the example docker-compose file, meaning that host ports will be shared with the container and the daemon can be accessed on `localhost`.
33+
**NOTE:** Host networking is enabled in the example docker-compose file, meaning that host ports will be shared with the container and the daemon can be accessed on `localhost`.

automation/services/mina-bp-stats/sidecar/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The sidecar takes 2 approaches to configuration, a pair of envars, or a configur
1515
- `MINA_NODE_URL` - The URL that the sidecar will reach out to to get statistics from
1616

1717
#### Config File
18+
[config-file]: #config-file
1819
The mina metrics sidecar will also look at `/etc/mina-sidecar.json` for its configuration variables, and the file should look like this:
1920

2021
```
@@ -93,7 +94,7 @@ $ dpkg -i ./mina-bp-stats-sidecar.deb
9394

9495
#### Configuring and Running
9596

96-
See the [Configuration](#Configuration) section above for what should be in the `/etc/mina-sidecar.json` file.
97+
See the [Config File](#config-file) section above for what should be in the `/etc/mina-sidecar.json` file.
9798

9899
To (optionally) enable the service to run on reboot you can use:
99100

@@ -151,4 +152,4 @@ ERROR:root:HTTP Error 400: Bad Request
151152
ERROR:root:Sleeping for 30s and trying again
152153
```
153154

154-
It likely means you're shipping off data to the ingest pipeline without any block producer key configured on your Mina node - since your BP key is your identity we can't accept node data since we don't know who is submitting it!
155+
It likely means you're shipping off data to the ingest pipeline without any block producer key configured on your Mina node - since your BP key is your identity we can't accept node data since we don't know who is submitting it!

automation/terraform/modules/services/daemon/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is a Terraform module that will deploy a mina Daemon container as a service
3434

3535
## Deployment Considerations
3636

37-
In order to deploy a "new" version of this module, you must ensure that you have rebuilt said container. The container build is a two-step process, with the base mina dockerfile being [here](https://github.com/MinaProtocol/mina/blob/develop/dockerfiles/Dockerfile-mina-daemon) and the more deployment-specific Dockerfile [here](https://github.com/MinaProtocol/mina-automation/blob/master/services/daemon/Dockerfile).
37+
In order to deploy a "new" version of this module, you must ensure that you have rebuilt said container.
3838

3939
The manual commands to release each container are the following:
4040

0 commit comments

Comments
 (0)