This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: elastic beanstalk server (#145)
- Loading branch information
1 parent
632d5b0
commit 0007d3e
Showing
25 changed files
with
2,020 additions
and
2,564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Elastic Beanstalk Files | ||
.elasticbeanstalk/* | ||
.git | ||
.gitignore | ||
node_modules | ||
www/node_modules | ||
server/node_modules | ||
common/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:18 | ||
|
||
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm | ||
|
||
WORKDIR /capi-multisig-app | ||
|
||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml /capi-multisig-app/ | ||
COPY www/package.json /capi-multisig-app/www/package.json | ||
COPY server/package.json /capi-multisig-app/server/package.json | ||
COPY common/package.json /capi-multisig-app/common/package.json | ||
|
||
RUN pnpm install | ||
|
||
COPY . /capi-multisig-app/ | ||
|
||
RUN pnpm run build:server | ||
|
||
EXPOSE 5000 | ||
CMD [ "node", "server/dist/main.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { binary, Config } from "capi" | ||
|
||
const polkadot = binary("polkadot", "v0.9.38") | ||
|
||
export const config: Config = { | ||
server: "https://capi.dev/@v0.1.0-beta.36/", | ||
chains: { | ||
westend: { | ||
url: "wss://westend-rpc.polkadot.io/", | ||
version: "v0.9.40", | ||
}, | ||
westendDev: { | ||
binary: polkadot, | ||
chain: "westend-dev", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* TODO: import { $runtimeCall, RuntimeCall } from "@capi/westend" */ | ||
import * as $ from "scale-codec" | ||
|
||
export interface Submit { | ||
type: "submit" | ||
// TODO: call: RuntimeCall | ||
channel: string | ||
signedExtrinsic: string | ||
} | ||
|
||
export interface Subscribe { | ||
type: "subscribe" | ||
channel: string | ||
} | ||
|
||
export interface Unsubscribe { | ||
type: "unsubscribe" | ||
channel: string | ||
} | ||
|
||
export type Input = Submit | Subscribe | Unsubscribe | ||
|
||
export const $input: $.Codec<Input> = $.taggedUnion("type", [ | ||
$.variant( | ||
"submit", | ||
$.object( | ||
// $.field("call", $runtimeCall), | ||
$.field("channel", $.str), | ||
$.field("signedExtrinsic", $.str), | ||
), | ||
), | ||
$.variant("subscribe", $.object($.field("channel", $.str))), | ||
$.variant("unsubscribe", $.object($.field("channel", $.str))), | ||
]) | ||
|
||
export interface SubscribeResult { | ||
type: "subscribe" | ||
channel: string | ||
result: "ok" | "error" | ||
} | ||
|
||
export interface UnsubscribeResult { | ||
type: "unsubscribe" | ||
channel: string | ||
result: "ok" | "error" | ||
} | ||
|
||
export interface SubmitResult { | ||
type: "submit" | ||
channel: string | ||
// TODO: callHash: string | ||
result: | ||
| { status: "future" } | ||
| { status: "ready" } | ||
| { status: "broadcast" } | ||
| { status: "inBlock" } | ||
| { status: "retracted" } | ||
| { status: "finalityTimeout" } | ||
| { status: "finalized"; hash: string } | ||
| { status: "usurped" } | ||
| { status: "dropped" } | ||
| { status: "invalid" } | ||
| { status: "failed" } | ||
} | ||
|
||
export type Result = SubmitResult | SubscribeResult | UnsubscribeResult | ||
|
||
export const $result: $.Codec<Result> = $.taggedUnion("type", [ | ||
$.variant( | ||
"subscribe", | ||
$.object( | ||
$.field("channel", $.str), | ||
$.field("result", $.literalUnion(["ok", "error"] as const)), | ||
), | ||
), | ||
$.variant( | ||
"unsubscribe", | ||
$.object( | ||
$.field("channel", $.str), | ||
$.field("result", $.literalUnion(["ok", "error"] as const)), | ||
), | ||
), | ||
$.variant( | ||
"submit", | ||
$.object( | ||
$.field("channel", $.str), | ||
$.field( | ||
"result", | ||
$.taggedUnion( | ||
"status", | ||
[ | ||
$.variant("future"), | ||
$.variant("ready"), | ||
$.variant("broadcast"), | ||
$.variant("inBlock"), | ||
$.variant("retracted"), | ||
$.variant("finalityTimeout"), | ||
$.variant("finalized", $.object($.field("hash", $.str))), | ||
$.variant("usurped"), | ||
$.variant("dropped"), | ||
$.variant("invalid"), | ||
$.variant("failed"), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export const HI = "World" | ||
export * from "./action.js" | ||
export * from "./models.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"name": "common", | ||
"private": true, | ||
"type": "module" | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: '3.8' | ||
services: | ||
web: | ||
build: | ||
context: ./ | ||
ports: | ||
- "80:5000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.