diff --git a/.github/workflows/docker-testing.yml b/.github/workflows/docker-testing.yml index e0343cbeb6..80b6629009 100644 --- a/.github/workflows/docker-testing.yml +++ b/.github/workflows/docker-testing.yml @@ -5,7 +5,6 @@ on: workflow_dispatch jobs: docker: - environment: pre-devnet runs-on: ubuntu-latest env: DOCKER_BUILDKIT: 1 @@ -16,7 +15,7 @@ jobs: - name: Publish to Docker Hub uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c with: - repository: iotaledger/goshimmer - username: '${{ secrets.IOTALEDGER_HUB_DOCKER_LOGIN }}' - password: '${{ secrets.IOTALEDGER_HUB_DOCKER_PASSWORD }}' + repository: iotafoundationtesting/goshimmer + username: '${{ secrets.IOTAFOUNDATIONTESTING_HUB_DOCKER_LOGIN }}' + password: '${{ secrets.IOTAFOUNDATIONTESTING_HUB_DOCKER_PASSWORD }}' tags: testing diff --git a/.github/workflows/pre-devnet-deploy.yml b/.github/workflows/pre-devnet-deploy.yml index af07f2e542..edfd0327b4 100644 --- a/.github/workflows/pre-devnet-deploy.yml +++ b/.github/workflows/pre-devnet-deploy.yml @@ -73,6 +73,7 @@ jobs: ELK_ELASTIC_USER: '${{ secrets.ELK_ELASTIC_USER }}' DRANDS_SECRET: '${{ secrets.DRANDS_SECRET }}' COMMIT_SHA: '${{ github.sha }}' + GOSHIMMER_DOCKER_TAG: 'develop' run: | export NETWORK_VERSION=$((16#$(git rev-parse --short "$COMMIT_SHA")%1000000000+1000)) - ./deploy/ansible/run.sh + ./deploy/ansible/run.sh pre-devnet.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b26b07cc9a..7e07b35bed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,32 @@ name: Release -'on': - release: - types: - - published +on: + workflow_dispatch: + inputs: + tagName: + description: 'Tag name' + required: true + releaseDescription: + description: 'Release description' + required: true + jobs: + createTag: + environment: devnet + name: Create Git tag + runs-on: + - ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Create Git tag + run: | + git tag ${{ github.event.inputs.tagName }} + git push origin ${{ github.event.inputs.tagName }} + goreleaser: environment: devnet + needs: createTag name: GoReleaser runs-on: - ubuntu-latest @@ -15,33 +36,70 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: "refs/tags/${{github.event.inputs.tagName}}" - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.16.3 + - name: Copy config.default.json to config.json run: cp config.default.json config.json + - name: Download latest snapshot file run: wget -O snapshot.bin https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/nectar/snapshot-latest.bin + - name: Run GoReleaser - run: goreleaser --rm-dist + run: goreleaser --rm-dist --release-notes <(echo "${{ github.event.inputs.releaseDescription }}") + shell: bash env: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + docker: environment: devnet - name: Docker + needs: createTag + name: Docker build and deploy runs-on: - ubuntu-latest - env: - DOCKER_BUILDKIT: 1 steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: "refs/tags/${{github.event.inputs.tagName}}" - name: Publish to Docker Hub uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c + env: + DOCKER_BUILDKIT: 1 with: repository: iotaledger/goshimmer username: '${{ secrets.IOTALEDGER_HUB_DOCKER_LOGIN }}' password: '${{ secrets.IOTALEDGER_HUB_DOCKER_PASSWORD }}' tags: latest tag_with_ref: true + + - name: Install SSH Key + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh/ + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + sudo chmod 600 ~/.ssh/id_ed25519 + echo ' + Host * + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null + ' > ~/.ssh/config + + - name: Ansible deploy + env: + GOSHIMMER_SEEDS: '${{ secrets.GOSHIMMER_SEEDS }}' + MONGODB_USER: '${{ secrets.MONGODB_USER }}' + MONGODB_PASSWORD: '${{ secrets.MONGODB_PASSWORD }}' + GRAFANA_ADMIN_PASSWORD: '${{ secrets.GRAFANA_ADMIN_PASSWORD }}' + ELK_ELASTIC_PASSWORD: '${{ secrets.ELK_ELASTIC_PASSWORD }}' + ELK_ELASTIC_USER: '${{ secrets.ELK_ELASTIC_USER }}' + DRANDS_SECRET: '${{ secrets.DRANDS_SECRET }}' + DRNG_XTEAM_01_SEED: '${{ secrets.DRNG_XTEAM_01_SEED }}' + GOSHIMMER_DOCKER_TAG: 'latest' + run: | + ./deploy/ansible/run.sh devnet.yml diff --git a/Dockerfile b/Dockerfile index b35523af98..94f8fa81c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN --mount=target=. \ # Enable building the image without downloading the snapshot. # If built with dummy snapshot then a snapshot needs to be mounted into the resulting image. -RUN if (( $DOWNLOAD_SNAPSHOT == 1 )); then \ +RUN if [ $DOWNLOAD_SNAPSHOT -gt 0 ]; then \ wget -O /tmp/snapshot.bin https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/nectar/snapshot-latest.bin ; \ else \ touch /tmp/snapshot.bin ; \ diff --git a/README.md b/README.md index 983f076a8c..f0d07381e1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

Prototype node software for an IOTA network without the Coordinator

- + Developer documentation portal

diff --git a/deploy/ansible/deploy.yml b/deploy/ansible/deploy.yml index 2f04b85075..ab013b99a4 100644 --- a/deploy/ansible/deploy.yml +++ b/deploy/ansible/deploy.yml @@ -14,8 +14,14 @@ - role: goshimmer-node nodeType: analysis-server -- hosts: goshimmers +- hosts: goshimmers:&internal_nodes vars: nodeType: goshimmer roles: - - goshimmer-node \ No newline at end of file + - goshimmer-node + +- hosts: goshimmers:&public_nodes + vars: + nodeType: public-node + roles: + - goshimmer-node diff --git a/deploy/ansible/hosts.yml b/deploy/ansible/hosts.yml deleted file mode 100644 index 96f7e26acc..0000000000 --- a/deploy/ansible/hosts.yml +++ /dev/null @@ -1,34 +0,0 @@ -metrics: - hosts: - metrics-01.pre-devnet.shimmer.iota.cafe: - -supports: - hosts: - analysisentry-01.pre-devnet.shimmer.iota.cafe: - entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}" - -goshimmers: - hosts: - bootstrap-01.pre-devnet.shimmer.iota.cafe: - seed: "{{ BOOTSTRAP_01_SEED }}" - bootstrap: true - vanilla-01.pre-devnet.shimmer.iota.cafe: - seed: "{{ VANILLA_01_SEED }}" - drng-01.pre-devnet.shimmer.iota.cafe: - seed: "{{ DRNG_01_SEED }}" - drng-02.pre-devnet.shimmer.iota.cafe: - seed: "{{ DRNG_02_SEED }}" - drng-03.pre-devnet.shimmer.iota.cafe: - seed: "{{ DRNG_03_SEED }}" - drng-04.pre-devnet.shimmer.iota.cafe: - seed: "{{ DRNG_04_SEED }}" - drng-05.pre-devnet.shimmer.iota.cafe: - seed: "{{ DRNG_05_SEED }}" - faucet-01.pre-devnet.shimmer.iota.cafe: - seed: "{{ FAUCET_01_SEED }}" - faucet: true - faucetSeed: "{{ FAUCET_01_FAUCET_SEED }}" - -drands: - hosts: - drand-01.pre-devnet.shimmer.iota.cafe: \ No newline at end of file diff --git a/deploy/ansible/hosts/devnet.yml b/deploy/ansible/hosts/devnet.yml new file mode 100644 index 0000000000..d05ef43a0b --- /dev/null +++ b/deploy/ansible/hosts/devnet.yml @@ -0,0 +1,58 @@ +metrics: + hosts: + metrics-01.devnet.shimmer.iota.cafe: + +supports: + hosts: + analysisentry-01.devnet.shimmer.iota.cafe: + entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}" + mongoDBHost: "metrics-01.devnet.shimmer.iota.cafe" + manaDashboardHost: "bootstrap-01.devnet.shimmer.iota.cafe" + +goshimmers: + children: + internal_nodes: + hosts: + bootstrap-01.devnet.shimmer.iota.cafe: + seed: "{{ BOOTSTRAP_01_SEED }}" + bootstrap: true + vanilla-01.devnet.shimmer.iota.cafe: + seed: "{{ VANILLA_01_SEED }}" + drng-01.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_01_SEED }}" + drng-02.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_02_SEED }}" + drng-03.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_03_SEED }}" + drng-04.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_04_SEED }}" + drng-05.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_05_SEED }}" + drng-xteam-01.devnet.shimmer.iota.cafe: + seed: "{{ DRNG_XTEAM_01_SEED }}" + faucet-01.devnet.shimmer.iota.cafe: + seed: "{{ FAUCET_01_SEED }}" + faucet: true + faucetSeed: "{{ FAUCET_01_FAUCET_SEED }}" + public_nodes: + hosts: + public-node-01.devnet.shimmer.iota.cafe: + public-node-02.devnet.shimmer.iota.cafe: + public-node-03.devnet.shimmer.iota.cafe: + + vars: + analysisServerHost: "analysisentry-01.devnet.shimmer.iota.cafe" + entryNodeHost: "analysisentry-01.devnet.shimmer.iota.cafe" + remoteLoggerHost: "metrics-01.devnet.shimmer.iota.cafe" + communityEntryNode: "5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entryshimmer.tanglebay.com:14646" + xteamDRNG: true + +drands: + hosts: + drand-01.devnet.shimmer.iota.cafe: + vars: + drngHostTemplate: "drng-0{drandNumber}.devnet.shimmer.iota.cafe" + +asset_registries: + hosts: + asset-registry-01.devnet.shimmer.iota.cafe: \ No newline at end of file diff --git a/deploy/ansible/hosts/pre-devnet.yml b/deploy/ansible/hosts/pre-devnet.yml new file mode 100644 index 0000000000..cf02f82539 --- /dev/null +++ b/deploy/ansible/hosts/pre-devnet.yml @@ -0,0 +1,44 @@ +metrics: + hosts: + metrics-01.pre-devnet.shimmer.iota.cafe: + +supports: + hosts: + analysisentry-01.pre-devnet.shimmer.iota.cafe: + entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}" + mongoDBHost: "metrics-01.pre-devnet.shimmer.iota.cafe" + manaDashboardHost: "bootstrap-01.pre-devnet.shimmer.iota.cafe" + +goshimmers: + children: + internal_nodes: + hosts: + bootstrap-01.pre-devnet.shimmer.iota.cafe: + seed: "{{ BOOTSTRAP_01_SEED }}" + bootstrap: true + vanilla-01.pre-devnet.shimmer.iota.cafe: + seed: "{{ VANILLA_01_SEED }}" + drng-01.pre-devnet.shimmer.iota.cafe: + seed: "{{ DRNG_01_SEED }}" + drng-02.pre-devnet.shimmer.iota.cafe: + seed: "{{ DRNG_02_SEED }}" + drng-03.pre-devnet.shimmer.iota.cafe: + seed: "{{ DRNG_03_SEED }}" + drng-04.pre-devnet.shimmer.iota.cafe: + seed: "{{ DRNG_04_SEED }}" + drng-05.pre-devnet.shimmer.iota.cafe: + seed: "{{ DRNG_05_SEED }}" + faucet-01.pre-devnet.shimmer.iota.cafe: + seed: "{{ FAUCET_01_SEED }}" + faucet: true + faucetSeed: "{{ FAUCET_01_FAUCET_SEED }}" + vars: + analysisServerHost: "analysisentry-01.pre-devnet.shimmer.iota.cafe" + entryNodeHost: "analysisentry-01.pre-devnet.shimmer.iota.cafe" + remoteLoggerHost: "metrics-01.pre-devnet.shimmer.iota.cafe" + +drands: + hosts: + drand-01.pre-devnet.shimmer.iota.cafe: + vars: + drngHostTemplate: "drng-0{drandNumber}.pre-devnet.shimmer.iota.cafe" diff --git a/deploy/ansible/initial-setup.yml b/deploy/ansible/initial-setup.yml index 58f62c17fa..b7461a9b69 100644 --- a/deploy/ansible/initial-setup.yml +++ b/deploy/ansible/initial-setup.yml @@ -14,12 +14,18 @@ - role: goshimmer-node nodeType: analysis-server -- hosts: goshimmers +- hosts: goshimmers:&internal_nodes vars: nodeType: goshimmer roles: - goshimmer-node +- hosts: goshimmers:&public_nodes + vars: + nodeType: public-node + roles: + - goshimmer-node + - hosts: drands vars: @@ -28,7 +34,6 @@ roles: - role: drand drandNumber: 1 - isLeaderDrand: true - role: drand drandNumber: 2 - role: drand @@ -41,9 +46,13 @@ - name: Generate key materials in leader Drand command: docker exec -d drand1 drand share --leader --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --period 10s --catchup-period 0 - name: Generate key materials in follower Drands - command: docker exec -d drand{{ item.drandNumber }} drand share --connect "drand-01.pre-devnet.shimmer.iota.cafe:1234" --tls-disable --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --catchup-period 0 + command: docker exec -d drand{{ item.drandNumber }} drand share --connect "{{ inventory_hostname }}:1234" --tls-disable --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --catchup-period 0 with_items: - { drandNumber: 2 } - { drandNumber: 3 } - { drandNumber: 4 } - { drandNumber: 5 } + +- hosts: asset_registries + roles: + - asset-registry diff --git a/deploy/ansible/roles/asset-registry/tasks/main.yml b/deploy/ansible/roles/asset-registry/tasks/main.yml new file mode 100644 index 0000000000..efa0cb0e83 --- /dev/null +++ b/deploy/ansible/roles/asset-registry/tasks/main.yml @@ -0,0 +1,31 @@ +- name: Create directory + file: + path: /opt/asset-registry + state: directory + mode: '0755' + + +- name: Template docker-compose.yml + template: + src: docker-compose.yml.j2 + dest: /opt/asset-registry/docker-compose.yml + mode: '0644' + +- name: Stop existing services gracefully + community.general.docker_compose: + project_src: /opt/asset-registry + timeout: 180 + state: present + stopped: yes + +- name: Tear down existing services + community.general.docker_compose: + project_src: /opt/asset-registry + state: absent + +- name: Run services + community.general.docker_compose: + project_src: /opt/asset-registry + timeout: 180 + state: present + pull: yes diff --git a/deploy/ansible/roles/asset-registry/templates/docker-compose.yml.j2 b/deploy/ansible/roles/asset-registry/templates/docker-compose.yml.j2 new file mode 100644 index 0000000000..1e0ec4bee6 --- /dev/null +++ b/deploy/ansible/roles/asset-registry/templates/docker-compose.yml.j2 @@ -0,0 +1,37 @@ +#jinja2: trim_blocks:True, lstrip_blocks:True +version: "3" +services: + mongodb: + image: mongo:4.4 + container_name: mongodb + restart: unless-stopped + expose: + - 27017 + environment: + MONGO_INITDB_ROOT_USERNAME: "{{ mongoDBUser }}" + MONGO_INITDB_ROOT_PASSWORD: "{{ mongoDBPassword }}" + volumes: + - ./mongodb_data:/data/db + networks: + - back-tier + + asset-registry: + image: angelocapossele/asset-registry + command: > + --username="{{ mongoDBUser }}" + --password="{{ mongoDBPassword }}" + --basicAuthUser="{{ assetRegistryUser }}" + --basicAuthPassword="{{ assetRegistryPassword }}" + ports: + - "80:80" + depends_on: + - mongodb + networks: + - back-tier + - front-tier + +networks: + back-tier: + driver: bridge + front-tier: + driver: bridge \ No newline at end of file diff --git a/deploy/ansible/roles/drand/templates/docker-compose.yml.j2 b/deploy/ansible/roles/drand/templates/docker-compose.yml.j2 index 5ae15f4ec7..e372c2cf75 100644 --- a/deploy/ansible/roles/drand/templates/docker-compose.yml.j2 +++ b/deploy/ansible/roles/drand/templates/docker-compose.yml.j2 @@ -12,9 +12,9 @@ services: - "0.0.0.0:{{ drandNumber }}235:8081" - "0.0.0.0:{{ drandNumber }}236:1236" environment: - - DRAND_PUBLIC_ADDRESS=drand-01.pre-devnet.shimmer.iota.cafe:{{ drandNumber }}234 + - DRAND_PUBLIC_ADDRESS={{ inventory_hostname }}:{{ drandNumber }}234 entrypoint: /usr/local/bin/entrypoint.sh - command: start --verbose --private-listen 0.0.0.0:8000 --public-listen 0.0.0.0:8081 --tls-disable --goshimmerAPIurl "http://drng-0{{ drandNumber }}.pre-devnet.shimmer.iota.cafe:9101" --instanceID 1 --metrics "0.0.0.0:1236" + command: start --verbose --private-listen 0.0.0.0:8000 --public-listen 0.0.0.0:8081 --tls-disable --goshimmerAPIurl "http://{{ drngHostTemplate | replace('{drandNumber}', drandNumber) }}:9101" --instanceID 1 --metrics "0.0.0.0:1236" restart: unless-stopped volumes: diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 index 25b155ec02..71144f7ff9 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 @@ -3,7 +3,7 @@ version: "3" services: analysis_server: - image: iotaledger/goshimmer:develop + image: iotaledger/goshimmer:{{goshimmerDockerTag}} container_name: analysis-server restart: unless-stopped network_mode: "host" @@ -21,10 +21,10 @@ services: --analysis.server.bindAddress=0.0.0.0:21888 --analysis.dashboard.bindAddress=0.0.0.0:28080 --analysis.dashboard.mongoDBEnabled=true - --analysis.dashboard.mongoDBHostAddress=metrics-01.pre-devnet.shimmer.iota.cafe:27117 + --analysis.dashboard.mongoDBHostAddress={{ mongoDBHost }}:27117 --analysis.dashboard.mongoDBUsername="{{ mongoDBUser }}" --analysis.dashboard.mongoDBPassword="{{ mongoDBPassword }}" - --analysis.dashboard.manaDashboardAddress="http://bootstrap-01.pre-devnet.shimmer.iota.cafe:9001" + --analysis.dashboard.manaDashboardAddress="http://{{ manaDashboardHost }}:9001" --prometheus.bindAddress=0.0.0.0:9312 --metrics.local=false --metrics.global=true diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 index fc8c5e6372..d33b41316a 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 @@ -3,7 +3,7 @@ version: "3" services: entrynode: - image: iotaledger/goshimmer:develop + image: iotaledger/goshimmer:{{goshimmerDockerTag}} container_name: entrynode restart: unless-stopped network_mode: "host" @@ -18,7 +18,9 @@ services: command: > --skip-config=true --autoPeering.port=15626 + {% if networkVersion|default(None) %} --autoPeering.networkVersion={{ networkVersion }} + {% endif %} --autoPeering.entryNodes= --analysis.client.serverAddress= --node.disablePlugins=portcheck,dashboard,analysisClient,gossip,consensus,drng,issuer,syncBeaconFollower,metrics,messageLayer,mana,webAPI,webAPIBroadcastDataEndpoint,webAPIFindTransactionHashesEndpoint,webAPIGetNeighborsEndpoint,webAPIGetTransactionObjectsByHashEndpoint,webAPIGetTransactionTrytesByHashEndpoint diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 index c5a34b9b7f..aee643c727 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 @@ -3,7 +3,7 @@ version: '3.3' services: goshimmer: - image: iotaledger/goshimmer:develop + image: iotaledger/goshimmer:{{goshimmerDockerTag}} container_name: goshimmer network_mode: "host" volumes: @@ -11,7 +11,7 @@ services: - "/etc/localtime:/etc/localtime:ro" environment: - DATABASE_DIRECTORY=/db/mainnetdb - - ANALYSIS_CLIENT_SERVERADDRESS=analysisentry-01.pre-devnet.shimmer.iota.cafe:21888 + - ANALYSIS_CLIENT_SERVERADDRESS={{ analysisServerHost }}:21888 - AUTOPEERING_SEED={{ seed }} - AUTOPEERING_PORT=33501 - DASHBOARD_BINDADDRESS=0.0.0.0:9001 @@ -22,8 +22,10 @@ services: entrypoint: /run/goshimmer command: > --skip-config=true - --autoPeering.entryNodes=2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@analysisentry-01.pre-devnet.shimmer.iota.cafe:15626 + --autoPeering.entryNodes=2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@{{ entryNodeHost }}:15626{% if communityEntryNode|default(None) %},{{ communityEntryNode }}{% endif %} + {% if networkVersion|default(None) %} --autoPeering.networkVersion={{ networkVersion }} + {% endif %} --node.disablePlugins= --node.enablePlugins=remotelog,networkdelay,prometheus{% if faucet|default(false) %},faucet{% endif %},activity,snapshot,"WebAPIToolsEndpoint" --prometheus.bindAddress=0.0.0.0:9312 @@ -38,11 +40,16 @@ services: --pow.timeout=60s --logger.level=info --logger.disableEvents=false - --logger.remotelog.serverAddress=metrics-01.pre-devnet.shimmer.iota.cafe:5213 + --logger.remotelog.serverAddress={{ remoteLoggerHost }}:5213 {% if bootstrap|default(false) %} --messageLayer.startSynced=true {% endif %} --statement.writeStatement=true --drng.pollen.instanceID=1 --drng.pollen.threshold=3 - --drng.pollen.committeeMembers=AheLpbhRs1XZsRF8t8VBwuyQh9mqPHXQvthV5rsHytDG,FZ28bSTidszUBn8TTCAT9X1nVMwFNnoYBmZ1xfafez2z,GT3UxryW4rA9RN9ojnMGmZgE2wP7psagQxgVdA4B9L1P,4pB5boPvvk2o5MbMySDhqsmC2CtUdXyotPPEpb7YQPD7,64wCsTZpmKjRVHtBKXiFojw7uw3GszumfvC4kHdWsHga \ No newline at end of file + --drng.pollen.committeeMembers=AheLpbhRs1XZsRF8t8VBwuyQh9mqPHXQvthV5rsHytDG,FZ28bSTidszUBn8TTCAT9X1nVMwFNnoYBmZ1xfafez2z,GT3UxryW4rA9RN9ojnMGmZgE2wP7psagQxgVdA4B9L1P,4pB5boPvvk2o5MbMySDhqsmC2CtUdXyotPPEpb7YQPD7,64wCsTZpmKjRVHtBKXiFojw7uw3GszumfvC4kHdWsHga + {% if xteamDRNG|default(false) %} + --drng.xteam.instanceId=1339 + --drng.xteam.threshold=4 + --drng.xteam.committeeMembers=GUdTwLDb6t6vZ7X5XzEnjFNDEVPteU7tVQ9nzKLfPjdo,68vNzBFE9HpmWLb2x4599AUUQNuimuhwn3XahTZZYUHt,Dc9n3JxYecaX3gpxVnWb4jS3KVz1K1SgSK1KpV1dzqT1,75g6r4tqGZhrgpDYZyZxVje1Qo54ezFYkCw94ELTLhPs,CN1XLXLHT9hv7fy3qNhpgNMD6uoHFkHtaNNKyNVCKybf,7SmttyqrKMkLo5NPYaiFoHs8LE6s7oCoWCQaZhui8m16,CypSmrHpTe3WQmCw54KP91F5gTmrQEL7EmTX38YStFXx + {% endif %} diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 new file mode 100644 index 0000000000..87363d69b9 --- /dev/null +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 @@ -0,0 +1,65 @@ +#jinja2: trim_blocks:True, lstrip_blocks:True +version: '3.3' + +services: + goshimmer: + image: iotaledger/goshimmer:{{goshimmerDockerTag}} + container_name: goshimmer + stop_grace_period: 2m + volumes: + - "./db:/db" + - "/etc/localtime:/etc/localtime:ro" + ports: + # Autopeering + - "0.0.0.0:14626:14626/udp" + # Gossip + - "0.0.0.0:14666:14666/tcp" + # FPC + - "0.0.0.0:10895:10895/tcp" + # HTTP API + - "0.0.0.0:8080:8080/tcp" + # Dashboard + - "0.0.0.0:8081:8081/tcp" + # pprof profiling + - "0.0.0.0:6061:6061/tcp" + environment: + - DATABASE_DIRECTORY=/db/mainnetdb + - ANALYSIS_CLIENT_SERVERADDRESS={{ analysisServerHost }}:21888 + - AUTOPEERING_PORT=14626 + - DASHBOARD_BINDADDRESS=0.0.0.0:8081 + - GOSSIP_PORT=14666 + - WEBAPI_BINDADDRESS=0.0.0.0:8080 + - PROFILING_BINDADDRESS=0.0.0.0:6061 + - FPC_BINDADDRESS=0.0.0.0:10895 + entrypoint: /run/goshimmer + command: > + --skip-config=true + --autopeering.entryNodes=2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@{{ entryNodeHost }}:15626{% if communityEntryNode|default(None) %},{{ communityEntryNode }}{% endif %} + {% if networkVersion|default(NOne) %} + --autopeering.networkVersion={{ networkVersion }} + {% endif %} + --node.disablePlugins= + --node.enablePlugins=remotelog,networkdelay,prometheus{% if faucet|default(false) %},faucet{% endif %} + --prometheus.bindAddress=0.0.0.0:9312 + {% if faucet|default(false) %} + --faucet.seed={{ faucetSeed }} + --faucet.tokensPerRequest=1000000 + {% endif %} + --faucet.powDifficulty=22 + --pow.difficulty=22 + --pow.numThreads=7 + --pow.timeout=60s + --logger.level=info + --logger.disableEvents=false + --logger.remotelog.serverAddress={{ remoteLoggerHost }}:5213 + {% if bootstrap|default(false) %} + --messageLayer.startSynced=true + {% endif %} + --drng.pollen.instanceId=1 + --drng.pollen.threshold=3 + --drng.pollen.committeeMembers=AheLpbhRs1XZsRF8t8VBwuyQh9mqPHXQvthV5rsHytDG,FZ28bSTidszUBn8TTCAT9X1nVMwFNnoYBmZ1xfafez2z,GT3UxryW4rA9RN9ojnMGmZgE2wP7psagQxgVdA4B9L1P,4pB5boPvvk2o5MbMySDhqsmC2CtUdXyotPPEpb7YQPD7,64wCsTZpmKjRVHtBKXiFojw7uw3GszumfvC4kHdWsHga + {% if xteamDRNG|default(false) %} + --drng.xteam.instanceId=1339 + --drng.xteam.threshold=4 + --drng.xteam.committeeMembers=GUdTwLDb6t6vZ7X5XzEnjFNDEVPteU7tVQ9nzKLfPjdo,68vNzBFE9HpmWLb2x4599AUUQNuimuhwn3XahTZZYUHt,Dc9n3JxYecaX3gpxVnWb4jS3KVz1K1SgSK1KpV1dzqT1,75g6r4tqGZhrgpDYZyZxVje1Qo54ezFYkCw94ELTLhPs,CN1XLXLHT9hv7fy3qNhpgNMD6uoHFkHtaNNKyNVCKybf,7SmttyqrKMkLo5NPYaiFoHs8LE6s7oCoWCQaZhui8m16,CypSmrHpTe3WQmCw54KP91F5gTmrQEL7EmTX38YStFXx + {% endif %} \ No newline at end of file diff --git a/deploy/ansible/roles/metrics/tasks/main.yml b/deploy/ansible/roles/metrics/tasks/main.yml index 28143ab202..025c51ab13 100644 --- a/deploy/ansible/roles/metrics/tasks/main.yml +++ b/deploy/ansible/roles/metrics/tasks/main.yml @@ -29,12 +29,24 @@ dest: /opt/metrics/prometheus.yml mode: '0644' +- name: Create logstash directory + file: + path: /opt/metrics/logstash + state: directory + mode: '0755' + - name: Template logstash.yml template: src: logstash/logstash.yml.j2 dest: /opt/metrics/logstash/logstash.yml mode: '0644' +- name: Create logstash/pipeline directory + file: + path: /opt/metrics/logstash/pipeline + state: directory + mode: '0755' + - name: Template pipeline logstash.conf template: src: logstash/pipeline/logstash.conf.j2 diff --git a/deploy/ansible/run.sh b/deploy/ansible/run.sh index d1a341ada1..2c1ec62faa 100755 --- a/deploy/ansible/run.sh +++ b/deploy/ansible/run.sh @@ -1,5 +1,5 @@ eval "$GOSHIMMER_SEEDS" -ansible-playbook -u root -i deploy/ansible/hosts.yml --extra-vars \ +ansible-playbook -u root -i deploy/ansible/hosts/"${1}" --extra-vars \ "ANALYSISSENTRY_01_ENTRYNODE_SEED=$ANALYSISSENTRY_01_ENTRYNODE_SEED BOOTSTRAP_01_SEED=$BOOTSTRAP_01_SEED VANILLA_01_SEED=$VANILLA_01_SEED @@ -8,13 +8,17 @@ DRNG_02_SEED=$DRNG_02_SEED DRNG_03_SEED=$DRNG_03_SEED DRNG_04_SEED=$DRNG_04_SEED DRNG_05_SEED=$DRNG_05_SEED +DRNG_XTEAM_01_SEED=$DRNG_XTEAM_01_SEED FAUCET_01_SEED=$FAUCET_01_SEED FAUCET_01_FAUCET_SEED=$FAUCET_01_FAUCET_SEED drandsSecret=$DRANDS_SECRET mongoDBUser=$MONGODB_USER mongoDBPassword=$MONGODB_PASSWORD +assetRegistryUser=$ASSET_REGISTRY_USER +assetRegistryPassword=$ASSET_REGISTRY_PASSWORD networkVersion=$NETWORK_VERSION grafanaAdminPassword=$GRAFANA_ADMIN_PASSWORD elkElasticUser=$ELK_ELASTIC_USER -elkElasticPassword=$ELK_ELASTIC_PASSWORD" \ - deploy/ansible/"${1:-deploy.yml}" +elkElasticPassword=$ELK_ELASTIC_PASSWORD +goshimmerDockerTag=$GOSHIMMER_DOCKER_TAG" \ + deploy/ansible/"${2:-deploy.yml}" diff --git a/documentation/docs/teamresources/release.md b/documentation/docs/teamresources/release.md index 5307f38be6..4aebe4a1d2 100644 --- a/documentation/docs/teamresources/release.md +++ b/documentation/docs/teamresources/release.md @@ -1,12 +1,8 @@ # How to do a release -1. Create a PR into `develop` updating the banner version (`plugins/banner.AppVersion`) and mentioning the changes in `CHANGELOG.md` -2. Create a PR merging `develop` into `master` -3. Create a release via the release page with the same changelog entries as in `CHANGELOG.md` for the given version tagging the `master` branch -4. Pray that the CI gods let the build pass -5. Check that the binaries are working -6. Stop the entry-node -7. Delete DB -8. Update version in docker-compose -9. Pull newest image -10. Start the node \ No newline at end of file +1. Create a PR into `develop` updating the banner version (`plugins/banner.AppVersion`) and mentioning the changes in `CHANGELOG.md`. +2. Create a PR merging `develop` into `master`. +3. Go to release workflow https://github.com/iotaledger/goshimmer/actions/workflows/release.yml and click the gray "Run workflow" button to configure the release process. +4. In "Branch" field set `master`, in "Tag name" set current version, in "Release description" paste the changes recently added to `CHANGELOG.md`. Click the green "Run workflow" to trigger the automatic release and deployment process. +5. Check that the binaries are working. +6. Check that the nodes are up and functioning on `devnet`__. \ No newline at end of file diff --git a/documentation/yarn.lock b/documentation/yarn.lock index 99199142bb..7d10fa8bbb 100644 --- a/documentation/yarn.lock +++ b/documentation/yarn.lock @@ -2415,11 +2415,11 @@ autoprefixer@^10.2.0, autoprefixer@^10.2.5: postcss-value-parser "^4.1.0" axios@^0.21.1: - version "0.21.1" - resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - follow-redirects "^1.10.0" + follow-redirects "^1.14.0" babel-loader@^8.2.2: version "8.2.2" @@ -4458,10 +4458,10 @@ flux@^4.0.1: fbemitter "^3.0.0" fbjs "^3.0.0" -follow-redirects@^1.0.0, follow-redirects@^1.10.0: - version "1.14.1" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz" - integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== +follow-redirects@^1.0.0, follow-redirects@^1.14.0: + version "1.14.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" + integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw== for-in@^1.0.2: version "1.0.2" diff --git a/packages/ledgerstate/utxoutil/build.go b/packages/ledgerstate/utxoutil/build.go index 14938fc2bf..776a1eee30 100644 --- a/packages/ledgerstate/utxoutil/build.go +++ b/packages/ledgerstate/utxoutil/build.go @@ -7,6 +7,7 @@ import ( "github.com/iotaledger/hive.go/identity" "golang.org/x/xerrors" + "github.com/iotaledger/goshimmer/client/wallet/packages/sendoptions" "github.com/iotaledger/goshimmer/packages/ledgerstate" ) @@ -174,7 +175,13 @@ func (b *Builder) Spend(spend map[ledgerstate.Color]uint64) error { // AddExtendedOutputSpend adds extended output using unspent amounts and spends it. Fails of not enough. // Do not consume inputs -func (b *Builder) AddExtendedOutputSpend(targetAddress ledgerstate.Address, data []byte, amounts map[ledgerstate.Color]uint64, mint ...uint64) error { +func (b *Builder) AddExtendedOutputSpend( + targetAddress ledgerstate.Address, + data []byte, + amounts map[ledgerstate.Color]uint64, + options *sendoptions.SendFundsOptions, + mint ...uint64, +) error { for col, needed := range amounts { available := b.consumedUnspent[col] if available < needed { @@ -185,6 +192,14 @@ func (b *Builder) AddExtendedOutputSpend(targetAddress ledgerstate.Address, data return err } output := ledgerstate.NewExtendedLockedOutput(amounts, targetAddress) + if options != nil { + if options.FallbackAddress != nil && !options.FallbackDeadline.IsZero() { + output = output.WithFallbackOptions(options.FallbackAddress, options.FallbackDeadline) + } + if !options.LockUntil.IsZero() { + output = output.WithTimeLock(options.LockUntil) + } + } if err := output.SetPayload(data); err != nil { return err } diff --git a/plugins/dashboard/frontend/yarn.lock b/plugins/dashboard/frontend/yarn.lock index 7d1ab5ec5a..99b3e89437 100644 --- a/plugins/dashboard/frontend/yarn.lock +++ b/plugins/dashboard/frontend/yarn.lock @@ -1660,7 +1660,7 @@ chokidar@^3.4.1: optionalDependencies: fsevents "~2.1.2" -chownr@^1.1.1, chownr@^1.1.3: +chownr@^1.1.1, chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -2964,7 +2964,7 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-minipass@^2.0.0: +fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== @@ -4371,14 +4371,14 @@ minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^3.0.0: +minipass@^3.0.0, minipass@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg== dependencies: yallist "^4.0.0" -minizlib@^2.1.0: +minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== @@ -6847,15 +6847,15 @@ tar-stream@^2.0.0: readable-stream "^3.1.1" tar@^5.0.5: - version "5.0.7" - resolved "https://registry.yarnpkg.com/tar/-/tar-5.0.7.tgz#42ff8ca3b731a52f4f2be72cc4cdd7688268f2af" - integrity sha512-g0qlHHRtAZAxzkZkJvt0P5C6ODEolw2paouzsSbVqE7l5jKani1m9ogy7VxGp6hEngiKpPCwkh9pX5UH8Wp6QA== - dependencies: - chownr "^1.1.3" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.0" - mkdirp "^0.5.0" + version "5.0.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-5.0.11.tgz#f6e972e26960f71387c88e4313b202889be09292" + integrity sha512-E6q48d5y4XSCD+Xmwc0yc8lXuyDK38E0FB8N4S/drQRtXOMUhfhDxbB0xr2KKDhNfO51CFmoa6Oz00nAkWsjnA== + dependencies: + chownr "^1.1.4" + fs-minipass "^2.1.0" + minipass "^3.1.3" + minizlib "^2.1.2" + mkdirp "^0.5.5" yallist "^4.0.0" terser-webpack-plugin@^1.4.3: