2024-03-22 19:01:22 +01:00
|
|
|
# Fluffy
|
|
|
|
# Copyright (c) 2024 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
{.push raises: [].}
|
|
|
|
|
2024-07-02 11:24:41 +02:00
|
|
|
import chronicles, ./[portal_bridge_conf, portal_bridge_common]
|
2024-03-22 19:01:22 +01:00
|
|
|
|
|
|
|
proc runState*(config: PortalBridgeConf) =
|
|
|
|
let
|
2024-07-02 11:24:41 +02:00
|
|
|
portalClient = newRpcClientConnect(config.portalRpcUrl)
|
|
|
|
web3Client = newRpcClientConnect(config.web3Url)
|
2024-03-22 19:01:22 +01:00
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# Here we'd want to implement initially a loop that backfills the state
|
|
|
|
# content. Secondly, a loop that follows the head and injects the latest
|
|
|
|
# state changes too.
|
|
|
|
#
|
|
|
|
# The first step would probably be the easier one to start with, as one
|
|
|
|
# can start from genesis state.
|
|
|
|
# It could be implemented by using the `exp_getProofsByBlockNumber` JSON-RPC
|
|
|
|
# method from nimbus-eth1.
|
|
|
|
# It could also be implemented by having the whole state execution happening
|
|
|
|
# inside the bridge, and getting the blocks from era1 files.
|
|
|
|
notice "State bridge functionality not yet implemented"
|
|
|
|
quit QuitSuccess
|