Skip to content

Commit 11d1d4f

Browse files
committed
init
0 parents  commit 11d1d4f

35 files changed

Lines changed: 2853 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
golangci:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.21'
19+
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v3
22+
with:
23+
version: latest
24+
args: --timeout=5m
25+

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.21'
19+
20+
- name: Run tests
21+
run: go test -v ./...
22+
23+
- name: Create Release
24+
uses: softprops/action-gh-release@v1
25+
with:
26+
generate_release_notes: true
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
name: Test
30+
31+
on:
32+
push:
33+
branches: [main, develop]
34+
pull_request:
35+
branches: [main, develop]
36+
37+
jobs:
38+
test:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
go-version: ['1.21', '1.22']
43+
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- name: Set up Go
48+
uses: actions/setup-go@v4
49+
with:
50+
go-version: ${{ matrix.go-version }}
51+
52+
- name: Cache Go modules
53+
uses: actions/cache@v3
54+
with:
55+
path: ~/go/pkg/mod
56+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-
59+
60+
- name: Download dependencies
61+
run: go mod download
62+
63+
- name: Run tests
64+
run: go test -v -race -coverprofile=coverage.out ./...
65+
66+
- name: Upload coverage
67+
uses: codecov/codecov-action@v3
68+
with:
69+
file: ./coverage.out
70+

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
go-version: ['1.21', '1.22']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
24+
- name: Cache Go modules
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Download dependencies
33+
run: go mod download
34+
35+
- name: Run tests
36+
run: go test -v -race -coverprofile=coverage.out ./...
37+
38+
- name: Upload coverage
39+
uses: codecov/codecov-action@v3
40+
with:
41+
file: ./coverage.out
42+

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Binaries
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin/
8+
dist/
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool
14+
*.out
15+
coverage.html
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# Dependency directories
22+
vendor/
23+
24+
# IDE
25+
.idea/
26+
.vscode/
27+
*.swp
28+
*.swo
29+
*~
30+
31+
# OS
32+
.DS_Store
33+
Thumbs.db
34+
35+
# Examples output
36+
examples/*/output/
37+
examples/*/*.bin
38+
examples/*/*.txt
39+

LICENSE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
http://www.apache.org/licenses/
4+
5+
Copyright 2025 Lumera Protocol
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
module github.com/LumeraProtocol/sdk-go

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: help build test lint clean examples install
2+
3+
help: ## Display this help screen
4+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5+
6+
build: ## Build the SDK
7+
@echo "Building SDK..."
8+
@go build ./...
9+
10+
test: ## Run tests
11+
@echo "Running tests..."
12+
@go test -v -race -coverprofile=coverage.out ./...
13+
@go tool cover -html=coverage.out -o coverage.html
14+
15+
lint: ## Run linters
16+
@echo "Running linters..."
17+
@golangci-lint run --timeout=5m
18+
19+
clean: ## Clean build artifacts
20+
@echo "Cleaning..."
21+
@rm -f coverage.out coverage.html
22+
@go clean -cache -testcache
23+
24+
examples: ## Build all examples
25+
@echo "Building examples..."
26+
@cd examples/cascade-upload && go build
27+
@cd examples/cascade-download && go build
28+
@cd examples/query-actions && go build
29+
@cd examples/claim-tokens && go build
30+
31+
install: ## Install the SDK locally
32+
@echo "Installing SDK..."
33+
@go install ./...
34+
35+
tidy: ## Tidy go modules
36+
@go mod tidy
37+
38+
deps: ## Update dependencies
39+
@go get -u ./...
40+
@go mod tidy
41+

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Lumera Go SDK
2+
3+
Official Go SDK for the Lumera Protocol - a next-generation blockchain platform for AI and decentralized storage.
4+
5+
## Features
6+
7+
- 🔗 **Unified Client** - Single interface for blockchain and storage operations
8+
- 📦 **Type-Safe** - Full Go type definitions for all Lumera modules
9+
- 🚀 **High-Level API** - Simple methods for complex operations
10+
- 🔐 **Secure** - Built on Cosmos SDK's proven cryptography
11+
- 📝 **Well-Documented** - Comprehensive examples and documentation
12+
13+
## Installation
14+
15+
```bash
16+
go get github.com/LumeraProtocol/sdk-go
17+
```
18+
19+
## Quick Start
20+
21+
```go
22+
package main
23+
24+
import (
25+
"context"
26+
"log"
27+
28+
"github.com/cosmos/cosmos-sdk/crypto/keyring"
29+
lumerasdk "github.com/LumeraProtocol/sdk-go/client"
30+
)
31+
32+
func main() {
33+
ctx := context.Background()
34+
35+
// Initialize keyring
36+
kr, err := keyring.New("lumera", "test", "/tmp", nil)
37+
if err != nil {
38+
log.Fatal(err)
39+
}
40+
41+
// Create client
42+
client, err := lumerasdk.New(ctx, lumerasdk.Config{
43+
ChainID: "lumera-testnet-2",
44+
GRPCAddr: "localhost:9090",
45+
Address: "lumera1abc...",
46+
KeyName: "my-key",
47+
}, kr)
48+
if err != nil {
49+
log.Fatal(err)
50+
}
51+
defer client.Close()
52+
53+
// Query an action
54+
action, err := client.Blockchain.Action.GetAction(ctx, "action-123")
55+
if err != nil {
56+
log.Fatal(err)
57+
}
58+
59+
log.Printf("Action: %+v", action)
60+
}
61+
```
62+
63+
## Examples
64+
65+
See the [examples](./examples) directory for complete working examples:
66+
67+
- [Cascade Upload](./examples/cascade-upload) - Upload files to decentralized storage
68+
- [Cascade Download](./examples/cascade-download) - Download files from storage
69+
- [Query Actions](./examples/query-actions) - Query blockchain actions
70+
- [Claim Tokens](./examples/claim-tokens) - Claim tokens from old chain
71+
72+
## Documentation
73+
74+
- [API Documentation](https://pkg.go.dev/github.com/LumeraProtocol/sdk-go)
75+
- [Lumera Documentation](https://docs.lumera.io)
76+
77+
## Development
78+
79+
```bash
80+
# Clone the repository
81+
git clone https://github.com/LumeraProtocol/sdk-go.git
82+
cd sdk-go
83+
84+
# Install dependencies
85+
go mod download
86+
87+
# Run tests
88+
make test
89+
90+
# Run linters
91+
make lint
92+
93+
# Build examples
94+
make examples
95+
```
96+
97+
## Contributing
98+
99+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
100+
101+
## License
102+
103+
Apache 2.0 - see [LICENSE](LICENSE) file for details.
104+
105+
## Links
106+
107+
- [Lumera Protocol](https://lumera.io)
108+
- [Documentation](https://docs.lumera.io)
109+
- [Discord](https://discord.gg/lumera)
110+
- [Twitter](https://twitter.com/LumeraProtocol)
111+

0 commit comments

Comments
 (0)