Deployer Demo for substrate smart contracts
$ node -v
v12.21.0
$ yarn -v
1.22.5
- Run
yarnto install all dependencies.
please modify config.json according to your env.
{
"listen_port": 4000,
"ws_endpoint" : "ws://47.242.250.114:9944",
"gateway_api_endpoint" : "http://m1-alice.apron.network:8082",
"gateway_proxy_endpoint" : "http://47.242.250.114:8080",
}yarn run connect
yarn run deploy
python3 test_demo.py
yarn run submit
- open
Developer->Contracts->Add an existing contract - run
queryServiceByUuid
yarn run webservercurl --location --request POST 'http://localhost:4001/service' \
--header 'Content-Type: application/json' \
--data-raw '{
"id" : "m1-alice_apron_network:8080",
"domain_name": "m1-alice.apron.network",
"name": "Httpbin",
"desc": "httpbin service for testing purpose.",
"logo": "https://via.placeholder.com/150?text=httpbin",
"usage": "Just run the command `curl http://m1-alice.apron.network:8080`. More information please refer the official documents.",
"providers": [
{
"id" : "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"name": "Alice",
"desc": "Httpbin service for testing",
"base_url": "https://httpbin.org/anything",
"schema": "http"
}
]
}'yarn run webserver --config ./config2.jscurl --location --request POST 'http://localhost:4000/service' \
--header 'Content-Type: application/json' \
--data-raw '{
"id" : "m1-bob_apron_network:8080",
"domain_name": "m1-bob_apron_network",
"name": "Httpbin",
"desc": "httpbin service for testing purpose.",
"logo": "https://via.placeholder.com/150?text=httpbin",
"usage": "Just run the command `curl http://m1-bob.apron.network:8080`. More information please refer the official documents.",
"providers": [
{
"id" : "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"name": "Alice",
"desc": "Httpbin service for testing",
"base_url": "https://httpbin.org/anything",
"schema": "http"
}
]
}'you can run query contract by exec node contract_query.js.

