forked from airalab/robonomics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* recover reqres rpc * reqresp rpc editing * add reqres rpc integration test * fixed reqres rpc integration test * rm reqres rpc integration test * fix reqres rpc unit test * add reqres rpc integration test with sudo * fix testrpc action sript by install protoc compiler * fix static action sript by install protoc compiler * fix static action sript for clippy with warnings arg * edit reqres to pass clippy * edit println due to clippy check
- Loading branch information
Showing
10 changed files
with
293 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Testing RPC | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
testrpc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get install cmake coreutils libclang-dev protobuf-compiler -y | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly-2022-08-05 | ||
target: ${{ matrix.target }} | ||
components: rustfmt, clippy | ||
default: true | ||
|
||
- name: Install WASM target (for runtime building) | ||
shell: bash | ||
run: rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-05 | ||
|
||
- name: Build and run reqres example node | ||
shell: bash | ||
run: | | ||
base64 --decode protocol/examples/reqres/QmUnozNz2tmzDeckoShMHbvGp1yWi4BKBiudkELwoKCdcL > private.pk8 | ||
cd protocol/examples/reqres | ||
cargo build --release | ||
cd ../../.. | ||
target/release/robonomics-request-response-example /ip4/127.0.0.1/tcp/61241 & | ||
- name: Build robonomics binary | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: Run robonomics and send test rpc reqres Ping and Get | ||
shell: bash | ||
run: | | ||
cd target/release/ | ||
./robonomics --dev & | ||
sleep 20 | ||
curl http://localhost:9933 -H "Content-Type:application/json;charset=utf-8" -d '{ "jsonrpc":"2.0", "id":1, "method":"p2p_ping", "params": ["/ip4/127.0.0.1/tcp/61241/QmUnozNz2tmzDeckoShMHbvGp1yWi4BKBiudkELwoKCdcL"] }' | grep -q Pong | ||
curl http://127.0.0.1:9933 -H "Content-Type:application/json;charset=utf-8" -d '{ "jsonrpc":"2.0", "id":1, "method":"p2p_get", "params": ["/ip4/127.0.0.1/tcp/61241/QmUnozNz2tmzDeckoShMHbvGp1yWi4BKBiudkELwoKCdcL","Meaning42"] }' | grep -q Meaning42 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,6 @@ libp2p = { version = "0.49", features = [ | |
"tokio", | ||
"rsa", | ||
] } | ||
|
||
tokio = { version = "1", features = ["full"] } | ||
|
22 changes: 22 additions & 0 deletions
22
protocol/examples/reqres/QmUnozNz2tmzDeckoShMHbvGp1yWi4BKBiudkELwoKCdcL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDcOnccRMgZ44/DOXK12GRuCfzT | ||
1qQDAiqYPJYe6HM7sreGTuBbZudTVVNtmIrpNcuUjYDXHYUYlm9RIIPHN3mOylo4rduaAmbZIaez | ||
bXYN/fHhPUsAb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lNJvRikuFk03PAXrkIIIoJ+PC0RQe6wtQ7 | ||
WmUmb3YtitrqUg5xjgYxEnMs9MCxZPGfTrZVbtpt+Jb8/zvwnlV3GQX3pQKBgCZA5CIhhQ5XJlD9 | ||
+5KsUA6iBSirnZPxiBT9CxKyDJiTsiCOmamVfR7VCMuCJxr/Js3ekIpQTda7fG95mPFrTtupHbXx | ||
6WRZjUJq8bUXfai8ZZg5Qi6hCnDh2Aho201ze8YbPukCuHrVeqhJIjq9QyEml1TQ2IwzRVdmk8Pz | ||
qJzZAoGBAItDqOE1U14UALM5XZjSy8VuVZiBlED3gSKdV69ShQvHeAtX/iV7a32UQY0Q/i5c+wOr | ||
JeUyC78lGE+gC0UPOWwNG409W+SiGoLt/OMERK49F+Aq9ocs6qXKJfIeisz/F3BPksH4sgymOizY | ||
ZcxDCzdQHavXdGF/4ZWTCXpJ0NFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.