LocalSecret - Devnet docker
A local, instant, zero-config Secret Network blockchain.
Last updated
Was this helpful?
A local, instant, zero-config Secret Network blockchain.
Last updated
Was this helpful?
LocalSecret is a complete Secret Network testnet and ecosystem containerized with Docker. It simplifies the way secret contract developers test their contracts in a sandbox before they deploy them on a testnet or mainnet.
LocalSecret comes preconfigured with opinionated, sensible defaults for standard testing environments. If other projects mention testing on LocalSecret, they are referring to the settings defined in this repo.
Easily modifiable world states
Quick to reset for rapid iterations
Simple simulations of different scenarios
Controllable validator behavior
Supported known architectures: x86_64, amd64
You've now officially created a local Secret Network testnet with chain-id secretdev-1
. ๐
Your environment now contains:
RPC
http://localhost:26657
secretcli
, Keplr, cosmjs
gRPC-web
http://localhost:9091
secretjs@v1.4
(deprecated)
SCRT Faucet
http://localhost:5000
To get SCRT
LCD
http://localhost:1317
secretjs
, Keplr, secretjs@v0.17.5
(deprecated)
Here are some examples of how to use LocalSecret with secretcli
, secret.js
, and Keplr
.
To access secretcli
from inside the docker container:
To configure & test your local secretcli binary:
To send some SCRT to the example secret address secret1e6mqxtwgaps7vz3qfa3fcekhh7a02hvfjvtqpt
we have to options:
The faucet drips 1000 SCRT at a time.
Inside the docker container there are accounts a
, b
, c
& d
that are pre-seeded with SCRT and can be used to send some to your address.
Connect to the chain through LocalSecret's LCD endpoint.
npm i secretjs
or yarn add secretjs
, then:
To add a custom chain to Keplr, use this code:
You can modify the node configuration of your validator in the ~/.secretd/config/config.toml
and ~/.secretd/config/app.toml
files inside the container.
To enter the docker container to access them, run:
You can then use commands like sed
& perl
to edit these files, or install text editors like vim
& nano
using apt install -y vim nano
.
To apply changes that are made to the config file, restart LocalSecret by running:
LocalSecret is often used alongside a script written with the secret.js as a convenient way to do integration tests. You can greatly improve the experience by speeding up the block time.
To decrease block times, run LocalSecret with the FAST_BLOCKS=true
environment varibale:
LocalSecret is pre-configured with one validator and 4 accounts with SCRT balances. You can import them into your own testing environment for easier prototyping.
a
secret1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03
grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar
b
secret1fc3fzy78ttp0lwuujw7e52rhspxn8uj52zfyne
jelly shadow frog dirt dragon use armed praise universe win jungle close inmate rain oil canvas beauty pioneer chef soccer icon dizzy thunder meadow
c
secret1ajz54hz8azwuy34qwy9fkjnfcrvf0dzswy0lqq
chair love bleak wonder skirt permit say assist aunt credit roast size obtain minute throw sand usual age smart exact enough room shadow charge
d
secret1ldjxljw7v4vk6zhyduywh04hpj0jdwxsmrlatf
word twist toast cloth movie predict advance crumble escape whale sail such angry muffin balcony keen move employ cook valve hurt glimpse breeze brick
To get started, simply click .
To complement this, when testing with secret.js you can lower broadcastCheckIntervalMs
to 100
from the default of 6000
().