Skip to content

Commit

Permalink
Add inx blockissuer and faucet to ansible setup
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Oct 24, 2023
1 parent a361ea2 commit 49ce601
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 86 deletions.
2 changes: 1 addition & 1 deletion components/metricstracker/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ var ParamsMetricsTracker = &ParametersMetricsTracker{}

var params = &app.ComponentParams{
Params: map[string]any{
"metricstracker": ParamsMetricsTracker,
"metricsTracker": ParamsMetricsTracker,
},
}
2 changes: 1 addition & 1 deletion config_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"pruningThreshold": 1,
"dbGranularity": 100
},
"metricstracker": {
"metricsTracker": {
"enabled": true
},
"database": {
Expand Down
22 changes: 10 additions & 12 deletions deploy/ansible/hosts/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ cores:
hosts:
node-01.feature.shimmer.iota.cafe:
validatorAccount: "{{ NODE_01_ACCOUNTID }}"
validatorPrivKey: "{{ NODE_01_VALIDATOR_PRIVKEY }}"
p2pIdentityPrivateKey: "{{ NODE_01_P2PIDENTITYPRIVATEKEY }}"
validatorPrvKey: "{{ NODE_01_VALIDATOR_PRIVKEY }}"
p2pIdentityPrvKey: "{{ NODE_01_P2PIDENTITYPRIVATEKEY }}"
node-02.feature.shimmer.iota.cafe:
validatorAccount: "{{ NODE_02_ACCOUNTID }}"
validatorPrivKey: "{{ NODE_02_VALIDATOR_PRIVKEY }}"
p2pIdentityPrivateKey: "{{ NODE_02_P2PIDENTITYPRIVATEKEY }}"
validatorPrvKey: "{{ NODE_02_VALIDATOR_PRIVKEY }}"
p2pIdentityPrvKey: "{{ NODE_02_P2PIDENTITYPRIVATEKEY }}"
node-03.feature.shimmer.iota.cafe:
validatorAccount: "{{ NODE_03_ACCOUNTID }}"
validatorPrivKey: "{{ NODE_03_VALIDATOR_PRIVKEY }}"
p2pIdentityPrivateKey: "{{ NODE_03_P2PIDENTITYPRIVATEKEY }}"
validatorPrvKey: "{{ NODE_03_VALIDATOR_PRIVKEY }}"
p2pIdentityPrvKey: "{{ NODE_03_P2PIDENTITYPRIVATEKEY }}"
node-04.feature.shimmer.iota.cafe:
validatorAccount: "{{ NODE_04_ACCOUNTID }}"
validatorPrivKey: "{{ NODE_04_VALIDATOR_PRIVKEY }}"
p2pIdentityPrivateKey: "{{ NODE_04_P2PIDENTITYPRIVATEKEY }}"
p2pIdentityPrvKey: "{{ NODE_04_P2PIDENTITYPRIVATEKEY }}"
blockissuerPrvKey: "{{ BLOCKISSUER_PRV_KEY }}"
faucetPrvKey: "{{ FAUCET_PRV_KEY }}"
node-05.feature.shimmer.iota.cafe:
validatorAccount: "{{ NODE_05_ACCOUNTID }}"
validatorPrivKey: "{{ NODE_05_VALIDATOR_PRIVKEY }}"
p2pIdentityPrivateKey: "{{ NODE_05_P2PIDENTITYPRIVATEKEY }}"
p2pIdentityPrvKey: "{{ NODE_05_P2PIDENTITYPRIVATEKEY }}"
vars:
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,120 @@
version: '3.3'

services:

###################
# IOTA-CORE Nodes #
###################

iota_core:
image: {{iota_core_docker_image_repo}}:{{iota_core_docker_image_tag}}
container_name: iota-core
stop_grace_period: 1m
restart: unless-stopped
ulimits:
nofile:
soft: 16384
hard: 16384
ports:
- "14666:14666/tcp" # P2P
- "6081:6061/tcp" # pprof
- "8080:8080/tcp" # REST-API
- "8081:8081/tcp" # Dashboard
- "9311:9311/tcp" # Prometheus
- "9089:9029/tcp" # INX
volumes:
- ./snapshot.bin:/app/data/snapshot.bin:ro
- ./config.json:/app/config.json:ro
- ./data:/app/data/
- ./snapshot.bin:/app/data/snapshot.bin:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "0.0.0.0:14666:14666/tcp"
- "0.0.0.0:8080:8080/tcp"
- "0.0.0.0:8081:8081/tcp"
- "0.0.0.0:6061:6061/tcp"
# prometheus
- "0.0.0.0:9311:9311/tcp"
environment:
- WEBAPI_BINDADDRESS=0.0.0.0:8080
- DASHBOARD_BINDADDRESS=0.0.0.0:8081
- PROFILING_BINDADDRESS=0.0.0.0:6061
command: >
-c config.json
--logger.level=debug
--logger.disableCaller=false
--logger.disableStacktrace=false
--logger.encoding=console
--logger.outputPaths=stdout
--database.path=/app/data/database
--p2p.db.path=/app/data/peerdb
--profiling.bindAddress=0.0.0.0:6061
--profiling.enabled=true
--protocol.snapshot.path=/app/data/snapshot.bin
command:
- "-c"
- "config.json"
- "--logger.level=debug"
- "--logger.disableCaller=false"
- "--p2p.peers=/dns/node-01.feature/tcp/14666/p2p/12D3KooWCrjmh4dUCWfGVQT6ivzArieJB9Z3eKdy2mdEEN95NDPS"
- "--p2p.externalMultiAddresses={{ ips | join(',') }}"
- "--p2p.identityPrivateKey={{p2pIdentityPrvKey}}"
- "--p2p.db.path=/app/data/peerdb"
- "--profiling.enabled=true"
- "--profiling.bindAddress=0.0.0.0:6061"
- "--restAPI.bindAddress=0.0.0.0:8080"
- "--database.path=/app/data/database"
- "--protocol.snapshot.path=/app/data/snapshot.bin"
{% if 'node-01' in inventory_hostname or 'node-02' in inventory_hostname or 'node-03' in inventory_hostname %}
--validator.enabled=true
--validator.account={{validatorAccount}}
--validator.privateKey={{validatorPrivKey}}
- "--validator.enabled=true"
{% if 'node-01' in inventory_hostname %}
- "--validator.ignoreBootstrapped=true"
{% endif %}
- "--validator.account={{validatorAccount}}"
- "--validator.privateKey={{validatorPrvKey}}"
{% endif %}
{% if 'node-01' in inventory_hostname %}
--validator.ignoreBootstrapped=true
{% endif %}
--p2p.peers=/dns/node-01.feature/tcp/14666/p2p/12D3KooWCrjmh4dUCWfGVQT6ivzArieJB9Z3eKdy2mdEEN95NDPS
--p2p.externalMultiAddresses={{ ips | join(',') }}
--p2p.identityPrivateKey={{p2pIdentityPrivateKey}}
--inx.enabled=true
--inx.bindAddress=iota-core:9029
- "--dashboard.bindAddress=0.0.0.0:8081"
- "--metrics.bindAddress=iota-core:9311"
- "--inx.enabled=true"
- "--inx.bindAddress=iota-core:9029"

##################
# INX Extensions #
##################

{% if 'node-04' in inventory_hostname %}
inx-indexer:
container_name: inx-indexer
image: iotaledger/inx-indexer:2.0-alpha
stop_grace_period: 5m
stop_grace_period: 1m
restart: unless-stopped
depends_on:
iota-core:
condition: service_started
ulimits:
nofile:
soft: 16384
hard: 16384
volumes:
- ./data:/app/database
command:
- "--inx.address=iota-core:9029"
- "--indexer.db.sqlite.path=database/indexer"
- "--restAPI.bindAddress=inx-indexer:9091"
- "--restAPI.bindAddress=inx-indexer:9091"

inx-blockissuer:
container_name: inx-blockissuer
image: iotaledger/inx-blockissuer:1.0-alpha
stop_grace_period: 1m
restart: unless-stopped
depends_on:
iota-core:
condition: service_started
inx-indexer:
condition: service_started
environment:
- "BLOCKISSUER_PRV_KEY={{blockissuerPrvKey}}"
command:
- "--inx.address=iota-core:9029"
- "--restAPI.bindAddress=inx-blockissuer:9086"
- "--blockIssuer.accountAddress=rms1pqas0clgfsf8du9e6dw0yx9nwclqe0dd4f728pvgmcshpscm8r5mkddrrfc"
- "--blockIssuer.proofOfWork.targetTrailingZeros=5"

inx-faucet:
container_name: inx-faucet
image: iotaledger/inx-faucet:2.0-alpha
stop_grace_period: 1m
restart: unless-stopped
depends_on:
iota-core:
condition: service_started
inx-indexer:
condition: service_started
inx-blockissuer:
condition: service_started
networks:
- iota-core
ports:
- "8091:8091/tcp" # Faucet Frontend
environment:
- "FAUCET_PRV_KEY={{faucetPrvKey}}"
command:
- "--inx.address=iota-core:9029"
- "--faucet.bindAddress=0.0.0.0:8091"
{% endif %}
17 changes: 8 additions & 9 deletions deploy/ansible/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ wireguard_server_private_key=$WIREGUARD_SERVER_PRIVKEY
elkElasticUser=$ELASTIC_USER
elkElasticPassword=$ELASTIC_PASSWORD
grafanaAdminPassword=$GRAFANA_ADMIN_PASSWORD
NODE_01_ACCOUNTID=$NODE_01_ACCOUNTID
NODE_01_VALIDATOR_PRIVKEY=$NODE_01_VALIDATOR_PRIVKEY
NODE_01_P2PIDENTITYPRIVATEKEY=$NODE_01_P2PIDENTITYPRIVATEKEY
NODE_02_ACCOUNTID=$NODE_02_ACCOUNTID
NODE_02_VALIDATOR_PRIVKEY=$NODE_02_VALIDATOR_PRIVKEY
NODE_02_P2PIDENTITYPRIVATEKEY=$NODE_02_P2PIDENTITYPRIVATEKEY
NODE_03_ACCOUNTID=$NODE_03_ACCOUNTID
NODE_01_VALIDATOR_PRIVKEY=$NODE_01_VALIDATOR_PRIVKEY
NODE_02_VALIDATOR_PRIVKEY=$NODE_02_VALIDATOR_PRIVKEY
NODE_03_VALIDATOR_PRIVKEY=$NODE_03_VALIDATOR_PRIVKEY
NODE_01_P2PIDENTITYPRIVATEKEY=$NODE_01_P2PIDENTITYPRIVATEKEY
NODE_02_P2PIDENTITYPRIVATEKEY=$NODE_02_P2PIDENTITYPRIVATEKEY
NODE_03_P2PIDENTITYPRIVATEKEY=$NODE_03_P2PIDENTITYPRIVATEKEY
NODE_04_ACCOUNTID=$NODE_04_ACCOUNTID
NODE_04_VALIDATOR_PRIVKEY=$NODE_04_VALIDATOR_PRIVKEY
NODE_04_P2PIDENTITYPRIVATEKEY=$NODE_04_P2PIDENTITYPRIVATEKEY
NODE_05_ACCOUNTID=$NODE_05_ACCOUNTID
NODE_05_VALIDATOR_PRIVKEY=$NODE_05_VALIDATOR_PRIVKEY
NODE_05_P2PIDENTITYPRIVATEKEY=$NODE_05_P2PIDENTITYPRIVATEKEY
NODE_05_P2PPUBKEY=$NODE_05_P2PPUBKEY" \
${ARGS[@]:2} deploy/ansible/"${2:-deploy.yml}"
4 changes: 2 additions & 2 deletions documentation/docs/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Example:
}
```

## <a id="metricstracker"></a> 7. Metricstracker
## <a id="metricstracker"></a> 7. MetricsTracker

| Name | Description | Type | Default value |
| ------- | --------------------------------------------- | ------- | ------------- |
Expand All @@ -273,7 +273,7 @@ Example:

```json
{
"metricstracker": {
"metricsTracker": {
"enabled": true
}
}
Expand Down
4 changes: 0 additions & 4 deletions tools/docker-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ services:
- "8081:8081/tcp" # Dashboard
- "6081:6061/tcp" # pprof
- "9089:9029/tcp" # INX
cap_drop:
- ALL
volumes:
- ./docker-network.snapshot:/app/data/snapshot.bin
- ./config.json:/app/config.json:ro
Expand Down Expand Up @@ -55,8 +53,6 @@ services:
- "8071:8081/tcp" # Dashboard
- "6071:6061/tcp" # pprof
- "9029:9029/tcp" # INX
cap_drop:
- ALL
volumes:
- ./docker-network.snapshot:/app/data/snapshot.bin
- ./config.json:/app/config.json:ro
Expand Down
72 changes: 52 additions & 20 deletions tools/genesis-snapshot/presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,6 @@ var Base = []options.Option[snapshotcreator.Options]{

var Docker = []options.Option[snapshotcreator.Options]{
snapshotcreator.WithFilePath("docker-network.snapshot"),
snapshotcreator.WithBasicOutputs(
/*
inx-faucet
ed25519 private key: de52b9964dda96564e9fab362ab16c2669c715c6a2a853bece8a25fc58c599755b938327ea463e0c323c0fd44f6fc1843ed94daecc6909c6043d06b7152e4737
ed25519 public key: 5b938327ea463e0c323c0fd44f6fc1843ed94daecc6909c6043d06b7152e4737
ed25519 address: 2f64f9d179991f50542b01e034fa043b195403875b8677efaf196b41c88803d0
bech32 address: rms1qqhkf7w30xv375z59vq7qd86qsa3j4qrsadcval04uvkkswg3qpaqf4hga2
=> restricted address with mana enabled: rms19qqz7e8e69uej86s2s4srcp5lgzrkx25qwr4hpnha7h3j66pezyq85qpqgqjjc5k
*/
snapshotcreator.BasicOutputDetails{
Address: lo.Return2(iotago.ParseBech32("rms19qqz7e8e69uej86s2s4srcp5lgzrkx25qwr4hpnha7h3j66pezyq85qpqgqjjc5k")),
Amount: 1_000_000_000_000_000,
Mana: 10_000_000,
},
),
snapshotcreator.WithAccounts(
snapshotcreator.AccountDetails{ // node-1-validator
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))),
Expand Down Expand Up @@ -108,6 +91,23 @@ var Docker = []options.Option[snapshotcreator.Options]{
Mana: iotago.Mana(testsuite.MinIssuerAccountAmount),
},
),
snapshotcreator.WithBasicOutputs(
/*
inx-faucet
ed25519 private key: de52b9964dda96564e9fab362ab16c2669c715c6a2a853bece8a25fc58c599755b938327ea463e0c323c0fd44f6fc1843ed94daecc6909c6043d06b7152e4737
ed25519 public key: 5b938327ea463e0c323c0fd44f6fc1843ed94daecc6909c6043d06b7152e4737
ed25519 address: 2f64f9d179991f50542b01e034fa043b195403875b8677efaf196b41c88803d0
bech32 address: rms1qqhkf7w30xv375z59vq7qd86qsa3j4qrsadcval04uvkkswg3qpaqf4hga2
=> restricted address with mana enabled: rms19qqz7e8e69uej86s2s4srcp5lgzrkx25qwr4hpnha7h3j66pezyq85qpqgqjjc5k
*/
snapshotcreator.BasicOutputDetails{
Address: lo.Return2(iotago.ParseBech32("rms19qqz7e8e69uej86s2s4srcp5lgzrkx25qwr4hpnha7h3j66pezyq85qpqgqjjc5k")),
Amount: 1_000_000_000_000_000,
Mana: 10_000_000,
},
),
snapshotcreator.WithProtocolParameters(
iotago.NewV3ProtocolParameters(
iotago.WithNetworkOptions("docker", "rms"),
Expand All @@ -125,7 +125,7 @@ var Docker = []options.Option[snapshotcreator.Options]{
var Feature = []options.Option[snapshotcreator.Options]{
snapshotcreator.WithFilePath("docker-network.snapshot"),
snapshotcreator.WithAccounts(
snapshotcreator.AccountDetails{
snapshotcreator.AccountDetails{ // node-01
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))),
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))),
Amount: testsuite.MinValidatorAccountAmount,
Expand All @@ -137,7 +137,7 @@ var Feature = []options.Option[snapshotcreator.Options]{
StakedAmount: testsuite.MinValidatorAccountAmount,
Mana: iotago.Mana(testsuite.MinValidatorAccountAmount),
},
snapshotcreator.AccountDetails{
snapshotcreator.AccountDetails{ // node-02
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))),
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))),
Amount: testsuite.MinValidatorAccountAmount,
Expand All @@ -149,7 +149,7 @@ var Feature = []options.Option[snapshotcreator.Options]{
StakedAmount: testsuite.MinValidatorAccountAmount,
Mana: iotago.Mana(testsuite.MinValidatorAccountAmount),
},
snapshotcreator.AccountDetails{
snapshotcreator.AccountDetails{ // node-03
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))),
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))),
Amount: testsuite.MinValidatorAccountAmount,
Expand All @@ -161,6 +161,38 @@ var Feature = []options.Option[snapshotcreator.Options]{
StakedAmount: testsuite.MinValidatorAccountAmount,
Mana: iotago.Mana(testsuite.MinValidatorAccountAmount),
},
snapshotcreator.AccountDetails{
/*
inx-blockissuer
ed25519 public key: 670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25
ed25519 address: 3b07e3e84c1276f0b9d35cf218b3763e0cbdadaa7ca38588de2170c31b38e9bb
bech32 address: rms1pqas0clgfsf8du9e6dw0yx9nwclqe0dd4f728pvgmcshpscm8r5mkddrrfc
*/
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))),
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))),
Amount: testsuite.MinIssuerAccountAmount,
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25")))),
ExpirySlot: iotago.MaxSlotIndex,
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 4,
Mana: iotago.Mana(testsuite.MinIssuerAccountAmount),
},
),
snapshotcreator.WithBasicOutputs(
/*
inx-faucet
ed25519 public key: dcd760a51cfafe901f4ca0745d399af7146028af643e8a339c7bb82fbb1be7f9
ed25519 address: 48acd764f626523646d5ccf22f807e96d30b7ab0064f370b66fa811985985ec4
bech32 address: rms1qpy2e4my7cn9ydjx6hx0ytuq06tdxzm6kqry7dctvmagzxv9np0vg9c55n4
=> restricted address with mana enabled: rms19qqy3txhvnmzv53kgm2ueu30splfd5ct02cqvnehpdn04qgeskv9a3qpqgh3p7yy
*/
snapshotcreator.BasicOutputDetails{
Address: lo.Return2(iotago.ParseBech32("rms19qqy3txhvnmzv53kgm2ueu30splfd5ct02cqvnehpdn04qgeskv9a3qpqgh3p7yy")),
Amount: 1_000_000_000_000_000,
Mana: 10_000_000,
},
),
snapshotcreator.WithProtocolParameters(
iotago.NewV3ProtocolParameters(
Expand Down

0 comments on commit 49ce601

Please sign in to comment.