Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/tp 165/terraform update #12

Merged
merged 11 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 73 additions & 73 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN cargo build --release --features $FEATURES

FROM debian:buster-slim

ARG NODE_TYPE=node-template
ARG NODE_TYPE=trackback-node

COPY ./LICENSE /build/LICENSE
COPY --from=builder /build/target/release/$NODE_TYPE /usr/local/bin/node-executable
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM paritytech/ci-linux:production

WORKDIR /var/www/node-template
WORKDIR /var/www/trackback-node

ADD . /var/www/node-template
ADD . /var/www/trackback-node

RUN rustup toolchain uninstall nightly
RUN rustup toolchain install nightly-2020-08-23
Expand All @@ -11,4 +11,4 @@ RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2020-08-23
RUN bash -c "cargo build --release"


CMD ["./target/release/node-template", "--dev", "--ws-external"]
CMD ["./target/release/trackback-node", "--dev", "-lruntime=debug","--ws-external"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ cargo build --release
Purge any existing dev chain state:

```bash
./target/release/node-template purge-chain --dev
./target/release/trackback-node purge-chain --dev
```

Start a dev chain:

```bash
./target/release/node-template --dev
./target/release/trackback-node--dev
```

Or, start a dev chain with detailed logging:

```bash
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/node-template -lruntime=debug --dev
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/trackback-node -lruntime=debug --dev
```

### Multi-Node Local Testnet
Expand All @@ -72,12 +72,12 @@ If you want to see the multi-node consensus algorithm in action, refer to
```bash
# Purge any chain data from previous runs
# You will be prompted to type `y`
./target/release/node-template purge-chain --base-path /tmp/alice --chain local
./target/release/trckback-node purge-chain --base-path /tmp/alice --chain local
```

```bash
# Start Alice's node
./target/release/node-template \
./target/release/trackback-node \
--base-path /tmp/alice \
--chain local \
--alice \
Expand All @@ -90,11 +90,11 @@ If you want to see the multi-node consensus algorithm in action, refer to
```
Starts Bob's node
```bash
./target/release/node-template purge-chain --base-path /tmp/bob --chain local
./target/release/trackback-node purge-chain --base-path /tmp/bob --chain local
```

```bash
./target/release/node-template \
./target/release/trackback-node \
--base-path /tmp/bob \
--chain local \
--bob \
Expand All @@ -108,7 +108,7 @@ Starts Bob's node

### CLIon configuration
```bash
run --bin node-template -- --base-path /tmp/alice --chain local --alice --port 30333 --ws-port 9944 --rpc-port 9933 --node-key 0000000000000000000000000000000000000000000000000000000000000001 --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --validator
run --bin trackback-node -- --base-path /tmp/alice --chain local --alice --port 30333 --ws-port 9944 --rpc-port 9933 --node-key 0000000000000000000000000000000000000000000000000000000000000001 --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --validator
```

### Gets a full list of available APIs for the node
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ services:
- "9944:9944"
- "30333:30333"
- "9933:9933"
environment:
- RUST_LOG=debug
- RUST_BACKTRACE=1
logging:
driver: awslogs
options:
awslogs-group: substrate
awslogs-region: ap-southeast-2
awslogs-stream: trackbackNode
18 changes: 13 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ services:
ports:
- "80:80"
dev:
container_name: node-template
container_name: trackback-node
image: paritytech/ci-linux:production
working_dir: /var/www/node-template
working_dir: /var/www/trackback-node
ports:
- "9944:9944"
- "30333:30333"
- "9933:9933"
environment:
- CARGO_HOME=/var/www/node-template/.cargo
- CARGO_HOME=/var/www/trackback-node.cargo
- RUST_LOG=debug
- RUST_BACKTRACE=1
volumes:
- .:/var/www/node-template
- .:/var/www/trackback-node
- type: bind
source: ./.local
target: /root/.local
command: bash -c "cargo build --release && ./target/release/node-template --dev --ws-external"
logging:
driver: awslogs
options:
awslogs-group: substrate
awslogs-region: ap-southeast-2
awslogs-stream: trackbackNode
command: bash -c "cargo build --release && RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/trackback-node -lruntime=debug --dev"
14 changes: 14 additions & 0 deletions docker-prom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.2"

services:
prometheus:
image: prom/prometheus
container_name: prometheus
ports:
- "9090:9090"
grafana:
image: grafana/grafana
container_name: grafana
ports:
- "3000:3000"

6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export BRANCH_NAME :=$(shell git branch --show-current)
all: deploy

destroy:
cd terraform/ap-southeast-2 && terraform destroy -var="branch_name=$(BRANCH_NAME)" --auto-approve
cd terraform/ap-southeast-2/deployec2 && terraform destroy -var="branch_name=$(BRANCH_NAME)" --auto-approve

ecr:
aws ecr get-login-password \
Expand All @@ -24,12 +24,12 @@ ecr:

build: ecr
docker build -f Dockerfile.dev --no-cache -t $(PROJECT_NAME):latest .

docker tag $(PROJECT_NAME):latest $(ECR_REPO_URL)/$(PROJECT_NAME):$(VERSION)
docker push $(ECR_REPO_URL)/$(PROJECT_NAME):$(VERSION)

deploy: destroy
cd terraform/ap-southeast-2 && terraform apply -var="branch_name=$(BRANCH_NAME)" --auto-approve
cd terraform/ap-southeast-2/deployec2 && terraform apply -var="branch_name=$(BRANCH_NAME)" --auto-approve

run-dev: ecr
docker-compose -f docker-compose.dev.yml up --build --force-recreate --remove-orphans -d
14 changes: 7 additions & 7 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
authors = ['Developers at TrackBack Limited']
build = 'build.rs'
description = 'A fresh FRAME-based Substrate node, ready for hacking.'
description = 'TrackBack node for Decentralised Indentifiers.'
edition = '2018'
homepage = 'https://substrate.dev'
homepage = 'https://trackback.co.nz/'
license = 'Unlicense'
name = 'node-template'
name = 'trackback-node'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '3.0.0'

[[bin]]
name = 'node-template'
name = 'trackback-node'

[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
Expand All @@ -23,7 +23,7 @@ jsonrpc-core = '15.1.0'
structopt = '0.3.8'

# local dependencies
node-template-runtime = { path = '../runtime', version = '3.0.0' }
trackback-node-runtime = { path = '../runtime', version = '3.0.0' }

# Substrate dependencies
frame-benchmarking = '3.0.0'
Expand Down Expand Up @@ -55,4 +55,4 @@ substrate-frame-rpc-system = '3.0.0'

[features]
default = []
runtime-benchmarks = ['node-template-runtime/runtime-benchmarks']
runtime-benchmarks = ['trackback-node-runtime/runtime-benchmarks']
2 changes: 1 addition & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use node_template_runtime::{
use trackback_node_runtime::{
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
SystemConfig, WASM_BINARY,
};
Expand Down
4 changes: 2 additions & 2 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use crate::cli::{Cli, Subcommand};
use crate::{chain_spec, service};
use node_template_runtime::Block;
use trackback_node_runtime::Block;
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents;

Expand Down Expand Up @@ -57,7 +57,7 @@ impl SubstrateCli for Cli {
}

fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
&node_template_runtime::VERSION
&trackback_node_runtime::VERSION
}
}

Expand Down
Loading