EPF4: UPDATE 6
Got very busy with my other project this week, but i was able to dig into ephemery native retention scripts and understand how ephemery reset works manually and rewrote it in typescript. Typescript is the language of choice for Lodestar.
I have written the purpose of this experimental code here, so i will just jump into my own impression of how to modify it within Lodestar here:
notes
- most of the constants and modules here are already present in lodestar, which is a good thing. i still want to know how directories are created though!
START CLIENTS
notes
- this is not really neccessary, in the sense that lodestar with ephemery currently starts with
./lodestar beacon --network ephemery
. however this is done manually from the terminal by the user.
- is there any implementation code in lodestar in which the client is restarted after a process? If yes, it can be repurposed here.
STOP CLIENTS
notes:
- same as above.
- stopping the client is probably not semantically correct because the client will still be implementing the following processes below after it has 'stopped'
- what's being stopped actually are the transactions :).
CLEAR DIRECTORIES
notes
- this refers to the management of the directories automatically created in
.ethereum
. the directory being cleared here is lodestar's which will contain beacon configurations(?) and validator list(?).
- something worth noting here is that the consensus client directories are not recreated as they are done in the original retention scripts for the execution client. i think this is so because once the client is restarted again after the reset, lodestar will reinitialize this directory automatically?
- this process is indicated in the
setupGenesis
function below:
SETUP GENESIS
notes
- this function initializes lodestar while creating the neccessary directories.
- however, in the original retention scripts there is no genesis setup function for the consensus clients, i wonder why it's not available ?
- is it because it's already created by the execution client?
- this function also indicates that the ephemery directory(
testnetDir
) will be within lodestar's directory(clDataDir
)
GET GITHUB RELEASE
notes
- this is basically grabbing the latest release of ephemery (i need to confirm it this is already being done automatically on lodestar)
DOWNLOAD GENESIS RELEASE
notes:
- if there is a new github release, this function downloads it. more file management here; this release will be downloaded into the
.ethereum
folder as well.
- lodestar like every other client after initialization has files within the
.ethereum
. so i suspect something similar to this will be available already.
RESET TESTNET
notes
- this function encompasses all the previous functions and implements them sequentially one after the other.
- (i think) most of these functions already exist in some form on lodestar and i will just need to modify them as neccessary.
- thus, this function will likely end up importing them into the ephemery package within lodestar where the reset can happen.
CHECK TESTNET
notes
- this function does the same thing as the previous in that it will be importing the previous functions (including the reset function).
- this function is checking if it's time to reset the testnet so as to proceed towards downloading a new genesis.
MAIN
notes
- this function will end up being an index file in keeping with lodestar best practice of setting up files in directories using typescript.
- this suggests that the code files within ephemery/reset directory will look somewhat like this:
checktestnet.ts
reset.ts
index.ts
Where the index.ts
imports all the aforementioned functions to implement ephemery reset automatically.