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

feat: initial commit #1

Merged
merged 1 commit into from
Feb 16, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
GO111MODULE=on
ROOT_DIR=${AKASH_ROOT}
AKASH_DEVCACHE_BASE=${AKASH_ROOT}/.cache
AKASH_DEVCACHE=${AKASH_DEVCACHE_BASE}
AKASH_DEVCACHE_BIN=${AKASH_DEVCACHE}/bin
AKASH_DEVCACHE_INCLUDE=${AKASH_DEVCACHE}/include
AKASH_DEVCACHE_VERSIONS=${AKASH_DEVCACHE}/versions
AKASH_DEVCACHE_NODE_MODULES=${AKASH_DEVCACHE}
AKASH_DEVCACHE_NODE_BIN=${AKASH_DEVCACHE_NODE_MODULES}/node_modules/.bin
40 changes: 40 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# if ! has make ; then
# echo "make is not installed"; exit 1
# fi
#
# if ! has go ; then
# echo "go is not installed"; exit 1
# fi
#
# if ! has unzip ; then
# echo "unzip is not installed"; exit 1
# fi
#
# if ! has wget ; then
# echo "wget is not installed"; exit 1
# fi
#
# if ! has curl ; then
# echo "curl is not installed"; exit 1
# fi
#
# if ! has npm ; then
# echo "npm is not installed"; exit 1
# fi
#
# if ! has jq ; then
# echo "jq is not installed"; exit 1
# fi
#
# if ! has readlink ; then
# echo "readlink is not installed"; exit 1
# fi

export AKASH_ROOT=$(pwd)

dotenv

PATH_add "$AKASH_DEVCACHE_NODE_BIN"
PATH_add "$AKASH_DEVCACHE_BIN"

make cache
39 changes: 39 additions & 0 deletions .github/workflows/proto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: protobuf

on:
pull_request:
paths:
- "**.proto"
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v3
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: go mod vendor
run: make modvendor
- name: lint
run: make lint
breakage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
with:
fetch-depth: 0
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v3
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: go mod vendor
run: make modvendor
- name: check-breakage
run: make check-breaking
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
UNAME_OS := $(shell uname -s)
UNAME_ARCH := $(shell uname -m)

GO := GO111MODULE=$(GO111MODULE) go
GO_MOD_NAME := $(shell go list -m 2>/dev/null)

BUF_VERSION ?= 1.13.1
PROTOC_VERSION ?= 21.12
GOGOPROTO_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/gogoproto)
PROTOC_GEN_GO_PULSAR_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/cosmos-proto)
PROTOC_GEN_GO_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' google.golang.org/protobuf)
PROTOC_GEN_GRPC_GATEWAY_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
PROTOC_GEN_SWAGGER_VERSION := $(PROTOC_GEN_GRPC_GATEWAY_VERSION)
MODVENDOR_VERSION ?= v0.5.0

BUF_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/buf/$(BUF_VERSION)
PROTOC_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc/$(PROTOC_VERSION)
GOGOPROTO_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/gogoproto/$(GOGOPROTO_VERSION)
PROTOC_GEN_GO_PULSAR_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc-gen-go-pulsar/$(PROTOC_GEN_GO_PULSAR_VERSION)
PROTOC_GEN_GO_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc-gen-go/$(PROTOC_GEN_GO_VERSION)
PROTOC_GEN_GRPC_GATEWAY_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc-gen-grpc-gateway/$(PROTOC_GEN_GRPC_GATEWAY_VERSION)
PROTOC_GEN_SWAGGER_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc-gen-swagger/$(PROTOC_GEN_SWAGGER_VERSION)
MODVENDOR_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/modvendor/$(MODVENDOR_VERSION)

BUF := $(AKASH_DEVCACHE_BIN)/buf
PROTOC := $(AKASH_DEVCACHE_BIN)/protoc
PROTOC_GEN_GO_PULSAR := $(AKASH_DEVCACHE_BIN)/protoc-gen-go-pulsar
PROTOC_GEN_GO := $(AKASH_DEVCACHE_BIN)/protoc-gen-go
PROTOC_GEN_GRPC_GATEWAY := $(AKASH_DEVCACHE_BIN)/protoc-gen-grpc-gateway
PROTOC_GEN_SWAGGER := $(AKASH_DEVCACHE_BIN)/protoc-gen-swagger
MODVENDOR := $(AKASH_DEVCACHE_BIN)/modvendor
SWAGGER_COMBINE := $(AKASH_DEVCACHE_NODE_BIN)/swagger-combine

DOCKER_RUN := docker run --rm -v $(shell pwd):/workspace -w /workspace
DOCKER_BUF := $(DOCKER_RUN) bufbuild/buf:$(BUF_VERSION)

ifeq (, $(shell which direnv))
$(warning "No direnv in $(PATH), consider installing. https://direnv.net")
endif

# AKASH_ROOT may not be set if environment does not support/use direnv
# in this case define it manually as well as all required env variables
ifndef AKASH_ROOT
AKASH_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/../)
include $(AKASH_ROOT)/.env

AKASH := $(AKASH_DEVCACHE_BIN)/akash
# setup .cache bins first in paths to have precedence over already installed same tools for system wide use
PATH := $(AKASH_DEVCACHE_BIN):$(AKASH_DEVCACHE_NODE_BIN):$(PATH)
endif

include $(AKASH_ROOT)/make/setup-cache.mk
include $(AKASH_ROOT)/make/mod.mk
include $(AKASH_ROOT)/make/test.mk
include $(AKASH_ROOT)/make/codegen.mk
include $(AKASH_ROOT)/make/lint.mk
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Akash API

## Node

## Provider
9 changes: 9 additions & 0 deletions buf.gen.gogo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
plugins:
- name: gocosmos
out: .
opt:
- plugins=interface+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
- name: grpc-gateway
out: .
opt: logtostderr=true,allow_colon_final_segments=true
17 changes: 17 additions & 0 deletions buf.gen.pulsar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: v1
managed:
enabled: true
go_package_prefix:
default: cosmossdk.io/api
except:
- buf.build/googleapis/googleapis
- buf.build/cosmos/gogo-proto
- buf.build/cosmos/cosmos-proto
override:
plugins:
- name: go-pulsar
out: ../api
opt: paths=source_relative
- name: go-grpc
out: ../api
opt: paths=source_relative
5 changes: 5 additions & 0 deletions buf.gen.swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: v1
plugins:
- name: swagger
out: ./.cache/tmp/swagger-gen
opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true
6 changes: 6 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: v1
directories:
- proto/node
- proto/provider
- vendor/github.com/cosmos/cosmos-sdk/proto
- vendor/github.com/cosmos/cosmos-sdk/third_party/proto
37 changes: 37 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"swagger": "2.0",
"info": {
"title": "AKASH - gRPC Gateway docs",
"description": "A REST interface for state queries, legacy transactions",
"version": "1.0.0"
},
"apis": [
{
"url": "./.cache/tmp/swagger-gen/akash/audit/v1beta3/query.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/cert/v1beta3/query.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/deployment/v1beta3/query.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/deployment/v1beta3/service.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/market/v1beta3/query.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/market/v1beta3/service.swagger.json"
},
{
"url": "./.cache/tmp/swagger-gen/akash/provider/v1beta3/query.swagger.json"
},
{
"url": "./vendor/github.com/cosmos/cosmos-sdk/client/docs/swagger-ui/swagger.yaml",
"dereference": {
"circular": "ignore"
}
}
]
}
Loading