# Testnet is live with Smart Contracts!

**URL:** <https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386>\
**Category:** Secret Network\
**Created:** [March 5, 2020, 8:06pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386 "2020-03-05T20:06:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![toml](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/toml/32/447_2.png) [@toml](https://forum.scrt.network/u/toml)\
**Post date:** [March 5, 2020, 8:06pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/1 "2020-03-05T20:06:23Z")

</div>

Hey all,  
Today we launched Enigma Blockchain’s Testnet, with nodes running the latest pre-release `v0.1.0` with a **smart contracts module** baked in.  
Just smart contracts, no SGX for now.

For smart contracts we actually worked with [CosmWasm](https://www.cosmwasm.com/) to embed their library (v0.7.0) into Enigma Blockchain’s `enigmad` and `enigmacli`.  
We call it `Compute`.

We also launched a [Testnet Faucet](https://faucet.testnet.enigma.co) so everyone can go and send themselves tokens to play with.  
**Keep in mind the number of available tokens is limited! Please don’t abuse this service.**

# So how do you join the testnet?

It’s essentialy the same process as one would join the mainnet, but we created a doc to refresh your memory and save you the hassle 🙂

_ **NOTE:** _ You DO NOT want to use the v0.1.0 on an existing mainnet validator node. It will not work.  
_ **NOTE 2:** _ We recommend you to first remove older `enigmachain` installations to prevent collisions.  
_ **NOTE 3:** _ Before removing, changing or doing anything with the old `enigmad`,`enigmacli` installations - make sure to back up your keys and recovery seeds!

- For detailed instructions, check this page: [https://github.com/enigmampc/EnigmaBlockchain/blob/master/docs/testnet/testnet-docs.md](https://github.com/enigmampc/EnigmaBlockchain/blob/master/docs/testnet/testnet-docs.md)
- For the experienced user, here are some key details to get you started right away:
  - Bootstrap node:
    - URL: [bootstrap.testnet.enigma.co](http://bootstrap.testnet.enigma.co)
    - Node ID: `16e95298703bfbf6565a1cbb6691cf30129f52ca`

  - Chain ID: enigma-testnet
  - RPC endpoint: [bootstrap.testnet.enigma.co:26657](http://bootstrap.testnet.enigma.co:26657)
  - REST API endpoint: [bootstrap.testnet.enigma.co:80](http://bootstrap.testnet.enigma.co:80)
  - `genesis.json`
    - File: [Here](https://raw.githubusercontent.com/enigmampc/EnigmaBlockchain/master/enigma-testnet-genesis.json)
    - Checksum: `cc7ab684b955dcc78baffd508530f0a119723836d24153b41d8669f0e4ec3caa`

## Additional notes

- If you are new to Cosmos SDK and Enigma Blockchain, you should check out our [docs](https://github.com/enigmampc/EnigmaBlockchain/tree/master/docs) for additional tips, configurations etc. (for example, [how to run a validator node](https://github.com/enigmampc/EnigmaBlockchain/blob/master/docs/validators-and-full-nodes/join-validator-mainnet.md))
- Existing documentation was written with **mainnet** in mind, but still relevant to testnet as well with slight modifications.
- Smart Contracts docs will be posted soon, in the meantime you should check out [CosmWasm’s docs](https://github.com/confio/cosmwasm) for info about writing and deploying smart contracts.
- This release supports currently only Debian/Ubuntu systems. More distribution will be available in the future.

# Possible future developments

- Testnet explorer.
- Ability for Mainnet and Testnet clients to be installed simultaneously.
- `enigmacli` builds for Windows/Mac

## Happy smart contracting 🤓

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 5, 2020, 9:19pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/2 "2020-03-05T21:19:59Z")

</div>

Nice! Could you provide a REST API as well as Tendermint RPC endpoint to allow connecting apps without running a node?

---

<div class="post-metadata">

**Author:** ![assafmo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/assafmo/32/440_2.png) [@assafmo](https://forum.scrt.network/u/assafmo)\
**Post date:** [March 5, 2020, 9:28pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/3 "2020-03-05T21:28:26Z")

</div>

@Simon RPC endpoint should be at [bootstrap.testnet.enigma.co:26657](http://bootstrap.testnet.enigma.co:26657)  
Re REST, we’ll try to have it tommorow, early Sunday at the most.

---

<div class="post-metadata">

**Author:** ![toml](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/toml/32/447_2.png) [@toml](https://forum.scrt.network/u/toml)\
**Post date:** [March 5, 2020, 10:18pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/4 "2020-03-05T22:18:17Z")

</div>

@Simon Thanks for pointing that out. Updated main post.  
RPC is indeed [bootstrap.testnet.enigma.co:26657](http://bootstrap.testnet.enigma.co:26657/).  
REST API live at [bootstrap.testnet.enigma.co:80](http://bootstrap.testnet.enigma.co:80/).

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 5, 2020, 10:20pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/5 "2020-03-05T22:20:33Z")

</div>

Great. Could you add TLS as well (REST API over HTTPs)? Otherwise in-browser apps hosted via https:// cannot access the API due to mixed content restrictions in browsers.

---

<div class="post-metadata">

**Author:** ![dbriggsie](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/dbriggsie/32/587_2.png) [@dbriggsie](https://forum.scrt.network/u/dbriggsie)\
**Post date:** [March 5, 2020, 11:10pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/6 "2020-03-05T23:10:18Z")

</div>

Is this the vanilla Cosmos/SDK Rest API responses, or is there new CosmWasm calls we can now make to through the REST interface?

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 5, 2020, 11:15pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/7 "2020-03-05T23:15:35Z")

</div>

This is a Cosmos SDK REST API plus CosmWasm specific additions in the /wasm module. There is e.g.

```
curl http://bootstrap.testnet.enigma.co/wasm/code
{
  "height": "4705",
  "result": null
}

```

which shows you that no contract was uploaded so far. The best API documentation for the CosmWasm additions is this file: [https://github.com/confio/cosmwasm-js/blob/v0.7.0/packages/sdk/src/restclient.ts#L347-L407](https://github.com/confio/cosmwasm-js/blob/v0.7.0/packages/sdk/src/restclient.ts#L347-L407)

Who uploads the first code? The race is on.

---

<div class="post-metadata">

**Author:** ![dbriggsie](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/dbriggsie/32/587_2.png) [@dbriggsie](https://forum.scrt.network/u/dbriggsie)\
**Post date:** [March 5, 2020, 11:32pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/8 "2020-03-05T23:32:08Z")

</div>

im about to help you out by proxying bootstrap.testnet LCD through an SSL endpoint 😉

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/laura/32/911_2.png) [@laura](https://forum.scrt.network/u/laura)\
**Post date:** [March 5, 2020, 11:48pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/9 "2020-03-05T23:48:05Z")

</div>

Has anyone tried to run as a full node on the testnet?

I’m getting an error when I try to validate the genesis.json:

`$ enigmad validate-genesis`

```auto
validating genesis file at /home/pigeonpoint/.enigmad/config/genesis.json
ERROR: error validating genesis file /home/pigeonpoint/.enigmad/config/genesis.json:
 failed to unmarshal genutil genesis state: UnmarshalJSON cannot decode empty bytes

```

The file’s not empty.

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 6, 2020, 8:24am UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/10 "2020-03-06T08:24:45Z")

</div>

Great. When you do that, there are 3 things worth considering for apps:

- **TLS certificate** : because of mixed content limitations by browsers. And because encryption makes sense.
- **CORS** : every origin should be allowed to access it and preflight requests (OPTION) should work
- **compression** : the REST server by default does not compress responses. A contract is about 100 kilobytes of bytecode that is encoded with 33% overhead in base64. The encoding overhead can be compressed away almost entirely and the pure code can be compressed to about 50% of the original size. For JSON responses larger than a couple of kilobytes this helps as well.

---

<div class="post-metadata">

**Author:** ![dbriggsie](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/dbriggsie/32/587_2.png) [@dbriggsie](https://forum.scrt.network/u/dbriggsie)\
**Post date:** [March 6, 2020, 2:32pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/11 "2020-03-06T14:32:18Z")

</div>

Yes I got the same error when using validate-genesis

---

<div class="post-metadata">

**Author:** ![assafmo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/assafmo/32/440_2.png) [@assafmo](https://forum.scrt.network/u/assafmo)\
**Post date:** [March 6, 2020, 3:53pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/12 "2020-03-06T15:53:01Z")

</div>

Sorry for this, we’ll fix this on Sunday

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 6, 2020, 5:44pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/13 "2020-03-06T17:44:03Z")

</div>

Right now, transactions are not indexed. There is a setting somewhere in Tendermint to enable that. Reproduce with

```
curl "http://bootstrap.testnet.enigma.co/txs?tx.minheight=1"
{
  "total_count": "0",
  "count": "0",
  "page_number": "1",
  "page_total": "0",
  "limit": "30",
  "txs": []
}

```

The same command works for demonet:

```
curl "https://lcd.demo-07.cosmwasm.com/txs?tx.minheight=1" | jq .total_count
"63"
```

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 6, 2020, 6:21pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/14 "2020-03-06T18:21:18Z")

</div>

At [https://enigma.wasm.glass/](https://enigma.wasm.glass/) I deployed is a Code Explorer pointing to the Enigma testnet. It is connecting to a pretty slow proxy backend that goes to sleep when unused for a while. So you need to be a bit patient when it says “Loading …”. At least it has HTTPs and CORS configured. Proper endpoint welcome.

I also uploaded and instantiated the first contract 🐎

---

<div class="post-metadata">

**Author:** ![assafmo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/assafmo/32/440_2.png) [@assafmo](https://forum.scrt.network/u/assafmo)\
**Post date:** [March 6, 2020, 6:25pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/15 "2020-03-06T18:25:23Z")

</div>

@Simon were you referring to this?

> <https://github.com/tendermint/tendermint/blob/master/docs/app-dev/indexing-transactions.md>

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 6, 2020, 6:28pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/16 "2020-03-06T18:28:42Z")

</div>

> [@assafmo](#):
>
> @Simon were you referring to this?

Yes. From the docs I think what you want is setting `index_all_keys = true` and comment out `index_keys`.

---

<div class="post-metadata">

**Author:** ![assafmo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/assafmo/32/440_2.png) [@assafmo](https://forum.scrt.network/u/assafmo)\
**Post date:** [March 6, 2020, 7:45pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/17 "2020-03-06T19:45:24Z")

</div>

Thanks, learning the ropes as we go. 🤗

---

<div class="post-metadata">

**Author:** ![mohammedpatla](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/mohammedpatla/32/739_2.png) [@mohammedpatla](https://forum.scrt.network/u/mohammedpatla)\
**Post date:** [March 6, 2020, 9:44pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/18 "2020-03-06T21:44:27Z")

</div>

Same issues as @laura

When i still proceed with starting the node

````auto
Mar 06 21:42:01 vultr.guest systemd[1]: enigma-node.service: Main process exited, code=exited, status=1/FAILURE
Mar 06 21:42:01 vultr.guest systemd[1]: enigma-node.service: Failed with result 'exit-code'.
Mar 06 21:42:05 vultr.guest systemd[1]: enigma-node.service: Service hold-off time over, scheduling restart.
Mar 06 21:42:05 vultr.guest systemd[1]: enigma-node.service: Scheduled restart job, restart counter is at 130.
Mar 06 21:42:05 vultr.guest systemd[1]: Stopped Enigma node service.
Mar 06 21:42:05 vultr.guest systemd[1]: Started Enigma node service.
Mar 06 21:42:05 vultr.guest enigmad[9599]: I[2020-03-06|21:42:05.193] starting ABCI with Tendermint module=main
Mar 06 21:42:05 vultr.guest enigmad[9599]: ERROR: error during handshake: error on replay: wrong Block.Header.AppHash. Expected CCD64058E400CAA1868DD204D3FD2229B51CDA6AF0120D0CB97824F425BFF435, got 9021AC0590DD7A5C07B56841360632FDAC86FFA0AA0AF97216738E50C03231BF
Mar 06 21:42:05 vultr.guest systemd[1]: enigma-node.service: Main process exited, code=exited, status=1/FAILURE
Mar 06 21:42:05 vultr.guest systemd[1]: enigma-node.service: Failed with result 'exit-code'.```
````

---

<div class="post-metadata">

**Author:** ![Simon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/simon/32/427_2.png) [@Simon](https://forum.scrt.network/u/Simon)\
**Post date:** [March 6, 2020, 9:57pm UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/19 "2020-03-06T21:57:01Z")

</div>

@laura @mohammedpatla the linked genesis file is definitely not the one [bootstrap.testnet.enigma.co](http://bootstrap.testnet.enigma.co) was started with. There are diffs in many of the fields.

Could you – out of curiosity – try the genesis file you get via?

```
curl http://bootstrap.testnet.enigma.co:26657/genesis | jq .result.genesis > genesis_from_rpc.json

```

It has the following hash for me

```
sha256sum genesis_from_rpc.json 
a84efa4ccf20681d34e23870317d9d2d3bcbcd02ec6296aeedd10d842f0aca03 genesis_from_rpc.json

```

This should not be considered a solution but just an idea from a random guy to get some nodes up.

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/laura/32/911_2.png) [@laura](https://forum.scrt.network/u/laura)\
**Post date:** [March 7, 2020, 12:02am UTC](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386/20 "2020-03-07T00:02:43Z")

</div>

Hi @Simon 😃

I got the same error on that `genesis.json` file. Everything looked good until the `enigmad validate-genesis` command.

[Next page](https://forum.scrt.network/t/testnet-is-live-with-smart-contracts/1386.md?page=2)
