2024-10-16 17:56:54 +00:00
# CosmWasm Binaries: Manual Install and Configure
> Note - We highly recommend setting up `neutrond` with the docker image provided. However, we have provided these detailed instructions in case you wanted to take a deeper look.
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
Quartz expects to interact with a CosmWasm-based blockchain.
2024-10-16 17:56:54 +00:00
The default/archetypal binary is `neutrond` . We have included instructions for `wasmd` , but it is not supported in the cli today.
2024-09-29 05:40:41 +00:00
2024-10-16 17:56:54 +00:00
Here we describe how to get setup from scratch or how to use an existing `neutrond`
2024-10-01 14:26:42 +00:00
binary/network you have access to.
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
- [Install ](#install )
- [Configure from scratch ](#configure-from-scratch )
- [Configure existing ](#configure-existing )
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
## Install
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
To build from source, first make sure you have Go installed.
2024-09-29 05:40:41 +00:00
2024-10-16 17:56:54 +00:00
For `neutrond` :
2024-09-29 05:40:41 +00:00
```bash
2024-10-01 14:26:42 +00:00
git clone -b main https://github.com/neutron-org/neutron.git
cd neutron
git checkout v4.0.0
make install
2024-09-29 05:40:41 +00:00
```
2024-10-16 17:56:54 +00:00
For `wasmd` (NOTE - NOT SUPPORTED BY CLI):
```bash
git clone https://github.com/cosmwasm/wasmd/
cd wasmd
git checkout v0.45.0
go install ./cmd/wasmd
```
2024-10-01 14:26:42 +00:00
## Configure From Scratch
We have to initialize a new chain and load it with some accounts.
2024-10-16 17:56:54 +00:00
We'll assume you're using `neutrond` but it could be `wasmd` or any other.
2024-10-01 14:26:42 +00:00
We also have to give the chain a chain ID. We'll use `testing` .
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
Run
2024-09-29 05:40:41 +00:00
```bash
2024-10-16 17:56:54 +00:00
neutrond init < your name > --chain-id testing
2024-09-29 05:40:41 +00:00
```
2024-10-16 17:56:54 +00:00
to initialize the local neutrond folder.
2024-09-29 05:40:41 +00:00
2024-10-16 17:56:54 +00:00
Now open the file `~/.neutrond/config/client.toml` and change the field
2024-10-01 14:26:42 +00:00
`keyring-backend` from `os` to `test` :
```toml keyring-backend = "test" ```
2024-10-16 17:56:54 +00:00
Now, finally, we can create a local admin key for your neutrond. You'll use this to
2024-10-01 14:26:42 +00:00
deploy contracts:
```bash
2024-10-16 17:56:54 +00:00
neutrond keys add admin
2024-10-01 14:26:42 +00:00
```
2024-10-16 17:56:54 +00:00
This should output a neutron address.
2024-10-01 14:26:42 +00:00
Now create the genesis file.
```bash
# generate a second key for the validator
2024-10-16 17:56:54 +00:00
neutrond keys add validator
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
# fund both accounts in genesis
2024-10-16 17:56:54 +00:00
neutrond genesis add-genesis-account admin 100000000000stake,100000000000ucosm
neutrond genesis add-genesis-account validator 100000000000stake,100000000000ucosm
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
# sign genesis tx from validator and compose genesis
2024-10-16 17:56:54 +00:00
neutrond genesis gentx validator 100000000stake --chain-id testing
neutrond genesis collect-gentxs
2024-09-29 05:40:41 +00:00
```
Before finally starting the node, for it to work with the front end, you need to
configure CORS.
2024-10-01 14:26:42 +00:00
### Configure CORS
2024-10-16 17:56:54 +00:00
In `~/.neutrond/config/config.toml` , you'll need to make sure the listen address
2024-09-29 05:40:41 +00:00
binds to the public IP (0.0.0.0) and the CORS allows all origins:
2024-10-01 14:26:42 +00:00
```toml
[rpc]
laddr = "tcp://0.0.0.0:26657"
cors_allowed_origins = ["*"]
2024-09-29 05:40:41 +00:00
```
2024-10-16 17:56:54 +00:00
And in `~/.neutrond/config/app.toml` :
2024-09-29 05:40:41 +00:00
2024-10-01 14:26:42 +00:00
```toml
[api]
enable = true
address = "tcp://0.0.0.0:1317"
enabled-unsafe-cors = true
2024-09-29 05:40:41 +00:00
```
Now, finally:
2024-10-16 17:56:54 +00:00
## neutrond start
2024-10-01 14:26:42 +00:00
```bash
2024-10-16 17:56:54 +00:00
neutrond start
2024-09-29 05:40:41 +00:00
```
And you should have a chain making blocks!
You can also reduce the block time by lowering `timeout_commit` in
2024-10-16 17:56:54 +00:00
`~/.neutrond/config/config.toml` .
2024-09-29 05:40:41 +00:00
Now that you have the chain running, you can start running the enclave and proxy
in other windows.
2024-10-01 14:26:42 +00:00
Return to the [getting started guide ](/docs/getting_started.md#installation )
## Configure Existing
If you want to join an existing testnet you either need to setup a node and
sync that testnet or find a node to use.
You'll also need to setup an account and get it funded.
Assuming you're using the Neutron testnet, create a new account called `admin` :
```bash
2024-10-16 17:56:54 +00:00
neutrond keys add admin
2024-10-01 14:26:42 +00:00
```
Now use a faucet or send this address to someone who can give you funds on the tesnet.
If you have funds yourself you can simply transfer them:
```bash
neutrond tx bank send < sender key name > < recipient address > < amount >
--chain-id testing -y
```
One your `admin` account is funded on the network, return to the [getting started guide ](/docs/getting_started.md#installation )