Please help me to deploy smart contract on testnet

Now I am learning Haskell & Plutus to write smart contract.
I can cost for your help to learn cardano smart contract.
So I am trying to compile & deploy on testnet with this project.

I had installed all environments on my Ubuntu & MacOS.

The Glorious Glasgow Haskell Compilation System, version 8.10.7
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
cardano-node 1.29.0 - linux-x86_64 - ghc-8.10
git rev 4c59442958072657812c6c0bb8e0b4ab85ce1ba2
cardano-cli 1.29.0 - linux-x86_64 - ghc-8.10
git rev 4c59442958072657812c6c0bb8e0b4ab85ce1ba2
nix (Nix) 2.8.0

cardano-wallet version
v2022-04-27 (git revision: 0000000000000000000000000000000000000000)
Installed Daedalus wallet

At first I command on terminal this cmd.
export CARDANO_NODE_SOCKET_PATH=$HOME/Cardano/db/node.socket
and run cardano-node on my local. After it I command cabal run integration-tests.

Up to date
{
“epoch”: 8,
“hash”: “48d8e744b97ff9c1288555640c839162f4e986d11a1f3d11d4457c0b50bd24b3”,
“slot”: 178977,
“block”: 177935,
“era”: “Byron”,
“syncProgress”: “3.98”
}
wrote NFT validator to file /tmp/swap3575763-0.plutus
wrote NFT validator to file /tmp/alwaysSucceeds3575763-1.plutus
Plutus script address: addr_test1wz5d96c7agqnynvpll2ytpssm7tgl05a8vfnzngpg5dr00gss36pg
Plutus script address: addr_test1wrxydyy3ps4rh5amg3p2gnjhacwglensysu9c5pulyallls7q0zwm
Command failed: query protocol-parameters Error: This query cannot be used for the Byron era
integration-tests: callProcess: cardano-cli “query” “protocol-parameters” “–out-file” “/tmp/protocol-params3575763-2.json” “–testnet-magic” “1097911063” (exit 1): failed

export CARDANO_NODE_SOCKET_PATH=/home/bluesky/.local/share/Daedalus/testnet/cardano-node.socket

Up to date
{
“epoch”: 208,
“hash”: “5ed55cbf6fd25d869671418370f2a24541872d9b8025b267b723d40b0c0abec8”,
“slot”: 59540218,
“block”: 3591914,
“era”: “Alonzo”,
“syncProgress”: “100.00”
}
wrote NFT validator to file /tmp/swap3577493-0.plutus
wrote NFT validator to file /tmp/alwaysSucceeds3577493-1.plutus
Plutus script address: addr_test1wz5d96c7agqnynvpll2ytpssm7tgl05a8vfnzngpg5dr00gss36pg
Plutus script address: addr_test1wrxydyy3ps4rh5amg3p2gnjhacwglensysu9c5pulyallls7q0zwm
single offer
can be purchased FAILED [1]
can be cancelled by owner FAILED [2]
buyer counter offers
seller can accept offer FAILED [3]
multiple offers
from same seller
can be cancelled in bulk FAILED [4]
for same offer
cannot be shorted FAILED [5]
from multiple sellers
that have no expiration
cannot be cancelled in bulk FAILED [6]
can be purchased in bulk FAILED [7]
Can’t be purchased if another script is an input FAILED [8]
Failures:
integration-tests/Main.hs:129:7:

  1. single offer can be purchased
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/single offer/can be purchased/”
    integration-tests/Main.hs:131:7:
  2. single offer can be cancelled by owner
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/single offer/can be cancelled by owner/”
    integration-tests/Main.hs:135:11:
  3. single offer, buyer counter offers, seller can accept offer
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/single offer/buyer counter offers/seller can accept offer/”
    integration-tests/Main.hs:141:9:
  4. multiple offers, from same seller, can be cancelled in bulk
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/multiple offers/from same seller/can be cancelled in bulk/”
    integration-tests/Main.hs:146:11:
  5. multiple offers, from same seller, for same offer, cannot be shorted
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/multiple offers/from same seller/for same offer/cannot be shorted/”
    integration-tests/Main.hs:182:11:
  6. multiple offers, from multiple sellers, that have no expiration, cannot be cancelled in bulk
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/multiple offers/from multiple sellers/that have no expiration/cannot be cancelled in bulk/”
    integration-tests/Main.hs:185:11:
  7. multiple offers, from multiple sellers, that have no expiration, can be purchased in bulk
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/multiple offers/from multiple sellers/that have no expiration/can be purchased in bulk/”
    integration-tests/Main.hs:188:11:
  8. multiple offers, from multiple sellers, that have no expiration, Can’t be purchased if another script is an input
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/multiple offers/from multiple sellers/that have no expiration/Can’t be purchased if another script is an input/”
    Randomized with seed 1266991612
    Finished in 17.3217 seconds
    8 examples, 8 failures

Please help me.
skype : live:.cid.8c36cbfe88725f27
telegram : Telegram: Contact @programlucky

These versions are quite ancient. Is there any reason, you did not install the latest versions?

You have tried to run the tests, before your node was fully synced. That cannot work. syncProgress has to be "100.00", before the test would work.

Now, you are using a different node – the one inside Daedalus. Are you really running both in parallel on the same machine?

And did you also set the other environment variables given in https://github.com/jpg-store/contract-v2#running-the-tests?

1 Like

Hi! @HeptaSean
Thanks for you help.
I will update my cardano-node & cardano-cli.
And these are my envs.

export CARDANO_NODE_SOCKET_PATH=/home/bluesky/.local/share/Daedalus/testnet/cardano-node.socket
export CARDANO_NODE_SOCKET_PATH=$HOME/Cardano/db/node.socket
export SOURCE_WALLET_ADDRESS_PATH=$HOME/Cardano/test-net/01.addr
export SOURCE_WALLET_SKEY_PATH=$HOME/Cardano/test-net/01.skey
export TESTNET_MAGIC=1097911063
export WALLET_DIR=$HOME/Cardano/test-net/wallet

I am using 2 nodes on my Ubuntu local, but I didn’t run them in parallel.

Thanks!!!:slight_smile:

Hi @HeptaSean
Now I am updating my cardano-node & cardano-cli.
It was required 8h to sync the Daedalus wallet.
How long will it take to sync my cardano-node?
If possible, I want to get long-term relation ship with you.

Since it is basically the same node running inside Daedalus, it will probably be in the same range.

For mainnet, it’s even worse. There, first sync can easily be several days.

Looks good (if you only uncomment one of the two settings for CARDANO_NODE_SOCKET_PATH at a time). And you have sourced that file, before trying to run the integration tests? And the wallets exist?

Hi @HeptaSean !
You are right!
It was already spent 4hrs, but the syncProgress is 47.79 yet.
I am using this path.

export CARDANO_NODE_SOCKET_PATH=$HOME/Cardano/db/node.socket

Before trying to run the integration tests, I set up all envars and ran scripts/compile.sh.

export WALLET_DIR=$HOME/Cardano/test-net/wallet

In this path, there are 01.addr, 01.sky, 01.vkey files that created by followed query.

cardano-cli address key-gen --verification-key-file 01.vkey --signing-key-file 01.skey
cardano-cli address build --payment-verification-key-file 01.vkey --testnet-magic 1097911063 --out-file 01.addr

If you are okay, I will resend msg after synchronizing.
Thanks. :smiley:

Hi! My friend @HeptaSean
How are you?

export WALLET_DIR=$HOME/Cardano/test-net/wallet

I deleted all files in this path, and commanded cabal run integration-tests.
After that in the path the addr,skey, vkey files named buyer, seller1, seller2, marketplace, royalties had created.
And the result was this.

Up to date
{
“era”: “Alonzo”,
“syncProgress”: “100.00”,
“hash”: “914b152647655b5e7f85dbf26c8fba261e64da3567e644092e59e66ac80a3be8”,
“epoch”: 208,
“slot”: 59603859,
“block”: 3593710
}
wrote NFT validator to file /tmp/swap4038710-0.plutus
wrote NFT validator to file /tmp/alwaysSucceeds4038710-1.plutus
Plutus script address: addr_test1wz5d96c7agqnynvpll2ytpssm7tgl05a8vfnzngpg5dr00gss36pg
Plutus script address: addr_test1wrxydyy3ps4rh5amg3p2gnjhacwglensysu9c5pulyallls7q0zwm
single offer
can be purchased FAILED [1]
can be cancelled by owner FAILED [2]
buyer counter offers
seller can accept offer FAILED [3]
multiple offers
from same seller
can be cancelled in bulk FAILED [4]
for same offer
cannot be shorted FAILED [5]
from multiple sellers
that have no expiration
cannot be cancelled in bulk FAILED [6]
can be purchased in bulk FAILED [7]
Can’t be purchased if another script is an input FAILED [8]
Failures:
integration-tests/Main.hs:129:7:

  1. single offer can be purchased
    uncaught exception: ErrorCall
    Prelude.foldl1: empty list
    To rerun use: --match “/single offer/can be purchased/”
    …
    …

I sent 100ADA to buyer.addr, but the result was same.
I checked seller1.addr, seller2.addr, but there are not any NFTs.
How can I fix this issues?
And How can I set marketplace.addr?
Please help me!
Thanks.

:+1: @HeptaSean
I had resolved all issues, and all transactions are success.
You were right. Cardano-node must be synchronized to testnet.
After sync Progress was 100.00, all transactions were succeeded.
Thanks!

1 Like

Hi @HeptaSean @bluesky0812. i am working on implementing this contract at the moment.
The problem i am facing is how to construct the datum and redeemer for all the cases.
Plus when i try to run all the test using cardano-node 8.1.2 that is the latest version all the test fail because it has a dependency of node -v 1.35.1, So i am Running private testnet node to run all the tests.