github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/integration/sawtooth_integration/docker/test_namespace_restriction.yaml (about)

     1  # Copyright 2017 Intel Corporation
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  # ------------------------------------------------------------------------------
    15  
    16  version: "2.1"
    17  
    18  services:
    19  
    20    settings-tp:
    21      build:
    22        context: ../../..
    23        dockerfile: ./families/settings/Dockerfile
    24      image: sawtooth-settings-tp$INSTALL_TYPE:$ISOLATION_ID
    25      volumes:
    26        - $SAWTOOTH_CORE:/project/sawtooth-core
    27      expose:
    28        - 4004
    29      depends_on:
    30        - validator
    31      command: settings-tp -vv -C tcp://validator:4004
    32      stop_signal: SIGKILL
    33  
    34    intkey-tp-python:
    35      build:
    36        context: ../../..
    37        dockerfile: ./sdk/examples/intkey_python/Dockerfile
    38      image: sawtooth-intkey-tp-python$INSTALL_TYPE:$ISOLATION_ID
    39      volumes:
    40        - $SAWTOOTH_CORE:/project/sawtooth-core
    41      expose:
    42        - 4004
    43      depends_on:
    44        - validator
    45      command: intkey-tp-python -vvv -C tcp://validator:4004
    46      stop_signal: SIGKILL
    47  
    48    xo-tp-python:
    49      build:
    50        context: ../../..
    51        dockerfile: ./sdk/examples/xo_python/Dockerfile
    52      image: sawtooth-xo-tp-python$INSTALL_TYPE:$ISOLATION_ID
    53      volumes:
    54        - $SAWTOOTH_CORE:/project/sawtooth-core
    55      expose:
    56        - 4004
    57      depends_on:
    58        - validator
    59      command: xo-tp-python -vv -C tcp://validator:4004
    60      stop_signal: SIGKILL
    61  
    62    block-info-tp:
    63      build:
    64        context: ../../..
    65        dockerfile: ./families/block_info/Dockerfile
    66      image: sawtooth-block-info-tp$INSTALL_TYPE:$ISOLATION_ID
    67      volumes:
    68        - $SAWTOOTH_CORE:/project/sawtooth-core
    69      expose:
    70        - 4004
    71      depends_on:
    72        - validator
    73      command: block-info-tp -v -C tcp://validator:4004
    74      stop_signal: SIGKILL
    75  
    76    validator:
    77      build:
    78        context: ../../..
    79        dockerfile: ./validator/Dockerfile
    80      image: sawtooth-validator$INSTALL_TYPE:$ISOLATION_ID
    81      volumes:
    82        - $SAWTOOTH_CORE:/project/sawtooth-core
    83      expose:
    84        - 4004
    85        - 8800
    86      # the namespaces for the intkey family are purposefuly incorrect
    87      command: "bash -c \"\
    88          sawadm keygen && \
    89          sawset genesis \
    90            -k /etc/sawtooth/keys/validator.priv \
    91            -o config-genesis.batch && \
    92          sawset proposal create \
    93            -k /etc/sawtooth/keys/validator.priv \
    94            sawtooth.validator.transaction_families='[
    95              {\\\"family\\\": \\\"block_info\\\",
    96               \\\"version\\\": \\\"1.0\\\",
    97               \\\"namespaces\\\": [\\\"00b10c\\\"]},
    98              {\\\"family\\\": \\\"intkey\\\",
    99               \\\"version\\\": \\\"1.0\\\",
   100               \\\"namespaces\\\": [\\\"1cf125\\\",\\\"1cf127\\\"]},
   101              {\\\"family\\\":\\\"sawtooth_settings\\\",
   102               \\\"version\\\":\\\"1.0\\\",
   103               \\\"encoding\\\":\\\"application/protobuf\\\"},
   104              {\\\"family\\\":\\\"xo\\\",
   105               \\\"version\\\":\\\"1.0\\\",
   106               \\\"namespaces\\\":[\\\"5b7349\\\"]}]' \
   107            -o config_transaction_families.batch && \
   108          sawset proposal create \
   109            -k /etc/sawtooth/keys/validator.priv \
   110            sawtooth.validator.batch_injectors=block_info \
   111            'sawtooth.validator.block_validation_rules=NofX:1,block_info;XatY:block_info,0;local:0' \
   112            -o config.batch && \
   113          sawadm genesis \
   114            config-genesis.batch config_transaction_families.batch config.batch && \
   115          sawtooth-validator --endpoint tcp://validator:8800 -vv \
   116              --bind component:tcp://eth0:4004 \
   117              --bind network:tcp://eth0:8800 \
   118      \""
   119      environment:
   120        PYTHONPATH: "/project/sawtooth-core/families/block_info"
   121      stop_signal: SIGKILL
   122  
   123    rest-api:
   124      build:
   125        context: ../../..
   126        dockerfile: ./rest_api/Dockerfile
   127      image: sawtooth-rest-api$INSTALL_TYPE:$ISOLATION_ID
   128      volumes:
   129        - $SAWTOOTH_CORE:/project/sawtooth-core
   130      expose:
   131        - 4004
   132        - 8008
   133      depends_on:
   134        - validator
   135      command: sawtooth-rest-api -v --connect tcp://validator:4004 --bind rest-api:8008
   136      stop_signal: SIGKILL
   137  
   138    test-namespace-restriction:
   139      build:
   140        context: ../../..
   141        dockerfile: integration/sawtooth_integration/docker/integration-tests.dockerfile
   142      image: integration-tests:$ISOLATION_ID
   143      volumes:
   144        - $SAWTOOTH_CORE:/project/sawtooth-core
   145      expose:
   146        - 8080
   147      depends_on:
   148        - validator
   149        - rest-api
   150      command: nose2-3
   151            -c /project/sawtooth-core/integration/sawtooth_integration/nose2.cfg
   152            -v
   153            -s /project/sawtooth-core/integration/sawtooth_integration/tests
   154            test_namespace_restriction.TestNamespaceRestriction
   155      stop_signal: SIGKILL
   156      environment:
   157        PYTHONPATH: "/project/sawtooth-core/sdk/python:\
   158          /project/sawtooth-core/sdk/examples/intkey_python:\
   159          /project/sawtooth-core/sdk/examples/xo_python:\
   160          /project/sawtooth-core/families/block_info:\
   161          /project/sawtooth-core/integration:\
   162          /project/sawtooth-core/signing"