# Testnet deployment tutorial

### 1. Public Full-node Information

You can find available public RPC endpoints information according to chain ids under the [Broken mention](broken://pages/Yh9jdPuAKDyI1gRMv3E7#public-rpcs) section.

### 2. Create Gameluk Account + Key

Create and configure your account:

```
export ACCOUNT_NAME="<YOUR_ACCOUNT_NAME_HERE>"
gameid keys add $ACCOUNT_NAME
```

This should create a new account locally and display its address and mnemonic:

```
- name: $ACCOUNT_NAME
  type: local
  address: game1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ai3obIQZXAmdgDSw7p1awFIPGK9b7cu/SfJM6nbc+hV/"}'
  mnemonic: ""


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
some mnemonic words some mnemonic words some mnemonic words some mnemonic words some mnemonic words 
Store the shown account address into local env variable and add it as the genesis account to the chain:
```

```
export ACCOUNT_ADDRESS="<ADDRESS_OF_YOUR_ACCOUNT>"
```

### 3. Fund your account

Use the [faucet](broken://pages/Yh9jdPuAKDyI1gRMv3E7#sei-faucet) to fund your account. It may be possible that your account needs more funds, in which case please reach out to our team on Discord / Telegram.

Verify your balance on the testnet:

```
gamed q bank balances $ACCOUNT_ADDRESS --node $RPC_ENDPOINT --chain-id $CHAIN_ID
```

### 4. Upload & Instantiate Wasm Contract

Store a compiled wasm binary to the Gameluk network:

```
gameid tx wasm store $CONTRACT_WASM_BINARY -y --from=$ACCOUNT_NAME --chain-id=$CHAIN_ID --node $ENDPOINT --gas=10000000 --fees=100000ugame --broadcast-mode=block
```

Once your proposal is stored to the testnet, you can instantiate your contract:

```shell
gameid tx wasm instantiate $CONTRACT_ID '{}' --chain-id gameluk-chain --from $ACCOUNT_NAME --gas=4000000 --fees=1000000ugame --broadcast-mode=block --label $LABEL --no-admin
```

Note that the `'{}'` part is the parameters you pass to instantiate the contract. In this example, the contract takes no parameter so `'{}'` suffices. For any real world contracts, their instantiation parameters would likely be non-empty.&#x20;

You should get a response like the following:

```yaml
height: "2051"
info: ""
logs:
- events:
  - attributes:
    - key: _contract_address
      value: game1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqdxfzff
    - key: code_id
      value: "1"
    type: instantiate
  - attributes:
    - key: action
      value: /cosmwasm.wasm.v1.MsgInstantiateContract
    - key: module
      value: wasm
    - key: sender
      value: cosmos1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn
    type: message
  log: ""
  msg_index: 0
raw_log: '[{"events":[{"type":"instantiate","attributes":[{"key":"_contract_address","value":"cosmos1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqdxfzff"},{"key":"code_id","value":"2"}]},{"type":"message","attributes":[{"key":"action","value":"/cosmwasm.wasm.v1.MsgInstantiateContract"},{"key":"module","value":"wasm"},{"key":"sender","value":"cosmos1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn"}]}]}]'
timestamp: ""
tx: null
txhash: 3033A3673367169693157DF4D22D973A012C03A4FBE452E994E4DE87C8628D23
```

From the output, you can see that your contract was created at address: `game1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqdxfzff`. You will need this address for any contract interaction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gameluk.gitbook.io/gameluk/develop/get-started/testnet-deployment-tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
