Skip to content

Commit 2ab83d8

Browse files
committed
initial support for 1.11
1 parent 7625951 commit 2ab83d8

File tree

5 files changed

+32
-42
lines changed

5 files changed

+32
-42
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
go_version: 1.21.13
9+
go_version: 1.22.12
1010

1111
jobs:
1212

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# go-flare-rosetta
22

33
## System Requirements
4-
- go version 1.21
4+
- go version 1.22
55
- gcc, g++ and jq
66
- CPU: Equivalent of 8 AWS vCPU
77
- RAM: 16 GiB
@@ -64,7 +64,12 @@ The following scripts use local RPC endpoints for the Flare and Costwo networks,
6464

6565
# Testing
6666

67-
Install the rosetta-cli: https://github.com/coinbase/rosetta-cli#installation
67+
Install the rosetta-cli:
68+
```
69+
mkdir /tmp/rosetta && curl -o /tmp/rosetta/install.sh -sSfL https://raw.githubusercontent.com/coinbase/mesh-cli/refs/tags/v0.10.4/scripts/install.sh
70+
sed -i 's/REPO="rosetta-cli"/REPO="mesh-cli"/g' /tmp/rosetta/install.sh
71+
bash /tmp/rosetta/install.sh -b /usr/local/bin v0.10.4
72+
```
6873

6974
Test requirements: a fully-synced Costwo or Flare node using the above config, and a connected Flare Rosetta server.
7075

@@ -114,7 +119,6 @@ check:data
114119
| `EXTRA_ARGUMENTS` | | Extra arguments passed to flare binary |
115120
| `ROSETTA_FLARE_ENDPOINT` | `http://127.0.0.1:9650` | go-flare HTTP endpoint used by rosetta |
116121
| `ROSETTA_CONFIG_PATH` | `/app/conf/${NETWORK_ID}/server-config.json` | Configuration path used by rosetta |
117-
| `STAKING_ENABLED` | `true` | set it to `false` to make avalanchego sample all nodes, not just validators. Read [Disabling staking](#disabling-staking)! Avalanchego docs: [--staking-enabled](https://docs.avax.network/nodes/maintain/avalanchego-config-flags#--staking-enabled-boolean). |
118122
| `MODE` | `online` | Run rosetta in [`online`](https://www.rosetta-api.org/docs/node_deployment.html#online-mode-endpoints) or [`offline`](https://www.rosetta-api.org/docs/node_deployment.html#offline-mode-endpoints) mode |
119123
| `START_ROSETTA_SERVER_AFTER_BOOTSTRAP` | `false` | Waits for go-flare to fully bootstrap before launching rosetta-server |
120124

@@ -137,10 +141,6 @@ check:data
137141

138142
Config folders in [`rosetta-cli-conf`](./server/rosetta-cli-conf/) also contain the Rosetta server config `server-config.json`. The used location of this config file can be overwritted with `ROSETTA_CONFIG_PATH` environment variable.
139143

140-
### Disabling staking
141-
142-
Disabling Proof of Stake is **dangerous**! Read the [avalanchego documentation](https://docs.avax.network/nodes/maintain/avalanchego-config-flags#--staking-enabled-boolean). If you want to proceed with disabled staking you will also need to [confirm this setting](#confirming-dangerous-settings) as it is a dangerous one.
143-
144144
### Confirming dangerous settings
145145

146146
To confirm dangrous settings set the environment variable `YES_I_REALLY_KNOW_WHAT_I_AM_DOING` to "i have read the documentation" with spaces replaced with minuses.

server/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# ------------------------------------------------------------------------------
22
# Build go-flare
33
# ------------------------------------------------------------------------------
4-
FROM golang:1.21 AS flare
4+
FROM golang:1.22 AS flare
55

66
WORKDIR /app
77

8-
ARG GO_FLARE_VERSION=v1.10.0
8+
ARG GO_FLARE_VERSION=v1.11.0-testnet
99
ARG GO_FLARE_REPO=https://github.com/flare-foundation/go-flare
1010

1111
RUN git clone --branch "$GO_FLARE_VERSION" "${GO_FLARE_REPO}" .
@@ -18,7 +18,7 @@ RUN cd avalanchego && \
1818
# ------------------------------------------------------------------------------
1919
# Build flare-rosetta
2020
# ------------------------------------------------------------------------------
21-
FROM golang:1.21 AS rosetta
21+
FROM golang:1.22 AS rosetta
2222

2323
ARG ROSETTA_SRC=https://github.com/flare-foundation/flare-rosetta/archive/refs/heads/main.zip
2424
ARG ROSETTA_SRC_ZIP_SUBFOLDER=flare-rosetta-main
@@ -71,9 +71,8 @@ ENV HTTP_HOST=0.0.0.0 \
7171
START_ROSETTA_SERVER_AFTER_BOOTSTRAP=false \
7272
AUTOCONFIGURE_BOOTSTRAP_ENDPOINT="" \
7373
AUTOCONFIGURE_BOOTSTRAP_ENDPOINT_RETRY=0 \
74-
STAKING_ENABLED="true" \
75-
YES_I_REALLY_KNOW_WHAT_I_AM_DOING="false"
76-
74+
YES_I_REALLY_KNOW_WHAT_I_AM_DOING="false" \
75+
HTTP_ALLOWED_HOSTS="*"
7776

7877

7978
# Intentionally empty, so env vars are evalueted at runtime (script entrypoint_flare.sh) instead of build time

server/Dockerfile.arm64

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# ------------------------------------------------------------------------------
22
# Build go-flare
33
# ------------------------------------------------------------------------------
4-
FROM arm64v8/golang:1.21 AS flare
4+
FROM arm64v8/golang:1.22 AS flare
55

66
WORKDIR /app
77

8-
ARG GO_FLARE_VERSION=v1.10.0
8+
ARG GO_FLARE_VERSION=v1.11.0-testnet
99
ARG GO_FLARE_REPO=https://github.com/flare-foundation/go-flare
1010

1111
RUN git clone --branch "$GO_FLARE_VERSION" "${GO_FLARE_REPO}" .
@@ -18,7 +18,7 @@ RUN cd avalanchego && \
1818
# ------------------------------------------------------------------------------
1919
# Build flare-rosetta
2020
# ------------------------------------------------------------------------------
21-
FROM arm64v8/golang:1.21 AS rosetta
21+
FROM arm64v8/golang:1.22 AS rosetta
2222

2323
ARG ROSETTA_SRC=https://github.com/flare-foundation/flare-rosetta/archive/refs/heads/main.zip
2424
ARG ROSETTA_SRC_ZIP_SUBFOLDER=flare-rosetta-main

server/docker/entrypoint_flare.sh

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,9 @@ if [ "$NETWORK_ID" != "flare" ] && [ "$NETWORK_ID" != "costwo" ] && [ "$NETWORK_
1818
fi
1919

2020
if [ "$NETWORK_ID" = "flare" ]; then
21-
export AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=${AUTOCONFIGURE_BOOTSTRAP_ENDPOINT:-'https://flare.flare.network/ext/info'}
21+
export AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=${AUTOCONFIGURE_BOOTSTRAP_ENDPOINT:-'https://flare-bootstrap.flare.network/ext/info'}
2222
elif [ "$NETWORK_ID" = "costwo" ]; then
23-
export AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=${AUTOCONFIGURE_BOOTSTRAP_ENDPOINT:-'https://coston2.flare.network/ext/info'}
24-
fi
25-
26-
if [ "$STAKING_ENABLED" = "false" ] && [ "$YES_I_REALLY_KNOW_WHAT_I_AM_DOING" != "i-have-read-the-documentation" ]; then
27-
echo "<ERROR>"
28-
echo " STAKING_ENABLED env var is set to 'false'"
29-
echo " but you have not confirmed that you ACTUALLY know what you are doing,"
30-
echo " that you have read the documentation and are aware of the dangers of this mode"
31-
echo "</ERROR>"
32-
exit 1
23+
export AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=${AUTOCONFIGURE_BOOTSTRAP_ENDPOINT:-'https://coston2-bootstrap.flare.network/ext/info'}
3324
fi
3425

3526
if [ "$FLARE_LOCAL_TXS_ENABLED" = "true" ]; then
@@ -57,18 +48,18 @@ then
5748
fi
5849

5950
/app/flare/build/avalanchego \
60-
--http-host=$HTTP_HOST \
61-
--http-port=$HTTP_PORT \
62-
--staking-port=$STAKING_PORT \
63-
--staking-enabled=$STAKING_ENABLED \
64-
--public-ip=$PUBLIC_IP \
65-
--db-dir=$DB_DIR \
66-
--db-type=$DB_TYPE \
67-
--bootstrap-ips=$BOOTSTRAP_IPS \
68-
--bootstrap-ids=$BOOTSTRAP_IDS \
69-
--chain-config-dir=$CHAIN_CONFIG_DIR \
70-
--log-dir=$LOG_DIR \
71-
--log-level=$LOG_LEVEL \
72-
--network-id=$NETWORK_ID \
51+
--http-host="$HTTP_HOST" \
52+
--http-port="$HTTP_PORT" \
53+
--staking-port="$STAKING_PORT" \
54+
--public-ip="$PUBLIC_IP" \
55+
--db-dir="$DB_DIR" \
56+
--db-type="$DB_TYPE" \
57+
--bootstrap-ips="$BOOTSTRAP_IPS" \
58+
--bootstrap-ids="$BOOTSTRAP_IDS" \
59+
--chain-config-dir="$CHAIN_CONFIG_DIR" \
60+
--log-dir="$LOG_DIR" \
61+
--log-level="$LOG_LEVEL" \
62+
--network-id="$NETWORK_ID" \
7363
--api-keystore-enabled=true \
74-
$EXTRA_ARGUMENTS
64+
-http-allowed-hosts="$HTTP_ALLOWED_HOSTS" \
65+
"$EXTRA_ARGUMENTS"

0 commit comments

Comments
 (0)