-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add cli image job, update docs, and move the docker folder to outside project-template * Update docs * Update docker registry path and fix unifyVersions script * Update publish image ci * Update Docker file to trigger the CI * Update docker path * Change tag to latest * Change tag to latest and remove extract metadata * Use registry in lowercase * Modify docker file to trigger ci * Use repository name as lowercase * Add windows docker setup ci * Remove container operation because it only work on linux runners * Remove non supported privileged mode * Remove windows setup job * Add Troubleshooting section to docs and increase the version to 1.0.16
- Loading branch information
felipe.fuerback
authored
Feb 29, 2024
1 parent
4da9c9f
commit f1e1ee0
Showing
19 changed files
with
193 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish CLI Docker image | ||
on: | ||
push: | ||
paths: | ||
- 'chain-cli/docker/Dockerfile' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: galachain/sdk | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Make the repository name lowercase | ||
id: lower-repo | ||
shell: pwsh | ||
run: | | ||
"::set-output name=repository::$($env:GITHUB_REPOSITORY.ToLowerInvariant())" | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./chain-cli/docker | ||
push: true | ||
tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Dockerized Galachain Dev Environment | ||
|
||
## Base requirement | ||
|
||
- Docker Desktop or Docker CLI. | ||
- [Optional] VS Code with [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. | ||
|
||
## Run a container | ||
Run a container from the built image: | ||
|
||
$ docker run --privileged -d -p 3010:3010 -it --name <container_name> ghcr.io/galachain/sdk:latest | ||
|
||
Make sure the container is up and running. | ||
The Docker image initializes a new project with the name `chaincode-template` by default. | ||
|
||
## Open the running container | ||
|
||
### Open the container with bash | ||
|
||
``` | ||
docker exec -ti <container_name> /bin/bash | ||
``` | ||
|
||
### Open the container with VSCode (Requires VSCode and Dev Containers Extension) | ||
|
||
Open VSCode and press F1 to open the Command Palette and search for `Dev Containers: Attach to Running Container` | ||
|
||
After attach the container you may have to open the project folder manually. | ||
|
||
## Start the network | ||
|
||
Once the terminal is open, start the network | ||
|
||
``` | ||
npm run network:start | ||
``` | ||
|
||
The network is going to start in dev mode and the prompt will be left showing the logs, so don't close the prompt and open new ones to proceed with the following commands. | ||
|
||
## Run integration tests | ||
|
||
Now you can run integration tests with: | ||
|
||
``` | ||
npm run test:e2e | ||
``` | ||
|
||
## Verify changes in block browser and GraphQL | ||
|
||
Navigate to [http://localhost:3010/blocks](http://localhost:3010/blocks) to see our block browser which allows you to see what's saved on your local GalaChain network. | ||
|
||
Navigate to [http://localhost:3010/graphiql](http://localhost:3010/graphiql) to interact with GraphQL and execute queries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"commands": { | ||
"connect": { | ||
"id": "connect", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.