Testnet is live with Smart Contracts!

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 to embed their library (v0.7.0) into Enigma Blockchain’s enigmad and enigmacli.
We call it Compute.

We also launched a Testnet Faucet 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 :slight_smile:

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!

Additional notes

  • If you are new to Cosmos SDK and Enigma Blockchain, you should check out our docs for additional tips, configurations etc. (for example, how to run a validator node)
  • 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 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 :nerd_face:

8 Likes

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

4 Likes

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

6 Likes

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

2 Likes

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.

3 Likes

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

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

Who uploads the first code? The race is on.

1 Like

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

2 Likes

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

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.

1 Like

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.

Yes I got the same error when using validate-genesis

1 Like

Sorry for this, we’ll fix this on Sunday

2 Likes

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"

At 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 :racehorse:

1 Like

@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.

Thanks, learning the ropes as we go. :hugs:

1 Like

Same issues as @laura

When i still proceed with starting the node

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'.```

@laura @mohammedpatla the linked genesis file is definitely not the one 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.

Hi @Simon :smiley:

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

1 Like