Arch-Network / public-issues

0 stars 0 forks source link

Deploying demo takes 8 hours / validator image 'vanished' / warnings on build #2

Closed bdunbar closed 43 minutes ago

bdunbar commented 2 days ago

[Subject of the issue]

Deploying demo application takes eight hours / warnings issued on cargo install / validator not present

Description

a) Initial complaint was the deploy took 8 hours. Retracing my steps I'm seeing b) warnings issued on cargo install and c) the validator docker image is no longer present locally.

Describe your issue in as much detail as possible here

a) 8 hours - https://gist.github.com/bdunbar/d94ed578e9a30e76b64bb32e33407fa8

b) warnings on cargo install - here https://gist.github.com/bdunbar/f4d44dc7588ef38b9992ccf8d702dbf9

c) this is honestly the weirdest one - I don't think I deleted the docker container yet it's no longer present.

~ $ arch-cli validator start Welcome to the Arch Network CLI Loading config for network: development → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml ✓ Loaded network-specific configuration for development Starting the local validator... Error: Bitcoin RPC endpoint should not contain protocol (http://) or path. Expected format: domain ~ $ arch-cli validator stop Welcome to the Arch Network CLI Loading config for network: development → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml ✓ Loaded network-specific configuration for development Stopping and removing the local validator... ⚠ Warning: Failed to stop the local validator: Error response from daemon: No such container: local_validator

Error: Failed to remove the local validator container: Error response from daemon: No such container: local_validator

~ $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES db31107dd9df lscr.io/linuxserver/webtop:ubuntu-xfce "/init" 2 months ago Exited (0) 2 months ago webtop 42b0251e9e47 linux-workspace "/usr/sbin/sshd -D" 2 months ago Exited (0) 2 months ago inspiring_chandrasekhar 2ec6577122ed linux-workspace "/usr/sbin/sshd -D" 2 months ago Exited (0) 2 months ago stupefied_thompson a5cbabf57450 c399c9db4a79 "/bin/bash" 8 months ago Exited (1) 8 months ago grist2 6d22236ae2b7 c399c9db4a79 "/bin/bash" 8 months ago Exited (0) 8 months ago grist 571038f4ad2d sheoran/webcash:latest "bash -c 'tail -F we…" 2 years ago Exited (255) 9 months ago webminer_wallet_poller 8ed7f283be43 sheoran/webcash:latest "bash -c '/usr/bin/w…" 2 years ago Exited (255) 9 months ago webminer ~ $

Steps to reproduce

See shared gists

Logs

That is a great question: where are the logs?

bdunbar commented 2 days ago

Jon, in Discord channel 'dev chat' asked me to do the following. I believe the error is due to the validator docker image 'vanishing'. As stated above, I have no clear idea how that could have happened - I don't believe I was mucking around with docker at all while doing this. If there is a manual step to setting up the validator, that might be helpful.

~ $ arch-cli project create --name hw Welcome to the Arch Network CLI Loading config for network: development → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml ✓ Loaded network-specific configuration for development Creating a new project... ✓ Updated configuration with project directory ✓ Created project directory at "/Users/bdunbar/Documents/ArchNetwork/hw" Creating Vite application... ✓ Created Vite application ✓ Installed base dependencies ✓ Installed additional packages New project created successfully! 🎉 ℹ Project location: "/Users/bdunbar/Documents/ArchNetwork/hw"

Next steps:

  1. Navigate to /Users/bdunbar/Documents/ArchNetwork/hw/app/program to find the Rust program template
  2. Edit the source code to implement your program logic
  3. When ready, run arch-cli deploy to compile and deploy your program to the network

Need help? Check out our documentation at https://arch-network.github.io/docs/ ~ $ ~ $ ~ $ ~ $ arch-cli deploy Welcome to the Arch Network CLI Loading config for network: development → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml ✓ Loaded network-specific configuration for development Deploying your Arch Network app... Available folders to deploy:

  1. demo
  2. hw Enter the number of the folder you want to deploy (or 'q' to quit): 2 Deploying from folder: "/Users/bdunbar/Documents/ArchNetwork/hw" ℹ Building program... ℹ Cargo.toml found at: /Users/bdunbar/Documents/ArchNetwork/hw ℹ Current working directory: /Users/bdunbar/Documents/ArchNetwork/hw ✓ Program built successfully Select a key to use as the program key: Create a new key Enter a name for the new key: bdunbar-1 ✓ Created and saved new key 'bdunbar-1' ℹ Program ID: 7505457d28be3a5f36a88aaa0b4d1245a1f2b7fcc246b306ebb259f0c4afbbf7 Wallet RPC URI: http://bitcoin-node.dev.aws.archnetwork.xyz:18443/wallet/testwallet Client connected: 23a045831a18382a06f3969ead329b387ac6d9ec4e02fc1933c9107c9866dc14 ✓ Wallet 'testwallet' is already loaded. thread 'tokio-runtime-worker' panicked at templates/demo/common/src/helper.rs:101:9: post method should not fail: reqwest::Error { kind: Request, url: "http://127.0.0.1:9002/", source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })) } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: task 13 panicked with message "post method should not fail: reqwest::Error { kind: Request, url: \"http://127.0.0.1:9002/\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 61, kind: ConnectionRefused, message: \"Connection refused\" })) }" ~ $
hoffmabc commented 2 days ago

In c) it looks like it didn't start properly which is why it wouldn't exist yet.

c) this is honestly the weirdest one - I don't think I deleted the docker container yet it's no longer present.

~ $ arch-cli validator start
Welcome to the Arch Network CLI
Loading config for network: development
→ Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml
✓ Loaded network-specific configuration for development
Starting the local validator...
**_Error: Bitcoin RPC endpoint should not contain protocol (http://) or path. Expected format: domain_**
~ $ arch-cli validator stop
Welcome to the Arch Network CLI
Loading config for network: development
→ Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml
✓ Loaded network-specific configuration for development
Stopping and removing the local validator...
⚠ Warning: Failed to stop the local validator: Error response from daemon: No such container: local_validator

Error: Failed to remove the local validator container: Error response from daemon: No such container: local_validator

Try

rm -rf /Users/bdunbar/Library/Application Support/arch-cli

and then: arch-cli init and make sure in the /Users/bdunbar/Library/Application Support/arch-cli/config.toml that your Bitcoin RPC URL does not have a protocol in front of the server name (http://).

bdunbar commented 2 days ago
rm -rf /Users/bdunbar/Library/Application Support/arch-cli
arch-cli init

removed http from line 12 of /Users/bdunbar/Library/Application\ Support/arch-cli/config.tomlto make it leader_rpc_endpoint = "host.docker.internal:9002"

et voila

 ~/Documents  $ arch-cli validator start
Welcome to the Arch Network CLI
Loading config for network: development
  → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml
  ✓ Loaded network-specific configuration for development
Starting the local validator...
Local validator started successfully!
 ~/Documents  $ docker ps -a
CONTAINER ID   IMAGE                                         COMMAND                  CREATED              STATUS                      PORTS                               NAMES
6448a4dd3ddb   ghcr.io/arch-network/local_validator:latest   "tini -- /usr/bin/lo…"   About a minute ago   Up About a minute           0.0.0.0:9002->9002/tcp, 29002/tcp   local_validator
db31107dd9df   lscr.io/linuxserver/webtop:ubuntu-xfce        "/init"                  2 months ago         Exited (0) 2 months ago                                         webtop
42b0251e9e47   linux-workspace                               "/usr/sbin/sshd -D"      2 months ago         Exited (0) 2 months ago                                         inspiring_chandrasekhar
2ec6577122ed   linux-workspace                               "/usr/sbin/sshd -D"      2 months ago         Exited (0) 2 months ago                                         stupefied_thompson
a5cbabf57450   c399c9db4a79                                  "/bin/bash"              8 months ago         Exited (1) 8 months ago                                         grist2
6d22236ae2b7   c399c9db4a79                                  "/bin/bash"              8 months ago         Exited (0) 8 months ago                                         grist
571038f4ad2d   sheoran/webcash:latest                        "bash -c 'tail -F we…"   2 years ago          Exited (255) 9 months ago                                       webminer_wallet_poller
8ed7f283be43   sheoran/webcash:latest                        "bash -c '/usr/bin/w…"   2 years ago          Exited (255) 9 months ago                                       webminer
 ~/Documents  $ 

And then ...

~  $ arch-cli project create --name hw2
Welcome to the Arch Network CLI
Loading config for network: development
  → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml
  ✓ Loaded network-specific configuration for development
Creating a new project...
  ✓ Updated configuration with project directory
  ✓ Created project directory at "/Users/bdunbar/Documents/ArchNetwork/hw2"
Creating Vite application...
  ✓ Created Vite application
  ✓ Installed base dependencies
  ✓ Installed additional packages
New project created successfully! 🎉
  ℹ Project location: "/Users/bdunbar/Documents/ArchNetwork/hw2"

Next steps:
  1. Navigate to /Users/bdunbar/Documents/ArchNetwork/hw2/app/program to find the Rust program template
  2. Edit the source code to implement your program logic
  3. When ready, run arch-cli deploy to compile and deploy your program to the network

Need help? Check out our documentation at https://arch-network.github.io/docs/
 ~  $ arch-cli deploy                   
Welcome to the Arch Network CLI
Loading config for network: development
  → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml
  ✓ Loaded network-specific configuration for development
Deploying your Arch Network app...
Available folders to deploy:
  1. hw2
  2. demo
  3. hw
Enter the number of the folder you want to deploy (or 'q' to quit): 1
Deploying from folder: "/Users/bdunbar/Documents/ArchNetwork/hw2"
  ℹ Building program...
  ℹ Cargo.toml found at: /Users/bdunbar/Documents/ArchNetwork/hw2
  ℹ Current working directory: /Users/bdunbar/Documents/ArchNetwork/hw2
  ✓ Program built successfully
No existing keys found or keys.json is empty.
Do you want to create a new key? yes
Enter a name for the new key: hw2
New key created and saved as 'hw2'
  ℹ Program ID: 8264442a42764a9d1bf8769b9d1241a9fa1dd9c9edde6fefaf42d7c0bdbf0eda
Wallet RPC URI: bitcoin-node.dev.aws.archnetwork.xyz:18443/wallet/testwallet
Client connected: 23a045831a18382a06f3969ead329b387ac6d9ec4e02fc1933c9107c9866dc14
  ✓ Wallet 'testwallet' is already loaded.
  ✓ Transaction sent: 5292b1fa745a206fccfb5bed5194704fec8384a942a8fedfdef1713e90009f53
  ✓ Transaction confirmed with 1 confirmations
    Creating program account...
    Program account created successfully
    Deploying program transactions...
 [00:00:01] Successfully Processed Deployment Transactions : [####################################################################################################] 10/10 (0s)    Program transactions deployed successfully
    Making program executable...
    Transaction sent: f7c74007737e8d8a4ae7f7f3febc2bd726105dced3d1f4a865c0163704e15549
    Program made executable successfully
  ✓ Program deployed successfully
  ✓ Wallet 'testwallet' unloaded successfully.
Your app has been deployed successfully!
  ℹ Program ID: 8264442a42764a9d1bf8769b9d1241a9fa1dd9c9edde6fefaf42d7c0bdbf0eda
 ~  $
waymobetta commented 2 days ago

@bdunbar Looks like it's resolved based on your fix to pull the new docker image.

If there is a manual step to setting up the validator, that might be helpful.

^ We will be implementing this shortly in order to get away from using Docker (as much as possible).

In the meantime, you can try the following:

Download the latest local validator release from arch-node/releases and choose the specific asset you need based on your OS/arch (ie, local_validator-*).

After downloading the binary, be sure to also download the system_program.so and store it in a new child directory called /ebpf within the parent directory of where there validator binary lives and will be invoked. See screenshot below.

Screenshot 2024-11-11 at 10 55 31 AM

You can then invoke the local validator with the following command:

rm -rf .arch_data && RUST_LOG=info local-validator --rpc-bind-ip 127.0.0.1 --rpc-bind-port 9002 --bitcoin-rpc-endpoint bitcoin-node.dev.aws.archnetwork.xyz --bitcoin-rpc-port 18443 --bitcoin-rpc-username bitcoin --bitcoin-rpc-password 428bae8f3c94f8c39c50757fc89c39bc7e6ebc70ebf8f618

You will notice that the above command references the same information found in the arch-cli development config.

bdunbar commented 1 day ago

Perhaps it's working, now.

I edited lib.rs line 34 to include a '_' before program_id - it compiled ok. Then deployed as expected;

warning: unused variable: program_id --> src/lib.rs:34:5 34 program_id: &Pubkey, ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _program_id

= note: #[warn(unused_variables)] on by default

warning: arch-network-app (lib) generated 1 warning (run cargo fix --lib -p arch-network-app to apply 1 suggestion) Finished release [optimized] target(s) in 38.16s .../app/program/src $ emacsclient lib.rs Waiting for Emacs... .../app/program/src $ emacsclient lib.rs Waiting for Emacs... .../app/program/src $ cargo-build-sbf
Compiling arch-network-app v0.1.0 (/Users/bdunbar/Documents/ArchNetwork/demo/app/program) Finished release [optimized] target(s) in 1.57s .../app/program/src $ arch-cli deploy Welcome to the Arch Network CLI Loading config for network: development → Loading configuration from /Users/bdunbar/Library/Application Support/arch-cli/config.toml ✓ Loaded network-specific configuration for development Deploying your Arch Network app... Available folders to deploy:

  1. hw2
  2. demo
  3. hw Enter the number of the folder you want to deploy (or 'q' to quit): 2 Deploying from folder: "/Users/bdunbar/Documents/ArchNetwork/demo" ℹ Building program... ℹ Cargo.toml found at: /Users/bdunbar/Documents/ArchNetwork/demo ℹ Current working directory: /Users/bdunbar/Documents/ArchNetwork/demo ✓ Program built successfully Select a key to use as the program key: Create a new key Enter a name for the new key: demo ✓ Created and saved new key 'demo' ℹ Program ID: 13e66079a683e2897bf970f83bb1bc13051bee4e8ed10eeeff673a5332911e9b Wallet RPC URI: bitcoin-node.dev.aws.archnetwork.xyz:18443/wallet/testwallet Client connected: 267532b5f5f773edbbfec08a31a843bcc42b98105cfdaef62188b5008049af5e ✓ Wallet 'testwallet' is already loaded. ✓ Transaction sent: 931e318b6ce1a6b74f8552174023462ee7bca268702dede9e22a43bcebafa28f ✓ Transaction confirmed with 1 confirmations Creating program account... Program account created successfully Deploying program transactions... [00:00:01] Successfully Processed Deployment Transactions : [####################################################################################################] 17/17 (0s) Program transactions deployed successfully Making program executable... Transaction sent: 6c155ae03782c08d897050f3d2c5b53987ac2c0b02415b3771abe41a9459930d Program made executable successfully ✓ Program deployed successfully ✓ Wallet 'testwallet' unloaded successfully. Your app has been deployed successfully! ℹ Program ID: 13e66079a683e2897bf970f83bb1bc13051bee4e8ed10eeeff673a5332911e9b .../app/program/src $
bdunbar commented 1 day ago

Update

arch-cli account create --name graffiti --program-id redacted
arch-cli demo start

After a short churn it opens a new tab in my browser 'Graffiti Wall'. It does say, below the bits tell me to 'add to wall' and 'wall messages' 'Program Error - Failed to fetch wall data: Offset is outside the bounds of the DataView'

I don't consider this last an actual issue - it would be nice to have it fully work, but as is it's sufficient to demo the concepts.

waymobetta commented 43 minutes ago

@bdunbar I was able to reproduce and that error is no cause for concern since it's checking to see if data has been posted to the wall and will complain if there is none. Once you tag the wall and refresh you will find that the error message vanishes.

Let us know if you have any other questions, otherwise we'll close this as resolved.