Add steps to deploy new custom token
This commit is contained in:
parent
8129b0eb90
commit
0e67ad7547
@ -175,21 +175,23 @@
|
|||||||
* Edit [`contract-vars.yml`](./contract-vars.yml) and fill in the following values:
|
* Edit [`contract-vars.yml`](./contract-vars.yml) and fill in the following values:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# L1 RPC endpoint
|
# RPC endpoint
|
||||||
geth_url: "https://sepolia.laconic.com"
|
geth_url: "https://fixturenet-eth.laconic.com"
|
||||||
|
|
||||||
# L1 chain ID (Sepolia: 11155111)
|
# Chain ID (Fixturenet-eth: 1212)
|
||||||
geth_chain_id: "11155111"
|
geth_chain_id: "1212"
|
||||||
|
|
||||||
# Private key for a funded L1 account, to be used for contract deployment on L1
|
# Private key for a funded L1 account, to be used for contract deployment on L1
|
||||||
# Must also be funded on L2 for deploying contracts
|
|
||||||
# Required since this private key will be utilized by both L1 and L2 nodes of the bridge
|
# Required since this private key will be utilized by both L1 and L2 nodes of the bridge
|
||||||
|
|
||||||
|
# TODO: HARDCODE PK AND USE SAME IN BRIDGE
|
||||||
|
|
||||||
geth_deployer_pk: ""
|
geth_deployer_pk: ""
|
||||||
|
|
||||||
# Custom L1 token to be deployed
|
# Custom token to be deployed
|
||||||
token_name: ""
|
token_name: "TestToken"
|
||||||
token_symbol: ""
|
token_symbol: "TST"
|
||||||
intial_token_supply: ""
|
intial_token_supply: "10000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
* Update the target dir in `setup-vars.yml`:
|
* Update the target dir in `setup-vars.yml`:
|
||||||
@ -252,6 +254,29 @@
|
|||||||
laconic-so deployment --dir nitro-contracts-deployment logs nitro-contracts -f
|
laconic-so deployment --dir nitro-contracts-deployment logs nitro-contracts -f
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* To deploy another token
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export TOKEN_NAME="TestToken2"
|
||||||
|
export TOKEN_SYMBOL="TST2"
|
||||||
|
|
||||||
|
# Note: Token supply denotes actual number of tokens and not the supply in Wei
|
||||||
|
export INITIAL_TOKEN_SUPPLY="10000000"
|
||||||
|
|
||||||
|
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "cd packages/nitro-protocol && yarn contracts:deploy-token-geth"
|
||||||
|
```
|
||||||
|
|
||||||
|
* To transfer a token to an account
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Note: Replace `<TokenName>` with name of the token to be tranferred (e.g. TestToken2)
|
||||||
|
export $ASSET_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.<TokenName>.address' /app/deployment/nitro-addresses.json")
|
||||||
|
export $ACCOUNT="<address of target account>"
|
||||||
|
export $AMOUNT="<Amount to be transferred>"
|
||||||
|
|
||||||
|
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "cd packages/nitro-protocol && yarn hardhat transfer --contract $ASSET_ADDRESS --to $ACCOUNT --amount 1000 --network geth"
|
||||||
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details open>
|
<details open>
|
||||||
@ -288,10 +313,10 @@
|
|||||||
|
|
||||||
# Expected output:
|
# Expected output:
|
||||||
# {
|
# {
|
||||||
# "11155111": [
|
# "1212": [
|
||||||
# {
|
# {
|
||||||
# "name": "geth",
|
# "name": "geth",
|
||||||
# "chainId": "11155111",
|
# "chainId": "1212",
|
||||||
# "contracts": {
|
# "contracts": {
|
||||||
# "ConsensusApp": {
|
# "ConsensusApp": {
|
||||||
# "address": "0xC98aD0B41B9224dad0605be32A9241dB9c67E2e8"
|
# "address": "0xC98aD0B41B9224dad0605be32A9241dB9c67E2e8"
|
||||||
@ -302,7 +327,7 @@
|
|||||||
# "VirtualPaymentApp": {
|
# "VirtualPaymentApp": {
|
||||||
# "address": "0x778e4e6297E8BF04C67a20Ec989618d72eB4a19E"
|
# "address": "0x778e4e6297E8BF04C67a20Ec989618d72eB4a19E"
|
||||||
# },
|
# },
|
||||||
# "Token": {
|
# "TestToken": {
|
||||||
# "address": "0x02ebfB2706527C7310F2a7d9098b2BC61014C5F2"
|
# "address": "0x02ebfB2706527C7310F2a7d9098b2BC61014C5F2"
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
@ -327,7 +352,7 @@
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# WS endpoint
|
# WS endpoint
|
||||||
nitro_chain_url: "wss://sepolia.laconic.com"
|
nitro_chain_url: "wss://fixturenet-eth.laconic.com"
|
||||||
|
|
||||||
# Private key for bridge Nitro address
|
# Private key for bridge Nitro address
|
||||||
nitro_sc_pk: ""
|
nitro_sc_pk: ""
|
||||||
@ -336,7 +361,7 @@
|
|||||||
# It also needs to hold L1 tokens to fund Nitro channels
|
# It also needs to hold L1 tokens to fund Nitro channels
|
||||||
nitro_chain_pk: ""
|
nitro_chain_pk: ""
|
||||||
|
|
||||||
# Deployed L1 Nitro contract addresses
|
# Deployed Nitro contract addresses
|
||||||
na_address: ""
|
na_address: ""
|
||||||
vpa_address: ""
|
vpa_address: ""
|
||||||
ca_address: ""
|
ca_address: ""
|
||||||
@ -414,7 +439,7 @@
|
|||||||
export CA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json")
|
export CA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json")
|
||||||
export VPA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json")
|
export VPA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json")
|
||||||
|
|
||||||
export ASSET_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json")
|
export ASSET_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.TestToken.address' /app/deployment/nitro-addresses.json")
|
||||||
|
|
||||||
export BRIDGE_NITRO_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.SCAddress')
|
export BRIDGE_NITRO_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.SCAddress')
|
||||||
|
|
||||||
@ -425,7 +450,7 @@
|
|||||||
|
|
||||||
# Create the required config file
|
# Create the required config file
|
||||||
cat <<EOF > nitro-node-config.yml
|
cat <<EOF > nitro-node-config.yml
|
||||||
nitro_chain_url: "wss://sepolia.laconic.com"
|
nitro_chain_url: "wss://fixturenet-eth.laconic.com"
|
||||||
na_address: "$NA_ADDRESS"
|
na_address: "$NA_ADDRESS"
|
||||||
ca_address: "$CA_ADDRESS"
|
ca_address: "$CA_ADDRESS"
|
||||||
vpa_address: "$VPA_ADDRESS"
|
vpa_address: "$VPA_ADDRESS"
|
||||||
|
Loading…
Reference in New Issue
Block a user