Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dndll committed Mar 28, 2024
1 parent f4b00ae commit f79904d
Show file tree
Hide file tree
Showing 41 changed files with 369 additions and 116 deletions.
2 changes: 0 additions & 2 deletions api/NEAR Light Client/.env.sample

This file was deleted.

65 changes: 0 additions & 65 deletions api/NEAR Light Client/Succinct/Deployment new test.bru

This file was deleted.

5 changes: 0 additions & 5 deletions api/NEAR Light Client/bruno.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta {
name: Check Release Status
name: check-release
type: http
seq: 2
}
Expand Down Expand Up @@ -28,7 +28,7 @@ headers {
}

vars:pre-request {
release: 13
release: noop
}

assert {
Expand All @@ -37,18 +37,16 @@ assert {
}

script:pre-request {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
let release = bru.getEnvVar(`${entrypoint}_RELEASE_NUM_NEW`)
if (release != null && entrypoint != null) {
let release = bru.getProcessEnv(`CHECK_RELEASE_NUM`)
if (release != null) {
bru.setVar("release", release)
}
}

script:post-response {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
if (res.body.status == "success") {
bru.setEnvVar(`${entrypoint}_RELEASE_ID_OLD`, bru.getEnvVar(`${entrypoint}_RELEASE_ID`))
bru.setEnvVar(`${entrypoint}_RELEASE_NUM`, bru.getEnvVar(`${entrypoint}_RELEASE_NUM_NEW`))
bru.setEnvVar(`${entrypoint}_RELEASE_ID`, bru.getEnvVar(`${entrypoint}_RELEASE_ID_NEW`))
bru.setEnvVar(`${entrypoint}_RELEASE_NUM`, bru.getProcessEnv(`CHECK_RELEASE_NUM`))
bru.setEnvVar(`${entrypoint}_RELEASE_ID`, bru.getProcessEnv(`CHECK_RELEASE_ID`))
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
meta {
name: New Entrypoint
name: new-deployment
type: http
seq: 1
}

post {
url: {{succinctBaseUrl}}/release/new
body: text
auth: bearer
}

headers {
Expand All @@ -24,12 +23,12 @@ headers {
sec-fetch-site: same-origin
sec-gpc: 1
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
cookie: session={{succinctSession}}
content-type: text/plain;charset=UTF-8
cookie: session={{succinctSession}}
}

auth:bearer {
token: {{succinctAuthToken}}
token: {{succinctApiKey}}
}

body:text {
Expand All @@ -47,6 +46,10 @@ vars:pre-request {
entrypoint: fake
}

assert {
res.status: eq 200
}

script:pre-request {
let gitRef = bru.getProcessEnv("GIT_REF")
if (gitRef != null) {
Expand All @@ -56,16 +59,11 @@ script:pre-request {
if (entrypoint != null) {
bru.setVar("entrypoint", entrypoint)
}
bru.setVar("succinctSession", bru.getProcessEnv("SUCCINCT_SESSION"))
bru.setVar("succinctApiKey", bru.getProcessEnv("SUCCINCT_API_KEY"))
}

script:post-response {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
bru.setEnvVar(`${entrypoint}_RELEASE_ID_NEW`, res.body.release_id)
bru.setEnvVar(`${entrypoint}_RELEASE_NUM_NEW`, res.body.release_number)
bru.setVar(`${entrypoint}_RELEASE_ID_NEW`, res.body.release_id)
bru.setVar(`${entrypoint}_RELEASE_NUM_NEW`, res.body.release_number)
}

assert {
res.status: eq 200
bru.setVar(`CHECK_RELEASE_ID`, res.body.release_id)
bru.setVar(`CHECK_RELEASE_NUM`, res.body.release_number)
}
93 changes: 93 additions & 0 deletions api/succinct/deploy/notify-deployment.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
meta {
name: notify-deployment
type: http
seq: 50
}

post {
url: {{succinctBaseUrl}}/deployment/new
body: text
}

headers {
authority: alpha.succinct.xyz
accept: */*
accept-language: en-GB,en;q=0.9
content-type: text/plain;charset=UTF-8
origin: https://alpha.succinct.xyz
referer: https://alpha.succinct.xyz/near/near-light-client/deployments/new
sec-ch-ua: "Not A(Brand";v="99", "Brave";v="121", "Chromium";v="121"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
sec-gpc: 1
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
cookie: session=Qa84UBz81dNmH6kV7DTW_de8TtSdeYZExnnngHJoMH8
}

body:text {
{
"release_id": "{{release}}",
"contract_address": "{{contract}}",
"gateway_address": "{{gateway}}",
"chain_id": {{chain_id}},
"function_id": "{{function_id}}",
"salt": "{{salt}}",
"tx_hash": {{tx_hash}}
}
}


vars:pre-request {
salt: d4f4fed64865db8ba82177c0c4528a9eb7ec47ec4fb0ddaf8d56dd7b79537597
chain_id: 421614
function_id:
tx_hash:
}

script:pre-request {
let release = bru.getEnvVar(`RELEASE_ID`)
console.log(`release: ${release}`)
if (release != null) {
bru.setVar("release", release)
}

let contract = bru.getProcessEnv(`CONTRACT_ADDRESS`)
console.log(`contract: ${contract}`)
if (contract != null) {
bru.setVar("contract", contract)
}

let gateway = bru.getProcessEnv(`SUCCINCT_GATEWAY_ID`)
console.log(`gateway: ${gateway}`)
if (gateway != null) {
bru.setVar("gateway", gateway)
}

let chain = bru.getProcessEnv(`CHAIN_ID`)
console.log(`chain: ${chain}`)
if (chain != null) {
bru.setVar("chain", chain)
}

let function_id = bru.getEnvVar(`FUNCTION_ID`)
console.log(`function_id: ${function_id}`)
if (function_id != null) {
bru.setVar("function_id", function_id)
}

let salt = bru.getEnvVar(`CREATE2_SALT`)
console.log(`salt: ${salt}`)
if (salt != null) {
bru.setVar("salt", salt)
}

let tx_hash = bru.getEnvVar(`TX_HASH`)
console.log(`tx_hash: ${tx_hash}`)
if (tx_hash != null) {
bru.setVar("tx_hash", tx_hash)
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta {
name: Pull Verifying Key
name: pull-vk
type: http
seq: 4
}
Expand Down Expand Up @@ -28,17 +28,16 @@ headers {
}

vars:pre-request {
releaseId: c2829278-6849-4487-ba5f-96ce503837d5
releaseId: c2829278-6849-4487-ba5f-96ce503837d5
}

assert {
res.status: eq 200
}

script:pre-request {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
let releaseId = bru.getEnvVar(`${entrypoint}_RELEASE_ID_NEW`)
if (releaseId != null && entrypoint != null) {
let releaseId = bru.getEnvVar("RELASE_ID")
if (releaseId != null) {
bru.setVar("releaseId", releaseId)
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
meta {
name: Update name
name: update-name
type: http
seq: 3
}

patch {
url: {{succinctBaseUrl}}/release/{{releaseNum}}/name
url: {{succinctBaseUrl}}/release/{{release}}/name
body: json
auth: none
}
Expand Down Expand Up @@ -33,8 +33,8 @@ body:json {
}

vars:pre-request {
releaseNum: noop
version: dev
release: noop
version: noop
}

assert {
Expand All @@ -43,14 +43,16 @@ assert {
}

script:pre-request {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
let releaseNum = bru.getEnvVar(`${entrypoint}_RELEASE_ID`)
if (releaseNum != null && entrypoint != null) {
bru.setVar("releaseNum", releaseNum)
let release = bru.getEnvVar(`RELEASE_ID`)
console.log(`release: ${release}`)
if (release != null) {
bru.setVar("release", release)
}

let version = bru.getProcessEnv("VERSION")
let version = bru.getEnvVar("VERSION")
console.log(`version: ${version}`)
if (version != null) {
bru.setVar("version", version)
}
bru.setVar("succinctSession", bru.getProcessEnv("SUCCINCT_SESSION"))
}
19 changes: 19 additions & 0 deletions bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "1",
"name": "api",
"type": "collection",
"presets": {
"requestType": "http",
"requestUrl": "{{succinctBaseUrl}}"
},
"ignore": [
"bin",
"target",
".git",
"crates",
"build",
"nearx",
"vendor",
"wrapped"
]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ vars {
operatorBaseUrl: http://0.0.0.0:3030
gitRef: 700edd24ac1666307f3f740e36bf4c5808c26e1b
}

vars:secret [
succinctAuthToken,
succinctSession
succinctApiKey,
succinctSession,
version,
releaseId,
releaseNum,
]
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
nativeBuildInputs = with pkgs; [
bashInteractive
taplo
just
clang
cmake
openssl
Expand All @@ -43,7 +44,6 @@

vscode-extensions.vadimcn.vscode-lldb.adapter
rust-analyzer

];
buildInputs = with pkgs; [
(rustVersion.override { extensions = [ "rust-src" ]; })
Expand Down
Loading

0 comments on commit f79904d

Please sign in to comment.