<p>Can you post the exact error code that spits out? By the way, for my docker container I had to change:</p>
<blockquote>
<p>export WALLET_ID_1=<code>curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'</code></p>
</blockquote>
<p>to</p>
<blockquote>
<p>export WALLET_ID_1=<code>curl -s -d '' http://172.17.0.2:9080/wallet/create | jq '.wiWallet.getWalletId'</code></p>
</blockquote>
<p>If you go to your command prompt, get your container ID through &quot;docker ps&quot;. Then run &quot;docker inspect CONTAINERID&quot; (replace CONTAINERID with yours). Then scroll to the bottom to get your host IP for your container. Mine was 172.17.0.2, yours might be different. I don't know if this has any impact to you, but I needed to do this to get mine to work.</p>

CC BY-SA 4.0
2021-09-19T22:34:43.377Z
The issue that you are having is a networking / bridging issue related to docker. This is not specific to plutus.
Matthias Sieber
CC BY-SA 4.0
2021-09-19T18:38:53.450Z
2021-09-19T18:38:53.450Z
projection-error
<p>Version 1.0.9 introduced a new way of creating (and activating wallets). Your code snippet shows the way how to create wallets with version 1.0.9.</p>
<p>Previously, you would not rely on manually creating wallets, but instead just pass a number into the activate endpoint for the respective contract:</p>
<pre><code>curl -s -H &quot;Content-Type: application/json&quot; \
  --request POST \
  --data '{&quot;caID&quot;: &quot;GameContract&quot;, &quot;caWallet&quot;:{&quot;getWallet&quot;: 1}}' \
  http://localhost:9080/api/contract/activate | jq
</code></pre>
<p>In version 1.0.9, you use the <code>getWalletID</code> from your requests to the wallet create endpoint to activate the given contract (e.g. GameContract that is shipped with the plutus-starter):</p>
<pre><code>curl -s -H &quot;Content-Type: application/json&quot; \
  --request POST \
  --data '{&quot;caID&quot;: &quot;GameContract&quot;, &quot;caWallet&quot;:{&quot;getWalletId&quot;: '$WALLET_ID_1'}}' \
  http://localhost:9080/api/contract/activate | jq
</code></pre>
<p>Looking at the plutus repo, it appears that the Wallet API has gone through some significant changes. Could it be that your JSON Object did not have the wiWallet.getWalletID but wiWallet.getWallet key? If that's the case, then the jq tool would grab a non-existent key from the JSON object, thus returning null. This would happen if you still have an older plutus version installed while trying to follow the directions that apply to the newer API.</p>
<p>The reason I'm suggesting this as a possibility is this commit: <a href="https://github.com/input-output-hk/plutus/commit/58c8b4bde7177a18cd6761ba328bc105e5c82a47#diff-c00cadb75428bc7238834d185e1e7e63dde8e3d1313b34e6a046f623abb78322" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus/commit/58c8b4bde7177a18cd6761ba328bc105e5c82a47#diff-c00cadb75428bc7238834d185e1e7e63dde8e3d1313b34e6a046f623abb78322</a></p>
<p>Solution: Update your local plutus library so it matches the docs.</p>

CC BY-SA 4.0
2021-09-19T17:11:53.043Z
2021-09-19T17:11:53.043Z
Matthias Sieber
<p>Having trouble with with the plutus-starter template. The following return null after starting the <code>pab</code>:</p>
<pre><code>export WALLET_ID_1=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'`
export WALLET_ID_2=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'`
</code></pre>
<p>However; if I remove the <code>| jq '.wiWallet.getWalletID'</code> I do get the json returned from create.
Any ideas?</p>

CC BY-SA 4.0
2021-09-19T09:41:49.297Z
Refreshed from starter repo and it is now working
Frank C.
<plutus>
Right way to get the Wallet ID when creating?
# Right way to get the Wallet ID when creating?

(Asked by: username_0 on 2021-09-19)

Having trouble with with the plutus-starter template. The following return null after starting the pab:
export WALLET_ID_1=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'`
export WALLET_ID_2=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'`

However; if I remove the | jq '.wiWallet.getWalletID' I do get the json returned from create.
Any ideas?

**Tags:** plutus
> **Comments:**
> **username_0**: Refreshed from starter repo and it is now working  

---

## 2 answers

### Answer by username_1 on 2021-09-19. Score: 0

Can you post the exact error code that spits out? By the way, for my docker container I had to change:

> export WALLET\_ID\_1=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet.getWalletId'`

to

> export WALLET\_ID\_1=`curl -s -d '' http://172.17.0.2:9080/wallet/create | jq '.wiWallet.getWalletId'`

If you go to your command prompt, get your container ID through "docker ps". Then run "docker inspect CONTAINERID" (replace CONTAINERID with yours). Then scroll to the bottom to get your host IP for your container. Mine was 172.17.0.2, yours might be different. I don't know if this has any impact to you, but I needed to do this to get mine to work.

> **Comments:**
> **username_2**: The issue that you are having is a networking / bridging issue related to docker. This is not specific to plutus.  

---

### Answer by username_2 on 2021-09-19. Score: 0

Version 1.0.9 introduced a new way of creating (and activating wallets). Your code snippet shows the way how to create wallets with version 1.0.9.
Previously, you would not rely on manually creating wallets, but instead just pass a number into the activate endpoint for the respective contract:
curl -s -H "Content-Type: application/json" \
  --request POST \
  --data '{"caID": "GameContract", "caWallet":{"getWallet": 1}}' \
  http://localhost:9080/api/contract/activate | jq

In version 1.0.9, you use the getWalletID from your requests to the wallet create endpoint to activate the given contract (e.g. GameContract that is shipped with the plutus-starter):
curl -s -H "Content-Type: application/json" \
  --request POST \
  --data '{"caID": "GameContract", "caWallet":{"getWalletId": '$WALLET_ID_1'}}' \
  http://localhost:9080/api/contract/activate | jq

Looking at the plutus repo, it appears that the Wallet API has gone through some significant changes. Could it be that your JSON Object did not have the wiWallet.getWalletID but wiWallet.getWallet key? If that's the case, then the jq tool would grab a non-existent key from the JSON object, thus returning null. This would happen if you still have an older plutus version installed while trying to follow the directions that apply to the newer API.
The reason I'm suggesting this as a possibility is this commit: https://github.com/input-output-hk/plutus/commit/58c8b4bde7177a18cd6761ba328bc105e5c82a47#diff-c00cadb75428bc7238834d185e1e7e63dde8e3d1313b34e6a046f623abb78322
Solution: Update your local plutus library so it matches the docs.


---

