Skip to content

Commit

Permalink
docs: update to reflect only 'cargo' based commands (#274)
Browse files Browse the repository at this point in the history
While Makefile did many commands cleanly for docs, there were confusions in developer community. CORD is mainly a rust language based project, and cargo is the build and packaging tool. Makefile (and automake toolset) are used differently, and introducing a make run-local type of commands in README confused many rust developers.

Hence, only highlight the cargo commands.
  • Loading branch information
amarts authored Feb 2, 2024
1 parent b6128a3 commit 982cffe
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 290 deletions.
172 changes: 0 additions & 172 deletions Makefile

This file was deleted.

127 changes: 9 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,118 +27,26 @@ cd cord
To build the production version of the project, optimized for performance, execute the following command:

```bash
make
cargo build --production
```

This will create the production binary in the `target/production` directory.

### Quickly start a 4 Node CORD Network

#### Start the network

```sh
make spinup
```

#### Stop the network

```sh
make spindown
```

### Run Single Node Local CORD Network

To run the production binary locally with the `--dev` flag, use the following command:

```bash
make run-local
./target/production/cord help | less
./target/production/cord --dev
```

Detailed logs may be shown by running the chain with the following environment variables set:

```bash
RUST_LOG=debug RUST_BACKTRACE=1 make run-local
```

### Checking the CORD

To perform a static analysis of the entire project, use the following command:

```bash
make check
```

This will check the code and dependencies for errors without producing an executable.

### Running Tests

To run all tests in the project, including runtime benchmarks and without fail-fast, run the following command:

```bash
make test
RUST_LOG=debug RUST_BACKTRACE=1 ./target/production/cord --dev
```

### Build the CORD in debug mode:

To build the project in the `debug` profile, run the following command:

```bash
make build-debug
```

This will compile the project without optimization and generate the executable in the `target/debug` directory.

### Displaying Help Message

To see the help message of the production binary, run the following command:

```bash
make help
```

### Clean Build Artifacts

To remove all build artifacts, use the following command:

```bash
make clean
```

This will clean up any compiled files and reset the project to a clean state.

## Specific Pallet Checks and Tests

The `Makefile` also provides specific rules to `check` and `test` individual `pallets`.
You can use these commands to `check` and `test` specific parts of the project.

### Check Pallets

To check specific pallets, use the following commands:

```bash
make check-did
make check-authorship
make check-did-name
make check-registry
make check-schema
make check-stream
```

### Test Pallets

To run tests for specific pallets, use the following commands:

```bash
make test-did
make test-authorship
make test-did-name
make test-registry
make test-schema
make test-stream
```

---

### Using Docker

> #### Install Docker
Expand All @@ -160,39 +68,24 @@ docker run --rm dhiway/cord --dev --name "CordDocker"

Once you are done experimenting and picking the best node name :) you can start CORD as daemon, exposes the CORD ports and mount a volume that will keep your blockchain data locally.

Make sure that you create a docker volume to mount on.
Make sure that you create a docker volume to mount on, or pass the separate mount (disk) to use for the process.

```sh
docker volume create cord
```

2. To start a CORD node on default rpc port 9933 and default p2p port 30333 & default prometheus port is 9615 use the following command:
(If you want to connect to rpc port 9933, then must add CORD startup parameter: `--rpc-external`)

```bash
docker run -d -p 30333:30333 -p 9933:9933 -p 9615:9615 --mount source=cord,target=/data dhiway/cord:develop --dev --rpc-external --rpc-cors all
docker run -d -p 9944:9944 -p 30333:30333 -p 9933:9933 -p 9615:9615 -v cord:/data dhiway/cord:develop --dev --rpc-external --rpc-cors all
```

3. Additionally if you want to have custom node name you can add the `--name "YourName"` at the end

```bash
docker run -d -p 30333:30333 -p 9933:9933 -p 9615:9615 --mount source=cord,target=/data dhiway/cord --dev --rpc-external --rpc-cors all --name "CordDocker"
```

4. If you also want to expose the webservice port 9944 use the following command:

```bash
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 --mount source=cord,target=/data dhiway/cord --dev --rpc-external --rpc-cors all --ws-external --name "CordDocker"
docker run -d -p 9944:9944 -p 30333:30333 -p 9933:9933 -p 9615:9615 -v cord:/data dhiway/cord --dev --rpc-external --rpc-cors all --name "CordDocker"
```

5. To get up and running with the smallest footprint on your system, you may use the CORD Docker image.
You can build it yourself (it takes a while...).

```sh
docker buildx create --use

docker buildx build --file docker/Dockerfile --tag local/cord:latest --platform linux/amd64,linux/arm64 --build-arg profile=production --load .
```

## Other projects of interest

Expand All @@ -206,18 +99,16 @@ This repository contains the complete code of the CORD Network Blockchain. To in

- There are multiple projects which are required when we need to monitor the chain, and make use of the transactions.

- [Telemetry](https://telemetry.cord.network) - This is hosted through 'substrate-telemetry' project.
- [Telemetry](https://telemetry.cord.network) - This is hosted through [substrate-telemetry](https://github.com/dhiway/substrate-telemetry) project.

- [Apps UI](https://apps.cord.network) - This project is managed through [apps](https://github.com/dhiway/apps) repository.

- [GraphQL Interface](https://query-sparknet.cord.network/) - This project is still in beta. Development work is happening at [cord-subql](https://github.com/dhiway/cord-subql) repository.
- *GraphQL Interface* - This project is still in beta. Development work is happening at [cord-subql](https://github.com/dhiway/cord-subql) repository.

3. Demostratable scripts and services, so one can take and build upon

- [Demo Scripts](https://github.com/dhiway/cord-demo-scripts) - Demo scripts are provided to connect and interact with the CORD Chain pallets/modules. This uses CORD.js SDK to interact with chain.

- [Demo API Service](https://github.com/dhiway/cord-agent-app-v1) - Demo API Server using nodejs/express.js combination, which uses SDK to in backend and provides basic APIs and also provides a mechanism to store application data in DB, so data along with chain interactions can be managed.


## Contributing

Expand Down
Loading

0 comments on commit 982cffe

Please sign in to comment.