Skip to content

Commit

Permalink
cleaning deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
dndll committed Mar 27, 2024
1 parent 8a76aff commit f4b00ae
Show file tree
Hide file tree
Showing 22 changed files with 444 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ nearx/build
nearx/contract/cache
nearx/contract/out
nearx/contract/lib
near/contract/script/FunctionVerifier
# Ignores development broadcast logs
!**broadcast
**broadcast/*/31337/
**broadcast/**/dry-run/
nearx/contract/broadcast
state.json

# Dotenv file
.env
Expand Down
13 changes: 13 additions & 0 deletions api/NEAR Light Client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

TODO:
let token = bru.setEnvVar("access_token", data.token);

Redeploying dev:
- Deploy entrypoints
- Wait for success
- rename old release to tag
- update nane of new releases
- get verifier, deploy with forge script
- send deployment info to succinct /deployment/new
- execute forge script to update functionIds
- send deployment
54 changes: 54 additions & 0 deletions api/NEAR Light Client/Succinct/Deploy/Check Release Status.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
meta {
name: Check Release Status
type: http
seq: 2
}

get {
url: {{succinctBaseUrl}}/projects/near/near-light-client/releases/{{release}}
body: text
auth: none
}

headers {
authority: alpha.succinct.xyz
accept: */*
accept-language: en-GB,en;q=0.9
origin: https://alpha.succinct.xyz
referer: https://alpha.succinct.xyz/near/near-light-client/releases/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
content-type: text/plain;charset=UTF-8
}

vars:pre-request {
release: 13
}

assert {
res.status: eq 200
res.body.status: eq "success"
}

script:pre-request {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
let release = bru.getEnvVar(`${entrypoint}_RELEASE_NUM_NEW`)
if (release != null && entrypoint != 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`))
}
}
71 changes: 71 additions & 0 deletions api/NEAR Light Client/Succinct/Deploy/New Entrypoint.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
meta {
name: New Entrypoint
type: http
seq: 1
}

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

headers {
authority: alpha.succinct.xyz
accept: */*
accept-language: en-GB,en;q=0.9
origin: https://alpha.succinct.xyz
referer: https://alpha.succinct.xyz/near/near-light-client/releases/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={{succinctSession}}
content-type: text/plain;charset=UTF-8
}

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

body:text {
{
"org_name": "near",
"project_name": "near-light-client",
"git_ref": "{{gitRef}}",
"entrypoint": "{{entrypoint}}",
"env_vars": []
}
}

vars:pre-request {
gitRef: notused
entrypoint: fake
}

script:pre-request {
let gitRef = bru.getProcessEnv("GIT_REF")
if (gitRef != null) {
bru.setVar("gitRef", gitRef)
}
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
if (entrypoint != null) {
bru.setVar("entrypoint", entrypoint)
}
}

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
}
44 changes: 44 additions & 0 deletions api/NEAR Light Client/Succinct/Deploy/Pull Verifying Key.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
meta {
name: Pull Verifying Key
type: http
seq: 4
}

get {
url: {{succinctBaseUrl}}/release/{{releaseId}}/download/FunctionVerifier.sol
body: text
auth: none
}

headers {
authority: alpha.succinct.xyz
accept: */*
accept-language: en-GB,en;q=0.9
origin: https://alpha.succinct.xyz
referer: https://alpha.succinct.xyz/near/near-light-client/releases/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
content-type: text/plain;charset=UTF-8
}

vars:pre-request {
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) {
bru.setVar("releaseId", releaseId)
}
}
56 changes: 56 additions & 0 deletions api/NEAR Light Client/Succinct/Deploy/Update name.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
meta {
name: Update name
type: http
seq: 3
}

patch {
url: {{succinctBaseUrl}}/release/{{releaseNum}}/name
body: json
auth: none
}

headers {
authority: alpha.succinct.xyz
accept: */*
accept-language: en-GB,en;q=0.9
content-type: application/json
origin: https://alpha.succinct.xyz
referer: https://alpha.succinct.xyz/near/near-light-client/releases/17
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) AppMozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
cookie: session={{succinctSession}}
}

body:json {
{"name":"{{version}}"}
}

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

assert {
res.body.status: eq success
res.status: eq 200
}

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 version = bru.getProcessEnv("VERSION")
if (version != null) {
bru.setVar("version", version)
}
}
65 changes: 65 additions & 0 deletions api/NEAR Light Client/Succinct/Deployment new test.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
meta {
name: Deployment new test
type: http
seq: 11
}

post {
url: {{succinctBaseUrl}}/deployment/new
body: json
auth: none
}

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:json {
{
"release_id": "{{release_id}}",
"contract_address": "{{contract_address}}",
"gateway_address": "{{gateway_address}}",
"chain_id": {{chain_id}},
"function_id": "0x{{function_id}}",
"salt": "0x{{salt}}",
"tx_hash": "0x{{tx_hash}}"
}
}

body:text {
{"release_id":"870e6490-2a30-4703-9958-646f3945da9c","contract_address":"0x395C22aEC73F7960245afBf6eDD77E086bf908C5","gateway_address":"0x6c7a05e0AE641c6559fD76ac56641778B6eCd776","chain_id":421614,"function_id":"0xf7dc8cfca607134de24309d606b91a4c071b7f6b2a7cf8535da65cef25db520f","salt":"0xd4f4fed64865db8ba82177c0c4528a9eb7ec47ec4fb0ddaf8d56dd7b79537597","tx_hash":"0x5ff9a3899f4716dbe63d21f2dfd1c13ece08ac9751f6509761ca1a510719c2b2"}
}

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

script:pre-request {
let entrypoint = bru.getProcessEnv("ENTRYPOINT")
let release = bru.getEnvVar(`${entrypoint}_RELEASE_ID`)
let functionId = bru.getEnvVar(`${entrypoint}_FUNCTION_ID`)
let chainId = bru.getProcessEnv("CHAIN_ID")
let salt = bru.getEnvVar(`${entrypoint}_SALT`)
let txHash = bru.getEnvVar(`${entrypoint}_TX_HASH`)

if (release != null && entrypoint != null) {
bru.setVar("release_id", release)
}
}
4 changes: 2 additions & 2 deletions api/NEAR Light Client/Succinct/Get Deployments.bru
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
meta {
name: Get Deployments
type: http
seq: 6
seq: 8
}

get {
url: {{succintBaseUrl}}/deployments/near/near-light-client
url: {{succinctBaseUrl}}/deployments/near/near-light-client
body: none
auth: none
}
4 changes: 2 additions & 2 deletions api/NEAR Light Client/Succinct/Get proof status.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ meta {
}

get {
url: {{succintBaseUrl}}/proof/{{proof_id}}
url: {{succinctBaseUrl}}/proof/{{proof_id}}
body: json
auth: bearer
}

auth:bearer {
token: {{succintAuthToken}}
token: {{succinctAuthToken}}
}

body:json {
Expand Down
6 changes: 3 additions & 3 deletions api/NEAR Light Client/Succinct/Get proofs.bru
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
meta {
name: Get proofs
type: http
seq: 7
seq: 9
}

get {
url: {{succintBaseUrl}}/proofs?project=near/near-light-client
url: {{succinctBaseUrl}}/proofs?project=near/near-light-client
body: json
auth: bearer
}
Expand All @@ -15,7 +15,7 @@ query {
}

auth:bearer {
token: {{succintAuthToken}}
token: {{succinctAuthToken}}
}

body:json {
Expand Down
4 changes: 2 additions & 2 deletions api/NEAR Light Client/Succinct/Get request status.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ meta {
}

get {
url: {{succintBaseUrl}}/request/{{proof_id}}
url: {{succinctBaseUrl}}/request/{{proof_id}}
body: json
auth: bearer
}

auth:bearer {
token: {{succintAuthToken}}
token: {{succinctAuthToken}}
}

body:json {
Expand Down
Loading

0 comments on commit f4b00ae

Please sign in to comment.