Skip to content

Commit 98ad280

Browse files
committed
chore(repo): try dockerizing Klesia
1 parent 97b4f7d commit 98ad280

File tree

11 files changed

+162
-3
lines changed

11 files changed

+162
-3
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,22 @@ jobs:
1818
needs: test
1919
steps:
2020
- uses: actions/checkout@v4
21+
- name: Install Nixpacks
22+
run: |
23+
curl -LO https://github.com/railwayapp/nixpacks/releases/download/v1.27.1/nixpacks-v1.27.1-amd64.deb
24+
sudo dpkg -i nixpacks-v1.27.1-amd64.deb
2125
- uses: oven-sh/setup-bun@v2
2226
- run: bun i --no-save
2327
- run: bun run build
2428
- run: bunx pkg-pr-new publish './packages/klesia-sdk'
29+
- run: nixpacks build . --config apps/klesia/nixpacks.toml
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Tag image
37+
run: docker tag $(docker images --format='{{.ID}}' | head -1) ghcr.io/palladians/klesia:$(git rev-parse --short HEAD)
38+
- name: Push to GHCR
39+
run: docker push ghcr.io/palladians/klesia:$(git rev-parse --short HEAD)

.github/workflows/promote_image.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Promote Docker image to latest
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
dockerize_and_push:
6+
name: Tag latest and push to GHCR
7+
runs-on: ubuntu-latest
8+
permissions:
9+
packages: write
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Login to GitHub Container Registry
13+
uses: docker/login-action@v3
14+
with:
15+
registry: ghcr.io
16+
username: ${{ github.actor }}
17+
password: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Tag image
19+
run: docker buildx imagetools create ghcr.io/palladians/klesia:$(git rev-parse --short HEAD) --tag ghcr.io/palladians/klesia:latest

apps/docs/docs/pages/about.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import { Callout } from 'vocs/components'
2+
13
# About MinaJS [Learn about MinaJS and Klesia.]
24

5+
<Callout type="warning">As of September 2024, MinaJS is in early development. Don't use for production just yet.</Callout>
6+
37
MinaJS is a TypeScript interface for Mina Protocol. It provides a set of TypeScript types and utilities to interact with Mina Protocol. MinaJS is the missing piece for your smooth zkApp development on Mina.
48
It aims to remove the complexities, and allow developers to focus on building innovative zkApps on Mina.
59

apps/docs/docs/pages/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ $ npm install @mina-js/klesia-sdk
2727

2828
- [MinaJS Connect](/connect)
2929
- [MinaJS Accounts](/accounts)
30-
- [Klesia SDK](/klesia-sdk)
30+
- [Klesia SDK](/klesia/sdk)

apps/docs/docs/pages/klesia-sdk/index.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/docs/docs/pages/klesia/index.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Klesia [Missed Alchemy and Infura? Here's Klesia.]
2+
3+
Klesia is a JSON-RPC wrapper over Mina Node's GraphQL API and TypeScript SDK to interact with it. It's similar to APIs like Alchemy and Infura. It's self hostable, so you can bring your own infrastructure.
4+
5+
## Tools and Libraries
6+
7+
- [Klesia JSON-RPC](/klesia/rpc) - JSON-RPC wrapper over Mina Node's GraphQL API.
8+
- [Klesia TypeScript SDK](/klesia/sdk) - TypeScript SDK to interact with Klesia JSON-RPC API with type-safe interfaces and properties auto-completion.

apps/docs/docs/pages/klesia/rpc.mdx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Klesia JSON-RPC
2+
3+
Klesia is accessible via HTTP JSON-RPC. You can use any HTTP client to interact with it, but if you're building o1js zkApps, we recommend using the [Klesia SDK](/klesia/sdk).
4+
5+
## Endpoints
6+
7+
There are two Klesia instances available. One for Mina Mainnet and the other for Mina Devnet.
8+
9+
### Mina Mainnet
10+
11+
```
12+
https://mainnet.klesia.palladians.xyz/api
13+
```
14+
15+
### Mina Devnet
16+
17+
```
18+
https://devnet.klesia.palladians.xyz/api
19+
```
20+
21+
## RPC Methods
22+
23+
Below you can find the complete list of RPC methods available on Klesia.
24+
25+
---
26+
27+
### mina_getTransactionCount
28+
29+
Returns the number of transactions sent from an address. Usually you may want to use this number to determine the nonce for the next transaction.
30+
31+
#### Parameters
32+
33+
Array of strings:
34+
- `publicKey` - Address to check for transaction count.
35+
36+
---
37+
38+
### mina_getBalance
39+
40+
Returns the balance of the account of given address.
41+
42+
#### Parameters
43+
44+
Array of strings:
45+
- `publicKey` - Address to check for transaction count.
46+
47+
---
48+
49+
### mina_blockHash
50+
51+
Returns the hash of the most recent block.
52+
53+
---
54+
55+
### mina_chainId
56+
57+
Returns the currently configured chain ID.
58+
59+
---
60+
61+
### mina_sendTransaction
62+
63+
Broadcasts a signed transaction to the network.
64+
65+
#### Parameters
66+
67+
Array of strings:
68+
- `input` - Signed transaction or zkApp input.
69+
- `type` - Transaction type. Can be `payment`, `delegation`, or `zkapp`.
70+
71+
## Self-hosting
72+
73+
The application is open-source and available on GitHub. You can self-host it by following the instructions in the repository.

apps/docs/docs/pages/klesia/sdk.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Klesia TypeScript SDK
2+
3+
Klesia has a TypeScript SDK to interact with the JSON-RPC API. The SDK provides type-safe interfaces and properties auto-completion.
4+
5+
## Installation
6+
7+
```bash
8+
$ npm install @mina-js/klesia-sdk
9+
```
10+
11+
## Usage
12+
13+
```typescript
14+
import { createClient } from '@mina-js/klesia-sdk'
15+
16+
const client = createClient({ network: 'devnet' })
17+
18+
const { result } = await client.request({
19+
method: 'mina_getTransactionCount',
20+
params: ['B62qkYa1o6Mj6uTTjDQCob7FYZspuhkm4RRQhgJg9j4koEBWiSrTQrS']
21+
})
22+
```
23+
24+
## Methods
25+
26+
Refer to the [RPC Methods](/klesia/rpc#rpc-methods) page for a complete list of methods available on Klesia.

apps/docs/vocs.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,24 @@ export default defineConfig({
4141
},
4242
},
4343
},
44+
markdown: {
45+
code: {
46+
themes: {
47+
light: "rose-pine-dawn",
48+
dark: "rose-pine",
49+
},
50+
},
51+
},
4452
socials: [
4553
{ icon: "github", link: "https://github.com/palladians/mina-js" },
4654
{ icon: "discord", link: "https://get.pallad.co/discord" },
4755
],
48-
topNav: [{ text: "Pallad", link: "https://get.pallad.co/website" }],
56+
topNav: [
57+
{
58+
text: "Pallad - Mina Protocol wallet",
59+
link: "https://get.pallad.co/website",
60+
},
61+
],
4962
sidebar: [
5063
{
5164
text: "About MinaJS",

apps/klesia/nixpacks.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[start]
2+
cmd = "cd apps/klesia && npm run start"

0 commit comments

Comments
 (0)