Skip to content

Commit

Permalink
Merge pull request #28 from cloud-j-luna/dev
Browse files Browse the repository at this point in the history
Mainnet-4 support
  • Loading branch information
cloud-j-luna authored Nov 18, 2022
2 parents 97e55ac + d1a2aa3 commit 05af6f0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.6] - 2022-11-16
### Added
- Add support to mainnet-4
### Fixed
- Bug where deployments did not close when no bids were made

## [0.0.5] - 2022-10-27
### Added
- Transaction memo stating the Terraform provider was used and which version
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TEST?=$$(go list ./... | grep -v 'vendor')
NAMESPACE=cloud
NAME=akash
BINARY=terraform-provider-${NAME}
VERSION=0.0.5
VERSION=0.0.6
OS_ARCH=darwin_arm64
OS := $(shell uname -s | tr A-Z a-z)
HOSTNAME := $(shell hostname)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ export AKASH_ACCOUNT_ADDRESS="$(./bin/akash keys show $AKASH_KEY_NAME -a)"
export AKASH_NET="https://raw.githubusercontent.com/ovrclk/net/master/mainnet"
export AKASH_VERSION="$(curl -s "$AKASH_NET/version.txt")"
export AKASH_CHAIN_ID="$(curl -s "$AKASH_NET/chain-id.txt")"
export AKASH_NODE="http://akash.c29r3.xyz:80/rpc"
export AKASH_NODE="https://akash-rpc.polkachu.com:443"
export AKASH_HOME="$(realpath ~/.akash)"
export AKASH_PATH="$(realpath ./bin/akash)"

export TF_LOG_PROVIDER=DEBUG
```
Expand Down
2 changes: 1 addition & 1 deletion akash/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type AkashCliClient interface {
func AkashCli(client AkashCliClient) AkashCommand {
path := client.GetPath()
if path == "" {
path = "akash"
path = "provider-services"
}

return AkashCommand{
Expand Down
4 changes: 2 additions & 2 deletions akash/client/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func (ak *AkashClient) SendManifest(dseq string, provider string, manifestLocation string) (string, error) {

cmd := cli.AkashCli(ak).Provider().SendManifest(manifestLocation).
cmd := cli.AkashCli(ak).SendManifest(manifestLocation).
SetDseq(dseq).SetProvider(provider).SetHome(ak.Config.Home).
SetKeyringBackend(ak.Config.KeyringBackend).SetFrom(ak.Config.KeyName).
SetNode(ak.Config.Node).OutputJson()
Expand All @@ -26,7 +26,7 @@ func (ak *AkashClient) SendManifest(dseq string, provider string, manifestLocati

func (ak *AkashClient) GetLeaseStatus(seqs Seqs, provider string) (*types.LeaseStatus, error) {

cmd := cli.AkashCli(ak).Provider().LeaseStatus().
cmd := cli.AkashCli(ak).LeaseStatus().
SetHome(ak.Config.Home).SetDseq(seqs.Dseq).SetGseq(seqs.Gseq).SetOseq(seqs.Oseq).
SetNode(ak.Config.Node).SetProvider(provider).SetFrom(ak.Config.KeyName)

Expand Down
4 changes: 2 additions & 2 deletions akash/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Provider() *schema.Provider {
Path: {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("AKASH_PATH", "akash"),
DefaultFunc: schema.EnvDefaultFunc("AKASH_PATH", "provider-services"),
},
},
ResourcesMap: map[string]*schema.Resource{
Expand Down Expand Up @@ -121,7 +121,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}

akash := client.New(ctx, configuration)

akash.SetGlobalTransactionNote("Akash Terraform Provider - [provider=\"cloud-j-luna/akash\" version=\"0.0.5\"]")
akash.SetGlobalTransactionNote("Akash Terraform Provider")

return akash, diags
}
Expand Down
4 changes: 4 additions & 0 deletions akash/resource_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func resourceDeploymentCreate(ctx context.Context, d *schema.ResourceData, m int

bids, diagnostics := queryBids(ctx, akash, seqs)
if diagnostics != nil {
tflog.Warn(ctx, "No bids on deployment")
if err := akash.DeleteDeployment(seqs.Dseq, akash.Config.AccountAddress); err != nil {
return append(diagnostics, diag.FromErr(err)...)
}
return diagnostics
}

Expand Down

0 comments on commit 05af6f0

Please sign in to comment.