Struggling following some of the tutorials

I want to build something will Nimiq and was trying to learn about implementing it and a few issues appeared:

The test accounts have balance zero: Does this prevent a test transaction occurring?

The examples in the tutorials don’t seem to work. For example:

It creates a node, wallet, establishes consensus,

Then Reports height, balance (zero NIM) over and over between errors reporting the socket dropping connections (expected behaviour).

When I try to place a transaction against another test wallet, nothing appears and nothing happens. Beyond “Nimiq.Client.TransactionState.PENDING” onTransaction() doesn’t report anything in any reasonable amount of time.

I put together an example here to better fiddle with the code:

In testing out the in browser miner over night I got precisely zero luna, this seems inordinately expensive.

1 Like

Have you tried running your code directly in the browser without codepen? I just tested codepen and it does not seem to support websockets. I tested your code and it worked fine for me when I ran it directly in Firefox. How? I placed all your code into a single HTML file, opened it, then sent some nim to the generated address (using After the transaction was complete I was able to send nim using your code.

1 Like

Yes I tried it in a web app, I’ll try building as you say though to see if it works. I’ll report back in a few days

Hi! As faberto said, you should make a testnet account in the testnet wallet that he linked. After you created your account, it will offer you to get 4000 test NIM from the faucet. You can then send this NIM to the address in your code wallet.

Transactions only work with NIM, zero balance cannot send anything.

1 Like

I tried creating another account on testnet, through the link and it has zero balance.

Here you can see the process I followed to create a test account:

Creating the Account is not supposed to give you any balance. There is a “bot” where you can request some NIM: