Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a 'Demo Net' for stable place to run jobs #430

Open
walkerlj0 opened this issue Nov 8, 2024 · 9 comments
Open

Create a 'Demo Net' for stable place to run jobs #430

walkerlj0 opened this issue Nov 8, 2024 · 9 comments

Comments

@walkerlj0
Copy link
Contributor

walkerlj0 commented Nov 8, 2024

General Description

We need to spin up a third 'demo net' (outside of regular and testnet) with a few select, stable RPs so JCs can run jobs on our network while we fix scaling issues on our mainnet

Which system(s) or functionality does this affect

solver, job-creation, executor, mediation, protocol-smart-contracts, apis, cron-server, , infrastructure-devops

Describe the changes, and how this affects/ interacts with each system.

To-Dos

-[] Thing

@walkerlj0
Copy link
Contributor Author

@noryev I created this initially - can you fill in a few details and a better effort estimate?

Also - will you be doing it this sprint, or do you have work to do still on devnet?

@bgins
Copy link
Contributor

bgins commented Nov 8, 2024

Writing up some details about configuration changes that will be required.

Embedded configs

We currently have config files for dev, devnet, and testnet: https://github.com/Lilypad-Tech/lilypad/tree/main/pkg/options/configs

The configs are in an embedded filesystem. We check if attempt to load the config file by name:

path := fmt.Sprintf("configs/%s.toml", network)
config_toml, err := fs.ReadFile(path)
if err != nil {
return nil, fmt.Errorf("network %s does not exist", network)
}

Adding a demonet config should be as simple as adding a demonet.toml config alongisde the existing config files.

Services will be run with the --network demonet option.

Configuration

Our testnet config looks like this:

[services]
solver = "0xe05e1b71955da4934938a6b16f97e1db9de6b764"
mediator = ["0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2"]
api_host = "https://api-testnet.lilypad.tech/"

[web3]
rpc_url = "wss://arbitrum-sepolia-rpc.publicnode.com,wss://rpc.ankr.com/arbitrum_sepolia,wss://arbitrum-sepolia.drpc.org/,wss://testnet-rpc.etherspot.io/v1/421614,wss://endpoints.omniatech.io/v1/arbitrum/sepolia/public"
chain_id = 421614
controller_address = "0x4a83270045FB4BCd1bdFe1bD6B00762A9D8bbF4E"
payments_address = "0xdE7CEa09A23e7Aa4980B95F69B8912F39A0e323A"
storage_address = "0x8d06cEB457d336c6c938FCe9C4862615a4F79af0"
users_address = "0x90ed1AC9c74B9340468134F8c669BA1169A11c58"
token_address = "0x0352485f8a3cB6d305875FaC0C40ef01e0C06535"
mediation_address = "0xD1377D4617CD634426A8b595507fd2045A2DFB03"
jobcreator_address = "0xDBA89e33EFE2eD227c04CB31356EFdE618d4953F"
pow_address = "0x8B852BA45293d6dd51B10c57625C6c5f25ADFB40"

[ipfs]
addr = "/ip4/127.0.0.1/tcp/5001"

[telemetry]
url = "https://observe.lilypad.tech"
token = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJ1c2VyIjoicmVzb3VyY2UtcHJvdmlkZXIifQ.n36M_ngwC4XPQ_pEkkWAnPiOinnx6-0VO1v_WgCTUEERD7b_p9KHCU6SY5bUdFh5UXRZHAhc1gfyc7rjAnmeDQ"

We can adapt this config file for demonet as follows.

The solver and mediator services should be updated with appropriate wallet addresses based on our deployment.

The api_host can be set to "" (empty string) because we don't need to collect metrics, and it removes an external dependency that could impact reliability.

The web3 section can be filled out with appropriate contract rpc_url, chain_id and contract addresses.

The ipfs section only matters for resource providers and can be left unchanged.

The telemetry section can be left unchanged. Contacting the observability server is another external dependency that we may want to remove, but the telemetry might be nice to track successful and failed job runs. If we don't want it, we can disable it with the --disable-telemetry option when starting services.

Debugging configs

It can sometimes be helpful to print the config to make sure it is loading properly. The can be done immediately after processing options. For example, in the solver:

network, _ := cmd.Flags().GetString("network")
options, err := optionsfactory.ProcessSolverOptions(options, network)
if err != nil {
return err
}

We can temporarily add a fmt.Printf("Options: %+v", options) line in between lines 24 and 25.

@walkerlj0
Copy link
Contributor Author

walkerlj0 commented Nov 8, 2024

No need to set up API Server, Cron server, or Job Creator or do anything for telemetry (up to you, can run services with --disable-telemetry)

@noryev
Copy link
Contributor

noryev commented Nov 12, 2024

Now that Devnet is up, I am starting the deployment of this. Awesome data @bgins saved me a ton of time!

@noryev
Copy link
Contributor

noryev commented Nov 12, 2024

Was there a specific URL we wanted to use for this? currently I am testing using my own(hawat.tech) @bgins

@bgins
Copy link
Contributor

bgins commented Nov 12, 2024

Was there a specific URL we wanted to use for this? currently I am testing using my own(hawat.tech) @bgins

For the solver? Depends on where and how we are running it, but could use a Cloudflare tunnel similar to what we do for testnet and devnet. Following our existing pattern, maybe solver-demonet.lilypad.tech.

@noryev
Copy link
Contributor

noryev commented Nov 15, 2024

  • Startup the chain
  • Configure the external routing via Unifi
  • Get the observability and api running(get rid of the errors)
  • Make sure the chain is accessible from the WAN
  • Get a Resource Provider Running
  • Configure a CLI with the correct demonet.toml file
  • Push the Demonet config to Lilypad/Main
  • Configure Cloudflare tunnels?
  • Configure the Cloudflare with lilypad demonet URL

When starting up the chain, to make the chain accessible, I needed to use this start command to make sure the chain is able to accept connections outside of my local network: vhosts needed to be changed from vhost=localhost to *

First thing, gsetup cloudflare tunnel- so that way I can make sure everythings accessible.

notes-demonet.png

notes-demonet.png

@noryev
Copy link
Contributor

noryev commented Nov 15, 2024

After getting into this more, per James recommendations, I am going to switch from this current setup and move to a setup similar to our Devnet setup found within our Github Workflows.

@noryev
Copy link
Contributor

noryev commented Nov 18, 2024

DEMONET DEPLOYMENT

  • get EC2 Server setup
  • configure security groups and networking
  • install dependencies on EC2 Server
  • login to cloudflare and setup new cloudflare tunnel
  • get cloudflare CNAMES setup for
    demonet-chain-http.lilypad.tech
    demonet-chain-ws.lilypad.tech
  • Pull down the most recent branch of logans demonet branch of lilypad
  • make sure when running up the chain you add this into the chain section of the stack file for the chain

--http.vhosts="localhost,127.0.0.1,demonet-chain-http.lilypad.tech,*" \

  • ./stack chain (this will use my edits to activate a chain with a chainID of 412347)

  • Setup your metamask: https://demonet-chain-http.lilypad.tech

  • Run ./stack chain-boot

  • Setup a wallet for a RP and CLI user (send funds/import wallets)

  • Install go

  • Turn on the solver using ./stack solver

  • Turn on the job-creator using ./stack job-creator --demonet

  • Activate a Resource Provider

  • Pull down the new demonet Lilypad branch

  • Run ./stack resource-provider --demonet --offer-gpu 1

  • Setup CLI Wallet with funds and run lilypad run .... -n demonet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants