Skip to content

Commit

Permalink
Merge branch 'main' into feat/xerrors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Dec 5, 2023
2 parents 398b50f + ab9486a commit 1fa57fa
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 64 deletions.
122 changes: 61 additions & 61 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
name: Release Docker Image

on:
release:
types: [ published ]
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
consecutiveness:
runs-on: ubuntu-latest
steps:
- uses: ignite/consecutive-workflow-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: [ consecutiveness ]

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ignitehq/cli
# push to ignitehq/cli:latest on every push to master
# push to ignitehq/cli:vx.x.x on every release published
tags: |
type=raw,value=latest
type=semver,pattern=v{{version}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
#name: Release Docker Image

#on:
#release:
#types: [ published ]
#push:
#branches:
#- main

#concurrency:
#group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
#cancel-in-progress: true

#jobs:
#consecutiveness:
#runs-on: ubuntu-latest
#steps:
#- uses: ignite/consecutive-workflow-action@main
#with:
#token: ${{ secrets.GITHUB_TOKEN }}

#docker:
#name: Push Docker image to Docker Hub
#runs-on: ubuntu-latest
#needs: [ consecutiveness ]

#steps:
#- name: Check out the repo
#uses: actions/checkout@v3

#- name: Set up QEMU
#uses: docker/setup-qemu-action@v1

#- name: Set up Docker Buildx
#uses: docker/setup-buildx-action@v1

#- name: Login to DockerHub
#uses: docker/login-action@v2
#with:
#username: ${{ secrets.DOCKERHUB_USERNAME }}
#password: ${{ secrets.DOCKERHUB_TOKEN }}

#- name: Docker meta
#id: meta
#uses: docker/metadata-action@v4
#with:
#images: ignitehq/cli
## push to ignitehq/cli:latest on every push to master
## push to ignitehq/cli:vx.x.x on every release published
#tags: |
#type=raw,value=latest
#type=semver,pattern=v{{version}}

#- name: Build and push
#uses: docker/build-push-action@v3
#with:
#push: true
#context: .
#platforms: linux/amd64,linux/arm64
#tags: ${{ steps.meta.outputs.tags }}
#labels: ${{ steps.meta.outputs.labels }}

69 changes: 66 additions & 3 deletions docs/versioned_docs/version-v0.27.2/03-clients/01-go-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ To import dependencies for your package, you can add the following code to the
```text title="blogclient/go.mod"
module blogclient
go 1.19
go 1.20
require (
blog v0.0.0-00010101000000-000000000000
github.com/ignite/cli v0.25.2
github.com/ignite/cli v0.27.2
)
replace blog => ../blog
Expand All @@ -94,7 +94,7 @@ Your package will import two dependencies:
* `ignite` for the `cosmosclient` package

The `replace` directive uses the package from the local `blog` directory and is
specified as a relative path to the `blogclient` directory.
specified as a relative path to the `blogclient` directory.

Cosmos SDK uses a custom version of the `protobuf` package, so use the `replace`
directive to specify the correct dependency.
Expand Down Expand Up @@ -211,6 +211,69 @@ package documentation for
This documentation provides information on how to use the `Client` type with
`Options` and `KeyringBackend`.

## Blockchain and Client App Are on Different Machines

If the blockchain and the client app are not on the same machine, replace ../blog with the github
repository pointing to your blog GitHub repository:

dependencies for your package

`go.mod` file:

```text title="blogclient/go.mod"
...
replace blog => github.com/<github-user-name>/blog v0.0.0-00010101000000-000000000000
...
```

and `main.go` file:

```go title="blogclient/main.go"
// Importing the types package of your blog blockchain
"github.com/<github-user-name>/blog/x/blog/types"
```

Then, update the dependencies again:

```bash
go mod tidy
```

## Using the Test Keyring Backend

***Only for testing***

Create a new directory inside the blog client named 'keyring-test'. Next, export the blockchain account keys from the user you want to be sign and broadcast the transaction too. After exporting, import the keys
to the 'keyring-test' directory you just created in root directory of your client app. You can use the following `ignite account import` command:

```bash
ignite account import alice --keyring-dir /path/to/client/blogclient/keyring-test
```

Define the path inside 'main.go':

```go title="blogclient/main.go"
.
.
.
func main() {
ctx := context.Background()
addressPrefix := "cosmos"

// Create a Cosmos client instance
client, err := cosmosclient.New(ctx, cosmosclient.WithAddressPrefix(addressPrefix),
cosmosclient.WithKeyringBackend("test"), cosmosclient.WithKeyringDir(".") )
if err != nil {
log.Fatal(err)
}

// Account `alice` was initialized during `ignite chain serve`
accountName :="aliceAddress"
.
.
.
```
## Run the blockchain and the client
Make sure your blog blockchain is still running with `ignite chain serve`.
Expand Down

0 comments on commit 1fa57fa

Please sign in to comment.