A bit of help getting started would be appreciated. I've installed Docker, Sandbox, and VSCode; now what?

I’m on the “Your First Transaction” page for Java. I’ve seen the entire video a few times, and I’ve gotten as far as installing Docker, Sandbox, and VSCode, and even installing the “Extension Pack for Java.” But I’ve never used VSCode or Maven before (we’re an Eclipse shop and an SVN shop, and actually, I do most of my coding in terminal sessions on IBM Midrange boxes), and so there’s a big gap between where I am right now (looking at VSCode with no project), and the next step (“Install SDK for Runtime”) on the “Your First Transaction” page.

Can somebody give me a hand with this?

You can also use Eclipse instead of VSCode.
You don’t need Maven either, you can use any way you’d like to install Java packages.

However, Maven or Gradle is probably the simplest way to install packages.
I would strongly recommend you to get familiar with Maven (or Gradle) first, e.g., via Maven – Maven in 5 Minutes

If you want to go the VSCode route, there are many good tutorials:

You can also look at Using VS Code with Java | Algorand Developer Portal

Thanks.

I’m inclined to stick with the tools shown in the demo while I’m following along. There will be plenty of time to figure out how to do it in Eclipse.

The biggest single thing that has me stymied is that when I click “Create Java Project” in VSCode, and then select “Maven create from archetype” (which appears to be the obvious choice), I get five choices and a “More…” option, and no idea where to go from there.

You can systematically choose the first/default option for everything.
In particular, for the archetype maven-archetype-quickstart is good.

You will then need to add the algosdk dependency via Java project management in Visual Studio Code

Later you may want to modify your pom.xml to use a more recent version of java:

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
  </properties>

but this is not necessary.

Thanks. Sorry if I’m wearing my ignorance on my sleeve; I’ve always regarded “asking for help on boards and list-servers” as a perfectly legitimate research tool.

Another thing that has me scratching my head is the prerequisite of “Android minSdkVersion 16+” – where and how do I get it? Or does that get pulled in automatically (automagically?) when the Maven dependency pulls in the Algorand SDK?

I plugged the Algorand SDK lines into the POM file, and I created a file with the contents of the “Complete Example” box on the “Your First Transaction” page.

VSCode can’t find “org.json” to import “org.json.JSONObject.” Where do I tell it to go?

This is for Android. You don’t need it for non-Android.

You need to import it the same way you added the dependency to AlgoSDK above.

Hmm. Had to do a quick Google search to get the details, but an answered StackOverflow question turned up, giving me everything but the version, and directing me to the Maven Repository to find that. Ended up with

    <dependency>
       <groupId>org.json</groupId>
       <artifactId>json</artifactId>
       <version>20211205</version>
    </dependency>

which seems to have gotten rid of the problem lines (although it briefly gave me a lot more problem lines, because of a typo in the “artifactId” tags).

Thanks. Perhaps this afternoon, I can try following along with the video.

I have this dependency in my pom.xml. file

org.json json 20190722

I can now run the “Getting Started” demo, from the video, but I got very different results.

I put in all of the breakpoints from the video, and I followed along, including adding “Monopoly Algos” from the dispenser. The only differences are that (1) the video showed the dispenser issuing 10 Algos, whereas it only issued me 5, and (2) in addition to looking at the “algoexplorer.io” and “GoalSeeker” explorers, I also added the account created in the demo to an Algorand Wallet running on my Chromebook, and switching the wallet to TestNet.

Both explorers show my balance of 5 Algos. So does my Wallet. And my Sandbox was definitely launched on TestNet. And yet, this is what I get (redacted of course) from the Getting Started app:

My Address: <REDACTED>
My Passphrase: <REDACTED>
Navigate to this link and dispense:  https://dispenser.testnet.aws.algodev.network?account=<REDACTED>
PRESS ENTER KEY TO CONTINUE...

Account Balance: 0 microAlgos
Algorand suggested parameters: {
  "fee": 0,
  "genesis-id": "testnet-v1.0",
  "min-fee": 1000,
  "genesis-hash": "<REDACTED>",
  "last-round": 845473,
  "consensus-version": "https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0"
}
Signed transaction with txid: <REDACTED>
Exception when calling algod#transactionInformation: {"message":"TransactionPool.Remember: txn dead: round 857508 outside of 845473--846473"}

Note the balance of “0 microAlgos.” I suspected that something had gone wrong at that point, but continued, in order to see what would happen.

So what went wrong?

Your node is not synced.
Last round should match https://testnet.algoexplorer.io/ latest block.
There seems to be an issue with your sandbox syncing.

Apparently so. I’ve now created and funded another account (see my other thread about hooking this thing up to an existing account, so I’m not breeding accounts like gerbils), and got the exact same result.

Here is what I got when I launched sandbox today:

$ ./sandbox up testnet

Starting sandbox for: testnet
see sandbox.log for detailed progress, or use -v.
* started!

algod version
12885032963
3.2.3.stable [rel/stable] (commit #d2289a52)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand

Indexer version
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "cmd/algorand-indexer/algorand-indexer": stat cmd/algorand-indexer/algorand-indexer: no such file or directory: unknown

and this is what showed up in Docker:

time="2022-01-19T13:52:46-08:00" level=warning msg="The \"ALGOD_SHA\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"ALGOD_URL\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"ALGOD_BRANCH\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"NETWORK_BOOTSTRAP_URL\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"NETWORK_GENESIS_FILE\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"ALGOD_CHANNEL\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"INDEXER_DISABLED\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"INDEXER_URL\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"INDEXER_BRANCH\" variable is not set. Defaulting to a blank string."
time="2022-01-19T13:52:46-08:00" level=warning msg="The \"INDEXER_SHA\" variable is not set. Defaulting to a blank string."
algorand-sandbox-algod     | Algorand node successfully started!
algorand-sandbox-algod     | Algorand node successfully started!
algorand-sandbox-algod     | Algorand node successfully started!
algorand-sandbox-postgres  | 
algorand-sandbox-postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
algorand-sandbox-postgres  | 
algorand-sandbox-postgres  | 2022-01-18 21:53:08.825 UTC [1] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
algorand-sandbox-postgres  | 2022-01-18 21:53:08.825 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
algorand-sandbox-postgres  | 2022-01-18 21:53:08.825 UTC [1] LOG:  listening on IPv6 address "::", port 5432
algorand-sandbox-postgres  | 2022-01-18 21:53:08.911 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
algorand-sandbox-postgres  | 2022-01-18 21:53:08.996 UTC [13] LOG:  database system was shut down at 2022-01-15 00:53:02 UTC
algorand-sandbox-postgres  | 2022-01-18 21:53:09.636 UTC [1] LOG:  database system is ready to accept connections
algorand-sandbox-postgres  | 2022-01-18 22:45:23.034 UTC [71] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-18 23:15:24.536 UTC [101] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:07:26.795 UTC [153] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:13:27.741 UTC [159] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:14:27.261 UTC [17] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:14:38.248 UTC [160] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:16:27.375 UTC [162] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:38:28.564 UTC [17] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 00:38:39.326 UTC [184] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 01:00:29.578 UTC [206] LOG:  using stale statistics instead of current ones because stats collector is not responding
algorand-sandbox-postgres  | 2022-01-19 01:16:47.842 UTC [1] LOG:  received fast shutdown request
algorand-sandbox-postgres  | 2022-01-19 01:16:47.846 UTC [1] LOG:  aborting any active transactions
algorand-sandbox-postgres  | 2022-01-19 01:16:47.857 UTC [1] LOG:  background worker "logical replication launcher" (PID 19) exited with exit code 1
algorand-sandbox-postgres  | 2022-01-19 01:16:47.858 UTC [14] LOG:  shutting down
algorand-sandbox-postgres  | 
algorand-sandbox-postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
algorand-sandbox-postgres  | 
algorand-sandbox-postgres  | 2022-01-19 21:50:33.198 UTC [1] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
algorand-sandbox-postgres  | 2022-01-19 21:50:33.198 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
algorand-sandbox-postgres  | 2022-01-19 21:50:33.198 UTC [1] LOG:  listening on IPv6 address "::", port 5432
algorand-sandbox-postgres  | 2022-01-19 21:50:33.335 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
algorand-sandbox-postgres  | 2022-01-19 21:50:33.419 UTC [13] LOG:  database system shutdown was interrupted; last known up at 2022-01-19 01:16:47 UTC
algorand-sandbox-postgres  | 2022-01-19 21:50:44.702 UTC [13] LOG:  database system was not properly shut down; automatic recovery in progress
algorand-sandbox-postgres  | 2022-01-19 21:50:44.763 UTC [13] LOG:  redo starts at 0/15CFE50
algorand-sandbox-postgres  | 2022-01-19 21:50:44.763 UTC [13] LOG:  invalid record length at 0/15CFFB0: wanted 24, got 0
algorand-sandbox-postgres  | 2022-01-19 21:50:44.763 UTC [13] LOG:  redo done at 0/15CFF38
algorand-sandbox-postgres  | 2022-01-19 21:50:45.259 UTC [1] LOG:  database system is ready to accept connections
algorand-sandbox-indexer   | Starting server at port 8980
algorand-sandbox-indexer   | Response code (400)
algorand-sandbox-indexer   | message (Indexer disabled for this configuration.)
algorand-sandbox-indexer   | Starting server at port 8980
algorand-sandbox-indexer   | Response code (400)
algorand-sandbox-indexer   | message (Indexer disabled for this configuration.)

Does sandbox need to be reinitialized in some way? I remember seeing a lengthy catch-up process the first time I launched it, a few days ago, but not yesterday or today.

I started Docker first; then I launched Sandbox from a terminal session; then I launched VSCode, and then I started “Getting Started” (this time without the debugger, and this time without importing the newly-created account into my Wallet). Am I missing something?

UPDATE
I found the “Fast Catchup not working in Sandbox” thread on this forum, and saw a reference to “./sandbox goal version -v”; I tried it (once I realized “goal” was a subcommand of “sandbox,” and not a command in and of itself), and got

$ ./sandbox goal version -v
Version: [v1 v2] 
GenesisID: testnet-v1.0 
Build: 3.2.3.stable [rel/stable] (commit #d2289a52)

and then I found the “status” subcommand

$ ./sandbox status

algod - goal node status
Last committed block: 1025065
Time since last block: 0.0s
Sync Time: 2159.9s
Last consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Next consensus protocol: https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0
Round for next consensus protocol: 1025066
Next consensus protocol supported: true
Last Catchpoint: 
Genesis ID: testnet-v1.0
Genesis hash: <REDACTED>

indexer - health
Indexer disabled for this configuration.

UPDATE

I tried “./sandbox reset” and “./sandbox clean” among other things, and then, after the latter, did a “./sandbox up -v testnet” and still “no joy.”

Then I looked at the video again: In the video, “indexer - health” is immediately followed by “Indexer disabled for this configuration” and then “Starting fast-catchup . . . .”; when I run it, I get (as above):

OCI runtime exec failed: exec failed: container_linux.go:380: starting container
 process caused: exec: "cmd/algorand-indexer/algorand-indexer": stat cmd/algorand-indexer/algoran
d-indexer: no such file or directory: unknown

And yet, I distinctly recall seeing it behave like the video, the very first time I ran it.

continuing on Sandbox fails to complete initialization on testnet -- it doesn't even try to "fast-catchup." Can anybody help?