Giter Site home page Giter Site logo

singnet / example-service Goto Github PK

View Code? Open in Web Editor NEW
19.0 9.0 26.0 31 KB

Simple arithmetic service compatible with SingularityNET platform. Can be used as a starting point to build services on the platform

License: MIT License

Dockerfile 9.96% Shell 1.14% Python 88.91%
snet-platform

example-service's Issues

Recipient Address from service metadata does not Match what was retrieved from Channel.

@raamb
Was working on deploying the service to sent platform and most of the tutorials in this do not cover if we are deploying it from certain IP.

I tried to match the port on my service_metadata and port on my organization config but still having this problem.

#organizational metadata
{
    "org_name": "nunet",
    "org_id": "nunet-org",
    "org_type": "individual",
    "description": {},
    "assets": {},
    "contacts": [],
    "groups": [
        {
            "group_name": "default_group",
            "group_id": "mFVJwqHYREJFiBWIs0iO05NSudNmLdT7pirUGHy1/yQ=",
            "payment": {
                "payment_address": "------",
                "payment_expiration_threshold": 100,
                "payment_channel_storage_type": "etcd",
                "payment_channel_storage_client": {
                    "connection_timeout": "100s",
                    "request_timeout": "5s",
                    "endpoints": [
                        "http://$MYIP:7010"
                    ]
                }
            }
        }
    ]
}

#service_metadata.json
{
    "version": 1,
    "display_name": "Fake News Binary Classification",
    "encoding": "proto",
    "service_type": "grpc",
    "model_ipfs_hash": "QmbrnBFRGF1YGrrzBBa2xe2i6EfXb9TaQn6SQAmMAn2T6U",
    "mpe_address": "------",
    "groups": [
        {
            "group_name": "default_group",
            "endpoints": [
                "http://$MYIP:7010"
            ],
            "pricing": [
                {
                    "price_model": "fixed_price",
                    "price_in_cogs": 1,
                    "default": true
                }
            ],
            "group_id": "mFVJwqHYREJFiBWIs0iO05NSudNmLdT7pirUGHy1/yQ="
        }
    ],
    "assets": {}
}

#snetd.config.json
{
    "BLOCKCHAIN_NETWORK_SELECTED": "ropsten",
    "DAEMON_END_POINT": "0.0.0.0:7010",
    "ETHEREUM_JSON_RPC_ENDPOINT": "https://ropsten.infura.io/v3/e7732e1f679e461b9bb4da5653ac3fc2",
    "IPFS_END_POINT": "http://ipfs.singularitynet.io:80",
   
    "PASSTHROUGH_ENABLED": true,
    "PASSTHROUGH_ENDPOINT": "http://$MYIP:7011",
    "ORGANIZATION_ID": "odyssey-org",
    "SERVICE_ID": "uclnlp-service",

    "metering_end_point": "https://ropsten-marketplace.singularitynet.io",
    "pvt_key_for_metering":    "----",

    "payment_channel_ca_path": "/opt/singnet/.certs/ca.pem",
    "payment_channel_cert_path": "/opt/singnet/.certs/client.pem",
    "payment_channel_key_path": "/opt/singnet/.certs/client-key.pem",
    

    "PAYMENT_CHANNEL_STORAGE_SERVER": {
        "id": "storage-ropsten",
        "host": "127.0.0.1",
        "client_port": 2381,
        "peer_port": 2382,
        "token": "unique-token",
        "cluster": "storage-ropsten=http://127.0.0.1:2382",
        "data_dir": "/opt/singnet/etcd/ropsten",
        "enabled": true
    
    },

    "log": {
        "level": "debug",
        "output": {
            "current_link": "./snetd-ropsten.log",
            "file_pattern": "./snetd-ropsten.%Y%m%d.log",
            "rotation_count": 0,
            "rotation_time_in_sec": 8640,
            "type": "file"
        }
    }
}

Shows error when I query like

snet client call "nunet-org" "fake-news-binary-classification" default_group predict '{"value":"this is sample text"}' --channel-id 2233

ERROR

Error: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "channel error:recipient Address from service metadata does not Match on what was retrieved from Channel"
	debug_error_string = "{"created":"@1619089022.119370330","description":"Error received from peer ipv4:109.88.2.12:7010","file":"src/core/lib/surface/call.cc","file_line":1067,"grpc_message":"channel error:recipient Address from service metadata does not Match on what was retrieved from Channel","grpc_status":2}"
>

Clarification - Decentralized Service Workers

So, if I have this right, you can create a service consumable by SingularityNET. A clean way is to use Docker containers but I'm guessing that isn't a 100% requirement. I'm still not entirely clear on this interaction but I do have a preliminary question: What about a decentralized service worker? Pyinstaller is a not-so-bad path to cross-platform. Shouldn't I be able to embed my service in my decentralized app?

I'm pretty sure I'll be able to but I just want to ask before-hand to make sure I'm not going to run into any problems along the way.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.