Skip to content

Commit 3b8c27d

Browse files
committed
some more stuff
1 parent 71d8e6b commit 3b8c27d

File tree

5 files changed

+77
-38
lines changed

5 files changed

+77
-38
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Terraform Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
terraform:
12+
name: Terraform
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
17+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18+
TF_VAR_bot_token: ${{ secrets.BOT_TOKEN }}
19+
TF_VAR_passport_api_key: ${{ secrets.PASSPORT_API_KEY }}
20+
TF_VAR_ethereum_host: ${{ secrets.ETHEREUM_HOST }}
21+
TF_VAR_backend_api_key: ${{ secrets.BACKEND_API_KEY }}
22+
TF_VAR_aws_region: "eu-west-2"
23+
TF_VAR_environment: "production"
24+
TF_VAR_bot_client_id: "1329079356785688616"
25+
TF_VAR_guild_id: "1144692727120937080"
26+
TF_VAR_passport_verified_role_id: "1364982673604345886"
27+
TF_VAR_minimum_score: "10"
28+
TF_VAR_passport_scorer_id: "11493"
29+
TF_VAR_vite_reown_project_id: "d037e9da5c5c9b24cfcd94c509d88dce"
30+
TF_VAR_staking_asset_handler_address: "0xF739D03e98e23A7B65940848aBA8921fF3bAc4b2"
31+
TF_VAR_l1_chain_id: "11155111"
32+
TF_VAR_local_dynamo_db: "false"
33+
TF_VAR_dynamodb_local_endpoint: "http://localhost:8000"
34+
TF_VAR_log_level: "info"
35+
TF_VAR_log_pretty_print: "false"
36+
TF_VAR_api_port: "3000"
37+
38+
defaults:
39+
run:
40+
working-directory: tooling/sparta/terraform
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Setup Terraform
47+
uses: hashicorp/setup-terraform@v3
48+
with:
49+
terraform_version: 1.5.7
50+
51+
- name: Terraform Init
52+
id: init
53+
run: terraform init
54+
55+
- name: Terraform Format
56+
id: fmt
57+
run: terraform fmt -check
58+
continue-on-error: true
59+
60+
- name: Terraform Validate
61+
id: validate
62+
run: terraform validate
63+
64+
- name: Terraform Apply
65+
run: |
66+
terraform apply -auto-approve

tooling/sparta/packages/discord/src/services/l2-info-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class L2InfoService {
318318
}
319319

320320
const tip = await this.getL2Tips();
321-
if (Number(tip) > Number(blockNumber) + 20) {
321+
if (Number(tip) > Number(blockNumber) + 100) {
322322
throw new Error("Proof is too old");
323323
}
324324

tooling/sparta/packages/discord/src/slashCommands/operators/register.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,33 @@ export async function showRegistrationHelp(
2020
const registrationEmbed = new EmbedBuilder()
2121
.setTitle("📝 How to Get the Apprentice Role")
2222
.setDescription(
23-
"Follow these steps to generate a sync proof and register your validator node on the discord server"
23+
"Follow these simple steps to generate a sync proof and register your validator node on the Discord server"
2424
)
2525
.setColor(0x4bb543) // Green color
2626
.addFields([
2727
{
2828
name: "📋 Step 1: Get the latest proven block number",
29-
value: '```bash\ncurl -s -X POST -H \'Content-Type: application/json\' \\\n-d \'{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}\' \\\n<your-node-url> | jq ".result.proven.number"\n```\n• Save this block number for the next steps\n• Example output: `12345`',
29+
value: '```bash\ncurl -s -X POST -H \'Content-Type: application/json\' \\\n-d \'{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}\' \\\n<your-node>:<your-port> | jq -r ".result.proven.number"\n```\n• Replace `<your-node>:<your-port>` with your node\'s URL, for example `http://localhost:8545` or `https://mynode.example.com:8545`\n• Save this block number for the next steps\n• Example output: `12345`',
3030
inline: false,
3131
},
3232
{
3333
name: "🔍 Step 2: Generate your sync proof",
34-
value: '```bash\ncurl -s -X POST -H \'Content-Type: application/json\' \\\n-d \'{"jsonrpc":"2.0","method":"node_getArchiveSiblingPath","params":["<block-number>","<block-number>"],"id":67}\' \\\n<your-node-url> | jq ".result"\n```\n• Replace `<block-number>` with the number from Step 1\n• This will output a long base64-encoded string - save it for registration',
34+
value: '```bash\ncurl -s -X POST -H \'Content-Type: application/json\' \\\n-d \'{"jsonrpc":"2.0","method":"node_getArchiveSiblingPath","params":["<block-number>","<block-number>"],"id":67}\' \\\n<your-node>:<your-port> | jq -r ".result"\n```\n• Replace `<your-node>:<your-port>` with the same URL you used in Step 1\n• Replace both instances of `<block-number>` with the number from Step 1 (example: 12345)\n• This will output a long base64-encoded string - copy it completely\n• Example command with values filled in:\n```bash\ncurl -s -X POST -H \'Content-Type: application/json\' \\\n-d \'{"jsonrpc":"2.0","method":"node_getArchiveSiblingPath","params":["12345","12345"],"id":67}\' \\\nhttp://localhost:8545 | jq -r ".result"\n```',
3535
inline: false,
3636
},
3737
{
3838
name: "✅ Step 3: Register with Discord",
39-
value: "Run the following command in this Discord server:\n```\n/operator register <node-address> <block-number> <proof>\n```\n• `<node-address>`: Your Ethereum validator address\n• `<block-number>`: The block number from Step 1\n• `<proof>`: The base64 string from Step 2",
39+
value: "Type the following command in this Discord server:\n```\n/operator register\n```\n**IMPORTANT**: After typing the command, Discord will display option fields that look like this:\n```\nOPTIONS\naddress Your validator address\nblock-number Block number for verification\nproof Your sync proof\n```\nClick on each option to fill in your information:\n• `address`: Your Ethereum validator address (must start with 0x, example: 0x1234567890abcdef1234567890abcdef12345678)\n• `block-number`: The block number from Step 1 (example: 12345)\n• `proof`: The complete base64 string from Step 2\n\n❗ **Common mistake**: Do not type all parameters in a single line. You must click on each option field separately to input your data.",
4040
inline: false,
4141
},
4242
{
4343
name: "💡 Tips for Success",
44-
value: "• Ensure your node is fully synced before attempting registration\n• Double-check your validator address format (must begin with 0x)\n• Make sure to copy the entire proof string without missing any characters\n• If registration fails, try generating a new proof with a more recent block",
44+
value: "• Ensure your node is fully synced before attempting registration\n• Double-check your validator Ethereum address format (must begin with 0x followed by 40 hex characters)\n• Make sure to copy the entire proof string without missing any characters\n• If you don't have jq installed, you can omit the `| jq` part and extract the needed values manually\n• If registration fails, try generating a new proof with a more recent block\n• Common errors: incorrect URL format, node not synced, or incomplete proof string",
45+
inline: false,
46+
},
47+
{
48+
name: "🛠️ Troubleshooting",
49+
value: "• If you get `Connection refused`: Check that your node is running and the URL is correct\n• If your proof is invalid: Ensure your node is fully synced and try again with a newer block\n• If you can't format the commands properly: Ask for help in the support channel",
4550
inline: false,
4651
},
4752
]);

tooling/sparta/packages/utils/openapi/api-docs.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,11 +1081,6 @@
10811081
"Users"
10821082
],
10831083
"operationId": "verifySignature",
1084-
"security": [
1085-
{
1086-
"ApiKeyAuth": []
1087-
}
1088-
],
10891084
"parameters": [
10901085
{
10911086
"in": "query",
@@ -1140,16 +1135,6 @@
11401135
}
11411136
}
11421137
},
1143-
"401": {
1144-
"description": "Unauthorized - Invalid or missing API key",
1145-
"content": {
1146-
"application/json": {
1147-
"schema": {
1148-
"$ref": "#/components/schemas/Error"
1149-
}
1150-
}
1151-
}
1152-
},
11531138
"404": {
11541139
"description": "Verification not found",
11551140
"content": {
@@ -1181,11 +1166,6 @@
11811166
"Users"
11821167
],
11831168
"operationId": "getScore",
1184-
"security": [
1185-
{
1186-
"ApiKeyAuth": []
1187-
}
1188-
],
11891169
"parameters": [
11901170
{
11911171
"in": "query",
@@ -1227,16 +1207,6 @@
12271207
}
12281208
}
12291209
},
1230-
"401": {
1231-
"description": "Unauthorized - Invalid or missing API key",
1232-
"content": {
1233-
"application/json": {
1234-
"schema": {
1235-
"$ref": "#/components/schemas/Error"
1236-
}
1237-
}
1238-
}
1239-
},
12401210
"404": {
12411211
"description": "Verification not found",
12421212
"content": {

tooling/sparta/packages/utils/openapi/types.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ declare namespace Paths {
502502
namespace Responses {
503503
export type $200 = Components.Schemas.ScoreResponse;
504504
export type $400 = Components.Schemas.Error;
505-
export type $401 = Components.Schemas.Error;
506505
export type $404 = Components.Schemas.Error;
507506
export type $500 = Components.Schemas.Error;
508507
}
@@ -636,7 +635,6 @@ declare namespace Paths {
636635
namespace Responses {
637636
export type $200 = Components.Schemas.VerifyResponse;
638637
export type $400 = Components.Schemas.Error;
639-
export type $401 = Components.Schemas.Error;
640638
export type $404 = Components.Schemas.Error;
641639
export type $500 = Components.Schemas.Error;
642640
}

0 commit comments

Comments
 (0)