Skip to content

Commit

Permalink
feat(iota): add markdown dprint (#1025)
Browse files Browse the repository at this point in the history
* feat(iota): add markdown dprint

* remove backslash

---------

Co-authored-by: DaughterOfMars <[email protected]>
  • Loading branch information
thibault-martinez and DaughterOfMars authored Jul 18, 2024
1 parent 8e63075 commit df78b91
Show file tree
Hide file tree
Showing 66 changed files with 599 additions and 495 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ If this is an issue with existing content, provide the URL or GitHub path to the

Describe the issue or request. Provide as much detail as possible. For issues, it is helpful to copy the specific section of the topic into the issue.

Thank you for taking the time to let us know about the issue or request. We triage all new issues and requests within 2 business days. We will follow up if we need additional information.
Thank you for taking the time to let us know about the issue or request. We triage all new issues and requests within 2 business days. We will follow up if we need additional information.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Explain why this feature is needed.

Write a list of what you want this feature to do.

1.
2.
3.
1.
2.
3.

## Open questions (optional)

Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Description of change

Please write a summary of your changes and why you made them.
Please write a summary of your changes and why you made them.

## Links to any relevant issues

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Thanks for considering making a contribution to the IOTA network or its document

See [IOTA Environment Setup](https://github.com/iotaledger/iota/blob/main/docs/content/guides/developer/getting-started/iota-environment.mdx) for approach to submitting code fixes and enhancements.

Found a bug or security vulnerability? Create a [GitHub issue](https://github.com/iotaledger/iota/issues/new/choose).
Found a bug or security vulnerability? Create a [GitHub issue](https://github.com/iotaledger/iota/issues/new/choose).

For larger documentation issues, you can [create an issue](https://github.com/iotaledger/iota/issues/new/choose) in GitHub. To fix the problem yourself, follow the [documentation contribution](./docs/content/references/contribute/contribution-process.mdx) guidelines.

Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# IOTA Releases
https://github.com/iotaledger/iota/releases

https://github.com/iotaledger/iota/releases
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IOTA Security

We appreciate your participation in keeping the IOTA network secure.
We appreciate your participation in keeping the IOTA network secure.
If you have any questions or concerns, contact [[email protected]](mailto:[email protected])
8 changes: 4 additions & 4 deletions apps/apps-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
Expand Down Expand Up @@ -64,9 +64,9 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Expand Down
4 changes: 3 additions & 1 deletion crates/anemo-benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Example invocations to run benchmark on local machine:

1. Server

```
target/debug/anemo-benchmark --port 5556
```

1. Client (look here for output)

```
target/debug/anemo-benchmark --port 5555 --addrs 127.0.0.1:5556 --requests-up 10 --requests-down 10 --size-up 5000 --size-down 5000
```
```
6 changes: 2 additions & 4 deletions crates/data-transform/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

data-transform is a separate process used to transform data, by decoding columns into other formats in preparation to upload to Snowflake.

### Running standalone transformer

1. in iota/crates/data-transform:

```sh
$ echo DATABASE_URL=postgres://username:password@localhost/diesel_demo > .env



```
22 changes: 14 additions & 8 deletions crates/iota-aws-orchestrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ In a network of 10 validators, each with a corresponding load generator, each lo
The orchestrator provides facilities to monitor metrics on clients and nodes. The orchestrator deploys a [Prometheus](https://prometheus.io) instance and a [Grafana](https://grafana.com) instance on a dedicated remote machine. Grafana is then available on the address printed on stdout (e.g., `http://3.83.97.12:3000`) with the default username and password both set to `admin`. You can either create a [new dashboard](https://grafana.com/docs/grafana/latest/getting-started/build-first-dashboard/) or [import](https://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/#import-a-dashboard) the example dashboards located in the `./assets` folder.

## Destroy a testbed

After you have found yourself that you don't need the deployed testbed anymore you can simply run

```
Expand All @@ -132,26 +133,31 @@ to use a different `testbed_id` in the `settings.json` to avoid any later confli
## FAQ

### I am getting an error "Failed to read settings file '"crates/iota-aws-orchestrator/assets/settings.json"': No such file or directory"

To run the tool a `settings.json` file with the deployment configuration should be under the directory `crates/iota-aws-orchestrator/assets`. Also, please make sure
that you run the orchestrator from the top level repo folder, ex `/iota $ cargo run --bin iota-aws-orchestrator`

### I am getting an error "IncorrectInstanceState" with message "The instance 'i-xxxxxxx' is not in a state from which it can be started."" when I try to run a benchmark

When a testbed is deployed the EC2 instances are tagged with the `testbed_id` as dictated in the `settings.json` file. When trying to run a benchmark the tool will try to list
all the EC2 instances on the dictated by the configuration regions. To successfully run the benchmark all the listed instances should be in status
`Running`. If there is any instance in different state , ex `Terminated` , then the above error will arise. Please pay attention that if you `destroy` a deployment
and then immediately `deploy` a new one under the same `testbed_id`, then it is possible to have a mix of instances with status `Running` and `Terminated`, as AWS does not immediately
delete the `Terminated` instances. That can eventually cause the above false positive error as well. It is advised in this case to use a different `testbed_id` to ensure that
delete the `Terminated` instances. That can eventually cause the above false positive error as well. It is advised in this case to use a different `testbed_id` to ensure that
there is no overlap between instances.

### I am getting an error "Not enough instances: missing X instances" when running a benchmark
In the common case to successfully run a benchmark we need to have enough instances available to run
* the required validators
* the grafana dashboard
* the benchmarking clients

In the common case to successfully run a benchmark we need to have enough instances available to run

- the required validators
- the grafana dashboard
- the benchmarking clients

for example when running the command `cargo run --bin iota-aws-orchestrator -- benchmark --committee 4 fixed-load --loads 500 --duration 500`, we'll need the following amount of instances available:
* `4 instances` to run the validators (since we set `--committee 4`)
* `1 instance` to run the grafana dashboard (by default only 1 is needed)
* no additional instances to run the benchmarking clients, as those will be co-deployed on the validator nodes

- `4 instances` to run the validators (since we set `--committee 4`)
- `1 instance` to run the grafana dashboard (by default only 1 is needed)
- no additional instances to run the benchmarking clients, as those will be co-deployed on the validator nodes

so in total we must have deployed a testbed of at least `5 instances`. If we attempt to run with fewer, then the above error will be thrown.
4 changes: 2 additions & 2 deletions crates/iota-axelar-cgp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Axelar cross-chain gateway protocol Iota implementation


## Design
TODO

TODO
6 changes: 3 additions & 3 deletions crates/iota-core/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## What this test is about
## What this test is about

This repository checks the conformance of our code to a BCS-compatible manifest of our serialized data formats.

Expand Down Expand Up @@ -40,8 +40,8 @@ [email protected]➜~/tmp/iota(main✗)» cd iota_core
[email protected]➜tmp/iota/iota_core(main✗)» cargo -q run --example generate-format -- print > tests/staged/iota.yaml
```


Let's check that we pass the test again:

```
[email protected]➜tmp/iota/iota_core(main✗)» cargo test format 2>&1 |tail -n 40 [8:47:22]
Finished test [unoptimized + debuginfo] target(s) in 0.35s
Expand All @@ -63,4 +63,4 @@ [email protected]➜tmp/iota/iota_core(main✗)» git status
M tests/staged/iota.yaml
M ../iota_types/src/error.rs
M ../iota_types/src/messages.rs
```
```
4 changes: 2 additions & 2 deletions crates/iota-framework/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
This file contains useful information and troubleshooting advice for those wishing to contribute to `iota-framework` crate.

## Framework Move source code changes
## Framework Move source code changes

If changes need to be made to the framework's Move code, additional actions need to be taken to ensure that the system builds and runs correctly. In particular, one needs to make sure that the framework snapshot tests are up-to-date and that any new native functions are correctly handled by the [Move Prover](https://github.com/move-language/move/tree/main/language/move-prover).

### Snapshot tests update

Run the following commands in Iota's [root directory](../../) and accept the changes, if any (if you do not have `cargo-insta` command installed, please run the `cargo install cargo-insta` command first):

``` bash
```bash
cargo insta test -p iota-cost --review
cargo insta test -p iota-config --review
```
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-framework/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# To add a new native Move function

1. Add a new `./iota-framework/{name}.move` file or find an appropriate `.move`.
2. Add the signature of the function you are adding in `{name}.move`.
2. Add the signature of the function you are adding in `{name}.move`.
3. Add the rust implementation of the function under `./iota-framework/src/natives` with name `{name}.rs`.
4. Link the move interface with the native function in [all_natives](https://github.com/iotaledger/iota/blob/main/crates/iota-framework/src/natives/mod.rs#L23)
5. Write some tests in `{name}_tests.move` and pass `run_framework_move_unit_tests`.
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-framework/packages/deepbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

DeepBook is a decentralized central limit order book (CLOB) built for the Iota ecosystem. DeepBook provides a one-stop shop for trading digital assets, with a technical design built for Iota’s architecture. DeepBook leverages Iota’s performance and delivers a low latency and high throughput execution engine to spread liquidity across the DeFi ecosystem.

Designed as permissionless and released as open source, DeepBook will accelerate the development of financial and other apps on Iota. It will give builders an efficient and shared ready-built financial layer for trading fungible assets.
Designed as permissionless and released as open source, DeepBook will accelerate the development of financial and other apps on Iota. It will give builders an efficient and shared ready-built financial layer for trading fungible assets.
5 changes: 3 additions & 2 deletions crates/iota-graphql-e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ installed using `brew`:
for pre-requisites and starting the Postgres service.

2. When postgres is initially installed, it creates a role for your current
user. We need to use that role to create the role that will access the
user. We need to use that role to create the role that will access the
database:

```sh
Expand All @@ -32,12 +32,13 @@ $ psql "postgres://postgres:postgrespw@localhost:5432/postgres" \
effect.

Mac

```sh
brew services restart postgresql@15

```

Linux

```sh
/etc/init.d/postgresql restart
```
Expand Down
13 changes: 11 additions & 2 deletions crates/iota-graphql-rpc/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# iota-graphql-rpc

## Dev setup

Note that we use compilation flags to determine the backend for Diesel. If you're using VS Code, make sure to update settings.json with the appropriate features - there should at least be a "pg_backend" (or other backend.)

```
"rust-analyzer.cargo.features": ["pg_backend"]
```

Consequently, you'll also need to specify the backend when running cargo commands:
```cargo run --features "pg_backend" --bin iota-graphql-rpc start-server --db-url <DB_URL>```
`cargo run --features "pg_backend" --bin iota-graphql-rpc start-server --db-url <DB_URL>`

The order is important:

1. --features "pg_backend": This part tells Cargo to enable the pg_backend feature.
2. --bin iota-graphql-rpc: This specifies which binary to run.
3. start-server --db-url: These are arguments to the binary.
Expand All @@ -20,6 +24,7 @@ The order is important:
The graphql service is backed by a db based on the db schema in [iota-indexer](../iota-indexer/src/schema.rs). To spin up a local db, follow the instructions at [iota-indexer](../iota-indexer/README.md) until "Running standalone indexer".

If you have not created a db yet, you can do so as follows:

```sh
psql -U postgres
CREATE DATABASE iota_indexer_v2;
Expand All @@ -36,9 +41,11 @@ diesel migration run --database-url="<DATABASE_URL>" --migration-dir=migrations
```

### Launching the server

See [src/commands.rs](src/commands.rs) for all CLI options.

Example `.toml` config:

```toml
[limits]
max-query-depth = 15
Expand All @@ -55,15 +62,17 @@ max-type-nodes = 256
max-move-value-depth = 128

[background-tasks]
watermark-update-ms=500
watermark-update-ms = 500
```

This will build iota-graphql-rpc and start an IDE:

```
cargo run --bin iota-graphql-rpc start-server [--rpc-url] [--db-url] [--port] [--host] [--config]
```

### Launching the server w/ indexer

For local dev, it might be useful to spin up an indexer as well. Instructions are at [Running standalone indexer](../iota-indexer/README.md#running-standalone-indexer).

## Compatibility with json-rpc
Expand Down
22 changes: 18 additions & 4 deletions crates/iota-indexer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Iota indexer is an off-fullnode service to serve data from Iota protocol, including both data directly generated from chain and derivative data.

## Architecture

![enhanced_FN](https://user-images.githubusercontent.com/106119108/221022505-a1d873c6-60e2-45f1-b2aa-e50192c4dfbb.png)

## Steps to run locally
Expand All @@ -19,7 +20,8 @@ export LDFLAGS="-L/opt/homebrew/opt/postgresql@15/lib"
export CPPFLAGS="-I/opt/homebrew/opt/postgresql@15/include"
export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
```
- make sure you have libpq installed: `brew install libpq`, and in your profile, add `export PATH="/opt/homebrew/opt/libpq/bin:$PATH"`. If this doesn't work, try `brew link --force libpq`.

- make sure you have libpq installed: `brew install libpq`, and in your profile, add `export PATH="/opt/homebrew/opt/libpq/bin:$PATH"`. If this doesn't work, try `brew link --force libpq`.

#### Postgres (Ubuntu)

Expand All @@ -31,15 +33,14 @@ sudo apt install postgresql

#### Diesel


- install Diesel CLI with `cargo install diesel_cli --no-default-features --features postgres`, refer to [Diesel Getting Started guide](https://diesel.rs/guides/getting-started) for more details
- [optional but handy] Postgres client like [Postico](https://eggerapps.at/postico2/), for local check, query execution etc.

### Start the Postgres Service

Postgres must run as a service in the background for other tools to communicate with. If it was installed using homebrew, it can be started as a service with:
Postgres must run as a service in the background for other tools to communicate with. If it was installed using homebrew, it can be started as a service with:

``` sh
```sh
brew services start postgresql@version
```

Expand All @@ -48,33 +49,46 @@ brew services start postgresql@version
Use [iota-test-validator](../../crates/iota-test-validator/README.md)

### Running standalone indexer

1. DB setup, under `iota/crates/iota-indexer` run:

```sh
# an example DATABASE_URL is "postgres://postgres:postgres@localhost/gegao" where postgres:postgres are the credentials.
diesel setup --database-url="<DATABASE_URL>"
diesel database reset --database-url="<DATABASE_URL>"
```

Note that you'll need an existing database for the above to work. Replace `gegao` with the name of the database created.

2. Checkout to your target branch

For example, if you want to be on the DevNet branch

```sh
git fetch upstream devnet && git reset --hard upstream/devnet
```

3. Start indexer binary, under `iota/crates/iota-indexer` run:

- run indexer as a writer, which pulls data from fullnode and writes data to DB

```sh
# Change the RPC_CLIENT_URL to http://0.0.0.0:9000 to run indexer against local validator & fullnode
cargo run --bin iota-indexer -- --db-url "<DATABASE_URL>" --rpc-client-url "https://fullnode.devnet.iota.io:443" --fullnode-sync-worker --reset-db
```

- run indexer as a reader, which is a JSON RPC server with the [interface](https://docs.iota.io/iota-api-ref#iotax_getallbalances)

```
cargo run --bin iota-indexer -- --db-url "<DATABASE_URL>" --rpc-client-url "https://fullnode.devnet.iota.io:443" --rpc-server-worker
```

More flags info can be found in this [file](https://github.com/iotaledger/iota/blob/main/crates/iota-indexer/src/lib.rs#L83-L123).

### DB reset

Run this command under `iota/crates/iota-indexer`, which will wipe DB; In case of schema changes in `.sql` files, this will also update corresponding `schema.rs` file.

```sh
diesel database reset --database-url="<DATABASE_URL>"
```
Loading

0 comments on commit df78b91

Please sign in to comment.