Skip to content

Commit

Permalink
docs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viswa3760 committed Feb 13, 2024
1 parent f5a9718 commit abd71f6
Show file tree
Hide file tree
Showing 41 changed files with 7,930 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/dev_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Docs Dev Deployment
on:
push:
branches: ['dev']
workflow_dispatch:

jobs:
deploy_staging:
name: Dev Deployment
permissions:
id-token: write
contents: write
environment: dev
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-dev-ecr
ECS_SERVICE: docs-dev-ecs-service
ECS_CLUSTER: frontend-dev-ecs-cluster
ECS_TASK_DEFINITION: .github/assets/dev-taskdef.json
CONTAINER_NAME: docs-dev
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::605436358845:role/docs-dev-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f .github/assets/Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Cloudflare Cache Purge
uses: nathanvaughn/actions-cloudflare-purge@master
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
hosts: docs-dev.polygon.technology
89 changes: 89 additions & 0 deletions .github/workflows/prod_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Prod Deployment

on:
workflow_dispatch:
inputs:
stage:
description: 'Stage to deploy (production)'
required: true
run_production:
description: 'Staging deployment completed (yes, no)'
required: true

jobs:
deploy_prod:
name: Prod Deployment
permissions:
id-token: write
contents: write
environment: prod
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.event.inputs.stage == 'production' && github.event.inputs.run_production == 'yes'
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-ecr
ECS_SERVICE: docs-ecs-service
ECS_CLUSTER: frontend-prod-ecs-cluster
ECS_TASK_DEFINITION: .github/assets/prod-taskdef.json
CONTAINER_NAME: docs
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::042947190491:role/docs-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f .github/assets/Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Cloudflare Cache Purge
uses: nathanvaughn/actions-cloudflare-purge@master
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
hosts: docs.polygon.technology
82 changes: 82 additions & 0 deletions .github/workflows/staging_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Staging Deployment
on:
push:
branches: ['main']
workflow_dispatch:

jobs:
deploy_staging:
name: Staging Deployment
permissions:
id-token: write
contents: write
environment: staging
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-staging-ecr
ECS_SERVICE: docs-staging-ecs-service
ECS_CLUSTER: frontend-staging-ecs-cluster
ECS_TASK_DEFINITION: .github/assets/staging-taskdef.json
CONTAINER_NAME: docs-staging
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::070528468658:role/docs-staging-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f .github/assets/Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Cloudflare Cache Purge
uses: nathanvaughn/actions-cloudflare-purge@master
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
hosts: docs-staging.polygon.technology
98 changes: 98 additions & 0 deletions docs/Dojima/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
id: quickstart
#title: Introduction to Dojima PoS
title: Dojima
sidebar_position: 1
---
# Introduction to Dojima PoS

!!! warning
UPDATING THE DEVELOP DOCS

The docs are being updated, enhanced, and improved. They are subject to change. Please feel free to raise an issue or pull request if you have any queries or suggestions.


Welcome to **Dojima** The most innovative and exciting platform to develop your blockchain application. Blockchain technology is poised to revolutionize how the digital world manages data and conducts business. You can join this revolution by getting a head start on Dojima's decentralized application (dApp) development.

This guide will introduce you to the Dojima ecosystem. You'll find links to valuable resources and websites that will bring you up to speed on building, not only on Dojima but also on general blockchain application development.

!!! tip
STAY IN THE KNOW

Keep up with the latest builder updates from the Dojima team and the community by subscribing to the .


## Building on Dojima

If you are an Ethereum developer, you are already a Dojima developer. Simply switch to the [Dojima RPC](https://api-test.d11k.dojima.network:8545/) and get started. All the tools you are familiar with on the Ethereum blockchain are supported on Dojima by default, such as Truffle, Remix, and Web3js.

You can deploy decentralized applications to either Dojima Testnet or the Mainnet. The Dojima Testnet connects with the Ethereum Goërli Testnet, which acts as its ParentChain. You can find all the network-related details in the **[network documentation]**.

### Wallets

To interact with the Dojima Network, you need to have an Ethereum-based wallet because Dojima runs on Ethereum Virtual Machine (EVM). You can choose to set up a Metamask or Arkane Wallet. More on wallet-related information and why you need one can be found in our wallet documentation.

### Smart Contracts

Dojima supports many services you can use to test, compile, debug, and deploy decentralized applications onto the Dojima Network. These include deployment using Alchemy, Chainstack, QuickNode, Remix, Truffle, Hardhat, and Replit.

<!-- ### Connecting to Dojima
You can add Dojima to Metamask or directly use Arkane, which allows you to connect to Dojima using RPC.
In order to connect with the Dojima Network to read blockchain information, we recommend using the Alchemy SDK.
```js
// Javascript
// Setup: npm install alchemy-sdk
const { Alchemy, Network } = require("alchemy-sdk");
const settings = {
apiKey: "demo", // Can replace with your API Key from https://www.alchemy.com
Network: Network.DOJIMA_TESTNET,
};
const alchemy = new Alchemy(settings);
async function main() {
const latestBlock = await alchemy.core.getBlockNumber();
console.log("The latest block number is", latestBlock);
}
main();
``` -->

### Building a new dApp on Dojima?

Decentralized applications (dApps) act as the bridge between users and their data privacy on the blockchain. The increasing number of dApps validates their usefulness within the blockchain ecosystem, solving challenges like executing transactions between two participants without the need for central authority via smart contracts.

Suppose you have no prior experience building decentralized applications (dApps). In that case, the below-mentioned resources will give you a head start on the tools required to build, debug, and deploy dApps on the Dojima Network.

[Full Stack dApp: Tutorial Series](https://kauri.io/full-stack-dapp-tutorial-series/5b8e401ee727370001c942e3/c)
- [Web3.js](https://www.dappuniversity.com/articles/web3-js-intro)
- [Ethers.js](https://docs.ethers.io/v5/)
- [Remix](https://docs.polygon.technology/docs/develop/remix/)
- [Truffle](https://docs.polygon.technology/docs/develop/truffle)
- [Metamask](https://docs.polygon.technology/docs/develop/metamask/overview)
- [Arkane](https://docs.polygon.technology/docs/develop/wallets/arkane/intro)
- [Develop a dApp using Fauna, Dojima and React](https://docs.polygon.technology/docs/develop/dapp-fauna-polygon-react)
### Already have a dApp?

If you already have a decentralized application (dApp) and are looking for a platform to help you scale efficiently, then you are at the right place because Dojima allows you to:

1. **Easily migrate from Ethereum Virtual Machine (EVM) based chain**: Dojima prides itself in being the ultimate Layer-2 scaling solution for Ethereum. You don't have to worry about the underlying architecture while moving or deploying your dApps to the Dojima Network as long as it is EVM-compatible

2. **Use Dojima as a faster transaction layer**: Deploying your dApp to the Dojima Mainnet allows you to leverage Dojima as a faster transaction layer for your dApp. Additionally, you can get your tokens mapped by us. You can join our technical discussions group on Telegram to learn more.

## Side Note

If this is overwhelming, that’s alright! You can jump right into the action and start hacking. Here are some notes before you start diving into resources, repositories, and docs:

1. **Beware the cost of being on the bleeding edge**: Like typical niche programming, dApps and blockchain development moves very quickly. While researching, you may find complex code repositories, 404s on a documentation site, or even no documentation. Use that opportunity to reach out to us via any social media channel.

2. **The learning curve may be daunting, but the barrier to entry is low**: The community is very open and welcoming! Projects welcome pull requests from outsiders and resolve any blockers actively. We’re working on creating a better world and contribution in any form is appreciated. We’ll be grateful to onboard you into this amazing Web3 ecosystem.

!!! info
STAY UPDATED

Decentralized application development encourages network decentralization. Follow our social media handles for more insights and updates about the Dojima ecosystem. You can find the links to all the Dojima communities here.
Loading

0 comments on commit abd71f6

Please sign in to comment.