Skip to content

Commit fe513fa

Browse files
authored
feature: Root update contract listener (#8)
* add: GitHub action to deploy service docs * add (docs): getting signed transited root state * update (resources): for root state signature response * update (resources): for root state signature response * add (stateQ): migrations for storing state data in DB and query interface to interact with schema * fix (cli): to use graceful shutdown for services * refactor (config): split network and contract structures, use ethclient.Client hook instead of manual connection, add pinger config timeouts * add: api handler and request for signed state root retrieval * refactor (ctx): store only used high-level structs in context to use * refactor (api): move API related logic into separate folder * add (listener): RootUpdated event processor via http connection pinger * update: deps * update (config): apply refactored changes, add some comments to clarify * fix: listener indexation issue * fix: go version in Dockerfile * update: signed state response with caught timestamp * rollback: register2 changing to replicator contract, keep other changes * add: replicator address in config to hash during signing root
1 parent bf848e7 commit fe513fa

31 files changed

+4969
-2829
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
cd ./docs
2626
npm install
2727
npm run build
28+
2829
- run: touch docs/.nojekyll
2930
- name: Deploy docs 🚀
3031
uses: JamesIves/github-pages-deploy-action@releases/v3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-alpine as buildbase
1+
FROM golang:1.22.0-alpine as buildbase
22

33
ARG CI_JOB_TOKEN
44

config.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
network:
2-
rpc: "https://rpc.evm.node1.mainnet-beta.rarimo.com/"
3-
proposer: "0xcB6Cd78e7527F4Ec032598E3aEe4dbd597fEFC97"
4-
voting_registry: "0xcB6Cd78e7527F4Ec032598E3aEe4dbd597fEFC97"
5-
lightweight_state: "0xcB6Cd78e7527F4Ec032598E3aEe4dbd597fEFC97"
2+
rpc: "https://rpc.evm.mainnet.rarimo.com/"
63
vault_address: "http://127.0.0.1:8200"
74
vault_mount_path: "secret_data"
85
gas_multiplier: 1.23
6+
private_key: without '0x' # For security purposes this key may be omitted and flow with Vault would be used
7+
8+
contracts:
9+
proposer:
10+
address: null
11+
voting_registry:
12+
address: null
13+
lightweight_state:
14+
address: null
15+
register2:
16+
address: "0xA25a197d26Cad659A8fFf7F268cA4F9e0283de03"
17+
block: 4939333 # Block is optional field for contract listeners, default value is 0 if nothing set
918

1019
log:
1120
level: debug
@@ -14,6 +23,18 @@ log:
1423
db:
1524
url: db_url
1625

26+
pinger:
27+
blocks_distance: 10000
28+
timeout: 5s # timeout to ping logs when 'subscribed' via http
29+
normal_period: 10s
30+
min_abnormal_period: 10s
31+
max_abnormal_period: 10s
32+
33+
replicator:
34+
address: 0x10f370A6d8782E0e0E85ba948be6DA2465Aab4E2
35+
source_smt: 0xc1534912902BBe8C54626e2D69288C76a843bc0E
36+
root_prefix: Rarimo root
37+
1738
listener:
1839
addr: :8000
1940

0 commit comments

Comments
 (0)