clockworklabs / spacetime-docs

Apache License 2.0
6 stars 11 forks source link

Two important things should be changed in the Rust docs #41

Open xNul opened 6 months ago

xNul commented 6 months ago

First, the command to send a message located here does not work correctly (at least on Windows). With single quotes, the text sent to the database is 'Hello,. In order to send the whole Hello, World! message, you have to use double quotes. The whole command should be spacetime call <module-name> send_message "Hello, World!".

Second, using spacetime start is never mentioned as a prerequisite. If you follow the guide without doing that, you get this error message:

>spacetime publish --project-path server quickstart-chat-module
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
checking crate with spacetimedb's clippy configuration
    Checking quickstart-chat-module v0.1.0
    Finished release [optimized] target(s) in 0.19s
    Finished release [optimized] target(s) in 0.08s
Optimising module with wasm-opt...
Uploading to local => http://127.0.0.1:3000
Error: error sending request for url (http://127.0.0.1:3000/identity): error trying to connect: tcp connect error: No connection could be made because the target machine actively refused it. (os error 10061)

Caused by:
    0: error trying to connect: tcp connect error: No connection could be made because the target machine actively refused it. (os error 10061)
    1: tcp connect error: No connection could be made because the target machine actively refused it. (os error 10061)
    2: No connection could be made because the target machine actively refused it. (os error 10061)

which is unclear as well. It would be good to have a check before the spacetime CLI tries to connect to the database to determine if it is up in the first place.